From 121f49b763466bcbada13adf7225d81537ea890a Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 11 Oct 2020 11:56:16 +0200 Subject: [PATCH] improved C128 hardware handling --- src/aliases/,aliases_config.s | 7 +++++++ src/kernal/init/e5a0.vicii_init.s | 12 ------------ src/kernal/init/fda3.ioinit.s | 14 +++++++++++++- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/aliases/,aliases_config.s b/src/aliases/,aliases_config.s index db5b2380..2e47a455 100644 --- a/src/aliases/,aliases_config.s +++ b/src/aliases/,aliases_config.s @@ -269,6 +269,13 @@ ; +; Handle platform/mothjerboard configuration + + +!ifdef PLATFORM_COMMODORE_64 { !ifndef CONFIG_MB_M65 { !ifndef CONFIG_MB_U64 { + !set HAS_128_POSSIBILITY = 1 +} } } + ; Handle CPU configuration diff --git a/src/kernal/init/e5a0.vicii_init.s b/src/kernal/init/e5a0.vicii_init.s index d4637ce4..43876303 100644 --- a/src/kernal/init/e5a0.vicii_init.s +++ b/src/kernal/init/e5a0.vicii_init.s @@ -31,18 +31,6 @@ vicii_init: dex bpl @1 -!ifndef CONFIG_MB_M65 { !ifndef CONFIG_MB_U64 { - - ; Disable C128 extra keys - just to be sure they will not interfere with anything - - stx VIC_XSCAN ; store $FF - - ; Disable the C128 2MHz mode, it prevents VIC-II display from working correctly - - inx - stx VIC_CLKRATE ; store $00 -} } - ; Set up default IO values ; - [CM64] page 129 - VIC_SCROLY ; - [CM64] pages 140-144 - VIC_SCROLX diff --git a/src/kernal/init/fda3.ioinit.s b/src/kernal/init/fda3.ioinit.s index e2243c7f..204b963a 100644 --- a/src/kernal/init/fda3.ioinit.s +++ b/src/kernal/init/fda3.ioinit.s @@ -62,7 +62,7 @@ IOINIT_skip_DOS: stx CIA1_PRA ; $DC00 ; - ; Now silence the SID chip(s), depending on the configuration - we want them silent ASAP + ; Silence the SID chip(s), depending on the configuration - we want them silent ASAP ; lda #$00 @@ -135,6 +135,18 @@ IOINIT_skip_DOS: stx CIA1_DDRB ; $DC03 stx CIA2_DDRB ; $DD03 ; XXX this port is used for RS-232, value here is most likely wrong! +!ifdef HAS_128_POSSIBILITY { + + ; Disable C128 extra keys - just to be sure they will not interfere with anything + + stx VIC_XSCAN ; store $FF + + ; Disable the C128 2MHz mode, it prevents VIC-II display from working correctly + + inx + stx VIC_CLKRATE ; store $00 +} + !ifdef CONFIG_KEYBOARD_C65_OR_CAPS_LOCK { lda #$02