![]() |
Routines |
| Prev: 54102 | Up: Map | Next: 54244 |
|
Used by the routine at PlayerDeath_TapeLoadContinue.
Handles a lost life and game-over flow: optional HUD and "PLAYER" messaging, decrementing Lives, calling 53836 to re-stage the wave, swapping players with SwapPlayerState, printing "GAME OVER" when no lives remain, and either returning to the attract mode at GameEntryPoint or looping. A lookup table at 54244 (read from 54272) supplies a start pointer stored at WaveStartPointer; 60667 jumps to PlayerDeath_TapeLoadContinue after a successful tape load. Clears player state at Player_1_State, wave and score fields, and applies Messaging_ResetMargins (reset margins) when starting a fresh game.
|
||||
| PlayerDeath | 54119 | LD A,(50482) | A=*DeathSequenceMode (death-sequence mode; 1 = skip the intro HUD/delay). | |
| 54122 | CP 1 | Compare with 1. | ||
| 54124 | JR Z,PlayerDeath_LoseLife | If set, jump to PlayerDeath_LoseLife to decrement Lives immediately. | ||
|
Full death sequence: redraw the HUD (RenderHUD), print Messaging_Player ("PLAYER") via PrintMessaging, then print the current player digit from *50207 as ASCII (48–57).
|
||||
| 54126 | CALL RenderHUD | Call RenderHUD. | ||
| 54129 | LD HL,54087 | Call PrintMessaging using Messaging_Player. | ||
| 54132 | CALL PrintMessaging | |||
| 54135 | LD A,(50207) | A=*50207 (player index for the digit). | ||
| 54138 | ADD A,%00110000 | Convert to ASCII ("0"–"9"). | ||
| 54140 | CALL PrintDispatch | Call PrintDispatch (print dispatch). | ||
| 54143 | LD B,32 | Inner delay loop count 32 (B=32). | ||
| PlayerDeath_IntroDelay | 54145 | PUSH BC | Stash BC on the stack. | |
| 54146 | CALL 55971 | Call 55971 (short delay). | ||
| 54149 | CALL 50963 | Call 50963 (attribute bar). | ||
| 54152 | POP BC | Restore BC from the stack. | ||
| 54153 | DJNZ PlayerDeath_IntroDelay | Decrease counter and loop back to PlayerDeath_IntroDelay until the intro delay finishes. | ||
| PlayerDeath_LoseLife | 54155 | LD HL,50197 | HL=Lives (lives counter). | |
| 54158 | DEC (HL) | Decrease *HL (lose one life). | ||
| 54159 | CALL 53836 | Call 53836 (re-stage the wave / death handling). | ||
| 54162 | LD A,(50197) | Jump to PlayerDeath_GameOver if *Lives shows no lives are left. | ||
| 54165 | AND A | |||
| 54166 | JR Z,PlayerDeath_GameOver | |||
|
Lives remain: swap to the other player and continue if two-player mode.
|
||||
| 54168 | CALL SwapPlayerState | Call SwapPlayerState. | ||
|
If not two-player, jump back to PlayerDeath for the same player.
|
||||
| 54171 | LD A,(50206) | Jump back to PlayerDeath if *TwoPlayerSessionFlag is not set. | ||
| 54174 | CP 1 | |||
| 54176 | JR NZ,PlayerDeath | |||
| 54178 | CALL SwapPlayerState | Call SwapPlayerState (swap back). | ||
| 54181 | JR PlayerDeath | Jump back to PlayerDeath. | ||
|
No lives left: redraw the HUD, then either the "PLAYER" line or straight to "GAME OVER" depending on *DeathSequenceMode, with a longer delay loop.
|
||||
| PlayerDeath_GameOver | 54183 | CALL RenderHUD | Call RenderHUD. | |
| 54186 | LD A,(50482) | Jump to PlayerDeath_GameOverDelay if *DeathSequenceMode is 1. | ||
| 54189 | CP 1 | |||
| 54191 | JR Z,PlayerDeath_GameOverDelay | |||
| 54193 | LD HL,54087 | Call PrintMessaging using Messaging_Player. | ||
| 54196 | CALL PrintMessaging | |||
| 54199 | LD A,(50207) | A=*50207. | ||
| 54202 | ADD A,%00110000 | Convert to ASCII. | ||
| 54204 | CALL PrintDispatch | Call PrintDispatch. | ||
| PlayerDeath_GameOverDelay | 54207 | LD HL,54102 | Call PrintMessaging using Messaging_GameOver. | |
| 54210 | CALL PrintMessaging | |||
| 54213 | LD B,41 | Longer delay loop count 41 (B=41). | ||
| PlayerDeath_GameOverDelayLoop | 54215 | PUSH BC | Stash BC on the stack. | |
| 54216 | CALL 55971 | Call 55971. | ||
| 54219 | CALL 50963 | Call 50963. | ||
| 54222 | POP BC | Restore BC from the stack. | ||
| 54223 | DJNZ PlayerDeath_GameOverDelayLoop | Decrease counter and loop back to PlayerDeath_GameOverDelayLoop. | ||
|
Set *TwoPlayerSessionFlag to 1 swap players with SwapPlayerState, then branch on the flag read back from *TwoPlayerSessionFlag.
|
||||
| 54225 | LD A,1 | Write 1 to *TwoPlayerSessionFlag. | ||
| 54227 | LD (50206),A | |||
| 54230 | CALL SwapPlayerState | Call SwapPlayerState. | ||
| 54233 | LD A,(50206) | Jump to GameEntryPoint if *TwoPlayerSessionFlag is 1 (attract mode). | ||
| 54236 | CP 1 | |||
| 54238 | JP Z,GameEntryPoint | |||
| 54241 | JP PlayerDeath | Jump back to PlayerDeath. | ||
| Prev: 54102 | Up: Map | Next: 54244 |