Skip to navigation


Screen buffer: GetColour (Part 2 of 3)

Name: GetColour (Part 2 of 3) [Show more] Type: Subroutine Category: Screen buffer Summary: Process the left verge
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
.gcol8 CPY vergeTopLeft \ If Y >= vergeTopLeft, jump to gcol6 to return from the BCS gcol6 \ subroutine with the colour green LDX leftSegment,Y \ Set X to the index within the track segment list of \ the segment for the left 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 left verge .gcol9 LDA (P),Y \ If the current byte in the screen buffer is non-zero, BNE gcol11 \ then it is not empty, so jump to gcol11 LDA leftTrackStart,Y \ Set A to the block number containing the right edge of \ the left verge BMI gcol10 \ If bit 7 of A is set then the block number is still in \ its initialised form, so jump to gcol10 CMP blockNumber \ Set the C flag if A >= blockNumber, which contains the \ dash data block number for the current edge DEY \ Decrease the track line in Y BCS gcol9 \ If A >= blockNumber, loop back to gcol9 INY \ Increment the track line in Y .gcol10 JSR SetMarker+6 \ Call SetMarker+6 to insert a marker byte into the Y-th \ byte of the dash data block, but only if the Y-th \ entry is zero and blockOffset <= Y < V .gcol11 LDY V \ Set Y = V JMP gcol13 \ Jump to gcol13 to return the colour of the verge mark \ for the segment beyond segment X