diff --git a/CONFIG.md b/CONFIG.md index e94e7ac6..9f0f7b30 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -307,9 +307,9 @@ Feature needs 2 bytes in KERNAL segmment (for CPUs needing the patch), but at th Tries to adjust the color scheme to the selected brand. Some brands might not support this. -### `CONFIG_BANNER_SIMPLE`, `CONFIG_BANNER_FANCY`, `CONFIG_BANNER_BRAND` +### `CONFIG_BANNER_SIMPLE`, `CONFIG_BANNER_FANCY` -Select startup banner - either a simple one, or with some colorful elements. `CONFIG_BANNER_BRAND` heavily depends on the selected brand, not all the brands support it. +Select startup banner - either a simple one, or with some colorful elements. Richer banners need more BASIC segment, varies between brands. diff --git a/src/,,config_custom.s b/src/,,config_custom.s index ad83a50a..5383a2ee 100644 --- a/src/,,config_custom.s +++ b/src/,,config_custom.s @@ -22,7 +22,6 @@ #define CONFIG_BRAND_CUSTOM_BUILD // #define CONFIG_BRAND_GENERIC // #define CONFIG_BRAND_TESTING -// #define CONFIG_BRAND_MEGA_65 // #define CONFIG_BRAND_ULTIMATE_64 .const CONFIG_CUSTOM_BRAND = @"CUSTOM BUILD" @@ -134,7 +133,6 @@ // #define CONFIG_COLORS_BRAND // #define CONFIG_BANNER_SIMPLE #define CONFIG_BANNER_FANCY -// #define CONFIG_BANNER_BRAND #define CONFIG_SHOW_FEATURES diff --git a/src/,,config_cx16.s b/src/,,config_cx16.s index 61056fb2..69d16602 100644 --- a/src/,,config_cx16.s +++ b/src/,,config_cx16.s @@ -21,7 +21,6 @@ #define CONFIG_BRAND_CUSTOM_BUILD // #define CONFIG_BRAND_GENERIC // #define CONFIG_BRAND_TESTING -// #define CONFIG_BRAND_MEGA_65 // #define CONFIG_BRAND_ULTIMATE_64 .const CONFIG_CUSTOM_BRAND = @"FOR COMMANDER X16" @@ -128,7 +127,6 @@ // #define CONFIG_COLORS_BRAND // #define CONFIG_BANNER_SIMPLE #define CONFIG_BANNER_FANCY -// #define CONFIG_BANNER_BRAND // #define CONFIG_SHOW_FEATURES diff --git a/src/,,config_generic.s b/src/,,config_generic.s index 391de569..a5bbe9bb 100644 --- a/src/,,config_generic.s +++ b/src/,,config_generic.s @@ -21,7 +21,6 @@ #define CONFIG_BRAND_GENERIC // #define CONFIG_BRAND_TESTING -// #define CONFIG_BRAND_MEGA_65 // #define CONFIG_BRAND_ULTIMATE_64 @@ -126,7 +125,6 @@ #define CONFIG_COLORS_BRAND // #define CONFIG_BANNER_SIMPLE #define CONFIG_BANNER_FANCY -// #define CONFIG_BANNER_BRAND #define CONFIG_SHOW_FEATURES diff --git a/src/,,config_mega65.s b/src/,,config_mega65.s index 545005e5..29bd1ddc 100644 --- a/src/,,config_mega65.s +++ b/src/,,config_mega65.s @@ -12,18 +12,11 @@ -// Hardware platform and brand +// Hardware platform #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 -// #define CONFIG_BRAND_ULTIMATE_64 - // Processor instruction set @@ -121,15 +114,6 @@ #define CONFIG_BCD_SAFE_INTERRUPTS -// Eye candy - -#define CONFIG_COLORS_BRAND -// #define CONFIG_BANNER_SIMPLE -// #define CONFIG_BANNER_FANCY -#define CONFIG_BANNER_BRAND -// #define CONFIG_SHOW_FEATURES - - // Built-in DOS configuration .const CONFIG_UNIT_SDCARD = 0 // do not change, DOS is not implemented yet diff --git a/src/,,config_testing.s b/src/,,config_testing.s index b56027c3..ed450277 100644 --- a/src/,,config_testing.s +++ b/src/,,config_testing.s @@ -21,7 +21,6 @@ // #define CONFIG_BRAND_GENERIC #define CONFIG_BRAND_TESTING -// #define CONFIG_BRAND_MEGA_65 // #define CONFIG_BRAND_ULTIMATE_64 @@ -126,7 +125,6 @@ // #define CONFIG_COLORS_BRAND #define CONFIG_BANNER_SIMPLE // #define CONFIG_BANNER_FANCY -// #define CONFIG_BANNER_BRAND #define CONFIG_SHOW_FEATURES diff --git a/src/,,config_ultimate64.s b/src/,,config_ultimate64.s index b463c918..5e6eb4b0 100644 --- a/src/,,config_ultimate64.s +++ b/src/,,config_ultimate64.s @@ -21,7 +21,6 @@ // #define CONFIG_BRAND_GENERIC // #define CONFIG_BRAND_TESTING -// #define CONFIG_BRAND_MEGA_65 #define CONFIG_BRAND_ULTIMATE_64 @@ -126,7 +125,6 @@ #define CONFIG_COLORS_BRAND // #define CONFIG_BANNER_SIMPLE #define CONFIG_BANNER_FANCY -// #define CONFIG_BANNER_BRAND #define CONFIG_SHOW_FEATURES diff --git a/src/aliases/,aliases_config.s b/src/aliases/,aliases_config.s index ae1798de..c42216ca 100644 --- a/src/aliases/,aliases_config.s +++ b/src/aliases/,aliases_config.s @@ -63,18 +63,21 @@ #if CONFIG_BRAND_TESTING .eval selected++ #endif -#if CONFIG_BRAND_MEGA_65 - .eval selected++ -#endif #if CONFIG_BRAND_ULTIMATE_64 .eval selected++ #endif +#if !CONFIG_MB_MEGA_65 .if (selected != 1) .error "Please select exactly one CONFIG_BRAND_* option" - -#if CONFIG_MB_MEGA_65 && !(CONFIG_BRAND_MEGA_65 || CONFIG_BRAND_TESTING || CONFIG_BRAND_CUSTOM_BUILD) - .error "Please select brand either matching the CONFIG_MB_*, or a testing/custom one" #endif +#if CONFIG_MB_MEGA_65 + .if (selected != 0) .error "Do not use CONFIG_BRAND_* options for MEGA65" +#endif + +#if CONFIG_MB_MEGA_65 && CONFIG_SHOW_FEATURES + .if (selected != 0) .error "Do not use CONFIG_SHOW_FEATURES options for MEGA65" +#endif + #if CONFIG_MB_ULTIMATE_64 && !(CONFIG_BRAND_ULTIMATE_64 || CONFIG_BRAND_TESTING || CONFIG_BRAND_CUSTOM_BUILD) .error "Please select brand either matching the CONFIG_MB_*, or a testing/custom one" #endif @@ -218,18 +221,17 @@ #if CONFIG_BANNER_FANCY .eval selected++ #endif -#if CONFIG_BANNER_BRAND - .eval selected++ -#endif +#if !CONFIG_MB_MEGA_65 .if (selected != 1) .error "Please select exactly one CONFIG_BANNER_* option" - -#if CONFIG_BANNER_BRAND && !CONFIG_BRAND_MEGA_65 - .error "CONFIG_BANNER_BRAND is not supported for your CONFIG_BRAND_*" #endif -#if CONFIG_MB_MEGA_65 && CONFIG_SHOW_PAL_NTSC - .error "MEGA65 can switch PAL/NTSC during run-time, CONFIG_SHOW_PAL_NTSC makes no sense" +#if CONFIG_MB_MEGA_65 + .if (selected != 0) .error "Do not use CONFIG_BANNER_* options for MEGA65" +#endif + +#if CONFIG_MB_MEGA_65 && CONFIG_COLORS_BRAND + .error "Do not use CONFIG_COLORS_BRAND options for MEGA65" #endif } diff --git a/src/basic/assets/startup_banner.s b/src/basic/assets/startup_banner.s new file mode 100644 index 00000000..2ae93071 --- /dev/null +++ b/src/basic/assets/startup_banner.s @@ -0,0 +1,65 @@ +// #LAYOUT# STD * #TAKE +// #LAYOUT# X16 BASIC_0 #TAKE +// #LAYOUT# * * #IGNORE + +// +// Startup banner, to be displayed during cold start +// + +.encoding "petscii_upper" + + +.macro BANNER_TEXT() { + +#if CONFIG_BRAND_CUSTOM_BUILD + .text "OPEN ROMS " + .text CONFIG_CUSTOM_BRAND +#elif CONFIG_BRAND_GENERIC + .text "OPEN ROMS GENERIC BUILD" +#elif CONFIG_BRAND_TESTING + .text "OPEN ROMS TESTING BUILD" +#elif CONFIG_BRAND_ULTIMATE_64 + .text "OPEN ROMS FOR ULTIMATE 64" +#endif + +} + +startup_banner: + +#if CONFIG_BANNER_SIMPLE + + .text " " + BANNER_TEXT() + .byte $00 + +#elif CONFIG_BANNER_FANCY + + BANNER_TEXT() + .byte $00 + +rainbow_logo: + +{ + .var SET_COLOR_0 = $05 + .var SET_COLOR_1 = $1C + .var SET_COLOR_2 = $9E + .var SET_COLOR_3 = $1E + .var SET_COLOR_4 = $9F + + .byte SET_COLOR_1, $12, $A4, $A4, $A4, $A4, $A4, $A4, $A4, $0D + .byte SET_COLOR_2, $12, $A4, $A4, $A4, $A4, $A4, $A4, $0D + .byte SET_COLOR_3, $12, $A4, $A4, $A4, $A4, $A4, $0D + .byte SET_COLOR_4, $12, $A4, $A4, $A4, $A4, $92 + .byte SET_COLOR_0, $00 +} + +#if !CONFIG_BRAND_CUSTOM_BUILD + +pre_revision_string: + + .text "RELEASE " + .byte $00 + +#endif // no CONFIG_BRAND_CUSTOM_BUILD + +#endif diff --git a/src/basic/init/startup_banner.s b/src/basic/assets/startup_banner_m65.s similarity index 73% rename from src/basic/init/startup_banner.s rename to src/basic/assets/startup_banner_m65.s index 68fb173a..fc10ded0 100644 --- a/src/basic/init/startup_banner.s +++ b/src/basic/assets/startup_banner_m65.s @@ -1,6 +1,4 @@ -// #LAYOUT# STD * #TAKE // #LAYOUT# M65 BASIC_1 #TAKE -// #LAYOUT# X16 BASIC_0 #TAKE // #LAYOUT# * * #IGNORE // @@ -10,75 +8,8 @@ .encoding "petscii_upper" -.macro BANNER_TEXT() { - -#if CONFIG_BRAND_CUSTOM_BUILD - .text "OPEN ROMS " - .text CONFIG_CUSTOM_BRAND -#elif CONFIG_BRAND_GENERIC - .text "OPEN ROMS GENERIC BUILD" -#elif CONFIG_BRAND_TESTING - .text "OPEN ROMS TESTING BUILD" -#elif CONFIG_BRAND_MEGA_65 - .text "OPEN ROMS FOR MEGA65" -#elif CONFIG_BRAND_ULTIMATE_64 - .text "OPEN ROMS FOR ULTIMATE 64" -#endif - -} - startup_banner: -#if CONFIG_BANNER_SIMPLE - - .text " " - BANNER_TEXT() - .byte $00 - -#elif CONFIG_BANNER_FANCY - - BANNER_TEXT() - .byte $00 - -rainbow_logo: - -{ -#if CONFIG_COLORS_BRAND && CONFIG_BRAND_MEGA_65 - - .var SET_COLOR_0 = $05 - .var SET_COLOR_1 = $9A - .var SET_COLOR_2 = $1E - .var SET_COLOR_3 = $9E - .var SET_COLOR_4 = $96 - -#else - - .var SET_COLOR_0 = $05 - .var SET_COLOR_1 = $1C - .var SET_COLOR_2 = $9E - .var SET_COLOR_3 = $1E - .var SET_COLOR_4 = $9F - -#endif - - .byte SET_COLOR_1, $12, $A4, $A4, $A4, $A4, $A4, $A4, $A4, $0D - .byte SET_COLOR_2, $12, $A4, $A4, $A4, $A4, $A4, $A4, $0D - .byte SET_COLOR_3, $12, $A4, $A4, $A4, $A4, $A4, $0D - .byte SET_COLOR_4, $12, $A4, $A4, $A4, $A4, $92 - .byte SET_COLOR_0, $00 -} - -#if !CONFIG_BRAND_CUSTOM_BUILD - -pre_revision_string: - - .text "RELEASE " - .byte $00 - -#endif // no CONFIG_BRAND_CUSTOM_BUILD - -#elif CONFIG_BANNER_BRAND && CONFIG_BRAND_MEGA_65 - // Fancy Mega65 banner - from Retrofan, slightly tweaked .byte $9A, $12, $20, $20, $7F, $A9, $20, $20, $1F, $20, $9A, $20, $20, $20, $20, $1F @@ -135,15 +66,9 @@ pre_revision_string: // .byte $12,$DF,$92,$7F,$9B,$20,$9A,$20,$9B,"0.2.0.0",$0D // .byte $0D,$05,$92,$00 -#if ROM_LAYOUT_M65 - -text_mode_64: +startup_banner_legacy: .text "LEGACY" .byte $11, $9D, $9D, $9D, $9D, $9D .text "MODE" .byte $00 - -#endif - -#endif diff --git a/src/basic/init/initmsg_m65.s b/src/basic/init/initmsg_m65.s new file mode 100644 index 00000000..d347bf03 --- /dev/null +++ b/src/basic/init/initmsg_m65.s @@ -0,0 +1,44 @@ +// #LAYOUT# M65 BASIC_1 #TAKE +// #LAYOUT# * * #IGNORE + + +// Routine is too long to fit in the original location + +// XXX banner-related code needs cleanup, move MEGA65 stuff to a separate file + + +INITMSG: + + // Clear the screen first, some cartridges (like IEEE-488) are leaving a mess on the screen + lda #147 + jsr JCHROUT + + lda #startup_banner + jsr STROUT + + jsr M65_ISMODE65 + bcc !+ // XXX for MEGA65 native mode, display something else instead + + ldx #$02 + ldy #$21 + jsr plot_set + + lda #startup_banner_legacy + jsr STROUT +!: + + ldx #$05 + ldy #$00 + jsr plot_set + + lda #rom_revision_basic_string + jsr STROUT + + ldx #$05 + ldy #$12 + jsr plot_set + + jsr initmsg_bytes_free diff --git a/src/basic/init/initmsg_real.s b/src/basic/init/initmsg_real.s index 29566f4c..e297a7d7 100644 --- a/src/basic/init/initmsg_real.s +++ b/src/basic/init/initmsg_real.s @@ -1,24 +1,13 @@ // #LAYOUT# STD * #TAKE -// #LAYOUT# M65 BASIC_1 #TAKE // #LAYOUT# X16 BASIC_0 #TAKE // #LAYOUT# * * #IGNORE // Routine is too long to fit in the original location -// XXX banner-related code needs cleanup, move MEGA65 stuff to a separate file - - -#if ROM_LAYOUT_M65 - -INITMSG: - -#else initmsg_real: -#endif - // Clear the screen first, some cartridges (like IEEE-488) are leaving a mess on the screen lda #147 jsr JCHROUT @@ -117,52 +106,4 @@ initmsg_real: jmp plot_set #endif -#elif CONFIG_BANNER_BRAND && CONFIG_BRAND_MEGA_65 - - lda #startup_banner - jsr STROUT - -#if ROM_LAYOUT_M65 - - jsr M65_ISMODE65 - bcc !+ // XXX for MEGA65 native mode, display something else instead - - ldx #$02 - ldy #$21 - jsr plot_set - - lda #text_mode_64 - jsr STROUT -!: - -#endif - - ldx #$05 - ldy #$00 - jsr plot_set - - lda #rom_revision_basic_string - jsr STROUT - - ldx #$05 - ldy #$12 - jsr plot_set - - jsr initmsg_bytes_free - -#if CONFIG_SHOW_FEATURES - ldx #$08 - ldy #$00 - jsr plot_set - jmp print_features -#else - ldx #$07 - ldy #$00 - jmp plot_set -#endif - - #endif diff --git a/tools/generate_strings.cc b/tools/generate_strings.cc index 8343aa28..f7d3c989 100644 --- a/tools/generate_strings.cc +++ b/tools/generate_strings.cc @@ -1226,7 +1226,7 @@ void DataSet::generateConfigDepStrings() // List found - if (GLOBAL_ConfigOptions["CONFIG_SHOW_FEATURES"] || GLOBAL_ConfigOptions["CONFIG_BRAND_MEGA_65"]) + if (GLOBAL_ConfigOptions["CONFIG_SHOW_FEATURES"] || GLOBAL_ConfigOptions["CONFIG_MB_MEGA_65"]) { StringEntry newEntry1 = { true, true, true, true, "STR_PAL", "PAL\r" }; StringEntry newEntry2 = { true, true, true, true, "STR_NTSC", "NTSC\r" }; @@ -1241,7 +1241,7 @@ void DataSet::generateConfigDepStrings() stringEntryList.list.push_back(newEntry); } - if (GLOBAL_ConfigOptions["CONFIG_BRAND_MEGA_65"]) + if (GLOBAL_ConfigOptions["CONFIG_MB_MEGA_65"]) { StringEntry newEntry = { false, true, false, false, "STR_SI_FEATURES", featureStrM65 }; stringEntryList.list.push_back(newEntry);