Prev: 57936 Up: Map Next: 58030
57993: Read Kempston Joystick
Used by the routine at ReadControls.
Reads the controls from a Kempston joystick.
ReadKempstonJoystick 57993 IN A,(31) Read the joystick, and start with none of the controls.
57995 LD C,0
57997 BIT 0,A Set the control for right if the joystick is pushed right.
57999 JR Z,ReadKempstonJoystick_Left
58001 SET 1,C
ReadKempstonJoystick_Left 58003 BIT 1,A Set the control for left if the joystick is pushed left.
58005 JR Z,ReadKempstonJoystick_Down
58007 SET 0,C
ReadKempstonJoystick_Down 58009 BIT 2,A Set the control for down if the joystick is pushed down.
58011 JR Z,ReadKempstonJoystick_Forward
58013 SET 4,C
ReadKempstonJoystick_Forward 58015 BIT 3,A Set the control for forward if the joystick is pushed up.
58017 JR Z,ReadKempstonJoystick_Fire
58019 SET 2,C
ReadKempstonJoystick_Fire 58021 BIT 4,A Set the control for fire if the fire button is pressed.
58023 JR Z,ReadKempstonJoystick_ViewKey
58025 SET 3,C
ReadKempstonJoystick_ViewKey 58027 JP ReadViewKey Jump to ReadViewKey to read the key for turning the view.
View the equivalent code in;
Prev: 57936 Up: Map Next: 58030