.DrawFuelPixel STX N \ Store the drawing mode in N CLC \ Set J = A + 184 ADC #184 \ STA J \ so the line's start y-coordinate is between: \ \ * 184, or -72, for A = 0 (empty tank) \ * 249, or -7, for A = 65 (full tank) \ \ As y-coordinates that we send to DrawVectorLine are \ relative to the top of the dashboard, this means we \ draw a pixel on the vertical line from 72 pixels below \ the top of the dashboard (i.e. the bottom of the fuel \ gauge at screen y-coordinate 231), up to 7 pixels \ below the top of the dashboard (i.e. the top of the \ fuel gauge at screen y-coordinate 166) LDA #2 \ Set I = 2, the x-coordinate of the fuel gauge line STA I LDA #1 \ Set T = 1, so line is 1 pixel wide STA T STA U \ Set U = 1, so the line is 1 pixel high LDA #0 \ Set V = 0 so the line is drawn in a positive direction STA V \ for both axes JSR DrawVectorLine \ Draw/erase a pixel at (2, A + 184) RTS \ Return from the subroutineName: DrawFuelPixel [Show more] Type: Subroutine Category: Dashboard Summary: Draw or erase a pixel on the fuel gauge on the dashboardContext: See this subroutine in context in the source code References: This subroutine is called as follows: * FillUpFuelTank calls DrawFuelPixel
Arguments: A The fuel gauge pixel to draw or erase (0 to 65) X Drawing mode: * Bit 7 clear = draw (using OR logic) * Bit 7 set = erase (using EOR logic)
[X]
Subroutine DrawVectorLine (Part 1 of 3) (category: Drawing lines)
Draw a line: set up pixel bytes and slope variables