Prev: 40646 Up: Map Next: 40781
40713: Check Pause
Used by the routine at MainLoop.
Called every frame. Pressing SPACE on its own pauses the game, while the lights run round the border. Pressing it again resumes the game.
CheckPause 40713 LD A,126 Read the half-row of the keyboard that contains SPACE...
40715 CALL ReadKeys ...using ReadKeys.
40718 BIT 0,A Return if SPACE is not being pressed.
40720 RET Z
40721 AND 30 Return if any of the other keys in the row are pressed.
40723 RET NZ
40724 CALL MakeBumpSound Make a beep using MakeBumpSound.
CheckPause_Release 40727 LD A,126 Read the half-row of the keyboard that contains SPACE...
40729 CALL ReadKeys ...using ReadKeys.
40732 BIT 0,A Loop back until SPACE has been released.
40734 JR NZ,CheckPause_Release
40736 LD HL,1 Set up a delay...
CheckPause_Wait 40739 LD C,1 Tell WaitForFrame to start another light running round the border...
40741 CALL WaitForFrame ...and wait for the next frame.
40744 LD A,126 Read the half-row of the keyboard that contains SPACE...
40746 CALL ReadKeys ...using ReadKeys.
40749 BIT 0,A Loop back until SPACE is pressed again.
40751 JR Z,CheckPause_Wait
CheckPause_Resume 40753 LD C,1 Tell WaitForFrame to start another light running round the border...
40755 CALL WaitForFrame ...and wait for the next frame.
40758 LD A,126 Read the half-row of the keyboard that contains SPACE...
40760 CALL ReadKeys ...using ReadKeys.
40763 BIT 0,A Loop back until SPACE has been released.
40765 JR NZ,CheckPause_Resume
40767 LD HL,1 Set up a delay...
40770 CALL MakeBeep ...and make a click using MakeBeep.
CheckPause_Finish 40773 LD C,0 Tell WaitForFrame not to start any more lights...
40775 CALL WaitForFrame ...and wait for the next frame.
40778 JR NZ,CheckPause_Finish Loop back until the lights have all finished.
40780 RET Return.
Prev: 40646 Up: Map Next: 40781