![]() |
Routines |
| Prev: 33369 | Up: Map | Next: 33477 |
|
If "O" is pressed on its own, waits for it to be released, then for a second press and release of "O" before returning.
|
||||||||||||||||||||
|
Hold the game while "O" is pressed.
|
||||||||||||||||||||
| ControlsPause | 33432 | DI | Disable interrupts. | |||||||||||||||||
| 33433 | LD A,223 | Read from the keyboard;
|
||||||||||||||||||
| 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 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;
|
|||||||||||||||||
| 33448 | OUT (253),A | |||||||||||||||||||
| 33450 | IN A,(254) | |||||||||||||||||||
| 33452 | BIT 1,A | Jump to GamePaused_Debounce if "O" is still pressed. | ||||||||||||||||||
| 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;
|
|||||||||||||||||
| 33458 | OUT (253),A | |||||||||||||||||||
| 33460 | IN A,(254) | |||||||||||||||||||
| 33462 | BIT 1,A | Jump to GamePaused if "O" is not pressed. | ||||||||||||||||||
| 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;
|
|||||||||||||||||
| 33468 | OUT (253),A | |||||||||||||||||||
| 33470 | IN A,(254) | |||||||||||||||||||
| 33472 | BIT 1,A | Jump to GamePaused_Debounce_Exit if "O" is still pressed. | ||||||||||||||||||
| 33474 | JR Z,GamePaused_Debounce_Exit | |||||||||||||||||||
| 33476 | RET | Return. | ||||||||||||||||||
| Prev: 33369 | Up: Map | Next: 33477 |