aboutsummaryrefslogtreecommitdiff
path: root/conio/clrscr.s
diff options
context:
space:
mode:
Diffstat (limited to 'conio/clrscr.s')
-rw-r--r--conio/clrscr.s35
1 files changed, 35 insertions, 0 deletions
diff --git a/conio/clrscr.s b/conio/clrscr.s
new file mode 100644
index 0000000..5881aea
--- /dev/null
+++ b/conio/clrscr.s
@@ -0,0 +1,35 @@
+;
+; Christian Groessler, Apr-2000
+;
+; void clrscr (void);
+;
+
+ .export _clrscr
+ .include "atari.inc"
+ .importzp ptr1
+
+SCRSIZE = 960 ; 40x24: size of default atari screen
+
+_clrscr:lda SAVMSC ; screen memory
+ sta ptr1
+ lda SAVMSC+1
+ clc
+ adc #>(SCRSIZE-1)
+ sta ptr1+1
+ lda #0 ; screen code of space char
+ sta OLDCHR
+ ldy #<(SCRSIZE-1)
+ ldx #>(SCRSIZE-1)
+_clr1: sta (ptr1),y
+ dey
+ bne _clr1
+ sta (ptr1),y
+ dex
+ bmi done
+ dec ptr1+1
+ dey
+ jmp _clr1
+
+done: sta COLCRS
+ sta ROWCRS
+ rts