![]() |
Routines |
| Prev: EB98 | Up: Map | Next: EBCD |
|
||||||||||||||||||||||
|
All the handlers match the outputs of the Kempston Joystick:
|
||||||||||||||||||||||
| InputHandler_Cursor | EB9E | LD A,$F7 | Read from the keyboard;
|
|||||||||||||||||||
| EBA0 | IN A,($FE) | |||||||||||||||||||||
| EBA2 | CPL | Invert the bits in A. | ||||||||||||||||||||
| EBA3 | AND %00010000 | Keep only bit 4 ("5" i.e. left). | ||||||||||||||||||||
|
If "left" has been pressed, add 02 to *HL.
|
||||||||||||||||||||||
| EBA5 | JR Z,Cursor_CheckInputs | Jump to Cursor_CheckInputs if "5" (left) is not being pressed. | ||||||||||||||||||||
| EBA7 | INC (HL) | Increment *HL by two. | ||||||||||||||||||||
| EBA8 | INC (HL) | |||||||||||||||||||||
| Cursor_CheckInputs | EBA9 | LD A,$EF | Read from the keyboard;
|
|||||||||||||||||||
| EBAB | IN A,($FE) | |||||||||||||||||||||
|
If "fire" has been pressed, add 10 to *HL.
|
||||||||||||||||||||||
| EBAD | RRA | Jump to Cursor_CheckRight if "0" (fire) is not being pressed. | ||||||||||||||||||||
| EBAE | JR C,Cursor_CheckRight | |||||||||||||||||||||
| EBB0 | PUSH AF | Stash the inputs on the stack. | ||||||||||||||||||||
| EBB1 | LD A,$10 | Add 10 to *HL and write it back. | ||||||||||||||||||||
| EBB3 | ADD A,(HL) | |||||||||||||||||||||
| EBB4 | LD (HL),A | |||||||||||||||||||||
| EBB5 | POP AF | Restore the inputs from the stack. | ||||||||||||||||||||
|
If "right" has been pressed, add 01 to *HL.
|
||||||||||||||||||||||
| Cursor_CheckRight | EBB6 | RRA | Jump to Cursor_CheckUp if "8" (right) is not being pressed. | |||||||||||||||||||
| EBB7 | RRA | |||||||||||||||||||||
| EBB8 | JR C,Cursor_CheckUp | |||||||||||||||||||||
| EBBA | INC (HL) | Increment *HL by one. | ||||||||||||||||||||
|
If "up" has been pressed, add 08 to *HL.
|
||||||||||||||||||||||
| Cursor_CheckUp | EBBB | RRA | Jump to Cursor_CheckDown if "7" (up) is not being pressed. | |||||||||||||||||||
| EBBC | JR C,Cursor_CheckDown | |||||||||||||||||||||
| EBBE | PUSH AF | Stash the inputs on the stack. | ||||||||||||||||||||
| EBBF | LD A,$08 | Add 08 to *HL and write it back. | ||||||||||||||||||||
| EBC1 | ADD A,(HL) | |||||||||||||||||||||
| EBC2 | LD (HL),A | |||||||||||||||||||||
| EBC3 | POP AF | Restore the inputs from the stack. | ||||||||||||||||||||
|
If "down" has been pressed, add 04 to *HL.
|
||||||||||||||||||||||
| Cursor_CheckDown | EBC4 | RRA | Jump to InputHandler_Common if "6" (down) is not being pressed. | |||||||||||||||||||
| EBC5 | JR C,InputHandler_Common | |||||||||||||||||||||
| EBC7 | LD A,$04 | Add 04 to *HL and write it back. | ||||||||||||||||||||
| EBC9 | ADD A,(HL) | |||||||||||||||||||||
| EBCA | LD (HL),A | |||||||||||||||||||||
| EBCB | JR InputHandler_Common | Jump to InputHandler_Common. | ||||||||||||||||||||
| Prev: EB98 | Up: Map | Next: EBCD |