![]() |
Routines |
| Prev: B0FA | Up: Map | Next: B12F |
|
Used by the routine at HandlerControls.
|
||||||||||||||||||||
|
Initialise the controls as "none" in C.
|
||||||||||||||||||||
| ReadCursorJoystick | B103 | LD C,$00 | C=00. | |||||||||||||||||
|
The cusor keys are covered by different ports.
|
||||||||||||||||||||
| HandleCursorJoystick_Port_F7 | B105 | LD A,$F7 | Read from the keyboard;
|
|||||||||||||||||
| B107 | OUT ($FD),A | |||||||||||||||||||
| B109 | IN A,($FE) | |||||||||||||||||||
|
Check joystick "LEFT".
|
||||||||||||||||||||
| ReadCursorJoystick_Left | B10B | BIT 4,A | Has key "5" been pressed? | |||||||||||||||||
| B10D | JR NZ,HandleCursorJoystick_Port_EF | If not jump to HandleCursorJoystick_Port_EF. | ||||||||||||||||||
| B10F | SET 0,C | Set bit 0 of C. | ||||||||||||||||||
|
Handle the other port.
|
||||||||||||||||||||
| HandleCursorJoystick_Port_EF | B111 | LD A,$EF | Read from the keyboard;
|
|||||||||||||||||
| B113 | OUT ($FD),A | |||||||||||||||||||
| B115 | IN A,($FE) | |||||||||||||||||||
|
Check joystick "DOWN".
|
||||||||||||||||||||
| ReadCursorJoystick_Down | B117 | BIT 4,A | Has key "6" been pressed? | |||||||||||||||||
| B119 | JR NZ,ReadCursorJoystick_Up | If not jump to ReadCursorJoystick_Up. | ||||||||||||||||||
| B11B | SET 3,C | Set bit 3 of C. | ||||||||||||||||||
|
Check joystick "UP".
|
||||||||||||||||||||
| ReadCursorJoystick_Up | B11D | BIT 3,A | Has key "7" been pressed? | |||||||||||||||||
| B11F | JR NZ,ReadCursorJoystick_Right | If not jump to ReadCursorJoystick_Right. | ||||||||||||||||||
| B121 | SET 2,C | Set bit 2 of C. | ||||||||||||||||||
|
Check joystick "RIGHT".
|
||||||||||||||||||||
| ReadCursorJoystick_Right | B123 | BIT 2,A | Has key "8" been pressed? | |||||||||||||||||
| B125 | JR NZ,ReadCursorJoystick_Fire | If not jump to ReadCursorJoystick_Fire. | ||||||||||||||||||
| B127 | SET 1,C | Set bit 1 of C. | ||||||||||||||||||
|
Check joystick "FIRE".
|
||||||||||||||||||||
| ReadCursorJoystick_Fire | B129 | BIT 0,A | Has key "0" been pressed? | |||||||||||||||||
| B12B | RET NZ | If not then return. | ||||||||||||||||||
| B12C | SET 4,C | Set bit 4 of C. | ||||||||||||||||||
| B12E | RET | Return. | ||||||||||||||||||
| Prev: B0FA | Up: Map | Next: B12F |