Skip to navigation

Revs on the BBC Micro

Driving model: ApplyLimitThrottle

Name: ApplyLimitThrottle [Show more] Type: Subroutine Category: Driving model Summary: Apply a maximum limit to a 16-bit number, unless the throttle is being applied
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ApplySkidForces calls ApplyLimitThrottle * ApplyTyreForces calls ApplyLimitThrottle

If the throttle is being applied, then set: variableG = (A T) * abs(H) otherwise set: variableG = max((A T), (NN MM)) * abs(H)
Arguments: G Offset of the variable to set: * 0 = xTyreForceNose * 1 = xTyreForceRear * 2 = zTyreForceNose * 3 = zTyreForceRear
.ApplyLimitThrottle LDY throttleBrakeState \ If throttleBrakeState = 1, then the throttle is being DEY \ applied, so jump to lims1 to skip applying the maximum BEQ lims1 \ value to variableG, so: \ \ variableG = (A T) * abs(H) \ Otherwise fall through into ApplyLimitAndSign to set: \ \ variableG = max((A T), (NN MM)) * abs(H)