From de1df01c436a1755f50fcd5d57fddb044deefd72 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Mon, 18 Apr 2022 00:15:15 +0300 Subject: [PATCH] Put const data in minishSizedEntrance --- assets/assets.json | 5 ----- data/const/object/minishSizedEntrance.s | 12 ------------ linker.ld | 2 +- src/object/minishSizedEntrance.c | 16 +++++++++++++--- 4 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 data/const/object/minishSizedEntrance.s diff --git a/assets/assets.json b/assets/assets.json index 2f86c83c..e98a7770 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -42664,11 +42664,6 @@ "size": 4, "type": "animation" }, - { - "path": "minishSizedEntrance/gUnk_0812225C.bin", - "start": 1188444, - "size": 8 - }, { "path": "animations/gSpriteAnimations_PullableLever_0.bin", "start": 1188548, diff --git a/data/const/object/minishSizedEntrance.s b/data/const/object/minishSizedEntrance.s deleted file mode 100644 index 1e0723b9..00000000 --- a/data/const/object/minishSizedEntrance.s +++ /dev/null @@ -1,12 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_08122254:: @ 08122254 - .4byte sub_08090EC0 - .4byte sub_08090F00 - -gUnk_0812225C:: @ 0812225C - .incbin "minishSizedEntrance/gUnk_0812225C.bin" diff --git a/linker.ld b/linker.ld index 624f337e..7e65fb86 100644 --- a/linker.ld +++ b/linker.ld @@ -1429,7 +1429,7 @@ SECTIONS { src/object/object4B.o(.rodata); src/object/pushableFurniture.o(.rodata); src/object/furniture.o(.rodata); - data/const/object/minishSizedEntrance.o(.rodata); + src/object/minishSizedEntrance.o(.rodata); data/animations/object/minishSizedEntrance.o(.rodata); src/object/giantRock2.o(.rodata); src/object/object53.o(.rodata); diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index e40ac638..debcea2d 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -2,11 +2,15 @@ #include "game.h" #include "functions.h" -extern void (*const gUnk_08122254[])(Entity*); -extern u16 gUnk_0812225C[]; +void sub_08090F00(Entity*); +void sub_08090EC0(Entity*); void MinishSizedEntrance(Entity* this) { - gUnk_08122254[this->action](this); + static void (*const actionFuncs[])(Entity*) = { + sub_08090EC0, + sub_08090F00, + }; + actionFuncs[this->action](this); } void sub_08090EC0(Entity* this) { @@ -22,6 +26,12 @@ void sub_08090EC0(Entity* this) { } void sub_08090F00(Entity* this) { + static const u16 gUnk_0812225C[] = { + 0x400, + 0x100, + 0x800, + 0x200, + }; if (this->type == 1) { Entity* parent = this->parent; u32 mask = 1 << this->subtimer;