Prev: 57913 Up: Map Next: 57936
57921: Read Controls
Used by the routine at UpdatePlayerLegs.
Reads the controls using the method in bits 1 and 2 of GameOptions, and keeps them in Controls. The methods are the keyboard, a Kempston joystick, a Cursor joystick and a Sinclair joystick.
Bit Meaning
0 Left
1 Right
2 Forward
3 Fire
4 Down
5 Turning the view
Output
C Controls
Fetch the control method from GameOptions.
ReadControls 57921 LD A,(48048) Fetch GameOptions.
57924 RRCA Move the type of controls into the low bits.
57925 AND %00000011 Keep the two bits.
57927 JP Z,ReadKeyboard Jump to ReadKeyboard to read the keyboard if it is the keyboard.
57930 DEC A Jump to ReadKempstonJoystick if it is a Kempston joystick.
57931 JR Z,ReadKempstonJoystick
57933 DEC A Jump to ReadCursorJoystick if it is a Cursor joystick.
57934 JR Z,ReadCursorJoystick
Continue on to ReadInterface2Joystick.
View the equivalent code in;
Prev: 57913 Up: Map Next: 57936