From 2a528d35b3f7ee97019304b593af10c58b566ee7 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Mon, 18 Apr 2022 00:18:13 +0300 Subject: [PATCH] Put const data in thoughtBubble --- assets/assets.json | 5 ----- data/const/object/thoughtBubble.s | 12 ------------ linker.ld | 2 +- src/object/thoughtBubble.c | 14 ++++++++++++-- 4 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 data/const/object/thoughtBubble.s diff --git a/assets/assets.json b/assets/assets.json index e98a7770..ecb9f510 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -42966,11 +42966,6 @@ "size": 28, "type": "animation" }, - { - "path": "thoughtBubble/ThoughtBubble_SFX.bin", - "start": 1189264, - "size": 8 - }, { "path": "animations/gSpriteAnimations_GentariCurtains_0.bin", "start": 1189404, diff --git a/data/const/object/thoughtBubble.s b/data/const/object/thoughtBubble.s deleted file mode 100644 index 0c70e9e0..00000000 --- a/data/const/object/thoughtBubble.s +++ /dev/null @@ -1,12 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -ThoughtBubble_SFX:: @ 08122590 - .incbin "thoughtBubble/ThoughtBubble_SFX.bin" - -ThoughtBubble_Behaviors:: @ 08122598 - .4byte ThoughtBubble_Init - .4byte ThoughtBubble_Update diff --git a/linker.ld b/linker.ld index 7e65fb86..42cb5dcb 100644 --- a/linker.ld +++ b/linker.ld @@ -1437,7 +1437,7 @@ SECTIONS { data/animations/object/pullableLever.o(.rodata); src/object/minecart.o(.rodata); data/animations/object/minecart.o(.rodata); - data/const/object/thoughtBubble.o(.rodata); + src/object/thoughtBubble.o(.rodata); data/animations/object/thoughtBubble.o(.rodata); data/const/object/hiddenLadderDown.o(.rodata); src/object/gentariCurtains.o(.rodata); diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c index 0a622628..eb3bf5e6 100644 --- a/src/object/thoughtBubble.c +++ b/src/object/thoughtBubble.c @@ -2,11 +2,21 @@ #include "entity.h" #include "sound.h" -extern void (*const ThoughtBubble_Behaviors[])(Entity*); +void ThoughtBubble_Init(Entity*); +void ThoughtBubble_Update(Entity*); -extern u16 ThoughtBubble_SFX[]; +static const u16 ThoughtBubble_SFX[] = { + SFX_METAL_CLINK, + SFX_F3, + SFX_NONE, + SFX_NONE, +}; void ThoughtBubble(Entity* this) { + static void (*const ThoughtBubble_Behaviors[])(Entity*) = { + ThoughtBubble_Init, + ThoughtBubble_Update, + }; ThoughtBubble_Behaviors[this->action](this); }