Skip to navigation

Screen buffer: GetColour (Part 3 of 3)

Name: GetColour (Part 3 of 3) [Show more] Type: Subroutine Category: Screen buffer Summary: Process the right verge
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
.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) ENDIF