.AddRacePoints SED \ Set the D flag to switch arithmetic to Binary Coded \ Decimal (BCD) LDA totalPointsLo,Y \ Add (0 racePointsHi racePointsLo) for position X to CLC \ (totalPointsTop totalPointsHi totalPointsLo) for ADC racePointsLo,X \ driver Y, starting with the low bytes STA totalPointsLo,Y LDA totalPointsHi,Y \ And then the high bytes ADC racePointsHi,X STA totalPointsHi,Y LDA totalPointsTop,Y \ And then the top bytes ADC #0 STA totalPointsTop,Y CLD \ Clear the D flag to switch arithmetic to normal RTS \ Return from the subroutineName: AddRacePoints [Show more] Type: Subroutine Category: Drivers Summary: Add the race points to the driver's total pointsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * AwardRacePoints calls AddRacePoints
Arguments: X The race position whose points should be added Y The driver who receives those points, i.e. who has then added to their total accumulated points
[X]
Variable racePointsHi (category: Drivers)
High byte of race points calculated for each position
[X]
Variable racePointsLo (category: Drivers)
Used to store the low byte of the race points being awarded to the driver in race position X
[X]
Variable totalPointsHi (category: Drivers)
High byte of total accumulated points for each driver
[X]
Variable totalPointsLo (category: Drivers)
Low byte of total accumulated points for each driver
[X]
Variable totalPointsTop in workspace Main variable workspace
Top byte of total accumulated points for each driver