Prev: D07E Up: Map Next: D0A7
D08B: Swap Player State
Used by the routines at RenderHUD, PlayerDeath and PlayerDeath_TapeLoadContinue.
Swaps the active and inactive player's 44-byte game state blocks between the player 1 slot at Player_1_State and the player 2 slot at Player_2_State, using C48B as a temporary buffer. Called each time the game switches between the two players.
SwapPlayerState D08B LD HL,$C403 HL=Player_1_State (player 1 state source).
D08E LD DE,$C48B DE=C48B (temporary buffer destination).
D091 LD BC,$0044 BC=0044 (44 bytes = one player state block).
D094 LDIR Copy player 1 state to the temporary buffer; HL advances to Player_2_State (player 2 state).
D096 LD DE,$C403 DE=Player_1_State (player 1 slot destination).
D099 LD BC,$0044 BC=0044.
D09C LDIR Copy player 2 state (from Player_2_State) into the player 1 slot.
D09E LD HL,$C48B HL=C48B (saved player 1 state source).
D0A1 LD BC,$0044 BC=0044.
D0A4 LDIR Copy saved player 1 state into the player 2 slot (at Player_2_State).
D0A6 RET Return.
Prev: D07E Up: Map Next: D0A7