![]() |
Routines |
| Prev: 53374 | Up: Map | Next: 53415 |
|
Swaps the active and inactive player's 68-byte game state blocks between the player 1 slot at Player_1_State and the player 2 slot at Player_2_State, using 50315 as a temporary buffer. Called each time the game switches between the two players.
|
||||
| SwapPlayerState | 53387 | LD HL,50179 | HL=Player_1_State (player 1 state source). | |
| 53390 | LD DE,50315 | DE=50315 (temporary buffer destination). | ||
| 53393 | LD BC,68 | BC=0068 (68 bytes = one player state block). | ||
| 53396 | LDIR | Copy player 1 state to the temporary buffer; HL advances to Player_2_State (player 2 state). | ||
| 53398 | LD DE,50179 | DE=Player_1_State (player 1 slot destination). | ||
| 53401 | LD BC,68 | BC=0068. | ||
| 53404 | LDIR | Copy player 2 state (from Player_2_State) into the player 1 slot. | ||
| 53406 | LD HL,50315 | HL=50315 (saved player 1 state source). | ||
| 53409 | LD BC,68 | BC=0068. | ||
| 53412 | LDIR | Copy saved player 1 state into the player 2 slot (at Player_2_State). | ||
| 53414 | RET | Return. | ||
| Prev: 53374 | Up: Map | Next: 53415 |