AppleIIAsm-Collection/source/d8_lores/T.MIN.SUB.LRBLINE.ASM
nathanriggs 9b12b6fd9b HOUSEKEEPING
- getting ready for major changes for 0.6.0.
- be sure to download the 0.5.0 release to ensure proper functionality, as these rountines will not work together in the SRC or BIN folder during the transition
- Beginning to significantly alter documentation
2019-12-17 17:19:24 -05:00

91 lines
2.1 KiB
NASM

]X1 EQU WPAR1
]Y1 EQU WPAR1+1
]X2 EQU WPAR2
]Y2 EQU WPAR2+1
]COLOR EQU BPAR1
]DX EQU VARTAB+9
]DY EQU VARTAB+10
]SX EQU VARTAB+11
]SY EQU VARTAB+12
]ERR EQU VARTAB+13
]ERR2 EQU VARTAB+14
LRBLINE
LDX #$FF
LDA ]Y1
SEC
SBC ]Y2
BPL :YSTORE
LDX #1
EOR #$FF
CLC
ADC #1
:YSTORE
STA ]DY
STX ]SY
LDX #$FF
LDA ]X1
SEC
SBC ]X2
BPL :XSTORE
LDX #1
EOR #$FF
CLC
ADC #1
:XSTORE
STA ]DX
STX ]SX
CMP ]DY
BEQ :SKIP
BPL :SKIP2
:SKIP
LDA ]DY
EOR #$FF
CLC
ADC #1
:SKIP2
STA ]ERR
ASL ]DX
ASL ]DY
:LP
LDA ]COLOR
LDY ]Y1
LDX ]X1
JSR LOCPLOT
LDA ]X1
CMP ]X2
BNE :KEEPGO
LDA ]Y1
CMP ]Y2
BEQ :EXIT ; IF EQUAL, EXIT
:KEEPGO
LDA ]ERR
STA ]ERR2
CLC
ADC ]DX
BMI :SKIPX
BEQ :SKIPX
LDA ]ERR
SEC
SBC ]DY
STA ]ERR
LDA ]X1
CLC
ADC ]SX
STA ]X1
:SKIPX
LDA ]ERR2
CMP ]DY
BPL :SKIPY
LDA ]ERR
CLC
ADC ]DX
STA ]ERR
LDA ]Y1
CLC
ADC ]SY
STA ]Y1
:SKIPY
JMP :LP
:EXIT
RTS