![]() |
Routines |
| Prev: 58140 | Up: Map | Next: 58195 |
|
Used by the routine at StartGame.
Pauses the game if CAPS SHIFT or SPACE is pressed on its own. The game continues when the key has been pressed again.
|
||||||||||||||||||||
|
Return unless CAPS SHIFT or SPACE is pressed on its own.
|
||||||||||||||||||||
| PauseGame | 58156 | LD A,126 | Read from the keyboard;
|
|||||||||||||||||
| 58158 | CALL ReadKeyboardPort | |||||||||||||||||||
| 58161 | BIT 0,A | Return if neither of the keys CAPS SHIFT or SPACE is pressed. | ||||||||||||||||||
| 58163 | RET Z | |||||||||||||||||||
|
Return if any of the other keys is pressed too.
|
||||||||||||||||||||
| 58164 | AND %00011110 | Keep bits 1 to 4. | ||||||||||||||||||
| 58166 | 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 | 58167 | LD A,126 | Read the keys. | |||||||||||||||||
| 58169 | CALL ReadKeyboardPort | |||||||||||||||||||
| 58172 | BIT 0,A | Jump to PauseGame_Release if bit 0 is set. | ||||||||||||||||||
| 58174 | JR NZ,PauseGame_Release | |||||||||||||||||||
|
Wait for a key to be pressed.
|
||||||||||||||||||||
| PauseGame_Press | 58176 | LD A,126 | Read the keys. | |||||||||||||||||
| 58178 | CALL ReadKeyboardPort | |||||||||||||||||||
| 58181 | BIT 0,A | Jump to PauseGame_Press if bit 0 is not set. | ||||||||||||||||||
| 58183 | JR Z,PauseGame_Press | |||||||||||||||||||
|
Wait for the key to be released.
|
||||||||||||||||||||
| PauseGame_ReleaseAgain | 58185 | LD A,126 | Read the keys. | |||||||||||||||||
| 58187 | CALL ReadKeyboardPort | |||||||||||||||||||
| 58190 | BIT 0,A | Jump to PauseGame_ReleaseAgain if bit 0 is set. | ||||||||||||||||||
| 58192 | JR NZ,PauseGame_ReleaseAgain | |||||||||||||||||||
| 58194 | RET | Return. | ||||||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||||||
| Prev: 58140 | Up: Map | Next: 58195 |