Skip to navigation

Revs on the BBC Micro

Driving model: AddSteeringForce

Name: AddSteeringForce [Show more] Type: Subroutine Category: Driving model Summary: Add the steering force to xVelocity or xTyreForceNose
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ApplySteeringForce calls AddSteeringForce * ApplySteeringSpeed calls AddSteeringForce

Arguments: X Called with either 8 or 10: * 8: set xVelocity += xSteeringForce * 10: set xTyreForceNose += xSteeringForce
.AddSteeringForce LDA xPlayerSpeedHi,X \ Add (xSteeringForceHi xSteeringForceLo) to the CLC \ variable at offset X from (xPlayerSpeedTop ADC xSteeringForceLo \ xPlayerSpeedHi), starting with the low bytes STA xPlayerSpeedHi,X LDA xPlayerSpeedTop,X \ And then the high bytes ADC xSteeringForceHi STA xPlayerSpeedTop,X RTS \ Return from the subroutine