From 9f323b8fc30fe274ebb5fb1670b001947813de77 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Wed, 13 Apr 2022 23:02:57 +0300 Subject: [PATCH] Put const data into marcy --- assets/assets.json | 5 ----- data/const/npc/marcy.s | 8 -------- linker.ld | 2 +- src/npc/marcy.c | 5 ++--- 4 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 data/const/npc/marcy.s diff --git a/assets/assets.json b/assets/assets.json index 4551fdc2..1eb7a9ff 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -35802,11 +35802,6 @@ "size": 14, "type": "animation" }, - { - "path": "marcy/gUnk_0810C34C.bin", - "start": 1098572, - "size": 20 - }, { "path": "animations/gSpriteAnimations_Wheaton_0.bin", "start": 1098696, diff --git a/data/const/npc/marcy.s b/data/const/npc/marcy.s deleted file mode 100644 index bae27b19..00000000 --- a/data/const/npc/marcy.s +++ /dev/null @@ -1,8 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_0810C34C:: @ 0810C34C - .incbin "marcy/gUnk_0810C34C.bin" diff --git a/linker.ld b/linker.ld index c5b6f7a9..3c59e855 100644 --- a/linker.ld +++ b/linker.ld @@ -1167,7 +1167,7 @@ SECTIONS { data/animations/npc/npc9.o(.rodata); src/npc/stamp.o(.rodata); data/animations/npc/stamp.o(.rodata); - data/const/npc/marcy.o(.rodata); + src/npc/marcy.o(.rodata); data/animations/npc/marcy.o(.rodata); data/const/npc/wheaton.o(.rodata); data/animations/npc/wheaton.o(.rodata); diff --git a/src/npc/marcy.c b/src/npc/marcy.c index bc49dab1..8fa1f14b 100644 --- a/src/npc/marcy.c +++ b/src/npc/marcy.c @@ -4,8 +4,6 @@ #include "message.h" #include "item.h" -extern u16 gUnk_0810C34C[]; - void Marcy(Entity* this) { if (this->action == 0) { this->action += 1; @@ -16,6 +14,7 @@ void Marcy(Entity* this) { } void sub_08062D18(Entity* this, ScriptExecutionContext* context) { + static const u16 msgIndices[] = { 0x4004, 0x400b, 0x4009, 0x400a, 0, 0, 0, 0, 0, 0 }; u8 tmp = 0; if ((GetInventoryValue(ITEM_SKILL_PERIL_BEAM) != 0) && (CheckLocalFlag(0x26) == 0)) { tmp = 7; @@ -50,7 +49,7 @@ void sub_08062D18(Entity* this, ScriptExecutionContext* context) { tmp = 3; } - MessageNoOverlap(gUnk_0810C34C[tmp], this); + MessageNoOverlap(msgIndices[tmp], this); if (tmp == 0) { context->condition = TRUE; } else {