From 85bf45cb2085eb7d33549e6bc2057cdd9456f679 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Thu, 14 Apr 2022 23:04:33 +0300 Subject: [PATCH] Put const data into epona --- assets/assets.json | 5 ----- data/const/npc/epona.s | 15 --------------- linker.ld | 2 +- src/npc/epona.c | 18 +++++++++++++----- 4 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 data/const/npc/epona.s diff --git a/assets/assets.json b/assets/assets.json index 5b245cc6..c97f761c 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -36817,11 +36817,6 @@ "size": 44, "type": "animation" }, - { - "path": "epona/gUnk_08110080.bin", - "start": 1114240, - "size": 8 - }, { "path": "animations/gSpriteAnimations_MilkCart_0.bin", "start": 1114400, diff --git a/data/const/npc/epona.s b/data/const/npc/epona.s deleted file mode 100644 index e5271c7a..00000000 --- a/data/const/npc/epona.s +++ /dev/null @@ -1,15 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_0811006C:: @ 0811006C - .4byte sub_080659B8 - .4byte sub_080659F0 - .4byte sub_08065A00 - .4byte sub_08065A10 - .4byte sub_08065A34 - -gUnk_08110080:: @ 08110080 - .incbin "epona/gUnk_08110080.bin" diff --git a/linker.ld b/linker.ld index c6862972..8e6e384e 100644 --- a/linker.ld +++ b/linker.ld @@ -1203,7 +1203,7 @@ SECTIONS { data/animations/npc/talon.o(.rodata); src/npc/malon.o(.rodata); data/animations/npc/malon.o(.rodata); - data/const/npc/epona.o(.rodata); + src/npc/epona.o(.rodata); data/animations/npc/epona.o(.rodata); data/const/npc/milkCart.o(.rodata); data/animations/npc/milkCart.o(.rodata); diff --git a/src/npc/epona.c b/src/npc/epona.c index b4840bbe..7673b726 100644 --- a/src/npc/epona.c +++ b/src/npc/epona.c @@ -7,12 +7,17 @@ void sub_08065A64(Entity* this); void sub_08065AA4(Entity*); - -extern void (*gUnk_0811006C[])(Entity*); -extern Dialog gUnk_08110080[]; +void sub_080659B8(Entity*); +void sub_080659F0(Entity*); +void sub_08065A00(Entity*); +void sub_08065A10(Entity*); +void sub_08065A34(Entity*); void Epona(Entity* this) { - gUnk_0811006C[this->action](this); + static void (*const actionFuncs[])(Entity*) = { + sub_080659B8, sub_080659F0, sub_08065A00, sub_08065A10, sub_08065A34, + }; + actionFuncs[this->action](this); sub_08065A64(this); sub_0806ED78(this); } @@ -51,7 +56,10 @@ void sub_08065A34(Entity* this) { } void sub_08065A50(Entity* this) { - ShowNPCDialogue(this, &gUnk_08110080[this->type]); + static const Dialog typeDialogs[] = { + { 0, 0, 6, 1, { 0x2017, 0x3f3c } }, + }; + ShowNPCDialogue(this, &typeDialogs[this->type]); } void sub_08065A64(Entity* this) {