Prev: 47233 Up: Map Next: 47273
47257: Wait For Key Press
Used by the routines at GameOver and GameCompleted.
Waits until a key is pressed or a time has passed. The time is B counts of HL from 0000 back to 0000.
Input
B Length of the wait
Count down, reading the keyboard each time.
WaitForKeyPress 47257 LD HL,0 Set HL to 0000.
WaitForKeyPress_Wait 47260 XOR A Select all of the keyboard rows.
47261 CALL ReadKeyboardPort Call ReadKeyboardPort.
47264 RET NZ Return if a key is pressed.
47265 DEC HL Count down.
47266 LD A,H Jump to WaitForKeyPress_Wait if HL is not zero.
47267 OR L
47268 JR NZ,WaitForKeyPress_Wait
47270 DJNZ WaitForKeyPress_Wait Jump to WaitForKeyPress_Wait.
47272 RET Return.
View the equivalent code in;
Prev: 47233 Up: Map Next: 47273