Skip to navigation

Revs on the BBC Micro

Drivers: GetPositionBehind

Name: GetPositionBehind [Show more] Type: Subroutine Category: Drivers Summary: Increment X to the next position number (from 0 to 19 and round again), which gives the position behind X
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawCars calls GetPositionBehind * MoveAndDrawCars calls GetPositionBehind * ProcessOvertaking (Part 3 of 3) calls GetPositionBehind * SetPlayerPositions calls GetPositionBehind
.GetPositionBehind INX \ Increment X CPX #20 \ If X < 20, jump to getb1 to skip the following BCC getb1 \ instruction LDX #0 \ Set X = 0, so repeated calls to this routine will \ increment X up to 19, and then start again at 0 .getb1 RTS \ Return from the subroutine