mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-12-11 09:49:17 +00:00
67 lines
1.6 KiB
Plaintext
67 lines
1.6 KiB
Plaintext
|
THLINE
|
||
|
PLA
|
||
|
STA RETADR
|
||
|
PLA
|
||
|
STA RETADR+1
|
||
|
PLA
|
||
|
STA :F
|
||
|
PLA
|
||
|
STA :Y
|
||
|
PLA
|
||
|
STA :X2
|
||
|
PLA
|
||
|
STA :X1
|
||
|
LDA ERRCTRL
|
||
|
CMP #1
|
||
|
BEQ :CHKERR
|
||
|
JMP :ERREND
|
||
|
:CHKERR
|
||
|
LDA :X1
|
||
|
CMP :X2
|
||
|
BCS :ERRTOOHI ; X1 => X2
|
||
|
LDA :X1
|
||
|
CMP #39
|
||
|
BCS :ERRXOVF ; X VALUE OVERFLOW
|
||
|
LDA :X2
|
||
|
CMP #40 ; MAX COLS + 1
|
||
|
BCS :ERRXOVF
|
||
|
LDA :Y
|
||
|
CMP #24 ; MAX ROWS + 1
|
||
|
BCS :ERRYOVF
|
||
|
JMP :ERREND
|
||
|
:ERRTOOHI
|
||
|
_ERR :E_SID;:E_XHI;:E_DMP1;:X1;#4
|
||
|
JMP :ERREND
|
||
|
:ERRXOVF
|
||
|
_ERR :E_SID;:E_XOF;:E_DMP1;:X1;#4
|
||
|
JMP :ERREND
|
||
|
:ERRYOVF
|
||
|
_ERR :E_SID;:E_YOF;:E_DMP1;:X1;#4
|
||
|
JMP :ERREND
|
||
|
:ERREND
|
||
|
LDA :Y ; LOAD ROW
|
||
|
LDY :X1 ; LOAD X START POS
|
||
|
:LOOP
|
||
|
JSR $F847 ; GBASCALC ROUTINE
|
||
|
LDA :F
|
||
|
STA ($26),Y ; PUSH TO SCREEN MEMORY
|
||
|
LDA :Y
|
||
|
INY ; INCREASE X POS
|
||
|
CPY :X2 ; IF LESS THAN X END POS
|
||
|
BNE :LOOP ; REPEAT UNTIL DONE
|
||
|
:EXIT
|
||
|
LDA RETADR+1
|
||
|
PHA
|
||
|
LDA RETADR
|
||
|
PHA
|
||
|
RTS
|
||
|
:X1 DS 1
|
||
|
:X2 DS 1
|
||
|
:Y DS 1
|
||
|
:F DS 1 ; FILL CHAR
|
||
|
:E_SID ASC "THLINE (THLIN MACRO)",00
|
||
|
:E_DMP1 ASC "DUMPING X1(1) X1(1) Y(1) F(1)",00
|
||
|
:E_XHI ASC "X1 MUST BE LOWER THAN X2.",00
|
||
|
:E_XOF ASC "X > # OF AVAILABLE COLUMNS.",00
|
||
|
:E_YOF ASC "Y > # OF AVAILABLE ROWS",00
|