Prev: 95DE Up: Map Next: 9609
95F3: Wait For Key
Used by the routines at Show_Game_Over and Show_Ending_Screen.
Waits until key 0 is pressed. It gives up after 0C times 10000 passes round the inner loop if no key is pressed.
Wait_For_Key 95F3 LD B,$0C Set the outer counter to 0C.
95F5 LD HL,$0000 Set the inner counter to 00 which makes 10000 passes round the inner loop.
Wait_For_Key_Inner_Loop 95F8 DEC HL Decrease the inner counter.
95F9 LD A,$EF Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
95FB OUT ($FD),A
95FD IN A,($FE)
95FF AND %00000001 Keep only the bit for key 0.
9601 RET Z Return if key 0 is pressed.
9602 LD A,H Jump back to Wait_For_Key_Inner_Loop until the inner counter is zero.
9603 OR L
9604 JR NZ,Wait_For_Key_Inner_Loop
9606 DJNZ Wait_For_Key_Inner_Loop Decrease the outer counter and loop back until it is zero.
9608 RET Return.
Prev: 95DE Up: Map Next: 9609