![]() |
Routines |
| Prev: C954 | Up: Map | Next: C9A5 |
|
Used by the routine at ReadControls.
Reads the controls from a cursor joystick, which uses the keys 5 for left, 8 for right, 7 for up, 6 for down and 0 for fire.
|
||||||||||||||||||||
|
Left from the 1-5 row.
|
||||||||||||||||||||
| ReadCursorJoystick | C979 | LD C,$00 | Set C to 00. | |||||||||||||||||
| C97B | LD A,$F7 | Read from the keyboard;
|
||||||||||||||||||
| C97D | CALL ReadKeyboardPort | |||||||||||||||||||
| C980 | BIT 4,A | Set bit 0 of C if bit 4 of A is set. | ||||||||||||||||||
| C982 | JR Z,ReadCursorJoystick_SecondRow | |||||||||||||||||||
| C984 | SET 0,C | |||||||||||||||||||
|
Fire, up, right and down from the 0-9 row.
|
||||||||||||||||||||
| ReadCursorJoystick_SecondRow | C986 | LD A,$EF | Read from the keyboard;
|
|||||||||||||||||
| C988 | CALL ReadKeyboardPort | |||||||||||||||||||
| C98B | BIT 0,A | Set bit 3 of C if bit 0 of A is set. | ||||||||||||||||||
| C98D | JR Z,ReadCursorJoystick_TestUp | |||||||||||||||||||
| C98F | SET 3,C | |||||||||||||||||||
| ReadCursorJoystick_TestUp | C991 | BIT 3,A | Set bit 2 of C if bit 3 of A is set. | |||||||||||||||||
| C993 | JR Z,ReadCursorJoystick_TestRight | |||||||||||||||||||
| C995 | SET 2,C | |||||||||||||||||||
| ReadCursorJoystick_TestRight | C997 | BIT 2,A | Set bit 1 of C if bit 2 of A is set. | |||||||||||||||||
| C999 | JR Z,ReadCursorJoystick_TestDown | |||||||||||||||||||
| C99B | SET 1,C | |||||||||||||||||||
| ReadCursorJoystick_TestDown | C99D | BIT 4,A | Jump to ReadControls_Finish if bit 4 of A is clear. | |||||||||||||||||
| C99F | JR Z,ReadControls_Finish | |||||||||||||||||||
| C9A1 | SET 4,C | Set bit 4 of C. | ||||||||||||||||||
| C9A3 | JR ReadControls_Finish | Jump to ReadControls_Finish. | ||||||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||||||
| Prev: C954 | Up: Map | Next: C9A5 |