Prev: 43057 Up: Map Next: 43160
43063: Pause Game
Used by the routines at ShowEnding and RunFrame.
Pauses the game, if SPACE or CAPS SHIFT is being pressed, until one of them is pressed again. The message 'PAUSED' scrolls in and out across the window.
PauseGame 43063 LD IY,(23793) Bring back IY from SavedIY.
43067 CALL TestPauseKeys Test whether SPACE or CAPS SHIFT is being pressed.
43070 RET Z Return if not.
PauseGame_Release 43071 CALL TestPauseKeys Test whether SPACE or CAPS SHIFT is being pressed.
43074 JR NZ,PauseGame_Release Jump back until the keys have been released.
43076 LD HL,65292 Set the scroll counter to 12 and the character index to 255.
43079 LD (43297),HL Store them in ScrollCounter and 43298.
43082 LD A,6 Set the length of the message to 6...
43084 LD (42354),A ...in the operand of the instruction at 42353.
PauseGame_ScrollIn 43087 EI Enable interrupts...
43088 HALT ...and wait for the next frame.
43089 DI Disable interrupts.
43090 LD HL,43057 Point HL at PauseMessage.
43093 CALL ScrollMessage Scroll the message by one step.
43096 LD HL,43057 Point HL at PauseMessage.
43099 CALL ScrollMessage Scroll the message by another step.
43102 LD HL,(43297) Fetch the scroll counter and the character index.
43105 LD DE,1548 Set the values at which the message is completely in.
43108 AND A Clear the carry flag.
43109 SBC HL,DE Compare them.
43111 JR NZ,PauseGame_ScrollIn Jump back to scroll the message until it is completely in.
PauseGame_Wait 43113 CALL Wait Wait for a short time.
43116 CALL TestPauseKeys Test whether SPACE or CAPS SHIFT is being pressed.
43119 JR Z,PauseGame_Wait Jump back until one of them is pressed.
PauseGame_Release2 43121 CALL TestPauseKeys Test whether SPACE or CAPS SHIFT is being pressed.
43124 JR NZ,PauseGame_Release2 Jump back until the keys have been released.
PauseGame_ScrollOut 43126 EI Enable interrupts...
43127 HALT ...and wait for the next frame.
43128 DI Disable interrupts.
43129 LD HL,43057 Point HL at PauseMessage.
43132 CALL ScrollMessage Scroll the message by one step.
43135 LD HL,43057 Point HL at PauseMessage.
43138 CALL ScrollMessage Scroll the message by one step.
43141 LD HL,43057 Point HL at PauseMessage.
43144 CALL ScrollMessage Scroll the message by one step.
43147 LD HL,43057 Point HL at PauseMessage.
43150 CALL ScrollMessage Scroll the message by one step.
43153 LD A,(43298) Fetch the character index.
43156 CP 15 Jump back to PauseGame_ScrollOut to scroll the message until it has gone.
43158 JR NZ,PauseGame_ScrollOut
Prev: 43057 Up: Map Next: 43160