![]() |
Routines |
| Prev: D7D2 | Up: Map | Next: D826 |
|
Used by the routine at Dispatch_Handlers.
Marks the game complete when the combination is 09 in every CollectionSlots slot, then ticks ActionTimer.
|
||||
| Handler_Housekeeping | D7FF | LD HL,$64C1 | Test whether the combination is complete (every digit is 09). | |
| D802 | LD B,$04 | |||
| D804 | LD A,$09 | |||
|
Compare each combination digit with 09.
|
||||
| Handler_Housekeeping_SlotLoop | D806 | CP (HL) | Jump to Handler_Housekeeping_Timer if this slot differs. | |
| D807 | JR NZ,Handler_Housekeeping_Timer | |||
| D809 | INC HL | Advance to the next slot. | ||
| D80A | DJNZ Handler_Housekeeping_SlotLoop | Decrease the slot count and loop back to Handler_Housekeeping_SlotLoop. | ||
| D80C | LD A,($64A1) | Jump to Handler_Housekeeping_Timer unless *CollectedKeys is 10. | ||
| D80F | CP $10 | |||
| D811 | JR NZ,Handler_Housekeeping_Timer | |||
| D813 | LD A,$FF | Write FF to *GameCompleteFlag. | ||
| D815 | LD ($647D),A | |||
|
Tick the action timer.
|
||||
| Handler_Housekeeping_Timer | D818 | LD A,($6489) | Return if *ActionTimer is zero. | |
| D81B | OR A | |||
| D81C | RET Z | |||
| D81D | DEC A | Decrease *ActionTimer by one. | ||
| D81E | LD ($6489),A | |||
| D821 | OR A | Return if the timer is still running. | ||
| D822 | RET NZ | |||
| D823 | JP Lose_Life | Jump to Lose_Life. | ||
| Prev: D7D2 | Up: Map | Next: D826 |