Prev: 7AB9 Up: Map Next: 7B07
7ACD: Wait until the user chooses a valid control type or switch to the overview mode on timeout.
controls_input 7ACD LD HL,($7802) Decrease timer
7AD0 DEC HL
7AD1 LD ($7802),HL
7AD4 LD A,H Check if the time is up
7AD5 OR L
7AD6 JP Z,switch_to_overview_mode
7AD9 LD A,($5C08)
7ADC CALL $02BF Scan keyboard
7ADF EI
7AE0 SUB $31 Subtract "1" from the pressed key ASCII code, mapping "1" to 0, "2" to 1, etc.
7AE2 LD ($7800),A
7AE5 AND $FC Validate the pressed key by making sure that none of the bits older than the first two are set, effectively allowing values 0 through 3.
7AE7 CP $00
7AE9 JR NZ,controls_input Repeat if a valid key was not pressed.
7AEB LD A,$FF
game_mode_print 7AED LD B,$00 Initialize delay counter.
controls_input_delay_loop 7AEF DJNZ controls_input_delay_loop Delay loop (purpose unclear).
7AF1 DEC A
7AF2 JR NZ,game_mode_print
7AF4 LD D,$07 PAPER BLACK; INK WHITE
7AF6 CALL clear_screen
7AF9 LD DE,$792A Print game mode dialog
7AFC LD BC,$0104
7AFF CALL $203C
7B02 LD A,$0D
7B04 LD ($5C08),A
Prev: 7AB9 Up: Map Next: 7B07