Prev: 9481 Up: Map Next: 94B6
9489: Pause Game
Used by the routine at DrawRoom.
Called by the main loop to check for the game being paused. The game is paused when only the key for CAPS SHIFT or SPACE is pressed. It then waits until the key has been released, pressed again and released again, before returning.
PauseGame 9489 DI Disable interrupts.
948A LD A,$7E Read from the keyboard;
Port Number Bit
0 1 2 3 4
7E CAPS SHIFT / SPACE Z / SYMBOL SHIFT X / M C / N V / B
948C OUT ($FD),A
948E IN A,($FE)
9490 BIT 0,A Return if the key for bit 0 is not pressed.
9492 RET NZ
9493 CPL Flip the bits, so that a set bit is a key which is pressed.
9494 AND %00011110 Keep only bits 1-4.
9496 RET NZ Return if any of the other keys are pressed.
Wait for the key to be released.
PauseGame_Release 9497 LD A,$7E Read from the keyboard.
9499 OUT ($FD),A
949B IN A,($FE)
949D BIT 0,A Loop back to PauseGame_Release until the key is released.
949F JR Z,PauseGame_Release
Wait for the key to be pressed again.
PauseGame_Wait 94A1 LD A,$7E Read from the keyboard.
94A3 OUT ($FD),A
94A5 IN A,($FE)
94A7 BIT 0,A Loop back to PauseGame_Wait until the key is pressed.
94A9 JR NZ,PauseGame_Wait
Wait for the key to be released again.
PauseGame_Resume 94AB LD A,$7E Read from the keyboard.
94AD OUT ($FD),A
94AF IN A,($FE)
94B1 BIT 0,A Loop back to PauseGame_Resume until the key is released.
94B3 JR Z,PauseGame_Resume
94B5 RET Return.
Prev: 9481 Up: Map Next: 94B6