Prev: D1BE Up: Map Next: D233
D206: Pause Game
Used by the routine at InitialiseGame.
Pauses the game if CAPS SHIFT or SPACE is pressed on its own. PlayPauseSound is played at the start and at the end. The game carries on when CAPS SHIFT or SPACE is pressed again.
Return unless CAPS SHIFT or SPACE is the only key being pressed.
PauseGame D206 LD A,$7E Read from the keyboard;
Port Number Bit
0 1 2 3 4
7E CAPS SHIFT or SPACE Z or SYMBOL SHIFT X or M C or N V or B
D208 CALL ReadKeyboardPort
D20B BIT 0,A Return if neither CAPS SHIFT nor SPACE is pressed.
D20D RET Z
D20E AND %00011110 Keep the bits for the other keys.
D210 RET NZ Return if any of them is pressed.
Play the pause sound.
D211 CALL PlayPauseSound Call PlayPauseSound.
Wait for the key to be released.
PauseGame_Release D214 LD A,$7E Read the keys, and jump to PauseGame_Release while CAPS SHIFT or SPACE is pressed.
D216 CALL ReadKeyboardPort
D219 BIT 0,A
D21B JR NZ,PauseGame_Release
Wait for a key to be pressed.
PauseGame_Press D21D LD A,$7E Read the keys, and jump to PauseGame_Press until CAPS SHIFT or SPACE is pressed.
D21F CALL ReadKeyboardPort
D222 BIT 0,A
D224 JR Z,PauseGame_Press
Play the pause sound.
D226 CALL PlayPauseSound Call PlayPauseSound.
Wait for the key to be released.
PauseGame_ReleaseAgain D229 LD A,$7E Read the keys, and jump to PauseGame_ReleaseAgain while CAPS SHIFT or SPACE is pressed.
D22B CALL ReadKeyboardPort
D22E BIT 0,A
D230 JR NZ,PauseGame_ReleaseAgain
D232 RET Return.
View the equivalent code in;
Prev: D1BE Up: Map Next: D233