Prev: 24972 Up: Map Next: 25056
25026: 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 251 if the brake is pressed, else 255
Check if this should be read from the Kempston joystick instead?
ReadInputBrake 25026 LD A,(24126) If GameOptions indicates the control method is via the Kempston joystick then jump to ReadKempstonJoystick.
25029 BIT 1,A
25031 JR NZ,ReadKempstonJoystick
Check for "Brake" button input.
25033 LD B,2 Set the keyboard row counter to 2.
25035 LD A,253 A=253 (the first keyboard row).
ReadInputBrake_Loop 25037 OUT (253),A Read from the keyboard;
Port Number Bit
0 1 2 3 4
253 A S D F G
191 ENTER L K J H
25039 IN A,(254)
25041 AND %00011111 Keep only bits 0-4.
25043 CP 31 If any buttons were pressed jump to Input_Brake.
25045 JR NZ,Input_Brake
25047 LD A,191 A=191 (the second keyboard row).
25049 DJNZ ReadInputBrake_Loop Decrease the keyboard row counter by one and loop back to ReadInputBrake_Loop until both rows have been checked.
25051 JR Input_None Jump to Input_None.
Return "Brake" button pressed.
Input_Brake 25053 LD A,251 A=11111011.
25055 RET Return.
View the equivalent code in;
Prev: 24972 Up: Map Next: 25056