LDA colourCycle \ If bit 7 of colourCycle is set, i.e. %11110000, jump BMI draw23 \ down to draw23 to add a line to buffer 1 LDX lineBuffer2Count \ If lineBuffer2Count <> 95, line buffer 2 is not full, CPX #95 \ so jump down to draw22 to add a new line to the buffer BNE draw22 RTS \ Return from the subroutine .draw22 INX \ Increment the value in lineBuffer2Count as we are STX lineBuffer2Count \ about to add a new line to line buffer 2 JMP draw25 \ Jump down to draw25 to buffer the line and draw it .draw23 LDX lineBuffer1Count \ If lineBuffer1Count <> 47, line buffer 1 is not full, CPX #47 \ so jump down to draw24 to add a new line to the buffer BNE draw24 RTS \ Return from the subroutine .draw24 INX \ Increment the value in lineBuffer1Count as we are STX lineBuffer1Count \ about to add a new line to line buffer 1 .draw25 LDA R \ Save the start x-coordinate in lineBufferR STA lineBufferR,X LDA W \ Save the max/min x-coordinate in lineBufferW STA lineBufferW,X LDA S \ Save the start y-coordinate in lineBufferS STA lineBufferS,X LDA G \ Save the max/min y-coordinate in lineBufferG STA lineBufferG,X LDA T \ Save the |x-delta| in lineBufferT STA lineBufferT,X LDA U \ Save the |y-delta| in lineBufferU STA lineBufferU,X LDA V \ Save the direction in lineBufferV STA lineBufferV,X \ Fall through into DrawCanopyLine to draw the lineName: DrawClippedLine (Part 6 of 6) [Show more] Type: Subroutine Category: Drawing lines Summary: Add the clipped line to the line buffer and draw itContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Variable colourCycle in workspace Main variable workspace
Determines which of the two canopy screens we are showing, so we can use colour cycling for smooth animation
[X]
Label draw22 is local to this routine
[X]
Label draw23 is local to this routine
[X]
Label draw24 is local to this routine
[X]
Label draw25 is local to this routine
[X]
Variable lineBuffer1Count in workspace Main variable workspace
Offset of the last line stored in buffer 1
[X]
Variable lineBuffer2Count in workspace Main variable workspace
Offset of the last line stored in buffer 2
[X]
Variable lineBufferG (category: Drawing lines)
Line buffer storage for the max/min y-coordinate (G)
[X]
Variable lineBufferR (category: Drawing lines)
Line buffer storage for the start x-coordinate (R)
[X]
Variable lineBufferS (category: Drawing lines)
Line buffer storage for the start y-coordinate (S)
[X]
Variable lineBufferT (category: Drawing lines)
Line buffer storage for the line's |x-delta| (T)
[X]
Variable lineBufferU in workspace Stack variables
Line buffer storage for the line's |y-delta| (U)
[X]
Variable lineBufferV (category: Drawing lines)
Line buffer storage for the line direction (V)
[X]
Variable lineBufferW (category: Drawing lines)
Line buffer storage for the max/min x-coordinate (W)