Prev: CE1C Up: Map Next: CE4E
CE22: Pause Game
Used by the routine at RunGame.
Pauses the game if CAPS SHIFT or SPACE is pressed on its own. The game waits for the key to be let go of, then for it to be pressed again and let go of again. There is a beep for the start and for the end of the pause.
Return unless CAPS SHIFT or SPACE is pressed on its own.
PauseGame CE22 LD A,$7E Read from the keyboard;
Port Number Bit
0 1 2 3 4
7E SHIFT / SPACE Z / SYM X / M C / N V / B
CE24 CALL ReadKeyboardPort
CE27 BIT 0,A Return if bit 0 is not set.
CE29 RET Z
CE2A AND %00011110 Keep bits 1 to 4.
CE2C RET NZ Return if any of them is set.
Wait for the key to be let go of, then pressed and let go of again.
PauseGame_Release CE2D LD A,$7E Read the keys.
CE2F CALL ReadKeyboardPort
CE32 BIT 0,A Jump to PauseGame_Release if bit 0 is set.
CE34 JR NZ,PauseGame_Release
CE36 CALL PlayMiddleBeep Call PlayMiddleBeep.
PauseGame_Wait CE39 LD A,$7E Read the keys.
CE3B CALL ReadKeyboardPort
CE3E BIT 0,A Jump to PauseGame_Wait if bit 0 is not set.
CE40 JR Z,PauseGame_Wait
PauseGame_Finish CE42 LD A,$7E Read the keys.
CE44 CALL ReadKeyboardPort
CE47 BIT 0,A Jump to PauseGame_Finish if bit 0 is set.
CE49 JR NZ,PauseGame_Finish
CE4B JP PlayMiddleBeep Jump to PlayMiddleBeep.
View the equivalent code in;
Prev: CE1C Up: Map Next: CE4E