Prev: D7D2 Up: Map Next: D877
D7FF: Handler: Housekeeping
Used by the routine at Dispatch_Handlers.
Marks the game complete when all four CollectionSlots slots are 09 then ticks ActionTimer.
Handler_Housekeeping D7FF LD HL,$64C1 Test the four collection slots for 09.
D802 LD B,$04
D804 LD A,$09
Handler_Housekeeping_SlotLoop D806 CP (HL) Jump to Handler_Housekeeping_Timer if any slot differs.
D807 JR NZ,Handler_Housekeeping_Timer
D809 INC HL
D80A DJNZ Handler_Housekeeping_SlotLoop Jump to Handler_Housekeeping_Timer unless *CollectedCount is 10.
D80C LD A,($64A1)
D80F CP $10
D811 JR NZ,Handler_Housekeeping_Timer Write FF to *GameCompleteFlag.
D813 LD A,$FF
D815 LD ($647D),A
Handler_Housekeeping_Timer D818 LD A,($6489) Return if *ActionTimer is zero.
D81B OR A
D81C RET Z Decrease *ActionTimer by one.
D81D DEC A
D81E LD ($6489),A
D821 OR A Return if the timer is still running.
D822 RET NZ Jump to Lose_Life.
D823 JP Lose_Life
This entry point is used by the routines at Initialise_Game and Game_Loop.
Read the Kempston port twice and return if the two reads match (the port is stable).
Read_Kempston D826 IN A,($1F) Read from the Kempston joystick port twice.
D828 LD E,A
D829 IN A,($1F)
D82B CP E Return if the two reads differ.
D82C RET Return.
This entry point is used by the routine at Handler_Player.
Demo / Kempston movement for the player.
Controls_Kempston D82D LD HL,($6486) HL=*KempstonMasks.
D830 CALL Read_Kempston Call Player_MoveLeft if left matches the stored mask.
D833 JR NZ,Controls_Kempston_Right
D835 CP L
D836 CALL Z,Player_MoveLeft
Controls_Kempston_Right D839 CALL Read_Kempston Call Player_MoveRight if right matches the stored mask.
D83C JR NZ,Controls_Kempston_Up
D83E CP H
D83F CALL Z,Player_MoveRight
Controls_Kempston_Up D842 CALL Read_Kempston Call Player_ClimbUp if up (bit 3) is pressed.
D845 JR NZ,Controls_Kempston_Down
D847 CP $08
D849 CALL Z,Player_ClimbUp
Controls_Kempston_Down D84C CALL Read_Kempston Call Player_ClimbDown if down (bit 2) is pressed.
D84F JR NZ,Controls_Kempston_Action
D851 CP $04
D853 CALL Z,Player_ClimbDown
Controls_Kempston_Action D856 CALL Read_Kempston Jump to Handler_Player_Resolve if the port is unstable.
D859 JP NZ,Handler_Player_Resolve Call Player_Action if fire (bit 4) is pressed.
D85C CP $10
D85E CALL Z,Player_Action Jump to Handler_Player_Resolve.
D861 JP Handler_Player_Resolve
This entry point is used by the routine at Handler_Combination.
Kempston climbing controls.
Controls_Kempston_Climb D864 CALL Read_Kempston Jump to Handler_Player_Commit if the port is unstable.
D867 JP NZ,Handler_Player_Commit Jump to Player_ClimbUp_Anim if up is pressed.
D86A CP $08
D86C JP Z,Player_ClimbUp_Anim Jump to Player_ClimbDown_Anim if down is pressed.
D86F CP $04
D871 JP Z,Player_ClimbDown_Anim Jump to Handler_Player_Commit.
D874 JP Handler_Player_Commit
Prev: D7D2 Up: Map Next: D877