From cf3fff2805dfec477708a772636755d0df051db1 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Sat, 16 Apr 2022 11:16:53 +0300 Subject: [PATCH] Put const data in drLeft --- assets/assets.json | 10 ---------- data/const/npc/drLeft.s | 11 ----------- linker.ld | 2 +- src/npc/drLeft.c | 15 ++++++++++----- 4 files changed, 11 insertions(+), 27 deletions(-) delete mode 100644 data/const/npc/drLeft.s diff --git a/assets/assets.json b/assets/assets.json index 643c54b1..2fafe3c9 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -39174,16 +39174,6 @@ "size": 65, "type": "animation" }, - { - "path": "drLeft/gUnk_081133A4.bin", - "start": 1127332, - "size": 16 - }, - { - "path": "drLeft/gUnk_081133B4.bin", - "start": 1127348, - "size": 4 - }, { "path": "animations/gSpriteAnimations_KingGustaf_0.bin", "start": 1127636, diff --git a/data/const/npc/drLeft.s b/data/const/npc/drLeft.s deleted file mode 100644 index 44da66f9..00000000 --- a/data/const/npc/drLeft.s +++ /dev/null @@ -1,11 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_081133A4:: @ 081133A4 - .incbin "drLeft/gUnk_081133A4.bin" - -gUnk_081133B4:: @ 081133B4 - .incbin "drLeft/gUnk_081133B4.bin" diff --git a/linker.ld b/linker.ld index d4687dbb..f6827934 100644 --- a/linker.ld +++ b/linker.ld @@ -1265,7 +1265,7 @@ SECTIONS { data/animations/npc/carlov.o(.rodata); src/npc/dampe.o(.rodata); data/animations/npc/dampe.o(.rodata); - data/const/npc/drLeft.o(.rodata); + src/npc/drLeft.o(.rodata); data/animations/npc/drLeft.o(.rodata); data/animations/npc/kingGustaf.o(.rodata); data/animations/npc/gina.o(.rodata); diff --git a/src/npc/drLeft.c b/src/npc/drLeft.c index ba3005a6..28ae056d 100644 --- a/src/npc/drLeft.c +++ b/src/npc/drLeft.c @@ -2,12 +2,8 @@ #include "functions.h" #include "item.h" -extern u32 gUnk_081133B4; - void sub_0806BFD8(Entity* this); -extern u16 gUnk_081133A4[]; - void DrLeft(Entity* this) { if (this->type == 0) { if (this->action == 0) { @@ -52,6 +48,9 @@ void sub_0806C028(Entity* this, ScriptExecutionContext* context) { } void sub_0806C038(Entity* this) { + static const u16 messageIndices[] = { + 0x4d07, 0x4d08, 0x4d09, 0x4d0a, 0x4d0a, 0x4d05, 0x4d06, 0x4d0f, + }; s32 index; index = gSave.global_progress - 5; @@ -72,9 +71,15 @@ void sub_0806C038(Entity* this) { } } } - MessageNoOverlap(gUnk_081133A4[index], this); + MessageNoOverlap(messageIndices[index], this); } void sub_0806C09C(Entity* this) { + static const u8 gUnk_081133B4[] = { + 0, + 6, + 8, + 12, + }; sub_08078850(this, 1, 0, &gUnk_081133B4); }