Put const data into zelda and mutoh

This commit is contained in:
Tal Hayon
2022-04-15 21:41:34 +03:00
parent 878ad8878e
commit 212dffac89
6 changed files with 34 additions and 60 deletions
+20 -7
View File
@@ -6,9 +6,11 @@
#include "npc.h"
#include "item.h"
extern SpriteLoadData gUnk_08110C00;
extern u16 gUnk_08110C0C[];
extern Dialog gUnk_08110C10[];
static const SpriteLoadData gUnk_08110C00[] = {
{ 0x51, 0x3e, 0x4 },
{ 0x1051, 0x3e, 0x4 },
{ 0, 0, 0 },
};
void Mutoh(Entity* this) {
if (*(u32*)&this->cutsceneBeh == 0) {
@@ -17,7 +19,7 @@ void Mutoh(Entity* this) {
switch (this->action) {
case 0:
if (LoadExtraSpriteData(this, &gUnk_08110C00)) {
if (LoadExtraSpriteData(this, gUnk_08110C00)) {
this->action = 1;
this->spriteSettings.draw = TRUE;
SetDefaultPriority(this, PRIO_MESSAGE);
@@ -49,6 +51,10 @@ void Mutoh_Head(Entity* this) {
}
void sub_080670B4(Entity* this) {
static const u16 messageIndices[] = {
0x1b02,
0x1b03,
};
u32 uVar2;
uVar2 = 0;
@@ -57,11 +63,18 @@ void sub_080670B4(Entity* this) {
uVar2 = 1;
}
}
MessageNoOverlap(gUnk_08110C0C[uVar2], this);
MessageNoOverlap(messageIndices[uVar2], this);
}
void sub_080670E4(Entity* this) {
ShowNPCDialogue(this, &gUnk_08110C10[gSave.global_progress]);
static const Dialog dialogs[] = {
{ 0, 0, 3, 1, { 0x4101, 0x4100 } }, { 0, 0, 3, 1, { 0x4101, 0x4100 } },
{ 0, 0, 3, 1, { 0x4101, 0x4100 } }, { 0, 0, 3, 1, { 0x4101, 0x4100 } },
{ 0, 0, 3, 1, { 0x4101, 0x4100 } }, { 0xb, 3, 4, 1, { 0x4104, 0x4102 } },
{ 0xb, 3, 4, 1, { 0x4104, 0x4103 } }, { 0xb, 3, 4, 1, { 0x4104, 0x4103 } },
{ 0xb, 3, 4, 1, { 0x4104, 0x4105 } }, { 0xb, 3, 4, 1, { 0x4104, 0x4105 } },
};
ShowNPCDialogue(this, &dialogs[gSave.global_progress]);
}
void sub_08067100(Entity* this) {
@@ -71,7 +84,7 @@ void sub_08067100(Entity* this) {
void Mutoh_Fusion(Entity* this) {
if (this->action == 0) {
if (LoadExtraSpriteData(this, &gUnk_08110C00) != 0) {
if (LoadExtraSpriteData(this, gUnk_08110C00) != 0) {
this->action++;
this->spriteSettings.draw = TRUE;
InitializeAnimation(this, 2);
+12 -5
View File
@@ -9,11 +9,14 @@ void sub_08068680(Entity*, Entity*);
void sub_08068694(Entity*, Entity*);
extern Entity* GetEntityByType(u32, u32);
extern void sub_080686C4(Entity*, Entity*);
extern void (*gUnk_08110BD8[])(Entity* ent);
extern u16 gUnk_08110BE0[];
void sub_08066CCC(Entity*);
void sub_08066CF8(Entity*);
void Zelda(Entity* this) {
static void (*const gUnk_08110BD8[])(Entity * ent) = {
sub_08066CCC,
sub_08066CF8,
};
gUnk_08110BD8[this->action](this);
}
@@ -161,9 +164,13 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
gActiveScriptInfo.commandSize = 0;
}
static const u16 gUnk_08110BE0[] = {
0x81c, 0x85c, 0x89c, 0x8dc, 0x91c, 0x95c, 0x99c, 0x9dc, 0x9dd, 0x9de, 0x9df, 0x9e0, 0x9e1, 0x9e2, 0x0, 0x0,
};
void sub_08066F94(void) {
u16 uVar1;
u16* puVar2;
const u16* puVar2;
puVar2 = gUnk_08110BE0;
while (*puVar2 != 0) {
@@ -175,7 +182,7 @@ void sub_08066F94(void) {
void sub_08066FB8(void) {
u16 uVar1;
u16* puVar2;
const u16* puVar2;
puVar2 = gUnk_08110BE0;
while (*puVar2 != 0) {