Skip to navigation

Elite on the BBC Micro

Drawing lines: HLOIN (Electron version)

Name: HLOIN [View in context] Type: Subroutine [Compare versions] Category: Drawing lines Summary: Draw a horizontal line from (X1, Y1) to (X2, Y1)
We do not draw a pixel at the end point (X2, X1). To understand how this routine works, you might find it helpful to read the deep dive on "Drawing monochrome pixels in mode 4". Returns: Y Y is preserved
.HLOIN LDX Y1 \ Set Y2 = Y1, so we can use the normal line-drawing STX Y2 \ routine to draw a horizontal line .HL1 JMP LL30 \ Draw a line from (X1, Y1) to (X2, Y2), which will be \ horizontal because we set Y2 to Y1 above