Prev: 7ACD Up: Map Next: 7B57
7B07: Wait until the user chooses a valid game mode.
game_mode_input 7B07 LD A,($5C08)
7B0A CALL $02BF Scan keyboard
7B0D EI
7B0E SUB $31 Subtract "1" from the pressed key ASCII code, mapping "1" to 0, "2" to 1, etc.
7B10 LD ($923A),A
7B13 AND $F8 Validate the pressed key by making sure that none of the bits older than the first three are set, effectively allowing values 0 through 7.
7B15 CP $00
7B17 JP NZ,game_mode_input Repeat if a valid key was not pressed.
7B1A LD D,$07 PAPER BLACK; INK WHITE
7B1C CALL clear_screen
7B1F LD A,($7800)
7B22 CP $00
7B24 JP NZ,instructions_print
7B27 LD DE,$7812 Print keyboard configuration
7B2A LD BC,$0070
7B2D CALL $203C
Print instructions and wait for Enter key.
instructions_print 7B30 LD DE,$7882 Print instructions text (msg_instructions, 168 bytes) via ROM PR_STRING.
7B33 LD BC,$00A8
7B36 CALL $203C
7B39 LD A," " Initialize LAST_K to space character.
7B3B LD ($5C08),A
Wait for user to press Enter.
instructions_input 7B3E LD A,($5C08) Read last key pressed from LAST_K.
7B41 CALL $02BF Scan keyboard via ROM routine.
7B44 EI
7B45 LD A,($5C08) Loop until Enter is pressed.
7B48 CP $0D
7B4A JP NZ,instructions_input Exit loop when Enter detected.
7B4D LD A,$00 Clear overview mode flag (start game).
7B4F LD ($7801),A
7B52 LD SP,($7810)
7B56 RET
Prev: 7ACD Up: Map Next: 7B57