![]() |
Routines |
| Prev: 54244 | Up: Map | Next: 54401 |
|
Used by the routine at 60667.
|
||||||||||
|
This routine is called after a successful tape load.
|
||||||||||
| PlayerDeath_TapeLoadContinue | 54264 | LD A,(50430) | Load A with *50430. | |||||||
| 54267 | DEC A | Decrease A by one. | ||||||||
| 54268 | ADD A,A | E=A multiplied by 2. | ||||||||
| 54269 | LD E,A | |||||||||
| 54270 | LD D,0 | D=0 (high byte of index). | ||||||||
| 54272 | LD HL,54244 | HL=54244 (base of the lookup table). | ||||||||
| 54275 | ADD HL,DE | Add DE into HL (index into the table). | ||||||||
| 54276 | LD A,(HL) | A=*(HL) (low byte of the table word). | ||||||||
| 54277 | INC HL | Advance HL. | ||||||||
| 54278 | LD H,(HL) | H=*(HL) (high byte of the table word). | ||||||||
| 54279 | LD L,A | L=A (little-endian word in HL). | ||||||||
| 54280 | LD (50457),HL | Write the pointer to *WaveStartPointer. | ||||||||
| 54283 | LD A,B | Write B (variant/ slot) to *DeathSequenceMode. | ||||||||
| 54284 | LD (50482),A | |||||||||
| 54287 | LD A,(50198) | Jump to PlayerDeath_InitMaxWave if *Wave is at the maximum wave. | ||||||||
| 54290 | CP 60 | |||||||||
| 54292 | JR Z,PlayerDeath_InitMaxWave | |||||||||
| 54294 | PUSH BC | Stash BC on the stack. | ||||||||
| 54295 | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| 54298 | POP BC | Restore BC from the stack. | ||||||||
|
Set the starting lives.
|
||||||||||
| PlayerDeath_InitMaxWave | 54299 | LD A,3 | Write 3 to *Lives. | |||||||
| 54301 | LD (50197),A | |||||||||
| 54304 | XOR A | Write 0 to *TwoPlayerSessionFlag. | ||||||||
| 54305 | LD (50206),A | |||||||||
| 54308 | LD A,68 | Write INK: GREEN, PAPER: BLACK (BRIGHT) (68) to; | ||||||||
| 54310 | LD (50222),A | |||||||||
| 54313 | LD (50286),A | |||||||||
| 54316 | LD A,B | Jump to PlayerDeath_NewGameSetup (margins + clear) if this is player 1. | ||||||||
| 54317 | CP 1 | |||||||||
| 54319 | JR Z,PlayerDeath_NewGameSetup | |||||||||
| 54321 | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| 54324 | LD A,3 | Write 3 to *Lives. | ||||||||
| 54326 | LD (50197),A | |||||||||
| 54329 | XOR A | Write 0 to *TwoPlayerSessionFlag. | ||||||||
| 54330 | LD (50206),A | |||||||||
| 54333 | LD A,68 | Write INK: GREEN, PAPER: BLACK (BRIGHT) (68) to *50222. | ||||||||
| 54335 | LD (50222),A | |||||||||
| PlayerDeath_NewGameSetup | 54338 | LD HL,54401 | Call PrintMessaging using Messaging_ResetMargins. | |||||||
| 54341 | CALL PrintMessaging | |||||||||
| 54344 | XOR A | A=0. | ||||||||
| 54345 | LD B,2 | Outer loop: two player slots (B=2). | ||||||||
| PlayerDeath_ClearPlayerSlot | 54347 | LD HL,50179 | HL=Player_1_State (player 1 state block). | |||||||
| 54350 | LD C,4 | Clear 4 bytes per slot (C=4). | ||||||||
| PlayerDeath_ClearPlayerBytes | 54352 | LD (HL),A | Write A to *HL. | |||||||
| 54353 | INC HL | Advance HL. | ||||||||
| 54354 | DEC C | Decrease C. | ||||||||
| 54355 | JR NZ,PlayerDeath_ClearPlayerBytes | Loop back to PlayerDeath_ClearPlayerBytes until the slot prefix is cleared. | ||||||||
| 54357 | LD (50184),A | Write A to *WaveNumber. | ||||||||
| 54360 | LD (50204),A | Write A to *50204. | ||||||||
| 54363 | LD HL,50200 | HL=50200. | ||||||||
| 54366 | LD (HL),A | Write A to *HL. | ||||||||
| 54367 | INC HL | Advance HL. | ||||||||
| 54368 | LD (HL),2 | Write 2 to *HL. | ||||||||
| 54370 | INC HL | Advance HL. | ||||||||
| 54371 | LD (HL),A | Write A to *HL. | ||||||||
| 54372 | INC HL | Advance HL. | ||||||||
| 54373 | LD (HL),A | Write A to *HL. | ||||||||
| 54374 | LD HL,(50457) | Write *WaveStartPointer to *50185. | ||||||||
| 54377 | LD (50185),HL | |||||||||
| 54380 | PUSH BC | Stash BC on the stack. | ||||||||
| 54381 | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| 54384 | POP BC | Restore BC from the stack. | ||||||||
| 54385 | DJNZ PlayerDeath_ClearPlayerSlot | Decrease outer counter and loop back to PlayerDeath_ClearPlayerSlot for the second player. | ||||||||
| 54387 | LD A,(50198) | Jump back to PlayerDeath if *Wave is still at the maximum wave. | ||||||||
| 54390 | CP 60 | |||||||||
| 54392 | JP Z,PlayerDeath | |||||||||
| 54395 | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| 54398 | JP PlayerDeath | Jump back to PlayerDeath. | ||||||||
| Prev: 54244 | Up: Map | Next: 54401 |