Prev: D03E Up: Map Next: D09C
D077: Read Kempston Joystick
Used by the routine at ReadControls.
Reads the controls from a Kempston joystick.
Output
C The controls
Set each control bit from the Kempston port.
ReadKempstonJoystick D077 IN A,($1F) Read the joystick.
D079 LD C,$00 Set the controls to none.
D07B BIT 0,A Set the right control if the joystick is pushed right.
D07D JR Z,ReadKempstonJoystick_TestLeft
D07F SET 1,C
ReadKempstonJoystick_TestLeft D081 BIT 1,A Set the left control if the joystick is pushed left.
D083 JR Z,ReadKempstonJoystick_TestDown
D085 SET 0,C
ReadKempstonJoystick_TestDown D087 BIT 2,A Set the pick up control if the joystick is pushed down.
D089 JR Z,ReadKempstonJoystick_TestUp
D08B SET 4,C
ReadKempstonJoystick_TestUp D08D BIT 3,A Set the walk control if the joystick is pushed up.
D08F JR Z,ReadKempstonJoystick_TestFire
D091 SET 2,C
ReadKempstonJoystick_TestFire D093 BIT 4,A Set the jump control if the fire button is pressed.
D095 JR Z,ReadKempstonJoystick_Done
D097 SET 3,C
ReadKempstonJoystick_Done D099 JP ReadControls_Finish Jump to ReadControls_Finish.
View the equivalent code in;
Prev: D03E Up: Map Next: D09C