Prev: ECDA Up: Map Next: ED4D
ECF3: Runs the redefine keys screen
Used by the routine at wait_for_keypress.
redefine_keys ECF3 CALL clear_screen Call clear_screen
ECF6 LD HL,$EA52 Address of "REDEFINE KEYS" strings
ECF9 CALL menu_draw_strings Call menu_draw_strings
ECFC LD DE,$48D6
ECFF LD BC,$0801
rdk_loop_1 ED02 PUSH HL Preserve registers
ED03 PUSH DE
ED04 PUSH BC
ED05 CALL define_keys Call define_keys
ED08 POP BC Restore registers
ED09 POP DE
ED0A POP HL
Debounce?
ED0B XOR A Read port $00FE
ED0C IN A,($FE)
ED0E CPL Complement the value returned to change it from active-low to active-high
ED0F AND $1F Discard any non-key flags
ED11 JR NZ,rdk_loop_1 Jump if any keys are pressed
ED13 CALL $ED6D
ED16 INC C C++
ED17 INC HL HL++
ED18 DJNZ rdk_loop_1 Loop rdk_loop_1 while B
ED1A LD B,$14 B = 20
rdk_loop_2 ED1C PUSH BC Preserve
ED1D CALL define_keys Call define_keys
ED20 POP BC Restore
ED21 DJNZ rdk_loop_2 Loop rdk_loop_2 while B
Test keys are "SHOCKED<ENTER>".
ED23 LD B,$08 B = 8
ED25 LD DE,$EE30 DE -> shocked bytes
ED28 LD HL,$EE38 HL -> input_tmp
rdk_loop_3 ED2B LD A,(DE) A = *DE
ED2C CP (HL) CP *HL
ED2D INC HL HL++
ED2E INC DE DE++
ED2F RET NZ Return if non-zero -- no match
ED30 DJNZ rdk_loop_3 Loop rdk_loop_3 while B
ED32 LD A,$01 Set test mode flag
ED34 LD ($8000),A
ED37 CALL clear_screen Call clear_screen
ED3A LD HL,$EAE1 Address of TEST MODE strings
ED3D CALL menu_draw_strings Call menu_draw_strings
redefine_keys_0 ED40 CALL define_keys Call define_keys
Debounce?
ED43 XOR A Read port $00FE
ED44 IN A,($FE)
ED46 CPL Complement the value returned to change it from active-low to active-high
ED47 AND $1F Discard any non-key flags
ED49 JR Z,redefine_keys_0 Loop while no keys were pressed
ED4B JR redefine_keys Loop
Prev: ECDA Up: Map Next: ED4D