mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-12-10 17:52:35 +00:00
f5c097e70f
- 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.
175 lines
3.7 KiB
Plaintext
175 lines
3.7 KiB
Plaintext
*
|
|
*``````````````````````````````*
|
|
* TFILLA :: TEXT FILL AREA *
|
|
*- -*
|
|
* FILLS A RECTANGULAR AREA OF *
|
|
* THE SCREEN WITH THE DESIRED *
|
|
* CHARACTER. *
|
|
*- -*
|
|
* CLOBBERS: *
|
|
* *
|
|
* FLAGS: ???----- REG: AXYM *
|
|
*- -*
|
|
* CYCLES: ??? *
|
|
* SIZE: *
|
|
*- -*
|
|
* USAGE: *
|
|
* LDA (LEFT BOUND) *
|
|
* PHA *
|
|
* LDA (UPPER BOUND) *
|
|
* PHA *
|
|
* LDA (RIGHT BOUND) *
|
|
* PHA *
|
|
* LDA (BOTTOM BOUND) *
|
|
* PHA *
|
|
* LDA (FILL CHAR) *
|
|
* PHA *
|
|
* JSR TFILLA *
|
|
*- -*
|
|
* ENTRY *
|
|
* *
|
|
* TOP OF STACK *
|
|
* *
|
|
* LOW BYTE OF RETURN ADDRESS *
|
|
* HI BYTE OF RETURN ADDRESS *
|
|
* FILL CHAR (:FILL) *
|
|
* BOTTOM BOUND (:BOTTOM) *
|
|
* RIGHT BOUND (:RIGHT) *
|
|
* TOP BOUND (:TOP) *
|
|
* LEFT BOUND (:LEFT) *
|
|
*- -*
|
|
* EXIT *
|
|
* *
|
|
* TOP OF STACK *
|
|
* *
|
|
* LOW BYTE OF RETURN ADDRESS *
|
|
* HI BYTE OF RETURN ADDRESS *
|
|
* *
|
|
* A = LOW BYTE OF ADDRESS *
|
|
* X = COUNTER DATA; TRASH *
|
|
* Y = COUNTER DATA; TRASH *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
TFILLA
|
|
*
|
|
** SAVE RETURN ADDRESS
|
|
*
|
|
PLA
|
|
STA RETADR
|
|
PLA
|
|
STA RETADR+1
|
|
*
|
|
** LOAD PARAMETERS
|
|
*
|
|
PLA
|
|
STA :F
|
|
PLA
|
|
STA :Y2
|
|
PLA
|
|
STA :X2
|
|
PLA
|
|
STA :YC
|
|
STA :Y1
|
|
PLA
|
|
STA :XC
|
|
STA :X1
|
|
*
|
|
********************************
|
|
*
|
|
** ERROR CONTROL
|
|
*
|
|
********************************
|
|
*
|
|
LDA ERRCTRL
|
|
CMP #1
|
|
BEQ :CHKERR
|
|
JMP :ERREND
|
|
:CHKERR
|
|
LDA :X1
|
|
CMP :X2 ; X1 => X2?
|
|
BCS :X1HI
|
|
LDA :Y1
|
|
CMP :Y2
|
|
BCS :Y1HI ; Y1 => Y2?
|
|
LDA :X1
|
|
CMP #40
|
|
BCS :XOVF
|
|
LDA :X2
|
|
CMP #40
|
|
BCS :XOVF
|
|
LDA :Y1
|
|
CMP #24
|
|
BCS :YOVF
|
|
LDA :Y2
|
|
CMP #24
|
|
BCS :YOVF
|
|
JMP :ERREND
|
|
:X1HI
|
|
_ERR :E_SID;:E_X1H;:E_DMP1;:X1;#7
|
|
JMP :ERREND
|
|
:Y1HI
|
|
_ERR :E_SID;:E_Y1H;:E_DMP1;:X1;#7
|
|
JMP :ERREND
|
|
:XOVF
|
|
_ERR :E_SID;:E_XOF;:E_DMP1;:X1;#7
|
|
JMP :ERREND
|
|
:YOVF
|
|
_ERR :E_SID;:E_YOF;:E_DMP1;:X1;#7
|
|
*
|
|
********************************
|
|
*
|
|
:ERREND
|
|
*
|
|
********************************
|
|
*
|
|
*
|
|
:LP1
|
|
LDA :YC
|
|
LDY :XC
|
|
JSR $F847 ; GBASCALC
|
|
LDA :F
|
|
STA ($26),Y
|
|
LDA :YC
|
|
INY
|
|
STY :XC
|
|
CPY :X2
|
|
BNE :LP1
|
|
|
|
*
|
|
LDA :X1
|
|
STA :XC
|
|
INC :YC
|
|
LDA :YC
|
|
CMP :Y2
|
|
BNE :LP1
|
|
*
|
|
:EXIT
|
|
*
|
|
** RESTORE RETURN ADDRESS
|
|
*
|
|
LDA RETADR+1
|
|
PHA
|
|
LDA RETADR
|
|
PHA
|
|
*
|
|
RTS
|
|
*
|
|
** DATA
|
|
*
|
|
:X1 DS 1
|
|
:X2 DS 1
|
|
:Y1 DS 1
|
|
:Y2 DS 1
|
|
:XC DS 1
|
|
:YC DS 1
|
|
:F DS 1
|
|
*
|
|
:E_SID ASC "TFILLA (TFILL MACRO)",00
|
|
:E_DMP1 ASC "DUMPING X1(1) X2(1) Y1(1) Y2(1)"
|
|
ASC "XC(1) YC(1) F(1)",00
|
|
:E_X1H ASC "X1 MUST BE LOWER THAN X2.",00
|
|
:E_Y1H ASC "Y1 MUST BE LOWER THAN Y2.",00
|
|
:E_XOF ASC "X <> MIN/MAX COLUMNS.",00
|
|
:E_YOF ASC "Y <> MIN/MAX ROWS",00
|
|
*
|