BIT configJoystick \ If bit 7 of configJoystick is clear then the joystick BPL keys21 \ is not configured, so jump to keys21 to skip the \ following joystick-specific gear checks LDX #0 \ Call OSBYTE with A = 128 and X = 0 to fetch the ADC LDA #128 \ channel that was last used for ADC conversion, JSR OSBYTE \ returning the channel number in Y, and the status of \ the two fire buttons in X TXA \ If bit 0 of X is zero, then no fire buttons are being AND #1 \ pressed, so jump to keys22 to check the next key BEQ keys22 LDY throttleBrakeState \ If throttleBrakeState <> 1, then the throttle is not DEY \ being applied, so jump to keys23 BNE keys23 \ If we get here then the fire button is being pressed \ and the throttle is being applied, which is the \ joystick method for changing gear, so now we jump to \ the correct part below to change up or down a gear LDA throttleBrake \ If the throttle amount is >= 200, jump to keys24 to CMP #200 \ change up a gear BCS keys24 BCC keys23 \ Otherwise jump to keys23 to change down a gearName: ProcessDrivingKeys (Part 5 of 6) [Show more] Type: Subroutine Category: Keyboard Summary: Process joystick gear changeContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Configuration variable OSBYTE = &FFF4
The address for the OSBYTE routine
[X]
Variable configJoystick in workspace Main variable workspace
A key has been pressed to set joystick or keyboard
[X]
Label keys21 in subroutine ProcessDrivingKeys (Part 6 of 6)
[X]
Label keys22 in subroutine ProcessDrivingKeys (Part 6 of 6)
[X]
Label keys23 in subroutine ProcessDrivingKeys (Part 6 of 6)
[X]
Label keys24 in subroutine ProcessDrivingKeys (Part 6 of 6)
[X]
Variable throttleBrake in workspace Zero page
The amount of throttle or brake being applied
[X]
Variable throttleBrakeState in workspace Zero page
Denotes whether the throttle or brake are being applied