Prev: B0B1 Up: Map Next: B0FA
B0D9: Controls: Kempston Joystick
Used by the routine at HandlerControls.
Output
C Joystick controls
ReadKempstonJoystick B0D9 IN A,($1F) A=controls.
Initialise the controls as "none" in C.
B0DB LD C,$00 C=00.
Check joystick "RIGHT".
ReadKempstonJoystick_Right B0DD BIT 0,A If bit 0 is set/ "RIGHT" is NOT being pressed then jump to ReadKempstonJoystick_Left.
B0DF JR Z,ReadKempstonJoystick_Left If not jump to ReadKempstonJoystick_Left.
B0E1 SET 1,C Set bit 1 of C.
Check joystick "LEFT".
ReadKempstonJoystick_Left B0E3 BIT 1,A If bit 1 is set/ "LEFT" is NOT being pressed then jump to ReadKempstonJoystick_Down.
B0E5 JR Z,ReadKempstonJoystick_Down If not jump to ReadKempstonJoystick_Down.
B0E7 SET 0,C Set bit 0 of C.
Check joystick "DOWN".
ReadKempstonJoystick_Down B0E9 BIT 2,A If bit 2 is set/ "DOWN" is NOT being pressed then jump to ReadKempstonJoystick_Up.
B0EB JR Z,ReadKempstonJoystick_Up If not jump to ReadKempstonJoystick_Up.
B0ED SET 3,C Set bit 3 of C.
Check joystick "UP".
ReadKempstonJoystick_Up B0EF BIT 3,A If bit 3 is set/ "UP" is NOT being pressed then jump to ReadKempstonJoystick_Fire.
B0F1 JR Z,ReadKempstonJoystick_Fire If not jump to ReadKempstonJoystick_Fire.
B0F3 SET 2,C Set bit 2 of C.
Check joystick "FIRE".
ReadKempstonJoystick_Fire B0F5 AND %00010000 Keep only bit 4.
B0F7 OR C Merge the kept bit into C.
B0F8 LD C,A
B0F9 RET Return.
Prev: B0B1 Up: Map Next: B0FA