![]() |
Routines |
| Prev: D3E4 | Up: Map | Next: D481 |
|
Used by the routine at ECFB.
|
||||||||||
|
This routine is called after a successful tape load.
|
||||||||||
| PlayerDeath_TapeLoadContinue | D3F8 | LD A,($C4FE) | Load A with *C4FE. | |||||||
| D3FB | DEC A | Decrease A by one. | ||||||||
| D3FC | ADD A,A | E=A multiplied by 02. | ||||||||
| D3FD | LD E,A | |||||||||
| D3FE | LD D,$00 | D=00 (high byte of index). | ||||||||
| D400 | LD HL,$D3E4 | HL=D3E4 (base of the lookup table). | ||||||||
| D403 | ADD HL,DE | Add DE into HL (index into the table). | ||||||||
| D404 | LD A,(HL) | A=*(HL) (low byte of the table word). | ||||||||
| D405 | INC HL | Advance HL. | ||||||||
| D406 | LD H,(HL) | H=*(HL) (high byte of the table word). | ||||||||
| D407 | LD L,A | L=A (little-endian word in HL). | ||||||||
| D408 | LD ($C519),HL | Write the pointer to *WaveStartPointer. | ||||||||
| D40B | LD A,B | Write B (variant/ slot) to *DeathSequenceMode. | ||||||||
| D40C | LD ($C532),A | |||||||||
| D40F | LD A,($C416) | Jump to PlayerDeath_InitMaxWave if *Wave is at the maximum wave. | ||||||||
| D412 | CP $3C | |||||||||
| D414 | JR Z,PlayerDeath_InitMaxWave | |||||||||
| D416 | PUSH BC | Stash BC on the stack. | ||||||||
| D417 | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| D41A | POP BC | Restore BC from the stack. | ||||||||
|
Set the starting lives.
|
||||||||||
| PlayerDeath_InitMaxWave | D41B | LD A,$03 | Write 03 to *Lives. | |||||||
| D41D | LD ($C415),A | |||||||||
| D420 | XOR A | Write 00 to *TwoPlayerSessionFlag. | ||||||||
| D421 | LD ($C41E),A | |||||||||
| D424 | LD A,$44 | Write INK: GREEN, PAPER: BLACK (BRIGHT) (44) to; | ||||||||
| D426 | LD ($C42E),A | |||||||||
| D429 | LD ($C46E),A | |||||||||
| D42C | LD A,B | Jump to PlayerDeath_NewGameSetup (margins + clear) if this is player 01. | ||||||||
| D42D | CP $01 | |||||||||
| D42F | JR Z,PlayerDeath_NewGameSetup | |||||||||
| D431 | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| D434 | LD A,$03 | Write 03 to *Lives. | ||||||||
| D436 | LD ($C415),A | |||||||||
| D439 | XOR A | Write 00 to *TwoPlayerSessionFlag. | ||||||||
| D43A | LD ($C41E),A | |||||||||
| D43D | LD A,$44 | Write INK: GREEN, PAPER: BLACK (BRIGHT) (44) to *C42E. | ||||||||
| D43F | LD ($C42E),A | |||||||||
| PlayerDeath_NewGameSetup | D442 | LD HL,$D481 | Call PrintMessaging using Messaging_ResetMargins. | |||||||
| D445 | CALL PrintMessaging | |||||||||
| D448 | XOR A | A=00. | ||||||||
| D449 | LD B,$02 | Outer loop: two player slots (B=02). | ||||||||
| PlayerDeath_ClearPlayerSlot | D44B | LD HL,$C403 | HL=Player_1_State (player 1 state block). | |||||||
| D44E | LD C,$04 | Clear 04 bytes per slot (C=04). | ||||||||
| PlayerDeath_ClearPlayerBytes | D450 | LD (HL),A | Write A to *HL. | |||||||
| D451 | INC HL | Advance HL. | ||||||||
| D452 | DEC C | Decrease C. | ||||||||
| D453 | JR NZ,PlayerDeath_ClearPlayerBytes | Loop back to PlayerDeath_ClearPlayerBytes until the slot prefix is cleared. | ||||||||
| D455 | LD ($C408),A | Write A to *WaveNumber. | ||||||||
| D458 | LD ($C41C),A | Write A to *C41C. | ||||||||
| D45B | LD HL,$C418 | HL=C418. | ||||||||
| D45E | LD (HL),A | Write A to *HL. | ||||||||
| D45F | INC HL | Advance HL. | ||||||||
| D460 | LD (HL),$02 | Write 02 to *HL. | ||||||||
| D462 | INC HL | Advance HL. | ||||||||
| D463 | LD (HL),A | Write A to *HL. | ||||||||
| D464 | INC HL | Advance HL. | ||||||||
| D465 | LD (HL),A | Write A to *HL. | ||||||||
| D466 | LD HL,($C519) | Write *WaveStartPointer to *C409. | ||||||||
| D469 | LD ($C409),HL | |||||||||
| D46C | PUSH BC | Stash BC on the stack. | ||||||||
| D46D | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| D470 | POP BC | Restore BC from the stack. | ||||||||
| D471 | DJNZ PlayerDeath_ClearPlayerSlot | Decrease outer counter and loop back to PlayerDeath_ClearPlayerSlot for the second player. | ||||||||
| D473 | LD A,($C416) | Jump back to PlayerDeath if *Wave is still at the maximum wave. | ||||||||
| D476 | CP $3C | |||||||||
| D478 | JP Z,PlayerDeath | |||||||||
| D47B | CALL SwapPlayerState | Call SwapPlayerState. | ||||||||
| D47E | JP PlayerDeath | Jump back to PlayerDeath. | ||||||||
| Prev: D3E4 | Up: Map | Next: D481 |