diff --git a/cubeboot/source/main.c b/cubeboot/source/main.c index f8d5e9d..00f32a4 100644 --- a/cubeboot/source/main.c +++ b/cubeboot/source/main.c @@ -303,6 +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_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 f3e976d..2c5bb56 100644 --- a/cubeboot/source/settings.c +++ b/cubeboot/source/settings.c @@ -140,6 +140,15 @@ void load_settings() { settings.disable_mcp_select = disable_mcp_select; } + // 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_rtc_errors); + settings.suppress_rtc_errors = suppress_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 d07ceef..6b251e2 100644 --- a/cubeboot/source/settings.h +++ b/cubeboot/source/settings.h @@ -13,6 +13,7 @@ typedef struct settings { u32 force_widescreen; u32 preboot_delay_ms; u32 postboot_delay_ms; + u32 suppress_rtc_errors; char *default_program; char *boot_buttons[MAX_BUTTONS]; menu_grid_type_t menu_grid_type; diff --git a/patches/linker/link_ntsc10.ld b/patches/linker/link_ntsc10.ld index a2970d6..272afa7 100644 --- a/patches/linker/link_ntsc10.ld +++ b/patches/linker/link_ntsc10.ld @@ -107,3 +107,6 @@ ntsc10_EXIImm = 0x81334d4c; ntsc10_EXIImmEx = 0x81334fa8; ntsc10_is_key_repeat = 0x81302ef8; + +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 59f44ae..e123b75 100644 --- a/patches/linker/link_ntsc11.ld +++ b/patches/linker/link_ntsc11.ld @@ -107,3 +107,6 @@ ntsc11_EXIImm = 0x8135a774; ntsc11_EXIImmEx = 0x8135a9d0; ntsc11_is_key_repeat = 0x81302de0; + +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 1df5c56..d25c4bf 100644 --- a/patches/linker/link_ntsc12_001.ld +++ b/patches/linker/link_ntsc12_001.ld @@ -102,3 +102,6 @@ ntsc12_001_EXIImm = 0x81363b64; ntsc12_001_EXIImmEx = 0x81363dc0; ntsc12_001_is_key_repeat = 0x8130317c; + +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 c6941af..58f67c0 100644 --- a/patches/linker/link_ntsc12_101.ld +++ b/patches/linker/link_ntsc12_101.ld @@ -102,3 +102,6 @@ ntsc12_101_EXIImm = 0x81363cc8; ntsc12_101_EXIImmEx = 0x81363f24; ntsc12_101_is_key_repeat = 0x81303194; + +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 66490a0..5460246 100644 --- a/patches/linker/link_pal10.ld +++ b/patches/linker/link_pal10.ld @@ -104,3 +104,6 @@ pal10_EXIImm = 0x8135dd54; pal10_EXIImmEx = 0x8135dfb0; pal10_is_key_repeat = 0x81302de0; + +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 7dff048..f8fc8fd 100644 --- a/patches/linker/link_pal11.ld +++ b/patches/linker/link_pal11.ld @@ -102,3 +102,6 @@ pal11_EXIImm = 0x8135a694; pal11_EXIImmEx = 0x8135a8f0; pal11_is_key_repeat = 0x81302de0; + +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 a8a297b..efd4aa4 100644 --- a/patches/linker/link_pal12.ld +++ b/patches/linker/link_pal12.ld @@ -103,3 +103,6 @@ pal12_EXIImm = 0x81367040; pal12_EXIImmEx = 0x8136729c; pal12_is_key_repeat = 0x81302f48; + +pal12_boot_setup_check = 0x81302240; +pal12_boot_rtc_check = 0x81302238; diff --git a/patches/source/main.c b/patches/source/main.c index f2d68fb..3009973 100644 --- a/patches/source/main.c +++ b/patches/source/main.c @@ -48,6 +48,7 @@ __attribute_data__ char cube_logo_path[MAX_FILE_NAME] = {0}; __attribute_data__ u32 force_progressive = 0; __attribute_data__ u32 force_widescreen = 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; @@ -101,6 +102,9 @@ typedef struct { __attribute_reloc__ projection_parameters_t *projection_parameters; +__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"); @@ -376,6 +380,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