From 7cff85fa22f9c0d921540e2451a341e575a6bd78 Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 25 Jan 2026 20:30:51 -0300 Subject: [PATCH] Run UI callbacks per frame. --- patches/recompui_patches.c | 17 +++++++++++++++++ patches/syms.ld | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 patches/recompui_patches.c diff --git a/patches/recompui_patches.c b/patches/recompui_patches.c new file mode 100644 index 0000000..1b0bb3f --- /dev/null +++ b/patches/recompui_patches.c @@ -0,0 +1,17 @@ +#include "functions.h" +#include "patches.h" +#include "ui_funcs.h" + +extern s32 D_802823AC; +extern f32 D_80282420; +extern f32 D_80282424; + +// @recomp Patched to run a callback per frame in a function that always gets called by mainLoop(). +RECOMP_PATCH void baMotor_80250C08(void) { + // @recomp Patched to run UI callbacks. + recomp_run_ui_callbacks(); + + if (D_802823AC != 0) { + D_80282424 = MIN(D_80282420, D_80282424 + time_getDelta()); + } +} \ No newline at end of file diff --git a/patches/syms.ld b/patches/syms.ld index 6ba9568..cf7723c 100644 --- a/patches/syms.ld +++ b/patches/syms.ld @@ -50,4 +50,5 @@ recomp_get_note_saving_enabled = 0x8F0000B4; recomp_get_cutscene_aspect_ratio = 0x8F0000B8; recomp_get_flying_and_swimming_inverted_axes = 0x8F0000BC; recomp_get_first_person_inverted_axes = 0x8F0000C0; -recomp_get_analog_cam_sensitivity = 0x8F0000C4; \ No newline at end of file +recomp_get_analog_cam_sensitivity = 0x8F0000C4; +recomp_run_ui_callbacks = 0x8F0000C8; \ No newline at end of file