feat(kernal): $E5B4, $EA24, and $ECF0 at their well-known addresses

cc65's C64 runtime and ip65 call past the jump table: $E5B4 takes the first
key from the keyboard buffer (cgetc), $EA24 points USER at the colour RAM of
PNT's line (cursor positioning), and $ECF0 holds the low bytes of the screen
lines' addresses (ip65's VT100 code), as Mapping the Commodore 64 describes
them. vicii_init's work moves out of $E5A0-$E5C8 to free $E5B4, and on the
standard layout PNT and USER are worked out through the routine at $EA24.
This commit is contained in:
chris committed 2026-10-18 07:24:08 +02:00
1 parent ec4dc7df62
commit a45f63e34e
9 files changed
+132 -39

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# CRT KERNAL_0 #TAKE
;; #LAYOUT# M65 KERNAL_1 #TAKE
;; #LAYOUT# * * #IGNORE
;
; The VIC-II set-up of vicii_init (e5a0.vicii_init.s), moved out of $E5A0-$E5C8
; so that $E5B4 is free
;
vicii_init_registers:
; Clear everything - turn off sprites (observed hanging around after
; running programs and resetting), etc.
lda #$00
ldx #$2E
@1:
sta __VIC_BASE, x
dex
bpl @1
; Set up default IO values
; - [CM64] page 129 - VIC_SCROLY
; - [CM64] pages 140-144 - VIC_SCROLX
; - [CM64] pages 145-146 - VIC_YMCSB
lda #$1B ; according to [CM64] page 137 some software assumes oldest bit is 0
sta VIC_SCROLY
lda #$C8
sta VIC_SCROLX ; 40 column, etc.
lda #$14
sta VIC_YMCSB
lda #$0F
sta VIC_IRQ ; clear all interrupts
; We use a different colour scheme of white text on all blue by default,
; but brand-specific color scheme can also be enabled
lda #CONFIG_COLOR_BG
sta VIC_EXTCOL
sta VIC_BGCOL0
; Setup default I/O devices
!ifdef CONFIG_IEC {
jmp clrchn_reset
} else {
jmp CLRCHN
}