![]() |
Routines |
| Prev: 94B8 | Up: Map | Next: 94E6 |
|
Used by the routine at MainMenu.
|
||||
|
Read from the keyboard- returns 00 when no keys are being pressed.
|
||||
| Debounce_CheckKeys | 94D3 | CALL $965F | Call 965F. | |
| 94D6 | OR A | Jump back to Debounce_CheckKeys if any keys are still being pressed. | ||
| 94D7 | JR NZ,Debounce_CheckKeys | |||
|
After the frame delay, return regardless of key presses.
|
||||
| 94D9 | LD B,$32 | Set a timeout counter in B of 32. | ||
| Debounce_Loop | 94DB | HALT | Halt operation (suspend CPU until the next interrupt). | |
| 94DC | XOR A | Reset the flags. | ||
| 94DD | IN A,($FE) | Read from the keyboard port. | ||
|
Mask off the unused bits.
|
||||
| 94DF | OR %11100000 | Set bits 5-7. | ||
|
If no keys are being pressed, A will become 00.
|
||||
| 94E1 | INC A | Increment the value by one. | ||
| 94E2 | RET NZ | Return if any key has been pressed. | ||
| 94E3 | DJNZ Debounce_Loop | Decrease the timeout counter by one and loop back to Debounce_Loop until the timeout counter is zero. | ||
| 94E5 | RET | Return. | ||
| Prev: 94B8 | Up: Map | Next: 94E6 |