Prev: 54536 Up: Map Next: 54586
54542: 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 54542 LD A,126 Read from the keyboard;
Port Number Bit
0 1 2 3 4
126 SHIFT / SPACE Z / SYM X / M C / N V / B
54544 CALL ReadKeyboardPort
54547 BIT 0,A Return if neither CAPS SHIFT nor SPACE is pressed.
54549 RET Z
54550 AND %00011110 Keep bits 1 to 4.
54552 RET NZ Return if any of them is pressed.
Wait for the key to be released.
PauseGame_Release 54553 LD A,126 Read from the keyboard;
Port Number Bit
0 1 2 3 4
126 SHIFT / SPACE Z / SYM X / M C / N V / B
54555 CALL ReadKeyboardPort
54558 BIT 0,A Jump to PauseGame_Release while CAPS SHIFT or SPACE is pressed.
54560 JR NZ,PauseGame_Release
54562 CALL PlayMiddleBeep Play the sound of the pause.
Wait for the key to be pressed.
PauseGame_Wait 54565 LD A,126 Read from the keyboard;
Port Number Bit
0 1 2 3 4
126 SHIFT / SPACE Z / SYM X / M C / N V / B
54567 CALL ReadKeyboardPort
54570 BIT 0,A Jump to PauseGame_Wait until CAPS SHIFT or SPACE is pressed.
54572 JR Z,PauseGame_Wait
Wait for the key to be released.
PauseGame_Finish 54574 LD A,126 Read from the keyboard;
Port Number Bit
0 1 2 3 4
126 SHIFT / SPACE Z / SYM X / M C / N V / B
54576 CALL ReadKeyboardPort
54579 BIT 0,A Jump to PauseGame_Finish while CAPS SHIFT or SPACE is pressed.
54581 JR NZ,PauseGame_Finish
54583 JP PlayMiddleBeep Jump to PlayMiddleBeep.
View the equivalent code in;
Prev: 54536 Up: Map Next: 54586