Prev: DC62 Up: Map Next: DE19
DD97: Handler: Keyboard
Used by the routine at Dispatch_Handlers.
In-game keypresses: save, load, pause, and the hidden room cheats when *FFFF is 0A.
Handler_Keyboard DD97 CALL $028E Call KEY_SCAN.
DD9A LD A,E A=the keypress.
DD9B CP $1E Jump to Tape_Save if "S" was pressed.
DD9D JR Z,Tape_Save
DD9F CP $19 Jump to Tape_Load if "J" was pressed.
DDA1 JR Z,Tape_Load
DDA3 CP $22 Jump to Wait_Keypress if "H" was pressed.
DDA5 JR Z,Wait_Keypress
DDA7 CP $10 Jump to Cheat_LoseLife if "Q" was pressed.
DDA9 JR Z,Cheat_LoseLife
DDAB LD A,($FFFF) Return unless *FFFF is 0A.
DDAE CP $0A
DDB0 RET NZ Cap *Player_Lives at 03.
DDB1 LD A,($64B4)
DDB4 CP $02
DDB6 JR C,Handler_Keyboard_Cheats
DDB8 LD A,$03
DDBA LD ($64B4),A
Handler_Keyboard_Cheats DDBD LD HL,$3C00 Write 3C00 to *CHARS.
DDC0 LD ($5C36),HL
DDC3 LD A,E Jump to Cheat_NextRoom if "8" was pressed.
DDC4 CP $08
DDC6 JP Z,Cheat_NextRoom
DDC9 OR A Jump to Cheat_PreviousRoom if "1" was pressed.
DDCA JP Z,Cheat_PreviousRoom
DDCD CP $20 Write 0705 to *Player if "C" was pressed.
DDCF JR NZ,Handler_Keyboard_Corner2
DDD1 LD HL,$0705
DDD4 LD ($64A4),HL
Handler_Keyboard_Corner2 DDD7 CP $24 Write 161F to *Player if "X" was pressed.
DDD9 JR NZ,Handler_Keyboard_Corner3
DDDB LD HL,$161F
DDDE LD ($64A4),HL
Handler_Keyboard_Corner3 DDE1 CP $27 Write 071F to *Player if "Z" was pressed.
DDE3 JR NZ,Handler_Keyboard_Corner4
DDE5 LD HL,$071F
DDE8 LD ($64A4),HL
Handler_Keyboard_Corner4 DDEB CP $23 Write 1605 to *Player if "V" was pressed.
DDED JR NZ,Handler_Keyboard_Lives
DDEF LD HL,$1605
DDF2 LD ($64A4),HL
Handler_Keyboard_Lives DDF5 CP $16 Write 01 to *Player_Lives if "B" was pressed.
DDF7 JR NZ,Handler_Keyboard_RoomLetter
DDF9 LD A,$01
DDFB LD ($64B4),A
Handler_Keyboard_RoomLetter DDFE LD BC,$0321 Call JumpTable_SetPrintPosition at column 03 row 21.
DE01 CALL JumpTable_SetPrintPosition
DE04 LD A,$07 Write WHITE to *ATTR_T.
DE06 LD ($5C8F),A
DE09 LD A,($64A2) Print *CurrentRoom as "A"+"room".
DE0C ADD A,$41
DE0E JP JumpTable_PrintCharacter
DE11 RET Return.
Print C as an ASCII digit.
Print_Digit DE12 LD A,C Convert the digit into ASCII.
DE13 ADD A,$30
DE15 CALL JumpTable_PrintCharacter Call JumpTable_PrintCharacter.
DE18 RET Return.
Prev: DC62 Up: Map Next: DE19