From: Stephan Mühlstrasser Date: Sat, 8 Nov 2014 00:14:46 +0000 (+0100) Subject: Implemented clrscr routine for C1P X-Git-Tag: V2.15~22^2~56 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5d7a24241cee19434f1ac8352c7f74eac7b410de;p=cc65 Implemented clrscr routine for C1P --- diff --git a/libsrc/c1p/c1p.inc b/libsrc/c1p/c1p.inc new file mode 100644 index 000000000..525a8e9ee --- /dev/null +++ b/libsrc/c1p/c1p.inc @@ -0,0 +1,3 @@ + +SCRNBASE := $D000 ; Base of video RAM +VIDEORAMSIZE := $0400 ; Size of C1P video RAM (1 kB) diff --git a/libsrc/c1p/clrscr.s b/libsrc/c1p/clrscr.s new file mode 100644 index 000000000..f219a4550 --- /dev/null +++ b/libsrc/c1p/clrscr.s @@ -0,0 +1,23 @@ +; +; void clrscr (void); +; + .export _clrscr + .include "c1p.inc" + +; Adapted from the Challenger Character Graphics +; Reference Manual, "2.3.3 MACHINE LANGUAGE SCREEN CLEAR" +; This is self-modifying code! +BANKS = VIDEORAMSIZE / $100 + +_clrscr: LDA #$20 ;' ' + LDY #BANKS + LDX #$00 +STALOC: STA SCRNBASE,X + INX + BNE STALOC + INC STALOC+2 + DEY + BNE STALOC + LDA #>(SCRNBASE) ; load high byte + STA STALOC+2 ; restore base address + RTS