Prev: B0A3 Up: Map Next: B0D9
B0B1: Controls: Interface II Joystick
Reads an Interface II joystick, which is mapped onto the keys "6" to "0".
Output
A Joystick controls
C Joystick controls
Initialise the controls as "none" in C.
ReadInterfaceIIJoystick B0B1 LD C,$00 Clear the controls in C.
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 Jump to ReadInterfaceIIJoystick_Up if "FIRE" (key "0") is not being pressed.
B0BB JR NZ,ReadInterfaceIIJoystick_Up
B0BD SET 4,C Set the "FIRE" bit (bit 4) of the controls in C.
Check joystick "UP".
ReadInterfaceIIJoystick_Up B0BF BIT 1,A Jump to ReadInterfaceIIJoystick_Down if "UP" (key "9") is not being pressed.
B0C1 JR NZ,ReadInterfaceIIJoystick_Down
B0C3 SET 2,C Set the "UP" bit (bit 2) of the controls in C.
Check joystick "DOWN".
ReadInterfaceIIJoystick_Down B0C5 BIT 2,A Jump to ReadInterfaceIIJoystick_Right if "DOWN" (key "8") is not being pressed.
B0C7 JR NZ,ReadInterfaceIIJoystick_Right
B0C9 SET 3,C Set the "DOWN" bit (bit 3) of the controls in C.
Check joystick "RIGHT".
ReadInterfaceIIJoystick_Right B0CB BIT 3,A Jump to ReadInterfaceIIJoystick_Left if "RIGHT" (key "7") is not being pressed.
B0CD JR NZ,ReadInterfaceIIJoystick_Left
B0CF SET 1,C Set the "RIGHT" bit (bit 1) of the controls in C.
Check joystick "LEFT".
ReadInterfaceIIJoystick_Left B0D1 BIT 4,A Jump to HandlerInterfaceIIJoystick if "LEFT" (key "6") is not being pressed.
B0D3 JR NZ,HandlerInterfaceIIJoystick
B0D5 SET 0,C Set the "LEFT" bit (bit 0) of the controls in C.
HandlerInterfaceIIJoystick B0D7 LD A,C Fetch the controls.
B0D8 RET Return.
Prev: B0A3 Up: Map Next: B0D9