Skip to navigation

Revs on the BBC Micro

Car geometry: ChangeDirection

Name: ChangeDirection [Show more] Type: Subroutine Category: Car geometry Summary: Update the track segment buffer when the player's car spins so it changes the direction in which it is facing along the track
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MovePlayerSegment calls ChangeDirection * UpdateCurveVector calls via ChangeDirection-1

Other entry points: ChangeDirection-1 Contains an RTS
.ChangeDirection LDA #6 \ Set sectionListValid = 6, to invalidate the contents STA sectionListValid \ of the track section list (so it gets repopulated \ by the GetTrackAndMarkers routine) LDX #64 \ Set X = 64, so the call to TurnPlayerAround \ initialises 64 track segments in the new direction STX debugSpinning \ Set debugSpinning = 64 (this value is never read and \ is not used anywhere, so perhaps it was used for \ debugging purposes, or was left over from code that \ was subsequently removed?) JSR TurnPlayerAround \ Turn the player around and initialise 64 track \ segments in the new direction LDA #0 \ Set debugSpinning = 0 (which has no effect) STA debugSpinning RTS \ Return from the subroutine