Prev: 618C Up: Map Next: 61E0
61C2: Input: Brake
Used by the routine at UpdatePlayerCar.
Reads the brake control. From the keyboard any key in the rows A to G, or ENTER to H, applies the brake.
Output
A FB if the brake is pressed, else FF
Check if this should be read from the Kempston joystick instead?
ReadInputBrake 61C2 LD A,($5E3E) If GameOptions indicates the control method is via the Kempston joystick then jump to ReadKempstonJoystick.
61C5 BIT 1,A
61C7 JR NZ,ReadKempstonJoystick
Check for "Brake" button input.
61C9 LD B,$02 Set the keyboard row counter to 02.
61CB LD A,$FD A=FD (the first keyboard row).
ReadInputBrake_Loop 61CD OUT ($FD),A Read from the keyboard;
Port Number Bit
0 1 2 3 4
FD A S D F G
BF ENTER L K J H
61CF IN A,($FE)
61D1 AND %00011111 Keep only bits 0-4.
61D3 CP $1F If any buttons were pressed jump to Input_Brake.
61D5 JR NZ,Input_Brake
61D7 LD A,$BF A=BF (the second keyboard row).
61D9 DJNZ ReadInputBrake_Loop Decrease the keyboard row counter by one and loop back to ReadInputBrake_Loop until both rows have been checked.
61DB JR Input_None Jump to Input_None.
Return "Brake" button pressed.
Input_Brake 61DD LD A,$FB A=11111011.
61DF RET Return.
View the equivalent code in;
Prev: 618C Up: Map Next: 61E0