aboutsummaryrefslogtreecommitdiff
path: root/console.s
diff options
context:
space:
mode:
Diffstat (limited to 'console.s')
-rw-r--r--console.s20
1 files changed, 13 insertions, 7 deletions
diff --git a/console.s b/console.s
index 04524ab..b02403d 100644
--- a/console.s
+++ b/console.s
@@ -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