Prev: 53490 Up: Map Next: 53584
53547: Read Kempston Joystick
Used by the routine at ReadControls.
Reads a Kempston joystick from port 31.
Output
C The controls
Read the joystick, and start with no controls.
ReadKempstonJoystick 53547 IN A,(31) Read the joystick from port 31.
53549 LD C,0 Clear the controls.
Set bit 1 if the joystick is pushed right.
53551 BIT 0,A Set bit 1 if the joystick is pushed right.
53553 JR Z,ReadKempstonJoystick_TestLeft
53555 SET 1,C
Set bit 0 if the joystick is pushed left.
ReadKempstonJoystick_TestLeft 53557 BIT 1,A Set bit 0 if the joystick is pushed left.
53559 JR Z,ReadKempstonJoystick_TestDown
53561 SET 0,C
Set bit 4 if the joystick is pushed down.
ReadKempstonJoystick_TestDown 53563 BIT 2,A Set bit 4 if the joystick is pushed down.
53565 JR Z,ReadKempstonJoystick_TestUp
53567 SET 4,C
Set bit 2 if the joystick is pushed up.
ReadKempstonJoystick_TestUp 53569 BIT 3,A Set bit 2 if the joystick is pushed up.
53571 JR Z,ReadKempstonJoystick_TestFire
53573 SET 2,C
Set bit 3 if the fire button is pressed.
ReadKempstonJoystick_TestFire 53575 BIT 4,A Set bit 3 if the fire button is pressed.
53577 JR Z,ReadKempstonJoystick_Finish
53579 SET 3,C
ReadKempstonJoystick_Finish 53581 JP ReadControls_Rotate Jump to ReadControls_Rotate.
View the equivalent code in;
Prev: 53490 Up: Map Next: 53584