diff --git a/CONFIG.md b/CONFIG.md index dc56c121..b1bee070 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -223,11 +223,17 @@ Select startup banner - either a simple one, or with some colorful elements. `CO Richer banners need more BASIC segment, varies between brands. +### `CONFIG_SHOW_FEATURES` + +If enabled, shows the most important compiled-in features on the startup screen. + +It is recommended to keep it enabled for informational purposes. + ### `CONFIG_BANNER_PAL_NTSC` If enabled, prints video system on startup banner. Eye candy only. -Feature needs some bytes in BASIC (depending on banner type) and about 25 bytes in KERNAL segment. +Feature needs few bytes in BASIC and about 25 bytes in KERNAL segment. ## Debug options diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index a860d7b5..6e208cbf 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -115,6 +115,7 @@ // #define CONFIG_BANNER_SIMPLE #define CONFIG_BANNER_FANCY // #define CONFIG_BANNER_BRAND +#define CONFIG_SHOW_FEATURES #define CONFIG_SHOW_PAL_NTSC diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index 07e095b3..e416562c 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -117,6 +117,7 @@ // #define CONFIG_BANNER_SIMPLE // #define CONFIG_BANNER_FANCY #define CONFIG_BANNER_BRAND +#define CONFIG_SHOW_FEATURES // #define CONFIG_SHOW_PAL_NTSC diff --git a/c64/,,config_testing.s b/c64/,,config_testing.s index b3180033..92e982eb 100644 --- a/c64/,,config_testing.s +++ b/c64/,,config_testing.s @@ -113,10 +113,11 @@ // Eye candy // #define CONFIG_COLORS_BRAND -// #define CONFIG_BANNER_SIMPLE -#define CONFIG_BANNER_FANCY +#define CONFIG_BANNER_SIMPLE +// #define CONFIG_BANNER_FANCY // #define CONFIG_BANNER_BRAND -// #define CONFIG_SHOW_PAL_NTSC +#define CONFIG_SHOW_FEATURES +#define CONFIG_SHOW_PAL_NTSC // Debug options diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index c10abe2f..2b80c95e 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -115,6 +115,7 @@ // #define CONFIG_BANNER_SIMPLE #define CONFIG_BANNER_FANCY // #define CONFIG_BANNER_BRAND +#define CONFIG_SHOW_FEATURES #define CONFIG_SHOW_PAL_NTSC diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s index 23f5d173..2725bc9e 100644 --- a/c64/aliases/,aliases_config.s +++ b/c64/aliases/,aliases_config.s @@ -3,6 +3,8 @@ // Various configuration dependent aliases/macros/checks // +.encoding "petscii_upper" + // Check that platform configuration is correct @@ -146,8 +148,8 @@ .error "CONFIG_BANNER_BRAND is not supported for your CONFIG_BRAND_*" #endif -#if CONFIG_BANNER_BRAND && CONFIG_BRAND_MEGA_65 && CONFIG_SHOW_PAL_NTSC - .error "MEGA65 brand banner does not support showing PAL/NTSC" +#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" #endif } @@ -261,3 +263,68 @@ STUB_IMPLEMENTATION_RTS() #endif } + + +// Function for printing out build features + +.var feature_new_line = false + +.function ADD_FEATURE(current_features, new_feature) +{ + .var features_str = current_features + + .if (!feature_new_line && features_str.size() > 0) + { + .eval features_str = features_str + ", " + } + + .if (feature_new_line) + { + .eval feature_new_line = false + .eval features_str = features_str + @"\r" + } + + .return features_str + new_feature +} + +.function BUILD_FEATURES_STR() +{ + .var features_str = "" + +#if CONFIG_TAPE_NORMAL + .eval features_str = ADD_FEATURE(features_str, "TAPE NORMAL") +#elif CONFIG_TAPE_TURBO + .eval features_str = ADD_FEATURE(features_str, "TAPE TURBO") +#elif CONFIG_TAPE_NORMAL && CONFIG_TAPE_TURBO + .eval features_str = ADD_FEATURE(features_str, "TAPE NORMAL+TURBO") +#endif + + .eval feature_new_line = true + +#if CONFIG_IEC + .eval features_str = ADD_FEATURE(features_str, "IEC") +#endif +#if CONFIG_IEC_JIFFYDOS + .eval features_str = ADD_FEATURE(features_str, "JIFFY") +#endif + + .eval feature_new_line = true + +#if CONFIG_RS232_UP2400 + .eval features_str = ADD_FEATURE(features_str, "UP2400") +#endif + +#if CONFIG_RS232_UP2400 + .eval features_str = ADD_FEATURE(features_str, "UP9600") +#endif + +#if CONFIG_KEYBOARD_C128 + .eval features_str = ADD_FEATURE(features_str, "KBD 128") +#endif + +#if CONFIG_KEYBOARD_C65 + .eval features_str = ADD_FEATURE(features_str, "KBD 65") +#endif + + .return features_str +} diff --git a/c64/basic/,imports.s b/c64/basic/,imports.s index bc90a4cd..525459f4 100644 --- a/c64/basic/,imports.s +++ b/c64/basic/,imports.s @@ -19,6 +19,10 @@ .label print_return = KERNAL.print_return .label print_space = KERNAL.print_space +#if CONFIG_SHOW_FEATURES +.label print_features = KERNAL.print_features +#endif + #if CONFIG_SHOW_PAL_NTSC .label print_pal_ntsc = KERNAL.print_pal_ntsc #endif diff --git a/c64/basic/init/initmsg_real.s b/c64/basic/init/initmsg_real.s index bd9494c5..ffe6c2b9 100644 --- a/c64/basic/init/initmsg_real.s +++ b/c64/basic/init/initmsg_real.s @@ -11,7 +11,7 @@ initmsg_real: jsr STROUT ldx #$02 - ldy #$02 + ldy #$04 jsr plot_set lda #rom_revision_basic_string jsr STROUT - ldx #$05 - ldy #$00 + ldx #$04 + ldy #$0A jsr plot_set -#if CONFIG_SHOW_PAL_NTSC - jsr print_pal_ntsc -#endif - jsr initmsg_bytes_free - ldx #$07 + ldx #$05 ldy #$00 +#if CONFIG_SHOW_PAL_NTSC && CONFIG_SHOW_FEATURES + jsr plot_set + jsr print_features + jmp print_pal_ntsc +#elif CONFIG_SHOW_PAL_NTSC + jsr plot_set + jmp print_pal_ntsc +#elif CONFIG_SHOW_FEATURES + jsr plot_set + jmp print_features +#else jmp plot_set +#endif #elif CONFIG_BANNER_BRAND && CONFIG_BRAND_MEGA_65 @@ -88,8 +104,17 @@ initmsg_real: jsr initmsg_bytes_free +#if CONFIG_SHOW_FEATURES + ldx #$04 + ldy #$00 + jsr plot_set + jsr print_features + jmp print_return +#else ldx #$05 ldy #$00 jmp plot_set +#endif + #endif diff --git a/c64/basic/init/startup_banner.s b/c64/basic/init/startup_banner.s index 6c3aaf37..8736df64 100644 --- a/c64/basic/init/startup_banner.s +++ b/c64/basic/init/startup_banner.s @@ -24,7 +24,7 @@ startup_banner: #if CONFIG_BANNER_SIMPLE - .text " " + .text " " BANNER_TEXT() .byte $00 diff --git a/c64/kernal/assets/kernal_messages.s b/c64/kernal/assets/kernal_messages.s index eb9723d9..91d2ab11 100644 --- a/c64/kernal/assets/kernal_messages.s +++ b/c64/kernal/assets/kernal_messages.s @@ -25,6 +25,9 @@ .label __MSG_KERNAL_PANIC_ROM_MISMATCH = __msg_kernalpanic_rom_mismatch - __msg_kernal_first #endif +#if CONFIG_SHOW_FEATURES +.label __MSG_KERNAL_FEATURES = __msg_kernalfeatures - __msg_kernal_first +#endif __msg_kernal_first: @@ -59,12 +62,14 @@ __msg_kernalto_hex: #if CONFIG_SHOW_PAL_NTSC __msg_kernalpal: - .text "PAL," - .byte $80 + $20 // end of string mark + space + .text "PAL" + .byte $0D + .byte $80 + $0D // end of string mark + return __msg_kernalntsc: - .text "NTSC," - .byte $80 + $20 // end of string mark + space + .text "NTSC" + .byte $0D + .byte $80 + $0D // end of string mark + return #endif // CONFIG_SHOW_PAL_NTSC @@ -79,3 +84,11 @@ __msg_kernalpanic_rom_mismatch: .byte $80 + $48 // end of string mark + 'H' #endif // CONFIG_PANIC_SCREEN + +#if CONFIG_SHOW_FEATURES + +__msg_kernalfeatures: + .text BUILD_FEATURES_STR() + .byte $80 + $0D // end of string mark + return + +#endif // CONFIG_SHOW_FEATURES diff --git a/c64/kernal/iec/iec_jiffydos.s b/c64/kernal/iec/iec_jiffydos.s index db093cdf..a17ff764 100644 --- a/c64/kernal/iec/iec_jiffydos.s +++ b/c64/kernal/iec/iec_jiffydos.s @@ -72,10 +72,10 @@ jiffydos_restore_sprites: .function SAME_PAGE_CHECK(label_1, label_2) { -#if !PASS_SIZETEST - return (label_1 - label_1 % 256) == (label_2 - label_2 % 256) +#if PASS_SIZETEST + .return (label_1 - label_1 % 256) == (label_2 - label_2 % 256) #else - return true + .return true #endif } diff --git a/c64/kernal/print/print_features.s b/c64/kernal/print/print_features.s new file mode 100644 index 00000000..8c958a53 --- /dev/null +++ b/c64/kernal/print/print_features.s @@ -0,0 +1,14 @@ + +// +// Print configured features on startup banner +// + +#if CONFIG_SHOW_FEATURES + +print_features: + + ldx #__MSG_KERNAL_FEATURES +!: + jmp print_kernal_message + +#endif // CONFIG_SHOW_FEATURES