Skip to navigation


Drawing lines: NLIN2

[Apple II version]

Name: NLIN2 [Show more] Type: Subroutine Category: Drawing lines Summary: Draw a screen-wide horizontal line at the pixel row in A
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * NLIN4 calls NLIN2

This draws a line from (0, A) to (255, A), which runs across the whole screen.
Arguments: A The pixel row on which to draw the horizontal line
.NLIN2 STA Y1 ; Set Y1 = A LDA #BLUE ; Switch to colour blue STA COL LDX #0 ; Set X1 = 0, so (X1, Y1) = (0, A) STX X1 DEX ; Set X2 = 255, so (X2, Y2) = (255, A) STX X2 JMP HLOIN ; Call HLOIN to draw a line from (0, A) to (255, A), ; returning from the subroutine using a tail call