AppleIIAsm-Collection/disks/disk1_stdio/T.THLINE.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

143 lines
3.4 KiB
Plaintext

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