Prev: C91B Up: Map Next: C979
C954: Read Kempston Joystick
Used by the routine at ReadControls.
Reads the controls from a Kempston joystick.
Output
C The controls
Read the port and map each bit to a control.
ReadKempstonJoystick C954 IN A,($1F) Read port 1F.
C956 LD C,$00 Set C to 00.
C958 BIT 0,A Set bit 1 of C if bit 0 of A is set.
C95A JR Z,ReadKempstonJoystick_TestLeft
C95C SET 1,C
ReadKempstonJoystick_TestLeft C95E BIT 1,A Set bit 0 of C if bit 1 of A is set.
C960 JR Z,ReadKempstonJoystick_TestDown
C962 SET 0,C
ReadKempstonJoystick_TestDown C964 BIT 2,A Set bit 4 of C if bit 2 of A is set.
C966 JR Z,ReadKempstonJoystick_TestUp
C968 SET 4,C
ReadKempstonJoystick_TestUp C96A BIT 3,A Set bit 2 of C if bit 3 of A is set.
C96C JR Z,ReadKempstonJoystick_TestFire
C96E SET 2,C
ReadKempstonJoystick_TestFire C970 BIT 4,A Set bit 3 of C if bit 4 of A is set.
C972 JR Z,ReadKempstonJoystick_Finish
C974 SET 3,C
ReadKempstonJoystick_Finish C976 JP ReadControls_Finish Jump to ReadControls_Finish.
View the equivalent code in;
Prev: C91B Up: Map Next: C979