From: Christian Groessler Date: Mon, 12 May 2014 01:05:21 +0000 (+0200) Subject: clrscr for Atari 5200 default conio screen X-Git-Tag: V2.15~57^2~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8cb68071cd1b338b446956a302f545f8ab3fda2f;p=cc65 clrscr for Atari 5200 default conio screen --- diff --git a/libsrc/atari5200/clrscr.s b/libsrc/atari5200/clrscr.s new file mode 100644 index 000000000..041f34a67 --- /dev/null +++ b/libsrc/atari5200/clrscr.s @@ -0,0 +1,34 @@ +; +; Christian Groessler, May-2014 +; +; void clrscr (void); +; + + .export _clrscr + .include "atari5200.inc" + .importzp ptr1 + +SCRSIZE = 480 ; 20x24: size of default conio atari5200 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 + 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_5200 + sta ROWCRS_5200 + rts