From 9ae0f84ecf5c4eb8fb5078fa3aaaac92697af0f2 Mon Sep 17 00:00:00 2001 From: Ben Hetherington Date: Sun, 17 Aug 2025 20:46:02 +0100 Subject: [PATCH 1/2] Allow the boot error suppression to be configured MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, Cubeboot would always suppress error messages on boot relating to settings and the RTC. This gives the user option to leave these error messages in place, if they wish to be informed when their SRAM battery has lost power. Additionally, this patches the calls that determines if an error has occurred, rather than the resulting menu state – this allows it to use the same code path as normal, setting the menu state depending on if `bs2tick` reports that the disc cover’s open. --- cubeboot/source/main.c | 1 + cubeboot/source/settings.c | 9 +++++++++ cubeboot/source/settings.h | 1 + patches/linker/link_ntsc10.ld | 3 +++ patches/linker/link_ntsc11.ld | 3 +++ patches/linker/link_ntsc12_001.ld | 3 +++ patches/linker/link_ntsc12_101.ld | 3 +++ patches/linker/link_pal10.ld | 3 +++ patches/linker/link_pal11.ld | 3 +++ patches/linker/link_pal12.ld | 3 +++ patches/source/main.c | 20 ++++++++++++++++++++ patches/source/patch.s | 8 ++++---- 12 files changed, 56 insertions(+), 4 deletions(-) diff --git a/cubeboot/source/main.c b/cubeboot/source/main.c index 8f4ab94..8cc766b 100644 --- a/cubeboot/source/main.c +++ b/cubeboot/source/main.c @@ -302,6 +302,7 @@ int main(int argc, char **argv) { set_patch_value(symshdr, syment, symstringdata, "cube_color", settings.cube_color); set_patch_value(symshdr, syment, symstringdata, "force_progressive", settings.progressive_enabled); set_patch_value(symshdr, syment, symstringdata, "force_swiss_boot", settings.force_swiss_default); + set_patch_value(symshdr, syment, symstringdata, "suppress_boot_setup_and_rtc_errors", settings.suppress_boot_setup_and_rtc_errors); set_patch_value(symshdr, syment, symstringdata, "disable_mcp_select", settings.disable_mcp_select); set_patch_value(symshdr, syment, symstringdata, "show_watermark", settings.show_watermark); diff --git a/cubeboot/source/settings.c b/cubeboot/source/settings.c index b315092..da0b107 100644 --- a/cubeboot/source/settings.c +++ b/cubeboot/source/settings.c @@ -131,6 +131,15 @@ void load_settings() { settings.disable_mcp_select = disable_mcp_select; } + // suppress_boot_setuo_and_rtc_errors + int suppress_boot_setup_and_rtc_errors = 1; + if (!ini_sget(conf, "cubeboot", "suppress_boot_setup_and_rtc_errors", "%d", &suppress_boot_setup_and_rtc_errors)) { + settings.suppress_boot_setup_and_rtc_errors = 1; + } else { + iprintf("Found suppress_boot_setup_and_rtc_errors = %d\n", suppress_boot_setup_and_rtc_errors); + settings.suppress_boot_setup_and_rtc_errors = suppress_boot_setup_and_rtc_errors; + } + // button presses for (int i = 0; i < (sizeof(buttons_names) / sizeof(char *)); i++) { char *button_name = buttons_names[i]; diff --git a/cubeboot/source/settings.h b/cubeboot/source/settings.h index 6f6bc6c..225d4f7 100644 --- a/cubeboot/source/settings.h +++ b/cubeboot/source/settings.h @@ -11,6 +11,7 @@ typedef struct settings { u32 progressive_enabled; u32 preboot_delay_ms; u32 postboot_delay_ms; + u32 suppress_boot_setup_and_rtc_errors; char *default_program; char *boot_buttons[MAX_BUTTONS]; } settings_t; diff --git a/patches/linker/link_ntsc10.ld b/patches/linker/link_ntsc10.ld index d054458..a7815a6 100644 --- a/patches/linker/link_ntsc10.ld +++ b/patches/linker/link_ntsc10.ld @@ -104,3 +104,6 @@ ntsc10_EXIDeselect = 0x81335838; ntsc10_EXISync = 0x81335134; ntsc10_EXIImm = 0x81334d4c; ntsc10_EXIImmEx = 0x81334fa8; + +ntsc10_boot_setup_check = 0x813022b8; +ntsc10_boot_rtc_check = 0x813022b0; diff --git a/patches/linker/link_ntsc11.ld b/patches/linker/link_ntsc11.ld index f4c171b..7408338 100644 --- a/patches/linker/link_ntsc11.ld +++ b/patches/linker/link_ntsc11.ld @@ -104,3 +104,6 @@ ntsc11_EXIDeselect = 0x8135b298; ntsc11_EXISync = 0x8135ab5c; ntsc11_EXIImm = 0x8135a774; ntsc11_EXIImmEx = 0x8135a9d0; + +ntsc11_boot_setup_check = 0x813020c0; +ntsc11_boot_rtc_check = 0x813020b8; diff --git a/patches/linker/link_ntsc12_001.ld b/patches/linker/link_ntsc12_001.ld index 0114570..1fefc5d 100644 --- a/patches/linker/link_ntsc12_001.ld +++ b/patches/linker/link_ntsc12_001.ld @@ -99,3 +99,6 @@ ntsc12_001_EXIDeselect = 0x81364790; ntsc12_001_EXISync = 0x81363f4c; ntsc12_001_EXIImm = 0x81363b64; ntsc12_001_EXIImmEx = 0x81363dc0; + +ntsc12_001_boot_setup_check = 0x81302474; +ntsc12_001_boot_rtc_check = 0x8130246c; diff --git a/patches/linker/link_ntsc12_101.ld b/patches/linker/link_ntsc12_101.ld index 2161f9d..6c00baa 100644 --- a/patches/linker/link_ntsc12_101.ld +++ b/patches/linker/link_ntsc12_101.ld @@ -99,3 +99,6 @@ ntsc12_101_EXIDeselect = 0x813648f4; ntsc12_101_EXISync = 0x813640b0; ntsc12_101_EXIImm = 0x81363cc8; ntsc12_101_EXIImmEx = 0x81363f24; + +ntsc12_101_boot_setup_check = 0x8130248c; +ntsc12_101_boot_rtc_check = 0x81302484; diff --git a/patches/linker/link_pal10.ld b/patches/linker/link_pal10.ld index 76ec3d7..d15911e 100644 --- a/patches/linker/link_pal10.ld +++ b/patches/linker/link_pal10.ld @@ -101,3 +101,6 @@ pal10_EXIDeselect = 0x8135e878; pal10_EXISync = 0x8135e13c; pal10_EXIImm = 0x8135dd54; pal10_EXIImmEx = 0x8135dfb0; + +pal10_boot_setup_check = 0x813020c0; +pal10_boot_rtc_check = 0x813020b8; diff --git a/patches/linker/link_pal11.ld b/patches/linker/link_pal11.ld index 5a070fb..4407c86 100644 --- a/patches/linker/link_pal11.ld +++ b/patches/linker/link_pal11.ld @@ -99,3 +99,6 @@ pal11_EXIDeselect = 0x8135b1b8; pal11_EXISync = 0x8135aa7c; pal11_EXIImm = 0x8135a694; pal11_EXIImmEx = 0x8135a8f0; + +pal11_boot_setup_check = 0x813020c0; +pal11_boot_rtc_check = 0x813020b8; diff --git a/patches/linker/link_pal12.ld b/patches/linker/link_pal12.ld index 9e4985d..d82bf16 100644 --- a/patches/linker/link_pal12.ld +++ b/patches/linker/link_pal12.ld @@ -100,3 +100,6 @@ pal12_EXIDeselect = 0x81367c6c; pal12_EXISync = 0x81367428; pal12_EXIImm = 0x81367040; pal12_EXIImmEx = 0x8136729c; + +pal12_boot_setup_check = 0x81302240; +pal12_boot_rtc_check = 0x81302238; diff --git a/patches/source/main.c b/patches/source/main.c index 96bfe84..ae8913b 100644 --- a/patches/source/main.c +++ b/patches/source/main.c @@ -47,6 +47,7 @@ __attribute_data__ static u8 *cube_text_tex = NULL; __attribute_data__ char cube_logo_path[MAX_FILE_NAME] = {0}; __attribute_data__ u32 force_progressive = 0; __attribute_data__ u32 force_swiss_boot = 0; +__attribute_data__ u32 suppress_boot_setup_and_rtc_errors = 1; // used if we are switching to 60Hz on a PAL IPL __attribute_data__ static int fix_pal_ntsc = 0; @@ -83,6 +84,9 @@ __attribute_data__ static GXColorS10 color_bg_outer_1; __attribute_data__ gm_file_entry_t boot_entry; __attribute_data__ gm_file_entry_t second_boot_entry; +__attribute_reloc__ u32 (*boot_setup_check)(); +__attribute_reloc__ u32 (*boot_rtc_check)(); + __attribute_used__ void mod_cube_colors() { if (cube_color == 0) { OSReport("Using default colors\n"); @@ -358,6 +362,22 @@ __attribute_used__ void pre_thread_init() { } } +__attribute_used__ s32 patch_boot_setup_check() { + if (suppress_boot_setup_and_rtc_errors) { + return 0; + } + + return boot_setup_check(); +} + +__attribute_used__ s32 patch_boot_rtc_check() { + if (suppress_boot_setup_and_rtc_errors) { + return 0; + } + + return boot_rtc_check(); +} + __attribute_used__ void pre_menu_init(int unk) { menu_init(unk); diff --git a/patches/source/patch.s b/patches/source/patch.s index 22d128f..1f71acc 100644 --- a/patches/source/patch.s +++ b/patches/source/patch.s @@ -85,11 +85,11 @@ patch_inst_pal "_gameselect_draw_helper" 0x81327e04 0x8132735c 0x81327f44 routin patch_inst_ntsc "_force_valid_encoding" 0x81345130 0x8136cdd4 0x8135a3e8 0x8135a3e8 routine_load_r0_r3_val1 patch_inst_pal "_force_valid_encoding" 0x813703b4 0x8136ccf4 0x8135d768 routine_load_r0_r3_val1 -patch_inst_ntsc "_ignore_boot_error_setup" 0x8130bad8 0x8130bcd8 0x8130c04c 0x8130c064 li r0, 0x3 -patch_inst_pal "_ignore_boot_error_setup" 0x8130bf30 0x8130bc04 0x8130c070 li r0, 0x3 +patch_inst_ntsc "_ignore_boot_error_setup" 0x8130bacc 0x8130bccc 0x8130c040 0x8130c058 bl patch_boot_setup_check +patch_inst_pal "_ignore_boot_error_setup" 0x8130bf24 0x8130bbf8 0x8130c064 bl patch_boot_setup_check -patch_inst_ntsc "_ignore_boot_error_rtc" 0x8130bac0 0x8130bcc0 0x8130c034 0x8130c04c li r0, 0x3 -patch_inst_pal "_ignore_boot_error_rtc" 0x8130bf18 0x8130bbec 0x8130c058 li r0, 0x3 +patch_inst_ntsc "_ignore_boot_error_rtc" 0x8130bab4 0x8130bcb4 0x8130c028 0x8130c040 bl patch_boot_rtc_check +patch_inst_pal "_ignore_boot_error_rtc" 0x8130bf0c 0x8130bbe0 0x8130c04c bl patch_boot_rtc_check patch_inst_ntsc "_stub_dvdwait" 0x00000000 0x8130108c 0x81301440 0x81301444 nop patch_inst_pal "_stub_dvdwait" 0x8130108c 0x8130108c 0x813011f8 nop From 28fc6cbccc44f6165ee63f03ce5e854b08182446 Mon Sep 17 00:00:00 2001 From: Ben Hetherington Date: Fri, 29 May 2026 22:40:46 +0100 Subject: [PATCH 2/2] Rename .ini setting to `suppress_rtc_errors` This seems like a more concise description of what the setting is, compared to the previous `suppress_boot_setup_and_rtc_errors`. --- cubeboot/source/main.c | 2 +- cubeboot/source/settings.c | 12 ++++++------ cubeboot/source/settings.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cubeboot/source/main.c b/cubeboot/source/main.c index aec8c4d..00f32a4 100644 --- a/cubeboot/source/main.c +++ b/cubeboot/source/main.c @@ -303,7 +303,7 @@ int main(int argc, char **argv) { set_patch_value(symshdr, syment, symstringdata, "force_progressive", settings.progressive_enabled); set_patch_value(symshdr, syment, symstringdata, "force_widescreen", settings.force_widescreen); set_patch_value(symshdr, syment, symstringdata, "force_swiss_boot", settings.force_swiss_default); - set_patch_value(symshdr, syment, symstringdata, "suppress_boot_setup_and_rtc_errors", settings.suppress_boot_setup_and_rtc_errors); + set_patch_value(symshdr, syment, symstringdata, "suppress_boot_setup_and_rtc_errors", settings.suppress_rtc_errors); set_patch_value(symshdr, syment, symstringdata, "disable_mcp_select", settings.disable_mcp_select); set_patch_value(symshdr, syment, symstringdata, "show_watermark", settings.show_watermark); diff --git a/cubeboot/source/settings.c b/cubeboot/source/settings.c index 96e2fee..2c5bb56 100644 --- a/cubeboot/source/settings.c +++ b/cubeboot/source/settings.c @@ -140,13 +140,13 @@ void load_settings() { settings.disable_mcp_select = disable_mcp_select; } - // suppress_boot_setuo_and_rtc_errors - int suppress_boot_setup_and_rtc_errors = 1; - if (!ini_sget(conf, "cubeboot", "suppress_boot_setup_and_rtc_errors", "%d", &suppress_boot_setup_and_rtc_errors)) { - settings.suppress_boot_setup_and_rtc_errors = 1; + // suppress_rtc_errors + int suppress_rtc_errors = 1; + if (!ini_sget(conf, "cubeboot", "suppress_rtc_errors", "%d", &suppress_rtc_errors)) { + settings.suppress_rtc_errors = 1; } else { - iprintf("Found suppress_boot_setup_and_rtc_errors = %d\n", suppress_boot_setup_and_rtc_errors); - settings.suppress_boot_setup_and_rtc_errors = suppress_boot_setup_and_rtc_errors; + iprintf("Found suppress_boot_setup_and_rtc_errors = %d\n", suppress_rtc_errors); + settings.suppress_rtc_errors = suppress_rtc_errors; } // button presses diff --git a/cubeboot/source/settings.h b/cubeboot/source/settings.h index 9ea6d67..6b251e2 100644 --- a/cubeboot/source/settings.h +++ b/cubeboot/source/settings.h @@ -13,7 +13,7 @@ typedef struct settings { u32 force_widescreen; u32 preboot_delay_ms; u32 postboot_delay_ms; - u32 suppress_boot_setup_and_rtc_errors; + u32 suppress_rtc_errors; char *default_program; char *boot_buttons[MAX_BUTTONS]; menu_grid_type_t menu_grid_type;