![]() |
Routines |
| Prev: EB9E | Up: Map | Next: EBF5 |
|
||||||||||||||||||||||
|
All the handlers match the outputs of the Kempston Joystick:
|
||||||||||||||||||||||
| InputHandler_Sinclair | EBCD | LD A,$EF | Read from the keyboard;
|
|||||||||||||||||||
| EBCF | IN A,($FE) | |||||||||||||||||||||
|
If "fire" has been pressed, add 10 to *HL.
|
||||||||||||||||||||||
| EBD1 | RRA | Jump to Sinclair_CheckUp if "0" (fire) is not being pressed. | ||||||||||||||||||||
| EBD2 | JR C,Sinclair_CheckUp | |||||||||||||||||||||
| EBD4 | PUSH AF | Stash the inputs on the stack. | ||||||||||||||||||||
| EBD5 | LD A,$10 | Add 10 to *HL and write it back. | ||||||||||||||||||||
| EBD7 | ADD A,(HL) | |||||||||||||||||||||
| EBD8 | LD (HL),A | |||||||||||||||||||||
| EBD9 | POP AF | Restore the inputs from the stack. | ||||||||||||||||||||
|
If "up" has been pressed, add 08 to *HL.
|
||||||||||||||||||||||
| Sinclair_CheckUp | EBDA | RRA | Jump to Sinclair_CheckDown if "9" (up) is not being pressed. | |||||||||||||||||||
| EBDB | JR C,Sinclair_CheckDown | |||||||||||||||||||||
| EBDD | PUSH AF | Stash the inputs on the stack. | ||||||||||||||||||||
| EBDE | LD A,$08 | Add 08 to *HL and write it back. | ||||||||||||||||||||
| EBE0 | ADD A,(HL) | |||||||||||||||||||||
| EBE1 | LD (HL),A | |||||||||||||||||||||
| EBE2 | POP AF | Restore the inputs from the stack. | ||||||||||||||||||||
|
If "down" has been pressed, add 04 to *HL.
|
||||||||||||||||||||||
| Sinclair_CheckDown | EBE3 | RRA | Jump to Sinclair_CheckRight if "8" (down) is not being pressed. | |||||||||||||||||||
| EBE4 | JR C,Sinclair_CheckRight | |||||||||||||||||||||
| EBE6 | PUSH AF | Stash the inputs on the stack. | ||||||||||||||||||||
| EBE7 | LD A,$04 | Add 04 to *HL and write it back. | ||||||||||||||||||||
| EBE9 | ADD A,(HL) | |||||||||||||||||||||
| EBEA | LD (HL),A | |||||||||||||||||||||
| EBEB | POP AF | Restore the inputs from the stack. | ||||||||||||||||||||
|
If "right" has been pressed, add 01 to *HL.
|
||||||||||||||||||||||
| Sinclair_CheckRight | EBEC | RRA | Jump to Sinclair_CheckLeft if "7" (right) is not being pressed. | |||||||||||||||||||
| EBED | JR C,Sinclair_CheckLeft | |||||||||||||||||||||
| EBEF | INC (HL) | Increment *HL by one. | ||||||||||||||||||||
|
If "left" has been pressed, add 02 to *HL.
|
||||||||||||||||||||||
| Sinclair_CheckLeft | EBF0 | RRA | Jump to InputHandler_Common if "6" (left) is not being pressed. | |||||||||||||||||||
| EBF1 | JR C,InputHandler_Common | |||||||||||||||||||||
| EBF3 | INC (HL) | Increment *HL by two. | ||||||||||||||||||||
| EBF4 | INC (HL) | |||||||||||||||||||||
|
Continue on to InputHandler_Common.
|
||||||||||||||||||||||
| Prev: EB9E | Up: Map | Next: EBF5 |