Prev: 25319 Up: Map Next: 25374
25335: Reset Player Data
Used by the routine at StartGame.
Gives both players their starting level and lives, and resets their cubby holes, flower and leaves. The data is set up for one player and then swapped using ChangePlayer, and then the same is done for the other.
ResetPlayerData 25335 LD B,2 Set the player counter to 2 (a game has at most two players).
ResetPlayerData_Loop 25337 PUSH BC Stash the player counter on the stack.
25338 XOR A Reset ActivePlayer_Level to 0 (level 1).
25339 LD (24119),A
25342 LD A,4 Set CurrentPlayer_Lives to 4.
25344 LD (24120),A
25347 CALL ResetCubbyHoles Reset the cubby holes using ResetCubbyHoles.
25350 CALL ResetFlowerLeaf Reset the flower and leaves using ResetFlowerLeaf.
25353 CALL ChangePlayer Swap the players using ChangePlayer.
25356 POP BC Restore the player counter from the stack.
25357 DJNZ ResetPlayerData_Loop Decrease the player counter by one and loop back to ResetPlayerData_Loop until both players have been set up.
2UP has one "extra" life, due to the way the game "spends" a life when your turn starts.
25359 LD A,5 Write 5 to InactivePlayer_Lives.
25361 LD (24122),A
25364 LD A,(24067) A=the game options from GameOptions.
25367 AND %00000001 Keep only bit 0 (1 or 2 players).
25369 RET NZ Return if this is a two player game.
25370 LD (24122),A Else, write 0 to InactivePlayer_Lives (2UP has no lives).
25373 RET Return.
Prev: 25319 Up: Map Next: 25374