mirror of
https://github.com/actraiser/dust-tutorial-c64-first-intro.git
synced 2025-06-18 17:05:34 -04:00
23 lines
1004 B
NASM
23 lines
1004 B
NASM
;============================================================
|
|
; clear screen
|
|
; a loop instead of kernal routine to save cycles
|
|
;============================================================
|
|
|
|
init_screen ldx #$00 ; set X to zero (black color code)
|
|
stx $d021 ; set background color
|
|
stx $d020 ; set border color
|
|
|
|
clear lda #$20 ; #$20 is the spacebar Screen Code
|
|
sta $0400,x ; fill four areas with 256 spacebar characters
|
|
sta $0500,x
|
|
sta $0600,x
|
|
sta $06e8,x
|
|
lda #$00 ; set foreground to black in Color Ram
|
|
sta $d800,x
|
|
sta $d900,x
|
|
sta $da00,x
|
|
sta $dae8,x
|
|
inx ; increment X
|
|
bne clear ; did X turn to zero yet?
|
|
; if not, continue with the loop
|
|
rts ; return from this subroutine |