.PrintGearNumber LDA #34 \ Move the cursor to character column 34 STA xCursor STA W \ Set W to a non-zero value with bit 7 clear, so the \ call to PrintCharacter-6 prints the left half of the \ double-width character LDA #215 \ Move the cursor to pixel row 215 STA yCursor LDX gearNumber \ Set X to the current gear number LDA gearNumberText,X \ Set A to the character to print for this gear number JSR PrintCharacter-6 \ Print the left half of the double-width character LDX #&FF \ Set W to a non-zero value with bit 7 set, so the STX W \ call to PrintCharacter-6 prints the right half of the \ double-width character JSR PrintCharacter-6 \ Print the right half of the double-width character RTS \ Return from the subroutineName: PrintGearNumber [Show more] Type: Subroutine Category: Text Summary: Print the number of the current gear in double-width characters on the gear stickContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ProcessDrivingKeys (Part 6 of 6) calls PrintGearNumber * ResetVariables calls PrintGearNumber
Arguments: X The gear number to print on the stick: * 0 = reverse * 1 = neutral * 2-7 = 1 to 5
[X]
Entry point PrintCharacter-6 in subroutine PrintCharacter (category: Text)
Print double-width character (this is used to print the double-width number on the gear stick)
[X]
Variable gearNumber in workspace Zero page
The current gear number
[X]
Variable gearNumberText (category: Text)
The character to print on the gear stick for each gear
[X]
Variable xCursor (category: Text)
The cursor's x-coordinate, which can either be a pixel coordinate or a character row
[X]
Variable yCursor (category: Text)
The cursor's pixel y-coordinate