mirror of
https://github.com/cc65/cc65.git
synced 2024-11-19 06:31:31 +00:00
Implemented clrscr routine for C1P
This commit is contained in:
parent
1f85c48fb2
commit
5d7a24241c
3
libsrc/c1p/c1p.inc
Normal file
3
libsrc/c1p/c1p.inc
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
SCRNBASE := $D000 ; Base of video RAM
|
||||
VIDEORAMSIZE := $0400 ; Size of C1P video RAM (1 kB)
|
23
libsrc/c1p/clrscr.s
Normal file
23
libsrc/c1p/clrscr.s
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user