From 5035a3cc391d58e46bf0dccb3ba6cff240fe9234 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Mon, 14 Mar 2022 11:58:03 +0200 Subject: [PATCH] Decompile object75 --- asm/object/object75.s | 20 -------------------- data/const/object/object75.s | 9 --------- linker.ld | 4 ++-- src/object/object75.c | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 31 deletions(-) delete mode 100644 asm/object/object75.s delete mode 100644 data/const/object/object75.s create mode 100644 src/object/object75.c diff --git a/asm/object/object75.s b/asm/object/object75.s deleted file mode 100644 index 6c8dc4a0..00000000 --- a/asm/object/object75.s +++ /dev/null @@ -1,20 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start Object75 -Object75: @ 0x0808C934 - push {lr} - ldr r2, _0808C948 @ =gUnk_08121670 - ldrb r1, [r0, #0xc] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {pc} - .align 2, 0 -_0808C948: .4byte gUnk_08121670 diff --git a/data/const/object/object75.s b/data/const/object/object75.s deleted file mode 100644 index 738b65b7..00000000 --- a/data/const/object/object75.s +++ /dev/null @@ -1,9 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_08121670:: @ 08121670 - .4byte sub_0808C964 - .4byte sub_0808CA10 diff --git a/linker.ld b/linker.ld index 1827e5f0..8dcff676 100644 --- a/linker.ld +++ b/linker.ld @@ -680,7 +680,7 @@ SECTIONS { src/object/bossDoor.o(.text); src/object/object3A.o(.text); src/object/macroMushroomStalks.o(.text); - asm/object/object75.o(.text); /* 75 and 76 are mislocated in object table */ + src/object/object75.o(.text); /* 75 and 76 are mislocated in object table */ asm/object/object76.o(.text); asm/object/code_0808C964.o(.text); src/object/macroPlayer.o(.text); @@ -1413,7 +1413,7 @@ SECTIONS { data/animations/object/bossDoor.o(.rodata); src/object/object3A.o(.rodata); src/object/macroMushroomStalks.o(.rodata); - data/const/object/object75.o(.rodata); + src/object/object75.o(.rodata); data/const/object/object76.o(.rodata); src/object/macroPlayer.o(.rodata); src/object/object3D.o(.rodata); diff --git a/src/object/object75.c b/src/object/object75.c new file mode 100644 index 00000000..efd305f6 --- /dev/null +++ b/src/object/object75.c @@ -0,0 +1,14 @@ +#define NENT_DEPRECATED +#include "entity.h" + +extern void sub_0808C964(Entity*); +extern void sub_0808CA10(Entity*); + +void Object75(Entity* this) { + static void (*const actionFuncs[])(Entity*) = { + sub_0808C964, + sub_0808CA10, + }; + + actionFuncs[this->action](this); +}