.ProcessPauseKeys LDA keyLogger+3 \ Set A to the key logger entry for "7", "8", COPY and \ DELETE (volume down, volume up, pause, unpause) BMI paws2 \ If there is no key press in the key logger entry, jump \ to paws2 to return from the subroutine CMP #2 \ If A <> 2 then COPY is not being pressed, so jump to BNE paws2 \ paws2 to check for DELETE \ If we get here then COPY is being pressed, so we need \ to pause the game ROR gamePaused \ Set bit 7 of gamePaused to indicate that the game is \ paused (this works because the CMP above returned an \ equality, so the C flag is set and ready to be rotated \ into bit 7 of gamePaused) LDA #8 \ Update the scanner so it's filled with green, to show JSR UpdateScannerNow \ that the game is paused (calling UpdateScannerNow \ ensures the scanner is updated irrespective of whether \ the scanner is currently enabled in-game) JSR FlushSoundBuffers \ Flush all four sound channel buffers .paws1 LDA keyLogger+3 \ Set A to the key logger entry for "7", "8", COPY and \ DELETE (volume down, volume up, pause, unpause) CMP #3 \ If A <> 3 then DELETE is not being pressed, so jump BNE paws1 \ paws1 to check for key presses (or wait until no key \ is being pressed) LDA #0 \ Update the scanner so it's filled with black, so the JSR UpdateScannerNow \ game can resume with a blank scanner (calling \ UpdateScannerNow ensures the scanner is updated \ irrespective of whether the scanner is currently \ enabled in-game) LSR gamePaused \ Clear bit 7 of gamePaused to indicate that the game is \ unpaused .paws2 RTS \ Return from the subroutineName: ProcessPauseKeys [Show more] Type: Subroutine Category: Keyboard Summary: Pause or unpause the game when COPY or DELETE are pressedContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ProcessGameplay calls ProcessPauseKeys
[X]
Subroutine FlushSoundBuffers (category: Sound)
Flush all four sound channel buffers
[X]
Subroutine UpdateScannerNow (category: Scanner/energy row)
Update the scanner to a new state
[X]
Variable gamePaused in workspace Main variable workspace
A flag to record whether the game is paused
[X]
Variable keyLogger in workspace Main variable workspace
The four-byte key logger for logging game key presses
[X]
Label paws1 is local to this routine
[X]
Label paws2 is local to this routine