![]() |
Routines |
| Prev: 28592 | Up: Map | Next: 28631 |
|
Used by the routine at GamePlay_Start.
Reads the controls which have been chosen in GameOptions; the keyboard, the Kempston joystick or the cursor joystick. The bits of the result are reset for the directions (and fire) which are being pressed.
|
||||||||||||||||||||||||||
| ReadControls | 28596 | LD A,(24332) | Fetch the game options. | |||||||||||||||||||||||
| 28599 | AND %00000110 | Keep only bits 1-2 (the choice of controls). | ||||||||||||||||||||||||
| 28601 | CP 2 | Jump to ReadKempstonJoystick if the Kempston joystick is being used. | ||||||||||||||||||||||||
| 28603 | JR Z,ReadKempstonJoystick | |||||||||||||||||||||||||
| 28605 | CP 4 | Jump to ReadCursorJoystick if the cursor joystick is being used. | ||||||||||||||||||||||||
| 28607 | JR Z,ReadCursorJoystick | |||||||||||||||||||||||||
| 28609 | LD A,251 | Read from the keyboard;
|
||||||||||||||||||||||||
| 28611 | OUT (253),A | |||||||||||||||||||||||||
| 28613 | IN A,(254) | |||||||||||||||||||||||||
| 28615 | LD C,A | Keep the key states in C. | ||||||||||||||||||||||||
| 28616 | RRA | Move the "W" key into bit 0. | ||||||||||||||||||||||||
| 28617 | AND %00000001 | Keep only bit 0. | ||||||||||||||||||||||||
| 28619 | LD E,A | Keep the result in E. | ||||||||||||||||||||||||
| 28620 | LD A,C | Fetch the key states. | ||||||||||||||||||||||||
| 28621 | RLA | Move the "Q" key into bit 1. | ||||||||||||||||||||||||
| 28622 | AND %00000010 | Keep only bit 1. | ||||||||||||||||||||||||
| 28624 | OR E | Combine with E. | ||||||||||||||||||||||||
| 28625 | LD E,A | Keep the result in E. | ||||||||||||||||||||||||
| 28626 | LD A,C | Fetch the key states. | ||||||||||||||||||||||||
| 28627 | AND %00011100 | Keep only bits 2-4 ("E", "R" and "T"). | ||||||||||||||||||||||||
| 28629 | OR E | Combine with E. | ||||||||||||||||||||||||
| 28630 | RET | Return. | ||||||||||||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||||||||||||
| Prev: 28592 | Up: Map | Next: 28631 |