Prev: B4EA Up: Map Next: B505
B4EB: Handler: Game Menu Input
Used by the routines at ThemeMusic and Play_ThemeMusic.
Input
BC Counter for a slight pause
Handler_GameMenuInput B4EB PUSH AF Stash AF, BC and DE on the stack.
B4EC PUSH BC
B4ED PUSH DE
Handler_GameMenuInput_Pause B4EE DEC BC Decrease BC by one.
B4EF LD A,B Jump to Handler_GameMenuInput_Pause until BC is 0000.
B4F0 OR C
B4F1 JR NZ,Handler_GameMenuInput_Pause
Collect the user input.
B4F3 LD A,$F7 Read from the keyboard;
Port Number Bit
0 1 2 3 4
F7 1 2 3 4 5
B4F5 IN A,($FE)
Pad out the bits we're not interested in (only keys 1, 2, 3 and 4).
B4F7 OR %11110000 Set bits 4-7.
B4F9 LD E,A Store the result in E.
B4FA LD A,($B4E9) A=*TempStore_GameOptions.
B4FD AND E Merge in the bits from E.
B4FE LD ($B4E9),A Write A to *TempStore_GameOptions.
B501 POP DE Restore DE, BC and AF from the stack.
B502 POP BC
B503 POP AF
B504 RET Return.
Prev: B4EA Up: Map Next: B505