Prev: EE00 Up: Map Next: EE42
EE29: Read Interface II Joystick
Used by the routine at ReadControls.
Reads the Interface II joystick, which acts as the keys 6 (left), 7 (right), 8 (down), 9 (up) and 0 (fire), and puts the state of the controls in B, to be completed by ReadControls_Bottom_Row (see ReadControls). A bit is reset when its key is pressed.
Output
B The state of the controls
Read_Interface_II_Joystick EE29 LD A,$EF Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
EE2B OUT ($FD),A
EE2D IN A,($FE)
EE2F RRA Move the key 0 (fire) into the carry flag.
EE30 RL B Shift it into B.
EE32 RRA Move the key 9 (up) into the carry flag.
EE33 RL B Shift it into B.
EE35 RRA Move the key 8 (down) into the carry flag.
EE36 RL B Shift it into B.
EE38 RRA Move the key 6 (left) into the carry flag, skipping the key 7.
EE39 RRA
EE3A RL B Shift it into B.
EE3C RLA Move the key 7 (right) into the carry flag.
EE3D RL B Shift it into B, which makes bit 0 right, bit 1 left, bit 2 down, bit 3 up and bit 4 fire.
EE3F JP ReadControls_Bottom_Row Jump to ReadControls_Bottom_Row to read the bottom row of the keyboard.
Prev: EE00 Up: Map Next: EE42