AppleIIAsm-Collection/source/disk20_minidisk_A/T.TVLINE.SUB.MIN
nathanriggs 82d0e74c1a 0.3.1 updates
some minor bugfixes, directory shuffling, added demo and utility disks
2019-01-26 21:02:17 -05:00

67 lines
1.6 KiB
Plaintext

TVLINE
PLA
STA RETADR
PLA
STA RETADR+1
PLA
STA :F ; FILL CHAR
PLA
STA :X ; X POS
PLA
STA :Y2 ; END
PLA
STA :Y1 ; START
LDA ERRCTRL
CMP #1
BEQ :CHKERR
JMP :ERREND
:CHKERR
LDA :Y1
CMP :Y2
BCS :ERRTOOHI ; Y1 => Y2
LDA :Y2
CMP #24
BCS :ERRYOVF ; Y VALUE OVERFLOW
LDA :X
CMP #40 ; MAX COLS + 1
BCS :ERRXOVF
LDA :Y1
CMP #24 ; MAX ROWS + 1
BCS :ERRYOVF
JMP :ERREND
:ERRTOOHI
_ERR :E_SID;:E_YHI;:E_DMP1;:X;#4
JMP :ERREND
:ERRXOVF
_ERR :E_SID;:E_XOF;:E_DMP1;:X;#4
JMP :ERREND
:ERRYOVF
_ERR :E_SID;:E_YOF;:E_DMP1;:X;#4
JMP :ERREND
:ERREND
LDA :Y1
LDY :X
:LOOP
JSR $F847 ; GBASCALC ROUTINE
LDA :F
STA ($26),Y ; PLOT TO SCREEN MEMORY
INC :Y1
LDA :Y1
CMP :Y2 ; IF Y1 < Y2
BNE :LOOP ; LOOP; ELSE, CONTINUE
:EXIT
LDA RETADR+1
PHA
LDA RETADR
PHA
RTS
:X DS 1
:Y1 DS 1
:Y2 DS 1
:F DS 1
:E_SID ASC "TVLINE (TVLIN MACRO)",00
:E_DMP1 ASC "DUMPING X(1) Y1(1) Y2(1) F(1)",00
:E_YHI ASC "Y1 MUST BE LOWER THAN Y2.",00
:E_XOF ASC "X > # OF AVAILABLE COLUMNS.",00
:E_YOF ASC "Y > # OF AVAILABLE ROWS",00