Skip to content

Commit

Permalink
Include setting for skipping bombers notebook animations.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhlexPlexico committed May 30, 2024
1 parent cfe9b2c commit cda9510
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/include/rnd/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ namespace rnd {
u8 enableFastArrowSwap;
u8 twinmoldRestoration;
u8 enableNoAnimationTransform;
u8 enableBomberAnimationSkipping;

// Cutscene Skips
u8 skipHMSCutscenes;
Expand Down
4 changes: 4 additions & 0 deletions code/mm.ld
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ SECTIONS{
*(.patch_OverrideBomberTextID)
}

.patch_DisableBomberNotebookAnimations 0x1D2860 : {
*(.patch_DisableBomberNotebookAnimations)
}

.patch_ISGCrouchStabOne 0x1D32E0 : {
*(.patch_ISGCrouchStabOne)
}
Expand Down
13 changes: 13 additions & 0 deletions code/source/asm/hooks.s
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 5 additions & 0 deletions code/source/asm/patches.s
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions code/source/rnd/savefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 3 additions & 0 deletions code/source/rnd/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cda9510

Please sign in to comment.