Prev: 45155 Up: Map Next: 45189
45173: Read Controls
Used by the routines at MainLoop and EnterInitials.
Reads the controls, using the method that has been chosen in the menu: keyboard, Kempston joystick, cursor keys or Sinclair interface 2. The controls are kept as bits that stay set until the robot has used them.
Bit Meaning
0 Turn right
1 Turn left
2 Move forward
3 Fire the second weapon
4 Fire the first weapon
6 Use the action key
Output
A The controls
C The controls
ReadControls 45173 PUSH BC Save BC.
45174 LD A,(38426) Fetch the method of control...
45177 RRCA ...and keep the bits that choose it.
45178 AND 3 Jump to read the keyboard if the method is zero.
45180 JP Z,ReadKeyboard
45183 DEC A Jump to read the Kempston joystick if it is one.
45184 JR Z,ReadKempstonJoystick
45186 DEC A Jump to read the cursor keys if it is two.
45187 JR Z,ReadCursorKeys
Prev: 45155 Up: Map Next: 45189