.gcol12 CPY vergeTopRight \ If Y >= vergeTopRight, jump to gcol6 to return from BCS gcol6 \ the subroutine with the colour green LDX rightSegment,Y \ Set X to the index within the track segment list of \ the segment for the right verge on this track line BMI gcol14 \ If bit 7 of X is set, then this entry in the \ rightSegment table was filled in by MapSegmentsToLines \ for a segment that doesn't have an entry in the track \ segment list, in which case the index of the last \ valid entry is captured in bits 0-6, so jump to gcol14 \ to clear bit 7 of X and return the colour of the verge \ mark for the segment beyond segment X JSR SetMarker \ Call SetMarker to insert a &AA marker into the screen \ buffer at the right verge .gcol13 LDA vergeDataRight-1,X \ Set A to entry X - 1 from vergeDataRight, which \ contains the colour of the verge for the segment \ beyond segment X AND #%00000011 \ Extract the colour number from bits 0-1 of A into X TAX LDA colourPalette,X \ Set A to logical colour X from the colour palette RTS \ Return from the subroutine .gcol14 TXA \ Clear bit 7 of X AND #%01111111 TAX BPL gcol13 \ Jump to gcol13 (this BPL is effectively a JMP as we \ just cleared bit 7 of A) ENDIFName: GetColour (Part 3 of 3) [Show more] Type: Subroutine Category: Screen buffer Summary: Process the right vergeContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Subroutine SetMarker (category: Screen buffer)
Insert a marker value into a dash data block
[X]
Variable colourPalette (category: Drawing pixels)
The main colour palette that maps logical colours 0 to 3 to physical colours
[X]
Label gcol13 is local to this routine
[X]
Label gcol14 is local to this routine
[X]
Label gcol6 in subroutine GetColour (Part 1 of 3)
[X]
Variable rightSegment in workspace Main variable workspace
For each track line, the index of the segment within the track segment list for the right verge
[X]
Variable vergeDataRight (category: Track geometry)
Data (such as colour) for the verge marks on the right side of the track
[X]
Variable vergeTopRight in workspace Zero page
The track line just above the segment at vergeDepthOfField (i.e. the furthest segment that might contain a verge) when drawing the right verge