![]() |
Routines |
| Prev: D150 | Up: Map | Next: D1BE |
|
Used by the routine at ReadControls.
Reads the controls from the keyboard. Left is X, V, M or B, right is C or N, up is any key from A to G or from H to ENTER, fire is any key from Q to T or from Y to P, and down is any key from 1 to 5 or from 6 to 0.
|
||||||||||||||||||||
|
Read left and right from CAPS SHIFT to V.
|
||||||||||||||||||||
| ReadKeyboard | D17C | LD A,$FE | Read from the keyboard;
|
|||||||||||||||||
| D17E | CALL ReadKeyboardPort | |||||||||||||||||||
| D181 | RRCA | Move X to bit 0 and C to bit 1. | ||||||||||||||||||
| D182 | RRCA | |||||||||||||||||||
| D183 | BIT 2,A | Set bit 0 if V is pressed. | ||||||||||||||||||
| D185 | JR Z,ReadKeyboard_Movement | |||||||||||||||||||
| D187 | SET 0,A | |||||||||||||||||||
|
Keep left and right, and read SPACE to B.
|
||||||||||||||||||||
| ReadKeyboard_Movement | D189 | AND %00000011 | Keep bits 0 and 1. | |||||||||||||||||
| D18B | LD C,A | Put them in C. | ||||||||||||||||||
| D18C | LD A,$7F | Read from the keyboard;
|
||||||||||||||||||
| D18E | CALL ReadKeyboardPort | |||||||||||||||||||
| D191 | BIT 2,A | Set bit 0 if M is pressed. | ||||||||||||||||||
| D193 | JR Z,ReadKeyboard_TestN | |||||||||||||||||||
| D195 | SET 0,C | |||||||||||||||||||
|
Set bit 1 if N is pressed.
|
||||||||||||||||||||
| ReadKeyboard_TestN | D197 | BIT 3,A | Set bit 1 if N is pressed. | |||||||||||||||||
| D199 | JR Z,ReadKeyboard_TestB | |||||||||||||||||||
| D19B | SET 1,C | |||||||||||||||||||
|
Set bit 0 if B is pressed.
|
||||||||||||||||||||
| ReadKeyboard_TestB | D19D | BIT 4,A | Set bit 0 if B is pressed. | |||||||||||||||||
| D19F | JR Z,ReadKeyboard_MiddleRows | |||||||||||||||||||
| D1A1 | SET 0,C | |||||||||||||||||||
|
Set bit 2 if any key from A to G or H to ENTER is pressed.
|
||||||||||||||||||||
| ReadKeyboard_MiddleRows | D1A3 | LD A,$BD | Read from the keyboard;
|
|||||||||||||||||
| D1A5 | CALL ReadKeyboardPort | |||||||||||||||||||
| D1A8 | JR Z,ReadKeyboard_TopRows | Set bit 2 if any key is pressed. | ||||||||||||||||||
| D1AA | SET 2,C | |||||||||||||||||||
|
Set bit 3 if any key from Q to T or Y to P is pressed.
|
||||||||||||||||||||
| ReadKeyboard_TopRows | D1AC | LD A,$DB | Read from the keyboard;
|
|||||||||||||||||
| D1AE | CALL ReadKeyboardPort | |||||||||||||||||||
| D1B1 | JR Z,ReadKeyboard_NumberRows | Set bit 3 if any key is pressed. | ||||||||||||||||||
| D1B3 | SET 3,C | |||||||||||||||||||
|
Set bit 4 if any key from 1 to 5 or 6 to 0 is pressed.
|
||||||||||||||||||||
| ReadKeyboard_NumberRows | D1B5 | LD A,$E7 | Read from the keyboard;
|
|||||||||||||||||
| D1B7 | CALL ReadKeyboardPort | |||||||||||||||||||
| D1BA | JR Z,ReadControls_Rotate | Set bit 4 if any key is pressed. | ||||||||||||||||||
| D1BC | SET 4,C | |||||||||||||||||||
|
Continue on to ReadControls_Rotate.
View the equivalent code in;
|
||||||||||||||||||||
| Prev: D150 | Up: Map | Next: D1BE |