mirror of
https://github.com/leoetlino/project-restoration
synced 2025-10-06 00:32:43 +02:00
Remove unneeded function trampolines or wrappers
This commit is contained in:
@@ -120,7 +120,7 @@ static void UiScheduleScreenUpdate() {
|
||||
}
|
||||
}
|
||||
|
||||
void Calc(game::State* state) {
|
||||
RST_HOOK void Calc(game::State* state) {
|
||||
Context& context = GetContext();
|
||||
context.gctx = nullptr;
|
||||
|
||||
@@ -148,17 +148,15 @@ void Calc(game::State* state) {
|
||||
PrintDebug(context.gctx);
|
||||
}
|
||||
|
||||
void WidgetPostCreateHook(game::ui::Widget&) {}
|
||||
|
||||
void PreActorCalcHook() {
|
||||
RST_HOOK void PreActorCalcHook() {
|
||||
FixOwlStatueActivationTrigger();
|
||||
}
|
||||
|
||||
void PostActorCalcHook() {
|
||||
RST_HOOK void PostActorCalcHook() {
|
||||
FixBosses();
|
||||
}
|
||||
|
||||
void UiScheduleTriggerHook() {
|
||||
RST_HOOK void UiScheduleTriggerHook() {
|
||||
auto* gctx = GetContext().gctx;
|
||||
if (!gctx || gctx->type != game::StateType::Play)
|
||||
return;
|
||||
@@ -184,26 +182,6 @@ void UiScheduleTriggerHook() {
|
||||
} // namespace rst
|
||||
|
||||
extern "C" {
|
||||
RST_HOOK void rst_Calc(game::State* state) {
|
||||
rst::Calc(state);
|
||||
}
|
||||
|
||||
RST_HOOK void rst_WidgetPostCreateHook(game::ui::Widget& widget) {
|
||||
rst::WidgetPostCreateHook(widget);
|
||||
}
|
||||
|
||||
RST_HOOK void rst_PreActorCalcHook() {
|
||||
rst::PreActorCalcHook();
|
||||
}
|
||||
|
||||
RST_HOOK void rst_PostActorCalcHook() {
|
||||
rst::PostActorCalcHook();
|
||||
}
|
||||
|
||||
RST_HOOK void rst_UiScheduleTriggerHook() {
|
||||
rst::UiScheduleTriggerHook();
|
||||
}
|
||||
|
||||
extern char* fake_heap_start;
|
||||
extern char* fake_heap_end;
|
||||
extern void (*__init_array_start[])(void) __attribute__((weak));
|
||||
|
@@ -125,11 +125,3 @@ TRAMPOLINE_DECLARE rst_GameStateGetNextStateInfo
|
||||
mov r8, r0 // state
|
||||
mov r0, r6 // original instruction
|
||||
pop {r1-r7, r9-r12, pc}
|
||||
|
||||
TRAMPOLINE_DECLARE rst_WidgetPostCreateHook
|
||||
push {r0-r12, lr}
|
||||
vpush {d0-d15}
|
||||
mov r0, r6 // widget
|
||||
bl rst_WidgetPostCreateHook
|
||||
vpop {d0-d15}
|
||||
pop {r0-r12, pc}
|
||||
|
@@ -6,24 +6,18 @@ start_hook:
|
||||
pre_calc_hook:
|
||||
type: softbranch
|
||||
opcode: post
|
||||
func: rst_Calc
|
||||
func: rst::Calc(game::State*)
|
||||
addr: 0x0010676C
|
||||
pre_actor_calc_hook:
|
||||
type: softbranch
|
||||
opcode: post
|
||||
addr: 0x174A6C
|
||||
func: rst_PreActorCalcHook
|
||||
func: rst::PreActorCalcHook()
|
||||
post_actor_calc_hook:
|
||||
type: softbranch
|
||||
opcode: post
|
||||
addr: 0x174E08
|
||||
func: rst_PostActorCalcHook
|
||||
|
||||
ui_widget_create_hook:
|
||||
type: softbranch
|
||||
opcode: post
|
||||
addr: 0x5C4430
|
||||
func: rst_trampoline_rst_WidgetPostCreateHook
|
||||
func: rst::PostActorCalcHook()
|
||||
|
||||
main_loop_get_next_game_state_info:
|
||||
type: branch
|
||||
@@ -182,7 +176,7 @@ update_time_hook:
|
||||
ui_schedule_trigger_hook:
|
||||
type: softbranch
|
||||
opcode: post
|
||||
func: rst_UiScheduleTriggerHook
|
||||
func: rst::UiScheduleTriggerHook()
|
||||
addr: 0x59BA10
|
||||
ui_schedule_disable_existing_trigger:
|
||||
type: patch
|
||||
|
Reference in New Issue
Block a user