.clan9 \ If we get here then we are on the ground and the \ undercarriage is down LDX xRotationHi \ If the high byte of the plane's rotation in the x-axis BMI clan8 \ is negative, jump to clan8 to return from the \ subroutine as the plane is already tilted backwards CPX #7 \ If the high byte of the plane's rotation in the x-axis BCC clan8 \ is positive and less than 7, jump to clan8 to return \ from the subroutine LDA #7 \ Set (xRotationHi xRotationLo) = (7 0), which is the STA xRotationHi \ default tilt of the plane - the undercarriage is LDA #0 \ taller than the rear tail wheel, so the whole plane STA xRotationLo \ points up by 7/256 = 9.84 degrees when its wheels are \ on the ground LDX xTurnTop \ If the high byte of the xTurn rate is positive, jump BPL clan7 \ to clan7 to stop the plane from pitching and return \ from the subroutine RTS \ Return from the subroutineName: ProcessLanding (Part 5 of 7) [Show more] Type: Subroutine Category: Flight model Summary: If we are taxiing with the undercarriage down, restrict pitching and tilt the plane backwards Deep dive: Take-offs and landingsContext: 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 down, then the plane gets set to the default tilt of 9.84 degrees (as the undercarriage is taller than the rear tail wheel).
[X]
Label clan7 in subroutine ProcessLanding (Part 4 of 7)
[X]
Label clan8 in subroutine ProcessLanding (Part 4 of 7)
[X]
Variable xRotationHi in workspace Main variable workspace
Plane rotation angle around the x-axis (high byte)
[X]
Variable xRotationLo in workspace Main variable workspace
Plane rotation angle around the x-axis (low byte)
[X]
Variable xTurnTop in workspace Main variable workspace
Turn rate around the x-axis (top byte)