Prev: 8258 Up: Map Next: 82C5
8298: Controls: Pause
Used by the routines at 8258 and B52E.
ControlsPause 8298 DI Disable interrupts.
8299 LD A,$DF Read from the keyboard;
Port Number Bit
0 1 2 3 4
DF P O I U Y
829B OUT ($FD),A
829D IN A,($FE)
If key "O" is not being pressed, then just return.
829F BIT 1,A Return if bit 1 is not set.
82A1 RET NZ
Return if any other key has been pressed with "O".
82A2 CPL Flip the bits.
82A3 AND %00011101 Keep only bits 0, 2-4.
82A5 RET NZ Return if the result is not zero.
Loop until the "O" button is released.
GamePaused_Debounce 82A6 LD A,$DF Read from the keyboard;
Port Number Bit
0 1 2 3 4
DF P O I U Y
82A8 OUT ($FD),A
82AA IN A,($FE)
82AC BIT 1,A Jump to GamePaused_Debounce if bit 1 is set.
82AE JR Z,GamePaused_Debounce
Creates an infinite loop which only exits when "O" is pressed again.
GamePaused 82B0 LD A,$DF Read from the keyboard;
Port Number Bit
0 1 2 3 4
DF P O I U Y
82B2 OUT ($FD),A
82B4 IN A,($FE)
82B6 BIT 1,A Jump to GamePaused if bit 1 is not set.
82B8 JR NZ,GamePaused
Likewise, to prevent the pause from recurring instantly, loop until the "O" button is released.
GamePaused_Debounce_Exit 82BA LD A,$DF Read from the keyboard;
Port Number Bit
0 1 2 3 4
DF P O I U Y
82BC OUT ($FD),A
82BE IN A,($FE)
82C0 BIT 1,A Jump to GamePaused_Debounce_Exit if bit 1 is set.
82C2 JR Z,GamePaused_Debounce_Exit
82C4 RET Return.
Prev: 8258 Up: Map Next: 82C5