.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 subroutineName: 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 trackContext: 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
[X]
Subroutine TurnPlayerAround (category: Car geometry)
Turn the player around and initialise the specified number of track segments in the new direction
[X]
Variable debugSpinning in workspace Zero page
This variable is never read, but is set to 64 and back to 0 when the car spins past the point where it changes the direction that it is facing along the track
[X]
Variable sectionListValid in workspace Zero page
The index of the first valid entry in the track section list