Skip to navigation

Aviator on the BBC Micro

Flight model: ProcessLanding (Part 4 of 7)

Name: ProcessLanding (Part 4 of 7) [Show more] Type: Subroutine Category: Flight model Summary: If we are taxiing with the undercarriage up, restrict pitching Deep dive: Take-offs and landings
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file

If we are taxiing with the undercarriage up, then if the plane is pitching forwards into the ground, the plane is made level and all pitching is stopped.
\ If we get here then we are on the ground but the \ undercarriage is up LDX landingStatus \ If bit 7 of landingStatus is set, skip the following BMI clan6 \ instruction ASL landingStatus \ Shift landingStatus left by one place .clan6 LDX xRotationHi \ If the high byte of the plane's rotation in the x-axis BPL clan8 \ is positive, skip the following LDX #&EA \ Set (xRotationHi xRotationLo) = 0 to set the plane to JSR ResetVariable \ the horizontal position (i.e. zero pitch angle) .clan7 LDX #&00 \ Set (xTurnTop xTurnHi) = 0 to stop the plane turning JSR ResetVariable \ around the x-axis (i.e. stop the plane pitching) .clan8 RTS \ Return from the subroutine