more screeen work, provided unofficial line clear routine

This commit is contained in:
FeralChild64 committed 2020-01-03 20:43:32 +01:00
1 parent ca22b228d7
commit 64c8bc6b82
11 files changed
+50 -24

No files matched your search

@@ -0,0 +1,34 @@
//
// Well-known routine, described in:
//
// - [CM64] Computes Mapping the Commodore 64 - page 219
// - http://sta.c64.org/cbm64scrfunc.html
//
// input: .X - screen line to clear
//
// Checked that original routine preserves X (convenient for loops),
// and leaves space screen code in .A, so duplicate this behaviour
//
screen_clear_line:
// First, calculate PNT and USER
phx_trash_a
jsr screen_calculate_PNT_USER_from_X
plx_trash_a
// Now clear the line
ldy #39
!:
lda COLOR
sta (USER), y
lda #$20 // space character screen code
sta (PNT), y
dey
bpl !-
// Done
rts