From 6d04f20dca7b4d658131d7164dd405b56c8b03bb Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Sat, 16 Apr 2022 11:13:50 +0300 Subject: [PATCH] Put const data in dampe --- assets/assets.json | 10 ---------- data/const/npc/dampe.s | 11 ----------- linker.ld | 2 +- src/npc/dampe.c | 17 ++++++++++++----- 4 files changed, 13 insertions(+), 27 deletions(-) delete mode 100644 data/const/npc/dampe.s diff --git a/assets/assets.json b/assets/assets.json index b3f82675..643c54b1 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -39126,16 +39126,6 @@ "size": 9, "type": "animation" }, - { - "path": "dampe/gUnk_08113344.bin", - "start": 1127236, - "size": 6 - }, - { - "path": "dampe/gUnk_0811334A.bin", - "start": 1127242, - "size": 6 - }, { "path": "animations/gSpriteAnimations_DrLeft_0.bin", "start": 1127352, diff --git a/data/const/npc/dampe.s b/data/const/npc/dampe.s deleted file mode 100644 index 4405c9cd..00000000 --- a/data/const/npc/dampe.s +++ /dev/null @@ -1,11 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_08113344:: @ 08113344 - .incbin "dampe/gUnk_08113344.bin" - -gUnk_0811334A:: @ 0811334A - .incbin "dampe/gUnk_0811334A.bin" diff --git a/linker.ld b/linker.ld index abdeec66..d4687dbb 100644 --- a/linker.ld +++ b/linker.ld @@ -1263,7 +1263,7 @@ SECTIONS { src/npc/farmers.o(.rodata); data/animations/npc/farmers.o(.rodata); data/animations/npc/carlov.o(.rodata); - data/const/npc/dampe.o(.rodata); + src/npc/dampe.o(.rodata); data/animations/npc/dampe.o(.rodata); data/const/npc/drLeft.o(.rodata); data/animations/npc/drLeft.o(.rodata); diff --git a/src/npc/dampe.c b/src/npc/dampe.c index cd6ee87c..a058d42d 100644 --- a/src/npc/dampe.c +++ b/src/npc/dampe.c @@ -7,9 +7,6 @@ #include "npc.h" #include "item.h" -extern u16 gUnk_08113344[]; -extern u16 gUnk_0811334A[]; - void Dampe(Entity* this) { switch (this->action) { case 0: @@ -52,6 +49,11 @@ void Dampe_Fusion(Entity* this) { } void sub_0806BE84(Entity* this, ScriptExecutionContext* context) { + static const u16 messageIndices[] = { + 0x2801, + 0x2808, + 0x2804, + }; u32 msgIndex; context->condition = 0; @@ -65,10 +67,15 @@ void sub_0806BE84(Entity* this, ScriptExecutionContext* context) { if (GetInventoryValue(ITEM_QST_GRAVEYARD_KEY) >= 2) { msgIndex = 2; } - MessageNoOverlap(gUnk_08113344[msgIndex], this); + MessageNoOverlap(messageIndices[msgIndex], this); } void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) { + static const u16 messageIndices[] = { + 0x2802, + 0x2803, + 0x2804, + }; u32 hasGraveyardKey; u32 msgIndex; @@ -82,7 +89,7 @@ void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) { msgIndex = 2; } - MessageNoOverlap(gUnk_0811334A[msgIndex], this); + MessageNoOverlap(messageIndices[msgIndex], this); } void sub_0806BEFC(void) {