This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Type: Subroutine Category: Drawing pixels Summary: Draw a single-height dash on the dashboard
This variation is blank in the 6502 Second Processor and Master versions.
Tap on a block to expand it, and tap it again to revert.
Arguments: X1 The screen pixel x-coordinate of the dash
This variation is blank in the Electron version.
Tap on a block to expand it, and tap it again to revert.
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Electron versions.
Returns: R The dash's right pixel byte
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Master versions.
LDY #128 \ Set SC = 128 for use in the calculation below STY SC
This variation is blank in the Disc (flight), Disc (docked), 6502 Second Processor, Master and Electron versions.
\.CPIX \ This label is commented out in the original source. It \ would provide a new entry point with A specifying the \ y-coordinate instead of Y1, but it isn't used anywhere
TAY \ Store the y-coordinate in Y
EOR (SC),Y \ Draw the pixel on-screen using EOR logic, so we can STA (SC),Y \ remove it later without ruining the background that's \ already on-screen
This variation is blank in the Cassette, Disc (flight) and Disc (docked) versions.
BCC P%+4 \ If the addition we just did overflowed, then increment INC SC+1 \ the high byte of SC(1 0), as this means we just moved \ into the right half of the screen row
.CP1
AND COL \ Apply the colour mask to the pixel byte, as above
This variation is blank in the Cassette, Disc (flight), Disc (docked), 6502 Second Processor and Electron versions.
STA R \ Store the dash's right pixel byte in R
RTS \ Return from the subroutine