Skip to navigation

Revs on the BBC Micro

Keyboard: SetSteeringLimit

Name: SetSteeringLimit [Show more] Type: Subroutine Category: Keyboard Summary: Apply a maximum limit to the amount of steering
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ProcessDrivingKeys (Part 2 of 6) calls SetSteeringLimit

Arguments: C flag The result of CMP steeringHi
Returns: (A T) A is set to |steeringHi steeringLo|
IF _SUPERIOR OR _REVSPLUS .SetSteeringLimit BCC slim1 \ Before calling this routine, we did a CMP steeringHi, \ so if A < steeringHi, jump to slim1 to return from \ the subroutine LDA steeringLo \ Set T = steeringLo with bit 0 cleared AND #%11111110 STA T LDA steeringHi \ Set A = steeringHi, so (A T) = (steeringHi steeringLo) \ with the sign bit in bit 0 cleared .slim1 RTS \ Return from the subroutine ENDIF