Prev: 45215 Up: Map Next: 45233
45219: Handler: Controls
Used by the routines at PlayerMovement, GamePlay_Start and EnterInitials.
Reads the controls using the method chosen in the game options (see GameOptions): the keyboard, a Kempston joystick, a Cursor joystick or an Interface II joystick. Each of the routines returns the controls in C, with a bit set for each direction or button pressed.
Bit Action
0 Left
1 Right
2 Up
3 Down
4 Fire
Output
C Controls
HandlerControls 45219 LD A,(38546) Fetch the game options from GameOptions.
45222 RRCA Rotate out the number of players bit (bit 0).
45223 AND %00000011 Keep only bits 0-1 (Kempston and Cursor joystick options).
45225 JR Z,ReadKeyboard Jump to ReadKeyboard if the keyboard was selected (both control bits are reset).
45227 DEC A Jump to ReadKempstonJoystick if the Kempston joystick was selected.
45228 JR Z,ReadKempstonJoystick
45230 DEC A Jump to ReadCursorJoystick if the Cursor joystick was selected.
45231 JR Z,ReadCursorJoystick
View the equivalent code in;
Else, handle Interface II joystick - it's the only option left.
Continue on to ReadInterfaceIIJoystick.
Prev: 45215 Up: Map Next: 45233