Prev: B0A3 Up: Map Next: B0D9
B0B1: Controls: Interface II Joystick
Output
C Joystick controls
Initialise the controls as "none" in C.
ReadInterfaceIIJoystick B0B1 LD C,$00 C=00.
B0B3 LD A,$EF Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
B0B5 OUT ($FD),A
B0B7 IN A,($FE)
Check joystick "FIRE".
ReadInterfaceIIJoystick_Fire B0B9 BIT 0,A Has key "0" been pressed?
B0BB JR NZ,ReadInterfaceIIJoystick_Up If not jump to ReadInterfaceIIJoystick_Up.
B0BD SET 4,C Set bit 4 of C.
Check joystick "UP".
ReadInterfaceIIJoystick_Up B0BF BIT 1,A Has key "9" been pressed?
B0C1 JR NZ,ReadInterfaceIIJoystick_Down If not jump to ReadInterfaceIIJoystick_Down.
B0C3 SET 2,C Set bit 2 of C.
Check joystick "DOWN".
ReadInterfaceIIJoystick_Down B0C5 BIT 2,A Has key "8" been pressed?
B0C7 JR NZ,ReadInterfaceIIJoystick_Right If not jump to ReadInterfaceIIJoystick_Right.
B0C9 SET 3,C Set bit 3 of C.
Check joystick "RIGHT".
ReadInterfaceIIJoystick_Right B0CB BIT 3,A Has key "7" been pressed?
B0CD JR NZ,ReadInterfaceIIJoystick_Left If not jump to ReadInterfaceIIJoystick_Down.
B0CF SET 1,C Set bit 1 of C.
Check joystick "LEFT".
ReadInterfaceIIJoystick_Left B0D1 BIT 4,A Has key "6" been pressed?
B0D3 JR NZ,HandlerInterfaceIIJoystick If not jump to HandlerInterfaceIIJoystick.
B0D5 SET 0,C Set bit 0 of C.
HandlerInterfaceIIJoystick B0D7 LD A,C A=controls.
B0D8 RET Return.
Prev: B0A3 Up: Map Next: B0D9