![]() |
Routines |
| Prev: 60312 | Up: Map | Next: 60365 |
|
||||||||||||||||||||||
|
All the handlers match the outputs of the Kempston Joystick:
|
||||||||||||||||||||||
| InputHandler_Cursor | 60318 | LD A,247 | Read from the keyboard;
|
|||||||||||||||||||
| 60320 | IN A,(254) | |||||||||||||||||||||
| 60322 | CPL | Invert the bits in A. | ||||||||||||||||||||
| 60323 | AND %00010000 | Keep only bit 4 ("5" i.e. left). | ||||||||||||||||||||
|
If "left" has been pressed, add 2 to *HL.
|
||||||||||||||||||||||
| 60325 | JR Z,Cursor_CheckInputs | Jump to Cursor_CheckInputs if "5" (left) is not being pressed. | ||||||||||||||||||||
| 60327 | INC (HL) | Increment *HL by two. | ||||||||||||||||||||
| 60328 | INC (HL) | |||||||||||||||||||||
| Cursor_CheckInputs | 60329 | LD A,239 | Read from the keyboard;
|
|||||||||||||||||||
| 60331 | IN A,(254) | |||||||||||||||||||||
|
If "fire" has been pressed, add 16 to *HL.
|
||||||||||||||||||||||
| 60333 | RRA | Jump to Cursor_CheckRight if "0" (fire) is not being pressed. | ||||||||||||||||||||
| 60334 | JR C,Cursor_CheckRight | |||||||||||||||||||||
| 60336 | PUSH AF | Stash the inputs on the stack. | ||||||||||||||||||||
| 60337 | LD A,16 | Add 16 to *HL and write it back. | ||||||||||||||||||||
| 60339 | ADD A,(HL) | |||||||||||||||||||||
| 60340 | LD (HL),A | |||||||||||||||||||||
| 60341 | POP AF | Restore the inputs from the stack. | ||||||||||||||||||||
|
If "right" has been pressed, add 1 to *HL.
|
||||||||||||||||||||||
| Cursor_CheckRight | 60342 | RRA | Jump to Cursor_CheckUp if "8" (right) is not being pressed. | |||||||||||||||||||
| 60343 | RRA | |||||||||||||||||||||
| 60344 | JR C,Cursor_CheckUp | |||||||||||||||||||||
| 60346 | INC (HL) | Increment *HL by one. | ||||||||||||||||||||
|
If "up" has been pressed, add 8 to *HL.
|
||||||||||||||||||||||
| Cursor_CheckUp | 60347 | RRA | Jump to Cursor_CheckDown if "7" (up) is not being pressed. | |||||||||||||||||||
| 60348 | JR C,Cursor_CheckDown | |||||||||||||||||||||
| 60350 | PUSH AF | Stash the inputs on the stack. | ||||||||||||||||||||
| 60351 | LD A,8 | Add 8 to *HL and write it back. | ||||||||||||||||||||
| 60353 | ADD A,(HL) | |||||||||||||||||||||
| 60354 | LD (HL),A | |||||||||||||||||||||
| 60355 | POP AF | Restore the inputs from the stack. | ||||||||||||||||||||
|
If "down" has been pressed, add 4 to *HL.
|
||||||||||||||||||||||
| Cursor_CheckDown | 60356 | RRA | Jump to InputHandler_Common if "6" (down) is not being pressed. | |||||||||||||||||||
| 60357 | JR C,InputHandler_Common | |||||||||||||||||||||
| 60359 | LD A,4 | Add 4 to *HL and write it back. | ||||||||||||||||||||
| 60361 | ADD A,(HL) | |||||||||||||||||||||
| 60362 | LD (HL),A | |||||||||||||||||||||
| 60363 | JR InputHandler_Common | Jump to InputHandler_Common. | ||||||||||||||||||||
| Prev: 60312 | Up: Map | Next: 60365 |