.PrintTimer STA G \ Store A in G so we can check the value of bit 7 below LDA bestLapMinutes,X \ Print the number of minutes in driver X's best lap JSR Print2DigitBCD \ time LDA #&3A \ Print ":" JSR PrintCharacter LDA bestLapSeconds,X \ Print the number of seconds in driver X's best lap JSR Print2DigitBCD \ time ASL G \ If bit 7 of G is set, we do not want to print tenths BCS plap1 \ of a second, so jump to plap1 to return from the \ subroutine LDA #&2E \ Print "." JSR PrintCharacter LDA bestLapTenths,X \ Print the number of tenths of a second in driver X's JSR Print2DigitBCD \ best lap time .plap1 RTS \ Return from the subroutineName: PrintTimer [Show more] Type: Subroutine Category: Text Summary: Print the specified timerContext: See this subroutine in context in the source code References: This subroutine is called as follows: * PrintBestLapTime calls PrintTimer * PrintDriverTable calls PrintTimer * PrintLapTime calls PrintTimer
Arguments: X The lap time to print: * 0 to 19: Lap time for the specified driver * 20 = the clock timer (clockMinutes clockSeconds clockTenths) * 21 = the lap timer (lapMinutes lapSeconds lapTenths) A Flags to control how the time is printed: * Bit 7: clear = do not print leading zeroes in mins set = print leading zeroes in mins * Bit 6: clear = print second digit in mins set = do not print second digit in mins * Bit 5: clear = do not print leading zeroes in secs set = print leading zeroes in secs * Bit 4: clear = print second digit in secs set = do not print second digit in secs * Bit 3: clear = print tenths of a second set = do not print tenths of a second * Bit 2: clear = do not print leading zeroes in tenths set = print leading zeroes in tenths * Bit 1: clear = print second digit in tenths set = do not print second digit in tenths
[X]
Subroutine Print2DigitBCD (category: Text)
Print a binary coded decimal (BCD) number in the specified format
[X]
Subroutine PrintCharacter (category: Text)
Print a character on-screen
[X]
Variable bestLapMinutes in workspace Main variable workspace
Minutes of each driver's best lap time, stored in BCD
[X]
Variable bestLapSeconds in workspace Main variable workspace
Seconds of each driver's best lap time, stored in BCD
[X]
Variable bestLapTenths in workspace Main variable workspace
Tenths of seconds of each driver's best lap time, stored in BCD
[X]
Label plap1 is local to this routine