Prev: F580 Up: Map Next: F5C4
F591: Hand over to the other player
Used by the routines at new_game, lose_life and game_over.
Does nothing if the other player has no lives (+6 of the second record). Otherwise swaps the two player records, all 105 bytes, so that the current player is always the one at messages_and_players + 25 and the rest of the game never needs to know which; swaps the two score lines of the panel (p1_score_text and p2_score_text, 16 bytes each); and unless player_in_play is $99 (as new_game sets it while it puts the score lines in order) changes player_in_play to the other player, says PLAYER n (show_player), pauses eight delays and clears the play area.
swap_players F591 LD A,($F656) The other player has no lives: carry on
F594 AND A
F595 RET Z
F596 LD DE,score Swap the records
F599 LD HL,other_player_record
F59C LD B,$69
F59E CALL swap_bytes
F5A1 LD DE,p1_score_text Swap the score lines
F5A4 LD HL,p2_score_text
F5A7 LD B,$10
F5A9 CALL swap_bytes
F5AC LD A,(player_in_play) Setting up: leave the current player alone
F5AF CP $99
F5B1 RET Z
F5B2 XOR $01 The other player, and say so
F5B4 LD (player_in_play),A
F5B7 CALL show_player
F5BA LD B,$08 A pause, and clear the play area
swap_players_0 F5BC CALL delay
F5BF DJNZ swap_players_0
F5C1 JP clear_play_area
Prev: F580 Up: Map Next: F5C4