Prev: 33368 Up: Map Next: 33477
33432: Controls: Pause
Used by the routines at 33368 and 46382.
ControlsPause 33432 DI Disable interrupts.
33433 LD A,223 Read from the keyboard;
Port Number Bit
0 1 2 3 4
223 P O I U Y
33435 OUT (253),A
33437 IN A,(254)
If key "O" is not being pressed, then just return.
33439 BIT 1,A Return if bit 1 is not set.
33441 RET NZ
Return if any other key has been pressed with "O".
33442 CPL Flip the bits.
33443 AND %00011101 Keep only bits 0, 2-4.
33445 RET NZ Return if the result is not zero.
Loop until the "O" button is released.
GamePaused_Debounce 33446 LD A,223 Read from the keyboard;
Port Number Bit
0 1 2 3 4
223 P O I U Y
33448 OUT (253),A
33450 IN A,(254)
33452 BIT 1,A Jump to GamePaused_Debounce if bit 1 is set.
33454 JR Z,GamePaused_Debounce
Creates an infinite loop which only exits when "O" is pressed again.
GamePaused 33456 LD A,223 Read from the keyboard;
Port Number Bit
0 1 2 3 4
223 P O I U Y
33458 OUT (253),A
33460 IN A,(254)
33462 BIT 1,A Jump to GamePaused if bit 1 is not set.
33464 JR NZ,GamePaused
Likewise, to prevent the pause from recurring instantly, loop until the "O" button is released.
GamePaused_Debounce_Exit 33466 LD A,223 Read from the keyboard;
Port Number Bit
0 1 2 3 4
223 P O I U Y
33468 OUT (253),A
33470 IN A,(254)
33472 BIT 1,A Jump to GamePaused_Debounce_Exit if bit 1 is set.
33474 JR Z,GamePaused_Debounce_Exit
33476 RET Return.
Prev: 33368 Up: Map Next: 33477