AppleIIAsm-Collection/disks/disk1_stdio/T.TVLINE.SUB
nathanriggs f5c097e70f STDIO disk 0.3.0 update
- added error handling
- no more massive library; just a subroutine per file. This is because Merlin doesn't like large files.
- added a "minify" BASIC utility that gets rid of *most* comments in a source textfile. This dramatically reduces space used if you're not terribly interested in non-inline comments.
- TFILL,THLIN,TVLIN and TPUT not directly access the video memory (page one), making for a much faster draw without interfering COUT.
- some stylistic changes, primarily to TFILL
- change required files to minified versions only. The whole files can be found on disk 2.
- got a norovirus so pretty much couldn't do anything requiring sustained attention, so focused on small things here and not on my dayjob. Cool.
- created a required.vars file that separates variables and settings from the other required files. Not minified.
- This current bout of revision will probably be the last, once all initial 6 disks are revamped, that focuses on all subroutines/macros in a given library at a single push. After this round, commits will be done on a subroutine or related file basis.
2019-01-13 23:48:09 -05:00

144 lines
3.4 KiB
Plaintext

*
*``````````````````````````````*
* TVLINE : TEXT VERTICAL LINE *
*- -*
* CREATES A VERTICAL LINE OF *
* TEXT COMPOSED OF THE FILL *
* CHARACTER SPECIFIED AT X. *
*- -*
* CLOBBERS: *
* *
* FLAGS: ????---- REG: AXYM *
*- -*
* CYCLES: ??? *
* SIZE: *
*- -*
* USAGE: *
* LDA (Y-START) *
* PHA *
* LDA (Y-END) *
* PHA *
* LDA (X-POS) *
* PHA *
* LDA (FILL CHAR) *
* PHA *
* JSR TVLINE *
*- -*
* ENTRY *
* *
* TOP OF STACK *
* *
* LOW BYTE OF RETURN ADDRESS *
* HI BYTE OF RETURN ADDRESS *
* XPOS START OF LINE (:Y1) *
* XPOS END OF LINE (:Y2) *
* YPOS OF LINE (:X) *
* FILL CHARACTER (:F) *
*- -*
* EXIT *
* *
* TOP OF STACK *
* *
* LOW BYTE OF RETURN ADDRESS *
* HI BYTE OF RETURN ADDRESS *
* *
* Y = END OF LINE *
* X = HORIZONTAL POSITION *
* A = LOW BYTE OF RET ADDR *
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
*
TVLINE
*
** SAVE RETURN ADDRESS
*
PLA
STA RETADR
PLA
STA RETADR+1
*
** GET PARAMETERS
*
PLA
STA :F ; FILL CHAR
PLA
STA :X ; X POS
PLA
STA :Y2 ; END
PLA
STA :Y1 ; START
*
********************************
*
** ERROR CONTROL
*
********************************
*
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
*
** RESTORE RETURN ADDRESS
*
LDA RETADR+1
PHA
LDA RETADR
PHA
*
RTS
*
** DATA
*
: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
*