Skip to navigation


Flight model: RetractFlapsIfFast

Name: RetractFlapsIfFast [Show more] Type: Subroutine Category: Flight model Summary: Retract the flaps if we are going faster than 150 mph
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ApplyTurnAndThrust (Part 2 of 2) calls RetractFlapsIfFast

Arguments: A The high byte of the current airspeed
.RetractFlapsIfFast CMP #14 \ First we check the high byte of the current airspeed BCC flap1 \ in A to see if it is less than 14, at which point the \ airspeed is: \ \ (14 0) * 100 / 2368 = 3584 * 100 / 2368 = 151 \ \ So if the airspeed is less than 151mph, we jump to \ flap1 to return from the subroutine without changing \ the flaps LDA flapsStatus \ If the flaps are already retracted, jump to flap1 to BEQ flap1 \ return from the subroutine without changing anything LDA #0 \ The speed is at least 151 mph and the flaps are on, STA flapsStatus \ so we retract them by setting flapsStatus to 0 JSR IndicatorF \ Update the flaps indicator .flap1 RTS \ Return from the subroutine