Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/include/rnd/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ namespace rnd {
extern "C" SettingsContext gSettingsContext;
extern const char hashIconNames[62][25];

s32 Settings_ApplyDamageMultiplier(game::GlobalContext*, s32);
extern "C" s32 Settings_ApplyDamageMultiplier(game::GlobalContext*, s32);
u32 Hash(u32);
u8 Bias(u32);
} // namespace rnd
Expand Down
20 changes: 12 additions & 8 deletions code/mm.ld
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ SECTIONS{
*(.patch_OverrideItemIdIndex)
}

.patch_ApplyDamageMultiplier 0x21E528 : {
*(.patch_ApplyDamageMultiplier)
}

.patch_ChangeTriggerAandRToA 0x220EFC : {
*(.patch_ChangeTriggerAandRToA)
}
Expand Down Expand Up @@ -301,6 +305,14 @@ SECTIONS{
*(.patch_RemoveSkulltulaTokenGetItem)
} */

.patch_OverrideTextID 0x2310FC : {
*(.patch_OverrideTextID)
}

.patch_OverrideItemID 0x231108 : {
*(.patch_OverrideItemID)
}

.patch_ForceSwordUpgradeOnHuman 0x233D88 : {
*(.patch_ForceSwordUpgradeOnHuman)
}
Expand All @@ -325,14 +337,6 @@ SECTIONS{
*(.patch_RemoveRazordSwordHealthThree)
}

.patch_OverrideTextID 0x2310FC : {
*(.patch_OverrideTextID)
}

.patch_OverrideItemID 0x231108 : {
*(.patch_OverrideItemID)
}

.patch_RemoveAddingSkulltulaTokenIfOverridden 0x23975C : {
*(.patch_RemoveAddingSkulltulaTokenIfOverridden)
}
Expand Down
11 changes: 11 additions & 0 deletions code/source/asm/player_hooks.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.arm
.text

.global hook_ApplyDamageMultiplier
hook_ApplyDamageMultiplier:
push {r0, r2-r12, lr}
bl Settings_ApplyDamageMultiplier @ Found in settings.cpp
cpy r1,r0
pop {r0, r2-r12, lr}
subs r4,r1,#0x0
bx lr
6 changes: 6 additions & 0 deletions code/source/asm/player_patches.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.arm

.section .patch_ApplyDamageMultiplier
.global patch_ApplyDamageMultiplier
patch_ApplyDamageMultiplier:
bl hook_ApplyDamageMultiplier
6 changes: 4 additions & 2 deletions code/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ namespace rnd {
// const u32 newButtons = gctx->pad_state.input.new_buttons.flags;
#if defined ENABLE_DEBUG || defined DEBUG_PRINT
if (pressedButtons == (u32)game::pad::Button::ZR) {
auto& inventory = game::GetCommonData().save.inventory;
inventory.items[0] = game::ItemId::None;
auto* player = gctx->GetPlayerActor();
if (player) {
player->damage = 4;
}
} else if (pressedButtons == (u32)game::pad::Button::ZL) {
auto& inventory = game::GetCommonData().save.inventory;
inventory.items[0] = game::ItemId::Ocarina;
Expand Down