Skip to navigation


Text: PrintGearNumber

Name: PrintGearNumber [Show more] Type: Subroutine Category: Text Summary: Print the number of the current gear in double-width characters on the gear stick
Context: 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
.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 subroutine