From d94ec12812f138e89e08232e74381e1acd803f6a Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Sat, 31 Jul 2021 11:49:26 +0300 Subject: [PATCH] Add option for making the crash screen appear automatically --- generated/dol_symbol_table/1.00.txt | 1 + generated/dol_symbol_table/1.02.txt | 1 + generated/dol_symbol_table/pal.txt | 1 + src/patch_config.rs | 7 +++++++ src/patches.rs | 7 +++++++ 5 files changed, 17 insertions(+) diff --git a/generated/dol_symbol_table/1.00.txt b/generated/dol_symbol_table/1.00.txt index 935ccbe0..68d31286 100644 --- a/generated/dol_symbol_table/1.00.txt +++ b/generated/dol_symbol_table/1.00.txt @@ -14337,3 +14337,4 @@ 0x805a8c34 g_MainStringTable 0x805a8c40 g_GameState 0x805aa82c g_EtankCapacity +0x802d6a44 CrashScreenControllerPollBranch \ No newline at end of file diff --git a/generated/dol_symbol_table/1.02.txt b/generated/dol_symbol_table/1.02.txt index ae7faa3b..449e5f3b 100644 --- a/generated/dol_symbol_table/1.02.txt +++ b/generated/dol_symbol_table/1.02.txt @@ -6995,3 +6995,4 @@ 0x805a9cd4 g_MainStringTable 0x805a9ce0 g_GameState 0x805ab8ec g_EtankCapacity +0x802d7494 CrashScreenControllerPollBranch diff --git a/generated/dol_symbol_table/pal.txt b/generated/dol_symbol_table/pal.txt index 020a70e9..c6002940 100644 --- a/generated/dol_symbol_table/pal.txt +++ b/generated/dol_symbol_table/pal.txt @@ -2762,3 +2762,4 @@ 0x8046ad38 g_MainStringTable 0x8046ad44 g_GameState 0x8046c99c g_EtankCapacity +0x802c2558 CrashScreenControllerPollBranch diff --git a/src/patch_config.rs b/src/patch_config.rs index 687c56fe..bfbbf6dc 100644 --- a/src/patch_config.rs +++ b/src/patch_config.rs @@ -138,6 +138,7 @@ pub struct PatchConfig pub skip_hudmenus: bool, pub keep_fmvs: bool, pub obfuscate_items: bool, + pub automatic_crash_screen: bool, pub etank_capacity: u32, pub nonvaria_heat_damage: bool, pub heat_damage_per_sec: f32, @@ -215,6 +216,7 @@ struct Preferences obfuscate_items: Option, map_default_state: Option, artifact_hint_behavior: Option, + automatic_crash_screen: Option, trilogy_disc_path: Option, keep_fmvs: Option, quickplay: Option, @@ -308,6 +310,9 @@ impl PatchConfig .arg(Arg::with_name("skip hudmenus") .long("non-modal-item-messages") .help("Display a non-modal message when an item is is acquired")) + .arg(Arg::with_name("automatic crash screen") + .long("automatic-crash-screen") + .help("Makes the crash screen appear without any button combination required")) .arg(Arg::with_name("etank capacity") .long("etank-capacity") .help("Set the etank capacity and base health") @@ -411,6 +416,7 @@ impl PatchConfig populate_config_bool!(matches; "skip hudmenus" => patch_config.preferences.skip_hudmenus, "obfuscate items" => patch_config.preferences.obfuscate_items, + "automatic crash screen" => patch_config.preferences.automatic_crash_screen, "keep attract mode" => patch_config.preferences.keep_fmvs, "quickplay" => patch_config.preferences.quickplay, "quiet" => patch_config.preferences.quiet, @@ -560,6 +566,7 @@ impl PatchConfigPrivate skip_hudmenus: self.preferences.skip_hudmenus.unwrap_or(true), obfuscate_items: self.preferences.obfuscate_items.unwrap_or(false), + automatic_crash_screen: self.preferences.automatic_crash_screen.unwrap_or(false), artifact_hint_behavior, flaahgra_music_files, keep_fmvs: self.preferences.keep_fmvs.unwrap_or(false), diff --git a/src/patches.rs b/src/patches.rs index cb822037..cdeb7731 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -2314,6 +2314,13 @@ fn patch_dol<'r>( // }); // dol_patcher.ppcasm_patch(&ball_color_patch)?; + if config.automatic_crash_screen { + let automatic_crash_patch = ppcasm!(symbol_addr!("CrashScreenControllerPollBranch", version), { + nop; + }); + dol_patcher.ppcasm_patch(&automatic_crash_patch)?; + } + let cinematic_skip_patch = ppcasm!(symbol_addr!("ShouldSkipCinematic__22CScriptSpecialFunctionFR13CStateManager", version), { li r3, 0x1; blr;