Skip to navigation

Elite on the BBC Micro and NES

Drawing lines: NLIN2

[NES version, Bank 7]

Name: NLIN2 [Show more] Type: Subroutine Category: Drawing lines Summary: Draw a horizontal line on tile row 2 to box in a title
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * NLIN4 calls NLIN2 * TT22 calls NLIN2
.NLIN2 JSR SetupPPUForIconBar ; If the PPU has started drawing the icon bar, configure ; the PPU to use nametable 0 and pattern table 0 LDY #1 ; We now draw a horizontal line into the nametable ; buffer starting at column 1, so set Y as a counter for ; the column number LDA #3 ; Set A to tile 3 so we draw the line as a horizontal ; line that's three pixels thick .nlin1 STA nameBuffer0+2*32,Y ; Set the Y-th tile on row 2 of nametable buffer 0 to ; to tile 3 INY ; Increment the column counter CPY #32 ; Keep drawing tile 3 along row 2 until we have drawn BNE nlin1 ; column 31 RTS ; Return from the subroutine