![]() |
Routines |
| Prev: 61C2 | Up: Map | Next: 61FE |
|
Used by the routine at UpdatePlayerCar.
Reads the accelerator control. From the keyboard any key in the rows Q to T, or P to Y, accelerates the car.
|
||||||||||||||||||||||||||
|
Check if this should be read from the Kempston joystick instead?
|
||||||||||||||||||||||||||
| ReadInputAccelerate | 61E0 | LD A,($5E3E) | If GameOptions indicates the control method is via the Kempston joystick then jump to ReadKempstonJoystick. | |||||||||||||||||||||||
| 61E3 | BIT 1,A | |||||||||||||||||||||||||
| 61E5 | JR NZ,ReadKempstonJoystick | |||||||||||||||||||||||||
|
Check for "Accelerator" button input.
|
||||||||||||||||||||||||||
| 61E7 | LD B,$02 | Set the keyboard row counter to 02. | ||||||||||||||||||||||||
| 61E9 | LD A,$FB | A=FB (the first keyboard row). | ||||||||||||||||||||||||
| ReadInputAccelerate_Loop | 61EB | OUT ($FD),A | Read from the keyboard;
|
|||||||||||||||||||||||
| 61ED | IN A,($FE) | |||||||||||||||||||||||||
| 61EF | AND %00011111 | Keep only bits 0-4. | ||||||||||||||||||||||||
| 61F1 | CP $1F | If any buttons were pressed jump to Input_Accelerate. | ||||||||||||||||||||||||
| 61F3 | JR NZ,Input_Accelerate | |||||||||||||||||||||||||
| 61F5 | LD A,$DF | A=DF (the second keyboard row). | ||||||||||||||||||||||||
| 61F7 | DJNZ ReadInputAccelerate_Loop | Decrease the keyboard row counter by one and loop back to ReadInputAccelerate_Loop until both rows have been checked. | ||||||||||||||||||||||||
| 61F9 | JR Input_None | Jump to Input_None. | ||||||||||||||||||||||||
|
Return "Accelerator" button pressed.
|
||||||||||||||||||||||||||
| Input_Accelerate | 61FB | LD A,$F7 | A=11110111. | |||||||||||||||||||||||
| 61FD | RET | Return. | ||||||||||||||||||||||||
|
View the equivalent code in;
|
||||||||||||||||||||||||||
| Prev: 61C2 | Up: Map | Next: 61FE |