Prev: 45219 Up: Map Next: 45273
45233: Controls: Interface II Joystick
Output
C Joystick controls
Initialise the controls as "none" in C.
ReadInterfaceIIJoystick 45233 LD C,0 C=0.
45235 LD A,239 Read from the keyboard;
Port Number Bit
0 1 2 3 4
239 0 9 8 7 6
45237 OUT (253),A
45239 IN A,(254)
Check joystick "FIRE".
ReadInterfaceIIJoystick_Fire 45241 BIT 0,A Has key "0" been pressed?
45243 JR NZ,ReadInterfaceIIJoystick_Up If not jump to ReadInterfaceIIJoystick_Up.
45245 SET 4,C Set bit 4 of C.
Check joystick "UP".
ReadInterfaceIIJoystick_Up 45247 BIT 1,A Has key "9" been pressed?
45249 JR NZ,ReadInterfaceIIJoystick_Down If not jump to ReadInterfaceIIJoystick_Down.
45251 SET 2,C Set bit 2 of C.
Check joystick "DOWN".
ReadInterfaceIIJoystick_Down 45253 BIT 2,A Has key "8" been pressed?
45255 JR NZ,ReadInterfaceIIJoystick_Right If not jump to ReadInterfaceIIJoystick_Right.
45257 SET 3,C Set bit 3 of C.
Check joystick "RIGHT".
ReadInterfaceIIJoystick_Right 45259 BIT 3,A Has key "7" been pressed?
45261 JR NZ,ReadInterfaceIIJoystick_Left If not jump to ReadInterfaceIIJoystick_Down.
45263 SET 1,C Set bit 1 of C.
Check joystick "LEFT".
ReadInterfaceIIJoystick_Left 45265 BIT 4,A Has key "6" been pressed?
45267 JR NZ,HandlerInterfaceIIJoystick If not jump to HandlerInterfaceIIJoystick.
45269 SET 0,C Set bit 0 of C.
HandlerInterfaceIIJoystick 45271 LD A,C A=controls.
45272 RET Return.
Prev: 45219 Up: Map Next: 45273