diff --git a/code/include/rnd/settings.h b/code/include/rnd/settings.h index 518498a..cdb98a7 100644 --- a/code/include/rnd/settings.h +++ b/code/include/rnd/settings.h @@ -418,6 +418,7 @@ namespace rnd { u8 enableFastArrowSwap; u8 twinmoldRestoration; u8 enableNoAnimationTransform; + u8 enableBomberAnimationSkipping; // Cutscene Skips u8 skipHMSCutscenes; diff --git a/code/mm.ld b/code/mm.ld index 8ae3362..95dcdfa 100644 --- a/code/mm.ld +++ b/code/mm.ld @@ -148,6 +148,10 @@ SECTIONS{ *(.patch_OverrideBomberTextID) } + .patch_DisableBomberNotebookAnimations 0x1D2860 : { + *(.patch_DisableBomberNotebookAnimations) + } + .patch_ISGCrouchStabOne 0x1D32E0 : { *(.patch_ISGCrouchStabOne) } diff --git a/code/source/asm/hooks.s b/code/source/asm/hooks.s index 3da4fc3..9c0fe67 100644 --- a/code/source/asm/hooks.s +++ b/code/source/asm/hooks.s @@ -176,6 +176,19 @@ noBomberOverride: cmp r1,r0 b 0x1D2768 +.global hook_DisableBomberNotebookAnimations +hook_DisableBomberNotebookAnimations: + push {r0-r12, lr} @ Push all registers so we don't interfere with base game. + bl SettingsBomberAnimationCheck @ Check our custom setting defined in settings.cpp + cmp r0, #0x1 @ make the compare for the setting, persists over pushes and pops. + pop {r0-r12, lr} @ pop game registers as we're done making any possible changes. + bne noBomberAnimationOverride @ If disabled, go to noBomberAnimationOverride + tst r1,r3 @ Original cmp instruction in case it's needed later. + b 0x1D29CC @ thanks Crispy_Baldy :) +noBomberAnimationOverride: + tst r1,r3 @ Restore original compare + bx lr @ Branch out of custom game code back to regular game code. Note that the patches.s files calls a BL so we can bx lr. + .global hook_EnteringLocation hook_EnteringLocation: push {r0-r12, lr} diff --git a/code/source/asm/patches.s b/code/source/asm/patches.s index c49a034..380adcd 100644 --- a/code/source/asm/patches.s +++ b/code/source/asm/patches.s @@ -182,6 +182,11 @@ patch_RemoveMysteryMilkFlagCheck: OverrideBomberTextID_patch: b hook_OverrideBomberTextID +.section .patch_DisableBomberNotebookAnimations +.global patch_DisableBomberNotebookAnimations +patch_DisableBomberNotebookAnimations: + bl hook_DisableBomberNotebookAnimations + .section .patch_EnteringLocation .global patch_EnteringLocation patch_EnteringLocation: diff --git a/code/source/rnd/savefile.cpp b/code/source/rnd/savefile.cpp index 7175c68..b92e5b4 100644 --- a/code/source/rnd/savefile.cpp +++ b/code/source/rnd/savefile.cpp @@ -157,6 +157,7 @@ namespace rnd { #ifdef ENABLE_DEBUG gSettingsContext.startingKokiriSword = 3; gSettingsContext.startingShield = 0; + saveData.inventory.collect_register.bombers_notebook = 1; #endif SaveFile_SetStartingInventory(); diff --git a/code/source/rnd/settings.cpp b/code/source/rnd/settings.cpp index 5e76b20..fbefccb 100644 --- a/code/source/rnd/settings.cpp +++ b/code/source/rnd/settings.cpp @@ -123,6 +123,9 @@ namespace rnd { u8 SettingsNoAnimationCheck() { return gSettingsContext.enableNoAnimationTransform; } + u8 SettingsBomberAnimationCheck() { + return gSettingsContext.enableBomberAnimationSkipping; + } } // TODO: Change the addr /* typedef void (*Health_ChangeBy_proc)(GlobalContext *arg1, u32 arg2);