Skip to navigation

Revs on the BBC Micro

Drivers: ClearTotalRaceTime

Name: ClearTotalRaceTime [Show more] Type: Subroutine Category: Drivers Summary: Clear a specified driver's total race time following the end of an incomplete race
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * FinishRace calls ClearTotalRaceTime

Arguments: X The driver number
.ClearTotalRaceTime LDA numberOfLaps \ Compare numberOfLaps with the driver X's lap number CMP driverLapNumber,X LDA #%11000000 \ Set bits 6 and 7 of the status byte for driver X's car STA objectStatus,X \ object, so it's hidden (bit 7) and is no longer racing \ (bit 6) BCC clap1 \ If numberOfLaps < driver X's lap number, then the \ driver has finished the race, so skip the following \ instruction STA totalRaceMinutes,X \ The player didn't finish the race, so set the player's \ total race time to &C0 minutes, which is negative and \ therefore not a valid time .clap1 RTS \ Return from the subnroutine