![]() |
Routines |
| Prev: C713 | Up: Map | Next: C794 |
| PollHKey | C77D | LD D,$15 | Initialise D to 15 (down-counter for "H" not pressed). | |||||||||||||||||
| C77F | LD E,$15 | Initialise E to 15 (down-counter for "H" pressed). | ||||||||||||||||||
| C781 | LD B,$14 | Set an inner loop counter to 14 loops. | ||||||||||||||||||
| PollHKey_Loop | C783 | LD A,$BF | Read from the keyboard;
|
|||||||||||||||||
| C785 | IN A,($FE) | |||||||||||||||||||
| C787 | AND %00010000 | Keep only bit 4 ("H" key). | ||||||||||||||||||
| C789 | JP NZ,PollHKey_NotPressed | If "H" is not pressed (bit 4 is 1), jump to PollHKey_NotPressed to decrement D. | ||||||||||||||||||
|
"H" key was pressed.
|
||||||||||||||||||||
| C78C | DEC E | Decrease E by one. | ||||||||||||||||||
| C78D | JP PollHKey_Continue | Jump to PollHKey_Continue (skip the D decrement). | ||||||||||||||||||
| PollHKey_NotPressed | C790 | DEC D | Decrease D by one. | |||||||||||||||||
| PollHKey_Continue | C791 | DJNZ PollHKey_Loop | Decrease the inner loop counter and loop back to PollHKey_Loop until it reaches zero. | |||||||||||||||||
| C793 | RET | Return. | ||||||||||||||||||
| Prev: C713 | Up: Map | Next: C794 |