Prev: 37182 Up: Map Next: 37233
37192: Read Kempston Joystick
Used by the routine at Controls.
Output
C Key press input
The response will be:
Byte Meaning
0 Select (fire)
1 Up
2 Down
3 Left
4 Right
255 No input
Controls_ReadKempston 37192 LD B,58 Set a read counter of 58.
Controls_ReadKempston_Loop 37194 IN A,(31) Read Kempston Joystick input.
37196 DJNZ Controls_ReadKempston_Loop Decrease the read counter by one and loop back to Controls_ReadKempston until the counter is zero.
37198 LD C,0 Return with C being 0 if "fire" has been pressed.
37200 CP 16
37202 RET Z
37203 INC C Return with C being 1 if "up" has been pressed.
37204 CP 4
37206 RET Z
37207 INC C Return with C being 2 if "down" has been pressed.
37208 CP 8
37210 RET Z
37211 INC C Return with C being 3 if "left" has been pressed.
37212 CP 2
37214 RET Z
37215 INC C Return with C being 4 if "right" has been pressed.
37216 CP 1
37218 RET Z
37219 CALL 703 Call KEYBOARD.
37222 LD A,(23560) Jump to QuitGame if LAST-K (last key pressed) is 14.
37225 CP 14
37227 JP Z,QuitGame
37230 LD C,255 C=255.
37232 RET Return.
Prev: 37182 Up: Map Next: 37233