bladeBrother.c start

This commit is contained in:
theo3
2020-06-14 04:42:46 -07:00
parent f0f3de254f
commit bd307ea8eb
129 changed files with 677 additions and 769 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ extern void sub_080042B8();
extern void (*gUnk_08123384[])(Entity*);
extern void UpdateSpriteOrderAndFlip(Entity*);
extern void LoadAnimation();
extern void InitAnimationForceUpdate();
void sub_08097D78(Entity* ent) {
gUnk_08123384[ent->action](ent);
@@ -17,7 +17,7 @@ void sub_08097D90(Entity* ent) {
ent->collisionLayer = 1;
ent->ticks.b0 = 0;
UpdateSpriteOrderAndFlip(ent);
LoadAnimation(ent, 0);
InitAnimationForceUpdate(ent, 0);
}
void sub_08097DCC(Entity* ent) {
+155
View File
@@ -0,0 +1,155 @@
#include "global.h"
#include "entity.h"
typedef struct {
/*0x00*/ u8 filler[0x2C];
/*0x2C*/ u8 unk;
} struct_030010A0;
extern void sub_0806ED78(Entity*);
extern void sub_08068BEC(Entity*, u32);
extern void sub_08078778(Entity*);
extern void InitializeAnimation(Entity*, u32);
extern s32 sub_0806ED9C(Entity*, u32, u32);
extern s32 sub_0806F078(Entity*, s32);
extern void sub_08004274(Entity*);
extern void TextboxNoOverlapFollow(u32);
extern void sub_0801D2B4(Entity*, u32);
extern void sub_0806FD3C(Entity*);
extern u32 sub_0801E99C(Entity*);
extern void sub_08078784(Entity*, u8);
extern void sub_0807DD50(Entity*);
extern void sub_080045C4(Entity*, Entity*);
extern u32 sub_0806F5A4(void);
extern void InitAnimationForceUpdate(Entity*, u32);
extern void sub_0806F118(Entity*);
extern void sub_0807DD94(Entity*, u32);
extern u32 UpdateFuseInteraction();
extern void (*gUnk_081115C0[])(Entity*);
extern void (*gUnk_081115D0[])(Entity*);
extern struct_030010A0 gUnk_030010A0;
extern u16 gUnk_081115DC[];
extern Entity gLinkEntity;
void sub_080689C0(Entity *this)
{
if ((this->flags & 2) != 0) {
gUnk_081115D0[this->action](this);
}
else {
gUnk_081115C0[this->action](this);
sub_0806ED78(this);
}
if ((this->frames.all & 1) != 0) {
this->frames.all &= 0xfe;
sub_08068BEC(this, 0);
}
}
void sub_08068A1C(Entity *this)
{
u8 bVar1;
int offset;
(this->entityType).parameter2 = (this->entityType).parameter1;
if (gUnk_030010A0.unk != 0) {
offset = 6;
bVar1 = 3;
}
else {
sub_08078778(this);
offset = 2;
bVar1 = 1;
}
this->action = bVar1;
InitializeAnimation(this, offset);
}
void sub_08068A4C(Entity *this)
{
s32 uVar1;
s32 iVar2;
uVar1 = sub_0806ED9C(this, 0x28, 0x28);
if (uVar1 < 0) {
uVar1 = 2;
}
else {
if (this->field_0xf == 0) {
this->field_0xf = 0x10;
}
else {
this->field_0xf--;
uVar1 = (u32)this->field_0x58;
}
}
iVar2 = sub_0806F078(this,uVar1);
if (iVar2 == 0) {
sub_08004274(this);
}
if (this->interactType != 0) {
this->interactType = 0;
this->action = 2;
TextboxNoOverlapFollow(0);
}
}
void sub_08068AA4(Entity *this)
{
u8 bVar1;
this->action = 1;
if (this->entityType.parameter1 != 0) {
this->entityType.parameter2++;
this->entityType.parameter2 &= 7;
if (this->entityType.parameter2 == 0) {
this->entityType.parameter2 += 1;
}
sub_0801D2B4(this, gUnk_081115DC[this->entityType.parameter2]);
}
}
void sub_08068ADC(Entity *this)
{
if (gUnk_030010A0.unk == 2) {
sub_08004274(this);
}
sub_0806FD3C(this);
}
void sub_08068AFC(Entity *this)
{
this->action = 1;
this->spriteSettings.b.ss0 = 1;
*(u8*)&this->field_0x68 = sub_0801E99C(this);
sub_08078784(this, *(u8*)&this->field_0x68);
sub_0807DD50(this);
}
void FUN_08068b2c(Entity *this)
{
u32 uVar1;
if (this->interactType == '\x02') {
this->action = 2;
this->interactType = '\0';
sub_080045C4(this,&gLinkEntity);
uVar1 = sub_0806F5A4();
InitAnimationForceUpdate(this, uVar1);
sub_0806F118(this);
}
else {
sub_0807DD94(this, 0);
}
}
void sub_08068B70(Entity *this)
{
if (UpdateFuseInteraction()) {
this->action = 1;
}
}
+8
View File
@@ -0,0 +1,8 @@
#include "global.h"
#include "entity.h"
extern void (*gUnk_0811423C[])(Entity*);
void sub_0806DD78(Entity* this) {
gUnk_0811423C[this->action](this);
}
+9 -9
View File
@@ -17,7 +17,7 @@ extern void sub_080791D0();
extern void (*gUnk_08111914[])(Entity*);
extern void (*gUnk_08111928[])(Entity*);
extern u32 gUnk_08111938[];
extern void LoadAnimation();
extern void InitAnimationForceUpdate();
extern void PlaySFX(u32);
extern u32 Random();
extern u32 UpdateFuseInteraction(Entity*);
@@ -55,7 +55,7 @@ void sub_08068FC0(Entity* ent) {
}
ent->field_0x6c = sub_0801E99C(ent);
LoadAnimation(ent, ent->animationState + 4);
InitAnimationForceUpdate(ent, ent->animationState + 4);
}
void sub_08069018(Entity* ent) {
@@ -64,7 +64,7 @@ void sub_08069018(Entity* ent) {
if (ent->previousActionFlag == 0) {
ent->previousActionFlag++;
ent->field_0xf = (Random() & 0x3F) + 0x3C;
LoadAnimation(ent, ent->animationState);
InitAnimationForceUpdate(ent, ent->animationState);
}
sub_080042B8(ent);
@@ -95,7 +95,7 @@ void sub_08069068(Entity* ent) {
ent->direction = anim <<= 3;
ent->field_0xf = (Random() & 0x3F) + 0x3C;
LoadAnimation(ent, ent->animationState + 4);
InitAnimationForceUpdate(ent, ent->animationState + 4);
}
sub_080AEF88(ent);
@@ -148,13 +148,13 @@ void sub_08069148(Entity* ent) {
var0 += 3;
ent->field_0xf = var0;
ent->previousActionFlag = 1;
LoadAnimation(ent, ent->animationState + 8);
InitAnimationForceUpdate(ent, ent->animationState + 8);
}
void sub_08069168(Entity* ent) {
if ((s8)ent->frames.all < 0) {
ent->previousActionFlag = 2;
LoadAnimation(ent, ent->animationState + 12);
InitAnimationForceUpdate(ent, ent->animationState + 12);
}
}
@@ -166,14 +166,14 @@ void sub_08069188(Entity* ent) {
if (((s8)--ent->field_0xf) != 0)
return;
ent->previousActionFlag = 3;
LoadAnimation(ent, ent->animationState + 16);
InitAnimationForceUpdate(ent, ent->animationState + 16);
}
void sub_080691BC(Entity* ent) {
if ((s8)ent->frames.all < 0) {
ent->action = 1;
ent->previousActionFlag = 0;
LoadAnimation(ent, ent->animationState + 4);
InitAnimationForceUpdate(ent, ent->animationState + 4);
}
}
@@ -232,7 +232,7 @@ void sub_080692A0(Entity* ent) {
if (ent->action == 0) {
ent->action++;
ent->spriteSettings.b.ss0 = 1;
LoadAnimation(ent, 15);
InitAnimationForceUpdate(ent, 15);
} else {
sub_080042B8(ent);
}
+6 -6
View File
@@ -5,7 +5,7 @@
extern void sub_0806ED78(Entity*);
extern u32 sub_0801E99C(Entity*);
extern void LoadAnimation(Entity*, u32);
extern void InitAnimationForceUpdate(Entity*, u32);
extern void sub_080042B8(Entity*);
extern void sub_08065AA4(Entity*);
extern u32 UpdateFuseInteraction(void);
@@ -40,7 +40,7 @@ void sub_080659B8(Entity* this) {
this->animationState = 6;
this->field_0x69 = -1;
this->field_0x68 = sub_0801E99C(this);
LoadAnimation(this, this->animationState / 2);
InitAnimationForceUpdate(this, this->animationState / 2);
}
void sub_080659F0(Entity* this) {
@@ -56,14 +56,14 @@ void sub_08065A00(Entity* this) {
void sub_08065A10(Entity* this) {
if ((gTextBox.doTextBox & 0x7F) == 0) {
this->action = 1;
LoadAnimation(this, this->animationState / 2);
InitAnimationForceUpdate(this, this->animationState / 2);
}
}
void sub_08065A34(Entity* this) {
if (UpdateFuseInteraction() != 0) {
this->action = 1;
LoadAnimation(this, this->animationState / 2);
InitAnimationForceUpdate(this, this->animationState / 2);
}
}
@@ -97,7 +97,7 @@ void sub_08065AA4(Entity* this) {
sub_08065A50(this);
}
sub_080045C4(this, &gLinkEntity);
LoadAnimation(this, sub_0806F5A4());
InitAnimationForceUpdate(this, sub_0806F5A4());
} else {
sub_08065A50(this);
sub_080791D0();
@@ -111,7 +111,7 @@ void sub_08065B1C(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->spriteSettings.b.ss0 = 1;
LoadAnimation(this, 7);
InitAnimationForceUpdate(this, 7);
} else {
sub_080042B8(this);
}
+5 -5
View File
@@ -2,9 +2,9 @@
#include "entity.h"
extern void sub_0806ED78(Entity*);
extern void LoadAnimation();
extern void InitAnimationForceUpdate();
extern void sub_08063280();
extern void TextboxTryNoOverlap(u32);
extern void TextboxNoOverlapFollow(u32);
extern void sub_080042B8();
extern void CreateFx();
@@ -22,7 +22,7 @@ void sub_08063210(Entity* ent)
{
ent->action = 1;
LoadAnimation(ent, 0);
InitAnimationForceUpdate(ent, 0);
return;
}
@@ -39,7 +39,7 @@ void sub_08063220(Entity* ent)
}
if (ent->field_0x58 != bVar1) {
LoadAnimation(ent);
InitAnimationForceUpdate(ent);
} else {
sub_08063280(ent, bVar1);
}
@@ -51,7 +51,7 @@ void sub_08063254(Entity* ent)
sub_08063280(ent);
if ((ent->frames.all & 0x80) != 0) {
ent->action = 3;
TextboxTryNoOverlap(0);
TextboxNoOverlapFollow(0);
}
return;
}
+2 -2
View File
@@ -3,7 +3,7 @@
extern void _call_via_r1(Entity*, u32);
extern void sub_0806ED78();
extern void LoadAnimation();
extern void InitAnimationForceUpdate();
extern void sub_080042B8();
extern void (*gMilkCartBehaviors[2])(Entity*);
@@ -18,7 +18,7 @@ void sub_08065B6C(Entity* ent) {
ent->spriteSettings.b.ss0 = 1;
(ent->y).HALF.LO += -32768;
ent->animationState = 6;
LoadAnimation(ent, 3);
InitAnimationForceUpdate(ent, 3);
}
void sub_08065B9C(Entity* ent) {
+3 -3
View File
@@ -7,7 +7,7 @@ extern void sub_08078778(Entity*);
extern void sub_0805E47C(Entity*);
extern void sub_08004274(Entity*);
extern void sub_0806ED78(Entity*);
extern void TextboxTryNoOverlap(u32);
extern void TextboxNoOverlapFollow(u32);
extern void sub_0805E584();
extern void sub_0807DD64();
extern void CreateFx();
@@ -28,7 +28,7 @@ extern void sub_08078778(Entity*);
extern void sub_0805E47C(Entity*);
extern void sub_08004274(Entity*);
extern void sub_0806ED78(Entity*);
extern void TextboxTryNoOverlap(u32);
extern void TextboxNoOverlapFollow(u32);
extern void sub_0805E584();
extern void sub_0807DD64();
extern void CreateFx();
@@ -73,7 +73,7 @@ void sub_08062C24(Entity* ent) {
sub_08004274(ent);
if ((ent->frames.all & 128) != 0) {
InitializeAnimation(ent, 4);
TextboxTryNoOverlap(2561);
TextboxNoOverlapFollow(2561);
ent->action++;
}
}
+1 -1
View File
@@ -24,7 +24,7 @@ void sub_08056360(void)
return;
}
void TextboxTryNoOverlap(u32 index)
void TextboxNoOverlapFollow(u32 index)
{
if (gRoomControls.cameraTarget != NULL) {
+8 -8
View File
@@ -16,7 +16,7 @@ u32 sub_0806EDC4(Entity* ent);
void DeleteThisEntity(void);
extern Entity* GetEntityByType(u32, u32);
extern void sub_080686C4(Entity*, Entity*);
extern void LoadAnimation(Entity*, u32);
extern void InitAnimationForceUpdate(Entity*, u32);
extern void sub_080042B8(Entity*);
extern void sub_0806F62C(Entity*, u32, u32);
extern u32 sub_08003FC4(Entity*, u32);
@@ -111,27 +111,27 @@ void sub_08066DE4(Entity* ent) {
}
void sub_08066E08(Entity* ent) {
LoadAnimation(ent, 0x50);
InitAnimationForceUpdate(ent, 0x50);
ent->field_0x80 = ent->field_0x58;
}
void sub_08066E20(Entity* ent) {
LoadAnimation(ent, 0x44);
InitAnimationForceUpdate(ent, 0x44);
ent->field_0x80 = ent->field_0x58;
}
void sub_08066E38(Entity* ent) {
LoadAnimation(ent, 0x48);
InitAnimationForceUpdate(ent, 0x48);
ent->field_0x80 = ent->field_0x58;
}
void sub_08066E50(Entity* ent) {
LoadAnimation(ent, 0x4C);
InitAnimationForceUpdate(ent, 0x4C);
ent->field_0x80 = ent->field_0x58;
}
void sub_08066E68(Entity* ent) {
LoadAnimation(ent, 0x54);
InitAnimationForceUpdate(ent, 0x54);
ent->field_0x80 = ent->field_0x58;
}
@@ -139,7 +139,7 @@ void sub_08066E80(Entity* ent, u8* param_2) {
switch (param_2[0x18]) {
case 0:
param_2[0x18]++;
LoadAnimation(ent, 0x16);
InitAnimationForceUpdate(ent, 0x16);
break;
case 1:
sub_080042B8(ent);
@@ -165,7 +165,7 @@ void sub_08066E80(Entity* ent, u8* param_2) {
sub_080042B8(ent);
if (sub_08003FC4(ent, 0x2000) == 0) {
param_2[0x18]++;
LoadAnimation(ent, 0x1E);
InitAnimationForceUpdate(ent, 0x1E);
}
break;
case 4: