From aec7fe972158a05fa264a314e37e38120d9f1081 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 20 Oct 2019 09:55:35 +0200 Subject: [PATCH] motherboard extras can now be configured --- CONFIG.md | 4 +++ c64/,,config_generic.s | 3 +++ c64/,,config_mega65.s | 4 +++ c64/,,config_testing.s | 5 +++- c64/,,config_ultimate64.s | 3 +++ c64/aliases/,aliases_config.s | 42 +++++++++++++++++++++++++----- c64/kernal/init/e5a0.setup_vicii.s | 4 +++ 7 files changed, 57 insertions(+), 8 deletions(-) diff --git a/CONFIG.md b/CONFIG.md index 6d492764..c5e80528 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -23,6 +23,10 @@ Since Open ROMs is highly modular, it should be possible to add other platforms * 8KB ROM area `$A000`-`$BFFF` * 8KB ROM area `$E000`-`$FFFF` +### `CONFIG_MB_MEGA_65`, `CONFIG_MB_ULTIMATE_64` + +Select if the ROM is going to be used exclusively on the specific motherboard. It prevents from enabling options not having sense, skips initialization of C128-only registers, etc. + ### `CONFIG_BRAND_GENERIC` If you don't know which variant to choose - select this one. diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 32283b0e..2978ce82 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -14,6 +14,9 @@ #define CONFIG_PLATFORM_COMMODORE_64 +// #define CONFIG_MB_MEGA_65 +// #define CONFIG_MB_ULTIMATE_64 + #define CONFIG_BRAND_GENERIC // #define CONFIG_BRAND_TESTING // #define CONFIG_BRAND_MEGA_65 diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index ea34f998..d54e3185 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -7,6 +7,7 @@ // Idea: // - sane defaults for the Mega 65 FPGA computer +// - do not enable features which are a significant compatibility risk // - unless VICE gains Commodore 65 (or at least Flash8 cartridge) emulation support, // do not enable CPU-specific optimizations; ROMs would be hard to test @@ -15,6 +16,9 @@ #define CONFIG_PLATFORM_COMMODORE_64 +#define CONFIG_MB_MEGA_65 +// #define CONFIG_MB_ULTIMATE_64 + // #define CONFIG_BRAND_GENERIC // #define CONFIG_BRAND_TESTING #define CONFIG_BRAND_MEGA_65 diff --git a/c64/,,config_testing.s b/c64/,,config_testing.s index c44dcef9..438a494d 100644 --- a/c64/,,config_testing.s +++ b/c64/,,config_testing.s @@ -7,7 +7,7 @@ // Idea: // - enable compatibility-risky features -// - enable code not normally used yto make sure it still compiles +// - enable code not normally used - to make sure they still compile @@ -15,6 +15,9 @@ #define CONFIG_PLATFORM_COMMODORE_64 +// #define CONFIG_MB_MEGA_65 +// #define CONFIG_MB_ULTIMATE_64 + // #define CONFIG_BRAND_GENERIC #define CONFIG_BRAND_TESTING // #define CONFIG_BRAND_MEGA_65 diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index fe635527..7d8a8ff5 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -14,6 +14,9 @@ #define CONFIG_PLATFORM_COMMODORE_64 +// #define CONFIG_MB_MEGA_65 +#define CONFIG_MB_ULTIMATE_64 + // #define CONFIG_BRAND_GENERIC // #define CONFIG_BRAND_TESTING // #define CONFIG_BRAND_MEGA_65 diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s index 353ec3d0..ac668e61 100644 --- a/c64/aliases/,aliases_config.s +++ b/c64/aliases/,aliases_config.s @@ -19,7 +19,31 @@ -// Check that platform and brand configuration is correct +// Check that motherboard extras configuration is correct + +{ + .var selected = 0; + +#if CONFIG_MB_MEGA_65 + .eval selected++ +#endif +#if CONFIG_MB_ULTIMATE_64 + .eval selected++ +#endif + + .if (selected > 1) .error "Please select at most one CONFIG_MB_* option" + +#if !CONFIG_PLATFORM_COMMODORE_64 && CONFIG_BRAND_MEGA_65 && + .error "CONFIG_BRAND_MEGA_65 can only be used with CONFIG_PLATFORM_COMMODORE_64" +#endif +#if !CONFIG_PLATFORM_COMMODORE_64 && CONFIG_BRAND_ULTIMATE_64 && + .error "CONFIG_BRAND_ULTIMATE_64 can only be used with CONFIG_PLATFORM_COMMODORE_64" +#endif +} + + + +// Check that brand configuration is correct { .var selected = 0; @@ -39,11 +63,11 @@ .if (selected != 1) .error "Please select exactly one CONFIG_BRAND_* option" -#if !CONFIG_PLATFORM_COMMODORE_64 && CONFIG_BRAND_MEGA_65 && - .error "CONFIG_BRAND_MEGA_65 can only be used with CONFIG_PLATFORM_COMMODORE_64" +#if CONFIG_MB_MEGA_65 && !(CONFIG_BRAND_MEGA_65 || CONFIG_BRAND_TESTING) + .error "Please select brand either matching the CONFIG_MB_*, or a testing one" #endif -#if !CONFIG_PLATFORM_COMMODORE_64 && CONFIG_BRAND_ULTIMATE_64 && - .error "CONFIG_BRAND_ULTIMATE_64 can only be used with CONFIG_PLATFORM_COMMODORE_64" +#if CONFIG_MB_ULTIMATE_64 && !(CONFIG_BRAND_ULTIMATE_64 || CONFIG_BRAND_TESTING) + .error "Please select brand either matching the CONFIG_MB_*, or a testing one" #endif } @@ -121,8 +145,12 @@ // Check if keyboard options are correct { -#if CONFIG_LEGACY_SCNKEY && CONFIG_KEYBOARD_C128 - .error "CONFIG_LEGACY_SCNKEY and CONFIG_KEYBOARD_C128 are mutually exclusive" +#if CONFIG_LEGACY_SCNKEY && (CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C128_CAPS_LOCK) + .error "CONFIG_LEGACY_SCNKEY and CONFIG_KEYBOARD_C128* are mutually exclusive" +#endif + +#if (CONFIG_MB_MEGA_65 || CONFIG_MB_ULTIMATE_64) && (CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C128_CAPS_LOCK) + .error "Selected CONFIG_MB_* is not compatible with CONFIG_KEYBOARD_C128*" #endif } diff --git a/c64/kernal/init/e5a0.setup_vicii.s b/c64/kernal/init/e5a0.setup_vicii.s index bd3d7d52..c359bdf1 100644 --- a/c64/kernal/init/e5a0.setup_vicii.s +++ b/c64/kernal/init/e5a0.setup_vicii.s @@ -18,6 +18,8 @@ setup_vicii: dex bpl !- +#if !CONFIG_MB_MEGA_65 && !CONFIG_MB_ULTIMATE_64 + // Disable C128 extra keys - just to be sure they won't interfere with anything stx VIC_XSCAN @@ -26,6 +28,8 @@ setup_vicii: stx VIC_CLKRATE +#endif + // Set up default IO values // - [CM64] page 129 - VIC_SCROLY // - [CM64] pages 140-144 - VIC_SCROLX