Prev: 60928 Up: Map Next: 60994
60969: 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 60969 LD A,239 Read from the keyboard;
Port Number Bit
0 1 2 3 4
239 0 9 8 7 6
60971 OUT (253),A
60973 IN A,(254)
60975 RRA Move the key 0 (fire) into the carry flag.
60976 RL B Shift it into B.
60978 RRA Move the key 9 (up) into the carry flag.
60979 RL B Shift it into B.
60981 RRA Move the key 8 (down) into the carry flag.
60982 RL B Shift it into B.
60984 RRA Move the key 6 (left) into the carry flag, skipping the key 7.
60985 RRA
60986 RL B Shift it into B.
60988 RLA Move the key 7 (right) into the carry flag.
60989 RL B Shift it into B, which makes bit 0 right, bit 1 left, bit 2 down, bit 3 up and bit 4 fire.
60991 JP ReadControls_Bottom_Row Jump to ReadControls_Bottom_Row to read the bottom row of the keyboard.
Prev: 60928 Up: Map Next: 60994