![]() |
Routines |
| Prev: 60246 | Up: Map | Next: 60312 |
|
|||||||||||||||||||||||||
|
All the handlers match the outputs of the Kempston Joystick:
|
|||||||||||||||||||||||||
| InputHandler_Keyboard | 60260 | LD A,223 | Read from the keyboard;
|
||||||||||||||||||||||
| 60262 | IN A,(254) | ||||||||||||||||||||||||
|
If "right" has been pressed, add 1 to *HL.
|
|||||||||||||||||||||||||
| 60264 | RRA | Jump to Keyboard_CheckLeft if "P" (right) is not being pressed. | |||||||||||||||||||||||
| 60265 | JR C,Keyboard_CheckLeft | ||||||||||||||||||||||||
| 60267 | INC (HL) | Increment *HL by one. | |||||||||||||||||||||||
|
If "left" has been pressed, add 2 to *HL.
|
|||||||||||||||||||||||||
| Keyboard_CheckLeft | 60268 | RRA | Jump to Keyboard_CheckUp if "O" (left) is not being pressed. | ||||||||||||||||||||||
| 60269 | JR C,Keyboard_CheckUp | ||||||||||||||||||||||||
| 60271 | INC (HL) | Increment *HL by two. | |||||||||||||||||||||||
| 60272 | INC (HL) | ||||||||||||||||||||||||
| Keyboard_CheckUp | 60273 | LD A,251 | Read from the keyboard;
|
||||||||||||||||||||||
| 60275 | IN A,(254) | ||||||||||||||||||||||||
| 60277 | RRA | Jump to Keyboard_CheckDown if "Q" (up) is not being pressed. | |||||||||||||||||||||||
| 60278 | JR C,Keyboard_CheckDown | ||||||||||||||||||||||||
| 60280 | LD A,8 | Add 8 to *HL and write it back. | |||||||||||||||||||||||
| 60282 | ADD A,(HL) | ||||||||||||||||||||||||
| 60283 | LD (HL),A | ||||||||||||||||||||||||
|
If "down" has been pressed, add 4 to *HL.
|
|||||||||||||||||||||||||
| Keyboard_CheckDown | 60284 | LD A,253 | Read from the keyboard;
|
||||||||||||||||||||||
| 60286 | IN A,(254) | ||||||||||||||||||||||||
| 60288 | RRA | Jump to Keyboard_CheckFire if "A" (down) is not being pressed. | |||||||||||||||||||||||
| 60289 | JR C,Keyboard_CheckFire | ||||||||||||||||||||||||
| 60291 | LD A,4 | Add 4 to *HL and write it back. | |||||||||||||||||||||||
| 60293 | ADD A,(HL) | ||||||||||||||||||||||||
| 60294 | LD (HL),A | ||||||||||||||||||||||||
|
If "fire" has been pressed, add 16 to *HL.
Note; ALL these keys are fire button keys.
|
|||||||||||||||||||||||||
| Keyboard_CheckFire | 60295 | LD A,126 | Read from the keyboard;
|
||||||||||||||||||||||
| 60297 | IN A,(254) | ||||||||||||||||||||||||
| 60299 | CPL | Invert the bits in A. | |||||||||||||||||||||||
| 60300 | AND %00011111 | Keep only the key bits 0-4. | |||||||||||||||||||||||
| 60302 | JP Z,InputHandler_Common | Jump to InputHandler_Common if none of the fire keys are being pressed. | |||||||||||||||||||||||
| 60305 | LD A,16 | Add 16 to *HL and write it back. | |||||||||||||||||||||||
| 60307 | ADD A,(HL) | ||||||||||||||||||||||||
| 60308 | LD (HL),A | ||||||||||||||||||||||||
| 60309 | JP InputHandler_Common | Jump to InputHandler_Common. | |||||||||||||||||||||||
| Prev: 60246 | Up: Map | Next: 60312 |