Put const data into kingDaltus

This commit is contained in:
Tal Hayon
2022-04-15 21:27:25 +03:00
parent e652f98b16
commit 5c9f688772
4 changed files with 26 additions and 31 deletions
-5
View File
@@ -37027,11 +37027,6 @@
"size": 39,
"type": "animation"
},
{
"path": "kingDaltus/gUnk_081104F8.bin",
"start": 1115384,
"size": 8
},
{
"path": "animations/gSpriteAnimations_MinisterPotho_0.bin",
"start": 1115736,
-18
View File
@@ -1,18 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_081104E0:: @ 081104E0
.4byte sub_08066654
.4byte sub_08066688
.4byte sub_080666DC
gUnk_081104EC:: @ 081104EC
.4byte sub_080666E4
.4byte sub_0806670C
.4byte sub_08066718
gUnk_081104F8:: @ 081104F8
.incbin "kingDaltus/gUnk_081104F8.bin"
+1 -1
View File
@@ -1212,7 +1212,7 @@ SECTIONS {
src/npc/smith.o(.rodata);
data/animations/npc/smith.o(.rodata);
src/npc/npc23.o(.rodata);
data/const/npc/kingDaltus.o(.rodata);
src/npc/kingDaltus.o(.rodata);
data/animations/npc/kingDaltus.o(.rodata);
data/const/npc/ministerPotho.o(.rodata);
data/animations/npc/ministerPotho.o(.rodata);
+25 -7
View File
@@ -4,12 +4,24 @@
#include "npc.h"
#include "item.h"
extern u16 gUnk_081104F8[];
extern void (*const gUnk_081104E0[])(Entity*);
extern void (*const gUnk_081104EC[])(Entity*);
void sub_08066654(Entity*);
void sub_08066688(Entity*);
void sub_080666DC(Entity*);
void sub_080666E4(Entity*);
void sub_0806670C(Entity*);
void sub_08066718(Entity*);
void KingDaltus(Entity* this) {
static void (*const actionFuncs[])(Entity*) = {
sub_08066654,
sub_08066688,
sub_080666DC,
};
static void (*const scriptedActionFuncs[])(Entity*) = {
sub_080666E4,
sub_0806670C,
sub_08066718,
};
if ((this->flags & ENT_SCRIPTED) != 0) {
if (this->interactType == 2) {
this->interactType = 0;
@@ -17,9 +29,9 @@ void KingDaltus(Entity* this) {
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
}
gUnk_081104EC[this->action](this);
scriptedActionFuncs[this->action](this);
} else {
gUnk_081104E0[this->action](this);
actionFuncs[this->action](this);
sub_0806ED78(this);
}
}
@@ -79,6 +91,12 @@ void sub_0806672C(Entity* this) {
}
void sub_0806673C(Entity* this) {
static const u16 messageIndices[] = {
0x1058,
0x1326,
0x1329,
0x132e,
};
u32 index;
if (CheckGlobalFlag(2) == 0) {
index = 0;
@@ -89,7 +107,7 @@ void sub_0806673C(Entity* this) {
} else {
index = 3;
}
MessageNoOverlap(gUnk_081104F8[index], this);
MessageNoOverlap(messageIndices[index], this);
}
void KingDaltus_Fusion(Entity* this) {