From eb7a55f464fc95cf0297b8b61379508838855dc3 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Wed, 13 Apr 2022 22:40:07 +0300 Subject: [PATCH] Put const data into festari --- data/const/npc/festari.s | 10 ---------- linker.ld | 2 +- src/npc/festari.c | 14 ++++++++++---- 3 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 data/const/npc/festari.s diff --git a/data/const/npc/festari.s b/data/const/npc/festari.s deleted file mode 100644 index 6d4307ce..00000000 --- a/data/const/npc/festari.s +++ /dev/null @@ -1,10 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_08109BBC:: @ 08109BBC - .4byte sub_0805FE10 - .4byte sub_0805FE48 - .4byte sub_0805FF18 diff --git a/linker.ld b/linker.ld index 39bb8747..080aadfd 100644 --- a/linker.ld +++ b/linker.ld @@ -1151,7 +1151,7 @@ SECTIONS { data/data_08108E6C.o(.rodata); src/playerItem/playerItemSpiralBeam.o(.rodata); data/animations/npc/gentari.o(.rodata); - data/const/npc/festari.o(.rodata); + src/npc/festari.o(.rodata); data/animations/npc/festari.o(.rodata); data/const/npc/forestMinish.o(.rodata); data/animations/npc/forestMinish.o(.rodata); diff --git a/src/npc/festari.c b/src/npc/festari.c index 2ee629fb..235463ce 100644 --- a/src/npc/festari.c +++ b/src/npc/festari.c @@ -3,12 +3,18 @@ #include "functions.h" #include "npc.h" -extern void sub_0805FF2C(Entity*, ScriptExecutionContext*); - -extern void (*const gUnk_08109BBC[])(Entity*); +void sub_0805FF2C(Entity*, ScriptExecutionContext*); +void sub_0805FE10(Entity* this); +void sub_0805FE48(Entity* this); +void sub_0805FF18(Entity* this); void Festari(Entity* this) { - gUnk_08109BBC[this->action](this); + static void (*const actionFuncs[])(Entity*) = { + sub_0805FE10, + sub_0805FE48, + sub_0805FF18, + }; + actionFuncs[this->action](this); } void sub_0805FE10(Entity* this) {