diff options
author | B. Watson <yalhcru@gmail.com> | 2016-02-19 16:52:10 -0500 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2016-02-19 16:52:10 -0500 |
commit | 7898133f92aebd3d44e3982931e69d90976d0b3c (patch) | |
tree | 0f7b7fb8f0510d88d39dd8e8905bb4188d575604 /console.s | |
parent | 671eec97f75007cdce6323a24d00ffbb08df89e0 (diff) | |
download | taipan-7898133f92aebd3d44e3982931e69d90976d0b3c.tar.gz |
use a clrtoeol() wrapper instead of conio clrscr(), now 6035 bytes free
Diffstat (limited to 'console.s')
-rw-r--r-- | console.s | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -1,7 +1,7 @@ .include "atari.inc" - .export _clrtobot, _clrtoeol, _clrtoline, _cspaces, _cblank, _backspace + .export _clrtobot, _clrtoeol, _clr_screen, _clrtoline, _cspaces, _cblank, _backspace .export _rvs_on, _rvs_off .import mul40 ; from cc65's runtime @@ -18,6 +18,7 @@ .endif +; void clr_screen(void); ; void clrtobot(void); ; void clrtoeol(void); ; void clrtoline(unsigned char line); @@ -26,11 +27,14 @@ ; current cursor position. It's *way* faster than writing them in ; C in terms of cclear() (which uses one cputc() call per blank). +_clr_screen: ; same as gotoxy(0,0); clrtobot(); + lda #0 + sta ROWCRS + sta COLCRS + _clrtobot: ; same as clrtoline(24); lda #24 - ;bne _clrtoline - .byte $2c ; BIT absolute opcode - ; fall through to _clrtoeol + bne _clrtoline _clrtoeol: lda ROWCRS @@ -38,15 +42,17 @@ _clrtoeol: _clrtoline: sta tmp3 ; stash our arg - lda #0 - sta OLDCHR ; stop conio from redrawing stuff after we clear it + + ;lda #0 + ;sta OLDCHR ; stop conio from redrawing stuff after we clear it, + ; no longer needed with our custom conio. ; setup destptr to start of current line, NOT ; current cursor position. lda ROWCRS jsr mul40 ; AX = A*40 (addr of start-of-row) clc - adc SAVMSC ; add to screen pointer + adc SAVMSC ; add AX to screen pointer sta destptr txa adc SAVMSC+1 |