Prev: 53374 Up: Map Next: 53415
53387: Swap Player State
Used by the routines at RenderHUD, PlayerDeath and PlayerDeath_TapeLoadContinue.
Swaps the active and inactive player's 68-byte state blocks between the player 1 slot at Player_1_State and the player 2 slot at Player_2_State, using Player_State_Swap_Buffer as a scratch buffer. Called each time the game switches between the two players. The swap is a three-step rotate through the scratch buffer: save active, overwrite active with inactive, restore saved.
Swap_Player_State 53387 LD HL,50179 Save the active player's 68-byte state block to the scratch buffer at Player_State_Swap_Buffer.
53390 LD DE,50315
53393 LD BC,68
53396 LDIR
53398 LD DE,50179 Copy the other player's state block from Player_2_State into the active player's slot at Player_1_State.
53401 LD BC,68
53404 LDIR
53406 LD HL,50315 Copy the saved state block from Player_State_Swap_Buffer into the other player's slot at Player_2_State.
53409 LD BC,68
53412 LDIR
53414 RET Return.
Prev: 53374 Up: Map Next: 53415