Prev: A99F Up: Map Next: A9EF
A9D4: Switch Players
Used by the routines at GameEntryPoint and Handler_Fired.
Handler_SwitchPlayers A9D4 LD A,($AB8A) A=*Game_Flags.
A9D7 XOR %00010000 Flip bit 4.
A9D9 LD ($AB8A),A Write A to *Game_Flags.
Default to using 1UP.
A9DC LD HL,$AB80 HL=1UP_Lives.
Who is in play, is it 1UP or 2UP?
A9DF BIT 4,A Jump to Handler_SwitchPlayers_Write if this is player one.
A9E1 JR Z,Handler_SwitchPlayers_Write
Else, use 2UP.
A9E3 LD HL,$AB85 HL=2UP_Lives.
Handler_SwitchPlayers_Write A9E6 LD ($AB7E),HL Write HL to *ActivePlayer.
A9E9 RLCA Rotate A left (with carry).
A9EA BIT 5,A Return if bit 5 of A is set.
A9EC RET NZ
A9ED RLCA Rotate A left (with carry).
A9EE RET Return.
Prev: A99F Up: Map Next: A9EF