Merge branch 'master' of github.com:zeldaret/tmc

This commit is contained in:
Ibot02
2020-08-09 12:16:02 +02:00
311 changed files with 6370 additions and 5443 deletions
+11
View File
@@ -1,6 +1,17 @@
#include "global.h"
#include "entity.h"
extern u8 gArea;
extern u8 gUnk_08127D30[];
bool32 sub_08052620(u32 r0) {
return gArea == 0x81;
}
bool32 sub_08052638(u32 r0) {
return gUnk_08127D30[r0 * 4] == 0x81;
}
u32 sub_08052654() {
return (gArea >> 7) & 1;
+1 -1
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "menu.h"
+4 -4
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "functions.h"
@@ -23,8 +23,8 @@ extern struct_0811BE48 gUnk_0811BE48[];
void sub_08077B98(UnkItemStruct* unk)
{
if ((gLinkState.field_0x2c == NULL) || (gLinkState.field_0x2c[9] != 1)) {
gLinkState.field_0x2c = sub_08077C54(unk);
if ((gPlayerState.field_0x2c == NULL) || (gPlayerState.field_0x2c[9] != 1)) {
gPlayerState.field_0x2c = sub_08077C54(unk);
}
}
@@ -34,7 +34,7 @@ void sub_08077BB8(UnkItemStruct* unk)
if (temp != NULL) {
temp[0x10] = 0x20;
}
gLinkState.field_0x2c = temp;
gPlayerState.field_0x2c = temp;
}
Entity* sub_08077BD4(ItemBehavior *beh)
+27 -27
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "functions.h"
typedef struct {
@@ -18,29 +18,29 @@ void sub_08077DF4(Entity *ent, u32 arg1)
if ((arg1 & 0xff) > 0xb8) {
arg1 += (ent->entityType).form >> 1;
}
gLinkEntity.spriteIndex = (short)(arg1 >> 8);
InitAnimationForceUpdate(&gLinkEntity, (u8)arg1);
gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
sub_08077E54(ent);
}
void UpdateItemAnim(Entity *ent)
{
UpdateAnimationSingleFrame(&gLinkEntity);
UpdateAnimationSingleFrame(&gPlayerEntity);
sub_08077E54(ent);
}
void sub_08077E3C(Entity *ent)
{
sub_080042BA(&gLinkEntity);
sub_080042BA(&gPlayerEntity);
sub_08077E54(ent);
}
void sub_08077E54(Entity *ent)
{
ent->action = gLinkEntity.animIndex;
*(u8 *)&ent->spriteIndex = gLinkEntity.frameIndex;
ent->previousActionFlag = gLinkEntity.frameDuration;
ent->actionDelay = gLinkEntity.frames.all;
ent->action = gPlayerEntity.animIndex;
*(u8 *)&ent->spriteIndex = gPlayerEntity.frameIndex;
ent->previousActionFlag = gPlayerEntity.frameDuration;
ent->actionDelay = gPlayerEntity.frames.all;
}
void sub_08077E78(void* arg0, u32 bits)
@@ -49,27 +49,27 @@ void sub_08077E78(void* arg0, u32 bits)
u32 not;
if (bits == 0) {
if (gLinkState.field_0x2c != NULL) {
((Unk_bitfield *)gLinkState.field_0x2c)[0x11].b0 = 6;
gLinkState.field_0x2c = (u8 *)bits;
if (gPlayerState.field_0x2c != NULL) {
((Unk_bitfield *)gPlayerState.field_0x2c)[0x11].b0 = 6;
gPlayerState.field_0x2c = (u8 *)bits;
}
else {
gLinkState.field_0x2c = (u8 *)bits;
gPlayerState.field_0x2c = (u8 *)bits;
}
}
not = (8 >> bits);
gLinkState.field_0x3[1] &= ~((u8)((8 >> bits) << 4) | not);
gPlayerState.field_0x3[1] &= ~((u8)((8 >> bits) << 4) | not);
not = ~not;
gLinkState.field_0xa &= not;
gLinkState.keepFacing &= not;
gPlayerState.field_0xa &= not;
gPlayerState.keepFacing &= not;
_DmaZero(arg0, 0x1c);
}
u32 sub_08077EC8(Unk_struct* arg0)
{
if ((gLinkState.field_0x1a[1] & 8) != 0) {
if ((gPlayerState.field_0x1a[1] & 8) != 0) {
sub_08077DF4((Entity *)arg0,0x170);
arg0->unk[7] = 0x28;
arg0->unk[4] = 7;
@@ -83,12 +83,12 @@ u32 sub_08077EC8(Unk_struct* arg0)
void sub_08077EFC(ItemBehavior* arg0)
{
sub_08077F24(arg0, (u16)gLinkState.field_0x90.HALF.LO);
sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.LO);
}
void sub_08077F10(ItemBehavior* arg0)
{
sub_08077F24(arg0, (u16)gLinkState.field_0x90.HALF.HI);
sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.HI);
}
NAKED
@@ -105,7 +105,7 @@ void sub_08077F50(ItemBehavior *beh, u32 arg1)
u32 sub_08077F64(ItemBehavior* arg0, u32 unk)
{
u32 temp;
if (gLinkState.heldObject == 0) {
if (gPlayerState.heldObject == 0) {
sub_08077F50(arg0, unk);
temp = 0;
}
@@ -119,15 +119,15 @@ void sub_08077F84(void)
{
Entity *obj;
if (((gLinkEntity.collisionLayer & 2) == 0) &&
GetTileTypeByPos(gLinkEntity.x.HALF.HI, gLinkEntity.y.HALF.HI - 0xc, 2) - 0x343U < 4) {
sub_0807AA80(&gLinkEntity);
gLinkState.jumpStatus |= 8;
if (((gPlayerEntity.collisionLayer & 2) == 0) &&
GetTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 0xc, 2) - 0x343U < 4) {
sub_0807AA80(&gPlayerEntity);
gPlayerState.jumpStatus |= 8;
obj = CreateObject(0x44, 0, 0);
if (obj != NULL) {
obj->x = gLinkEntity.x;
obj->y.HALF.HI = gLinkEntity.y.HALF.HI - 0xc;
gLinkEntity.y.HALF.HI -= 0xc;
obj->x = gPlayerEntity.x;
obj->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0xc;
gPlayerEntity.y.HALF.HI -= 0xc;
}
}
}
+4 -4
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
#include "link.h"
#include "player.h"
extern s32 sub_080012DC(Entity*);
extern u32 GetNextFunction(Entity*);
@@ -57,7 +57,7 @@ void sub_0802A8C8(Entity* this)
void sub_0802A8E0(Entity *this)
{
this->previousActionFlag = 1;
this->filler[1] = 0x3c;
this->field_0x1d = 0x3c;
}
void sub_0802A8EC(Entity *this)
@@ -72,8 +72,8 @@ void sub_0802A8F4(Entity *this)
void sub_0802A8FC(Entity *this)
{
if ((gLinkState.field_0x1c & 0xf) == 0) {
this->currentHealth = gLinkState.field_0x1c & 0xf;
if ((gPlayerState.field_0x1c & 0xf) == 0) {
this->currentHealth = gPlayerState.field_0x1c & 0xf;
}
}
+13 -17
View File
@@ -115,26 +115,22 @@ void sub_080324FC(Entity* this) {
}
}
#if NON_MATCHING // r4-r5 register swap
void sub_08032574(Entity* this) {
if (this->attachedEntity == NULL || !(this->attachedEntity->bitfield & 0x80)) {
(this->field_0x76)--;
if ((this->field_0x76 == 0) || (sub_080AEFE0(this) == 0)) {
sub_0803275C(this);
} else {
UpdateAnimationSingleFrame(this);
if (!(this->field_0x76 & 0x7)) {
sub_08032794(this);
}
}
if (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)) {
sub_0803275C(this);
return;
}
if (--this->field_0x76 == 0 || !sub_080AEFE0(this)) {
sub_0803275C(this);
return;
}
UpdateAnimationSingleFrame(this);
if ((this->field_0x76 & 0x7) == 0) {
sub_08032794(this);
}
}
#else
NAKED
void sub_08032574(Entity* this) {
asm(".include \"asm/non_matching/keaton/sub_08032574.inc\"");
}
#endif
void sub_080325C4(Entity* this) {
this->actionDelay--;
+4 -4
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "enemy.h"
#include "link.h"
#include "player.h"
extern void sub_0804AA30(Entity*, void *);
extern u32 sub_0806F520(Entity*);
@@ -73,7 +73,7 @@ void sub_08021DF0(Entity *this)
this->height.HALF.HI = -0x10;
}
this->direction = Random() & 0x1f;
this->filler[0] = 1;
this->field_0x1c = 1;
this->spritePriority.b0 = 3;
this->collisionLayer = 3;
UpdateSpriteForCollisionLayer(this);
@@ -113,7 +113,7 @@ void sub_08021EBC(Entity *this)
this->actionDelay--;
}
else {
iVar1 = sub_0806FCB8(this, gLinkEntity.x.HALF.HI, gLinkEntity.y.HALF.HI, 0x70);
iVar1 = sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70);
if (iVar1 != 0) {
sub_08021EF0(this);
}
@@ -139,7 +139,7 @@ void sub_08021F24(Entity *this)
this->actionDelay = gUnk_080CB6F6[Random() & 0xf];
InitializeAnimation(this, 1);
}
else if (!this->field_0x7a && !(sub_0806FCB8(this, gLinkEntity.x.HALF.HI, gLinkEntity.y.HALF.HI, 0x70))) {
else if (!this->field_0x7a && !(sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) {
this->action = 3;
this->actionDelay = 0x1e;
InitializeAnimation(this, 1);
+5 -5
View File
@@ -3,7 +3,7 @@
#include "functions.h"
#include "trig.h"
#include "random.h"
#include "link.h"
#include "player.h"
// Lakitu
extern void EnemyFunctionHandler(Entity *, void (*const funcs[])(Entity*));
@@ -268,8 +268,8 @@ void sub_0803CA0C(Entity *this) {
}
bool32 sub_0803CA4C(Entity *this) {
if (sub_0806FCB8(this, gLinkEntity.x.HALF.HI, gLinkEntity.y.HALF.HI, 0x28) == 0) {
if (sub_080041A0(this, &gLinkEntity, 0x70, 0x50)) {
if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) {
if (sub_080041A0(this, &gPlayerEntity, 0x70, 0x50)) {
return 1;
}
}
@@ -278,7 +278,7 @@ bool32 sub_0803CA4C(Entity *this) {
}
void sub_0803CA84(Entity *this, u32 unkParameter) {
u32 altAnimState = GetFacingDirection(this, &gLinkEntity);
u32 altAnimState = GetFacingDirection(this, &gPlayerEntity);
if (((altAnimState - 3) & 7) > 2 || ((this->animationState - (altAnimState >> 3)) & 3) > 1) {
u32 intermediate = (altAnimState + 4) & 0x18;
@@ -324,7 +324,7 @@ void sub_0803CB34(Entity *this) {
this->action = 5;
this->damageType = 0xa6;
this->field_0x78.HALF.LO = GetFacingDirection(this, &gLinkEntity);
this->field_0x78.HALF.LO = GetFacingDirection(this, &gPlayerEntity);
InitAnimationForceUpdate(this, this->animationState + 8);
}
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
extern u32 GetNextFunction(Entity *);
@@ -60,7 +60,7 @@ void sub_0803CD40(Entity *this) {
ModHealth(-2);
sub_0800449C(&gLinkEntity, 122);
sub_0800449C(&gPlayerEntity, 122);
sub_08079D84();
sub_0803CE3C(this);
+118 -145
View File
@@ -22,115 +22,100 @@ extern Entity* gUnk_020000B0;
extern u8 gUnk_080CA4C8[];
extern u16 gUnk_080CA4CA[];
extern s16 gSineTable[];
void Leever(Entity *this)
{
EnemyFunctionHandler(this, gUnk_080CA49C);
SetChildOffset(this, 0, 1, -0x10);
void Leever(Entity* this) {
EnemyFunctionHandler(this, gUnk_080CA49C);
SetChildOffset(this, 0, 1, -0x10);
}
void sub_0801FC28(Entity *this)
{
gUnk_080CA4B4[this->action](this);
void sub_0801FC28(Entity* this) {
gUnk_080CA4B4[this->action](this);
}
void sub_0801FC40(Entity *this)
{
if (this->bitfield == 0x80) {
if (this->action == 3) {
this->field_0x74 = 1;
void sub_0801FC40(Entity* this) {
if (this->bitfield == 0x80) {
if (this->action == 3) {
this->field_0x74 = 1;
}
} else {
if (this->field_0x43 != 0) {
sub_0804A9FC(this, 0x1c);
}
}
}
else {
if (this->field_0x43 != 0) {
sub_0804A9FC(this, 0x1c);
}
}
sub_0804AA30(this, gUnk_080CA49C);
sub_0804AA30(this, gUnk_080CA49C);
}
void sub_0801FC7C(Entity *this)
{
if ((this->entityType).form == 0) {
sub_0804A7D4(this);
}
else {
CreateDeathFx(this, 0xf1, 0);
}
}
void sub_0801FC9C(Entity *this)
{
sub_0804A720(this);
this->action = 1;
this->actionDelay = Random();
}
void sub_0801FCB0(Entity *this)
{
if (--this->actionDelay == 0) {
if (sub_0801FE68(this, Random() & 0x1f) != 0) {
this->action = 2;
this->spriteSettings.b.draw = TRUE;
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA4C8[Random() & 1]) & 0x1f;
InitializeAnimation(this, 0);
UpdateSpriteForCollisionLayer(this);
}
else {
this->actionDelay = (Random() & 0x18) + 8;
}
}
}
void sub_0801FD2C(Entity *this)
{
GetNextFrame(this);
if (this->frames.b.f3 != 0) {
this->action = 3;
if (this->entityType.form == 0) {
this->field_0x74 = 0xb4;
}
else {
this->field_0x74 = 0x6e;
}
InitializeAnimation(this,2);
}
else if (this->frames.b.f0 != 0) {
this->frames.all &= 0xfe;
this->flags |= 0x80;
void sub_0801FC7C(Entity* this) {
if ((this->entityType).form == 0) {
sub_0804A7D4(this);
} else {
CreateDeathFx(this, 0xf1, 0);
}
}
void sub_0801FD80(Entity *this)
{
sub_0801FED4(this);
GetNextFrame(this);
if (--this->field_0x74 == 0) {
this->action = 4;
this->flags &= 0x7f;
InitializeAnimation(this, 1);
}
}
void sub_0801FDB4(Entity *this)
{
sub_0801FED4(this);
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
void sub_0801FC9C(Entity* this) {
sub_0804A720(this);
this->action = 1;
this->actionDelay = 0xf0;
this->spriteSettings.b.draw = FALSE;
}
this->actionDelay = Random();
}
u32 sub_0801FDE4(Entity *ent, s32 x, s32 y)
{
void sub_0801FCB0(Entity* this) {
if (--this->actionDelay == 0) {
if (sub_0801FE68(this, Random() & 0x1f) != 0) {
this->action = 2;
this->spriteSettings.b.draw = TRUE;
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA4C8[Random() & 1]) & 0x1f;
InitializeAnimation(this, 0);
UpdateSpriteForCollisionLayer(this);
} else {
this->actionDelay = (Random() & 0x18) + 8;
}
}
}
void sub_0801FD2C(Entity* this) {
GetNextFrame(this);
if (this->frames.b.f3 != 0) {
this->action = 3;
if (this->entityType.form == 0) {
this->field_0x74 = 0xb4;
} else {
this->field_0x74 = 0x6e;
}
InitializeAnimation(this, 2);
} else if (this->frames.b.f0 != 0) {
this->frames.all &= 0xfe;
this->flags |= 0x80;
}
}
void sub_0801FD80(Entity* this) {
sub_0801FED4(this);
GetNextFrame(this);
if (--this->field_0x74 == 0) {
this->action = 4;
this->flags &= 0x7f;
InitializeAnimation(this, 1);
}
}
void sub_0801FDB4(Entity* this) {
sub_0801FED4(this);
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
this->action = 1;
this->actionDelay = 0xf0;
this->spriteSettings.b.draw = FALSE;
}
}
u32 sub_0801FDE4(Entity* ent, s32 x, s32 y) {
u32 uVar3;
u16 *puVar4;
u16* puVar4;
if (sub_080002D4(x, y, gUnk_020000B0->collisionLayer) != 0) {
return 0;
} else {
@@ -147,60 +132,48 @@ u32 sub_0801FDE4(Entity *ent, s32 x, s32 y)
}
}
bool32 sub_0801FE68(Entity *ent, s32 arg2)
{
s32 sin, cos;
s32 x, y;
u32 i;
bool32 sub_0801FE68(Entity* ent, s32 arg2) {
s32 sin, cos;
s32 x, y;
u32 i;
if (sub_08049FDC(ent, 1) == 0) {
return 0;
}
else {
x = gUnk_020000B0->x.WORD;
y = gUnk_020000B0->y.WORD;
sin = gSineTable[arg2 * 8] << 11;
cos = gSineTable[arg2 * 8 + 0x40] << 11;
for (i = 0; i < 8; i++) {
x += sin;
y += -cos;
if (sub_0801FDE4(ent, x >> 0x10, y >> 0x10) == 0) {
return 0;
}
if (sub_08049FDC(ent, 1) == 0) {
return 0;
} else {
x = gUnk_020000B0->x.WORD;
y = gUnk_020000B0->y.WORD;
sin = gSineTable[arg2 * 8] << 11;
cos = gSineTable[arg2 * 8 + 0x40] << 11;
for (i = 0; i < 8; i++) {
x += sin;
y += -cos;
if (sub_0801FDE4(ent, x >> 0x10, y >> 0x10) == 0) {
return 0;
}
}
return 1;
}
return 1;
}
}
#if NON_MATCHING
void sub_0801FED4(Entity *this)
{
s16 sVar2;
if (sub_08049FDC(this, 1) == 0) {
this->field_0x74 = 1;
}
sVar2 = (this->frames.all & 0xf) * 0x20;
this->nonPlanarMovement = sVar2;
if (this->entityType.form == 0) {
this->field_0xf++;
if ((this->field_0xf & 0xf) == 0) {
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
extern u32 sub_0800132C(Entity*, Entity*);
void sub_0801FED4(Entity* this) {
s16 sVar2;
if (sub_08049FDC(this, 1) == 0) {
this->field_0x74 = 1;
}
}
else {
this->nonPlanarMovement = sVar2 + 0x40;
this->field_0xf++;
if ((this->field_0xf & 0x7) == 0) {
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
sVar2 = (this->frames.all & 0xf) * 0x20;
this->nonPlanarMovement = sVar2;
if (this->entityType.form == 0) {
if ((this->field_0xf++ & 0xf) == 0) {
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
}
} else {
this->nonPlanarMovement = sVar2 + 0x40;
if ((this->field_0xf++ & 0x7) == 0) {
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
}
}
}
sub_080AEF88(this);
sub_080AEF88(this);
}
#else
NAKED
void sub_0801FED4(Entity *this) {
asm(".include \"asm/non_matching/leever/sub_0801FED4.inc\"");
}
#endif
+1 -1
View File
@@ -62,7 +62,7 @@ void sub_0801EB2C(Entity* ent) {
void sub_0801EB68(Entity* ent) {
ent->previousActionFlag = 1;
ent->filler[1] = 60;
ent->field_0x1d = 60;
}
void sub_0801EB74(Entity* ent) {
+21 -21
View File
@@ -4,7 +4,7 @@
#include "functions.h"
#include "npc.h"
#include "structures.h"
#include "link.h"
#include "player.h"
extern void sub_080293DC(Entity*);
extern void sub_080296D8(Entity*);
@@ -25,7 +25,7 @@ void RupeeLike(Entity* this) {
u32 uVar1;
if (this->entityType.parameter == 0) {
uVar1 = sub_080043E8(this);
uVar1 = (u8)sub_080043E8(this);
if (uVar1 != 0) {
if (this->action == 4) {
sub_080296D8(this);
@@ -61,7 +61,7 @@ void sub_08029318(Entity* this) {
this->field_0xf = 0;
this->field_0x82.HALF.HI = 0x41;
this->flags2 &= 0xfc;
this->field_0x80.HALF.LO = gLinkEntity.spritePriority.b1;
this->field_0x80.HALF.LO = gPlayerEntity.spritePriority.b1;
sub_08004488(0x104);
} else {
if (this->field_0x43 != 0) {
@@ -116,7 +116,7 @@ void sub_08029474(Entity* this) {
if (this->frames.b.f3) {
this->action = 3;
this->actionDelay = 8;
bVar1 = GetFacingDirection(this, &gLinkEntity);
bVar1 = GetFacingDirection(this, &gPlayerEntity);
this->direction = bVar1;
this->animationState = (bVar1 << 0x18) >> 0x1c;
InitializeAnimation(this, this->animationState);
@@ -133,7 +133,7 @@ void sub_080294D4(Entity* this) {
if (sub_08049FDC(this, 1) != 0) {
if (--this->actionDelay == 0) {
this->actionDelay = 8;
sub_08004596(this, GetFacingDirection(this, &gLinkEntity));
sub_08004596(this, GetFacingDirection(this, &gPlayerEntity));
sub_0802969C(this);
}
sub_080AEF88(this);
@@ -162,13 +162,13 @@ void sub_0802953C(Entity* this) {
if (((this->field_0xf > 0x2d) || (gUnk_02002A40.stats.rupees == 0)) && (this->actionDelay == 0)) {
sub_080296D8(this);
} else {
ResetLink();
gLinkState.field_0x1a[0] |= 0x80;
PositionRelative(this, &gLinkEntity, 0, 0x10000);
ResetPlayer();
gPlayerState.field_0x1a[0] |= 0x80;
PositionRelative(this, &gPlayerEntity, 0, 0x10000);
pbVar3 = GetSpriteSubEntryOffsetDataPointer((u16)this->spriteIndex, this->frameIndex);
gLinkEntity.spriteOffsetX = pbVar3[0];
gLinkEntity.spriteOffsetY = pbVar3[1] - 1;
gLinkEntity.spritePriority.b1 = 0;
gPlayerEntity.spriteOffsetX = pbVar3[0];
gPlayerEntity.spriteOffsetY = pbVar3[1] - 1;
gPlayerEntity.spritePriority.b1 = 0;
if (--this->field_0x82.HALF.HI == 0) {
this->field_0x82.HALF.HI = 0x41;
if (gUnk_02002A40.stats.rupees != 0) {
@@ -230,16 +230,16 @@ void sub_080296C8(Entity* this) {
}
void sub_080296D8(Entity* this) {
gLinkState.jumpStatus = 0x41;
gLinkState.flags.all &= 0xffffffef;
gLinkEntity.flags |= 0x80;
gLinkEntity.field_0x20 = 0x18000;
gLinkEntity.hurtBlinkTime = 0xa6;
gLinkEntity.height.HALF.HI = -2;
gLinkEntity.direction = gLinkEntity.animationState << 2;
gLinkEntity.spritePriority.b1 = this->field_0x80.HALF.LO;
gLinkEntity.spriteOffsetY = 0;
gLinkEntity.nonPlanarMovement = 0x140;
gPlayerState.jumpStatus = 0x41;
gPlayerState.flags.all &= 0xffffffef;
gPlayerEntity.flags |= 0x80;
gPlayerEntity.field_0x20 = 0x18000;
gPlayerEntity.hurtBlinkTime = 0xa6;
gPlayerEntity.height.HALF.HI = -2;
gPlayerEntity.direction = gPlayerEntity.animationState << 2;
gPlayerEntity.spritePriority.b1 = this->field_0x80.HALF.LO;
gPlayerEntity.spriteOffsetY = 0;
gPlayerEntity.nonPlanarMovement = 0x140;
this->action = 5;
this->field_0xf = 0x3c;
this->flags2 |= 3;
+1 -1
View File
@@ -46,7 +46,7 @@ void sub_0803169C(Entity *this)
void sub_080316DC(Entity *this)
{
this->previousActionFlag = 1;
this->filler[1] = 0x3c;
this->field_0x1d = 0x3c;
}
void sub_080316E8(Entity *this)
+3 -3
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "enemy.h"
#include "structures.h"
#include "link.h"
#include "player.h"
#include "functions.h"
extern void (*const gUnk_080CEB74[])(Entity*);
@@ -34,7 +34,7 @@ void sub_08033564(Entity* this) {
this->spriteSettings.b.draw = FALSE;
this->flags &= 0x7f;
this->field_0x7c.HALF.LO = 0x27c;
gLinkState.flags.all |= 0x4000;
gPlayerState.flags.all |= 0x4000;
gUnk_02002A40.stats.filler2[4] = this->entityType.form + 1;
gUnk_02002A40.stats.field_0x20 = 600;
if (this->entityType.form == 0) {
@@ -85,7 +85,7 @@ void sub_08033674(Entity* this) {
sub_0804A720(this);
this->actionDelay = 0;
this->action = 1;
this->filler[0] = 1;
this->field_0x1c = 1;
this->field_0x80.HWORD = this->x.HALF.HI;
this->field_0x82.HWORD = this->y.HALF.HI;
sub_08033744(this);
+3 -3
View File
@@ -122,18 +122,18 @@ void DeleteEntity(Entity* ent)
}
}
extern Entity gLinkEntity;
extern Entity gPlayerEntity;
void sub_0805E870(Entity*);
void sub_0805E84C(void)
{
Entity* ent = &gLinkEntity;
Entity* ent = &gPlayerEntity;
do {
if ((int)ent->field_0x0 < 0) {
sub_0805E870(ent);
}
} while (ent++, ent < (&gLinkEntity + 80));
} while (ent++, ent < (&gPlayerEntity + 80));
return;
}
+68
View File
@@ -0,0 +1,68 @@
#include "global.h"
#include "entity.h"
#include "player.h"
#include "structures.h"
#include "functions.h"
#include "room.h"
#include "flags.h"
extern u32 gUnk_03000B80;
extern u32 gUnk_03003FC0;
extern Entity gPlayerEntity;
extern u8 gUnk_080FCAC8[];
void InitializePlayer(void)
{
Entity* pl;
sub_080784C8();
_DmaZero((void *)&gUnk_03000B80, 0x70);
_DmaZero((void *)&gPlayerState, 0xb0);
_DmaFill32(0xffffffff, &gPlayerState.field_0x40, 0x40);
pl = &gPlayerEntity;
_DmaZero((void *)pl, 0x88);
gRoomControls.cameraTarget = pl;
gPlayerState.playerAction = gUnk_080FCAC8[gScreenTransition.field_0xf];
if (!CheckGlobalFlag(0x14)) {
gPlayerState.flags.all |= 8;
}
switch (gScreenTransition.field_0xf) {
case 0x2:
case 0x6:
pl->height.HALF.HI = -0xc0;
break;
case 0x4:
gPlayerState.field_0x34[4] = 0x10;
pl->direction = gScreenTransition.playerState << 2;
case 0x3:
pl->nonPlanarMovement = 0xe0;
break;
case 0x7:
case 0x8:
gPlayerState.field_0x34[4] = 1;
gPlayerState.field_0x34[5] = gScreenTransition.field_0xf;
break;
case 0xa:
gPlayerState.field_0x34[4] = 1;
break;
case 0xb:
gPlayerState.field_0x34[4] = 3;
break;
case 0xc:
gPlayerState.field_0x34[4] = 4;
}
pl->entityType.type = 1;
pl->flags |= 0xa0;
pl->spritePriority.b0 = 4;
pl->currentHealth = gUnk_02002A40.stats.health;
pl->x.HALF.HI = gScreenTransition.playerStartPos.HALF.x;
pl->y.HALF.HI = gScreenTransition.playerStartPos.HALF.y;
pl->animationState = gScreenTransition.playerState;
pl->collisionLayer = gScreenTransition.playerLayer;
UpdateSpriteForCollisionLayer(pl);
sub_0805EA2C(pl, 1);
sub_08017640();
}
+20 -20
View File
@@ -61,28 +61,28 @@ extern u8 gUnk_02034490;
#if 0
void Ocarina(ItemBehavior* beh, u32 inputFlags) {
gOcarinaStates[beh->stateID](beh, inputFlags);
gLinkEntity.field_0x7a++;
gPlayerEntity.field_0x7a++;
}
void OcarinaUse(ItemBehavior *beh, u32 arg1)
{
u32 bVar1;
if (gLinkState.linkAction == 0x18) {
LinkChangeState(beh, arg1);
if (gPlayerState.playerAction == 0x18) {
PlayerChangeState(beh, arg1);
}
else {
beh->field_0x5[4] = beh->field_0x5[4] | 0xf;
gLinkEntity.animationState = 4;
gLinkEntity.spriteSettings.b.flipX = 0;
gLinkEntity.flags &= 0x7f;
gLinkEntity.field_0x7a = 2;
gLinkState.flags.all |= 0x10000000;
gLinkState.field_0x27[0] = 0xff;
gPlayerEntity.animationState = 4;
gPlayerEntity.spriteSettings.b.flipX = 0;
gPlayerEntity.flags &= 0x7f;
gPlayerEntity.field_0x7a = 2;
gPlayerState.flags.all |= 0x10000000;
gPlayerState.field_0x27[0] = 0xff;
gUnk_02034490 = 1;
bVar1 = (8 >> arg1);
gLinkState.field_0xa |= bVar1;
gLinkState.keepFacing |= bVar1;
gPlayerState.field_0xa |= bVar1;
gPlayerState.keepFacing |= bVar1;
sub_08078F60();
sub_08077D38(beh, arg1);
PlaySFX(0x216);
@@ -98,7 +98,7 @@ void PacciCane(ItemBehavior* beh, u32 arg1) {
void sub_08076C98(ItemBehavior* beh, u32 arg1) {
beh->field_0x5[4] |= 0xf;
sub_08077D38(beh, arg1);
sub_0806F948(&gLinkEntity);
sub_0806F948(&gPlayerEntity);
sub_08077BB8(beh);
}
@@ -118,25 +118,25 @@ void Shield(ItemBehavior* beh, u32 arg1) {
}
void sub_08076D04(ItemBehavior* beh, u32 arg1) {
gLinkState.field_0x3[0] = 0x81;
gPlayerState.field_0x3[0] = 0x81;
beh->field_0x5[4] = 2;
sub_0806F948(&gLinkEntity);
sub_0806F948(&gPlayerEntity);
sub_08077D38(beh, arg1);
sub_08077BB8(beh);
}
void sub_08076D34(ItemBehavior* beh, u32 arg1) {
if (sub_08077EFC() != 0) {
gLinkState.field_0x3[0] |= 1;
gPlayerState.field_0x3[0] |= 1;
UpdateItemAnim(beh);
if (beh->field_0x5[9] != 0) {
beh->stateID++;
beh->field_0xf = 0;
gLinkState.field_0xa &= ~(u8)(8 >> arg1);
gPlayerState.field_0xa &= ~(u8)(8 >> arg1);
PlaySFX(0x15d);
}
} else {
gLinkState.field_0x3[0] = 0;
gPlayerState.field_0x3[0] = 0;
sub_08077E78(beh, arg1);
}
}
@@ -144,17 +144,17 @@ void sub_08076D34(ItemBehavior* beh, u32 arg1) {
void sub_08076D94(ItemBehavior *beh, u32 arg1)
{
if (sub_08077EFC(beh)) {
gLinkState.field_0x3[0] |= 1;
gPlayerState.field_0x3[0] |= 1;
UpdateItemAnim(beh);
}
else {
gLinkState.field_0x3[0] = 0;
gPlayerState.field_0x3[0] = 0;
sub_08077E78(beh, arg1);
}
}
void GustJar(ItemBehavior *beh, u32 arg1)
{
gLinkState.field_0xa8[0] = 3;
gPlayerState.field_0xa8[0] = 3;
gUnk_0811BDF4[beh->stateID](beh, arg1);
}
+14 -14
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
extern void DeleteThisEntity();
extern void sub_08078CD0(Entity*);
@@ -31,14 +31,14 @@ void sub_08018CBC(Entity *this)
u8 uVar2;
Entity *pEVar3;
*(u32 *)&this->cutsceneBeh = this->x.WORD = gLinkEntity.x.WORD;
*(u32 *)&this->field_0x80 = this->y.WORD = gLinkEntity.y.WORD;
uVar2 = this->animationState = gLinkEntity.animationState & 0xe;
*(u32 *)&this->cutsceneBeh = this->x.WORD = gPlayerEntity.x.WORD;
*(u32 *)&this->field_0x80 = this->y.WORD = gPlayerEntity.y.WORD;
uVar2 = this->animationState = gPlayerEntity.animationState & 0xe;
this->direction = (u8)(uVar2 << 2);
this->nonPlanarMovement = 0x400;
this->damageType = 0x96;
this->field_0x3c = (gLinkEntity.field_0x3c + 1) | 0x80;
this->flags2 = gLinkEntity.flags2;
this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x80;
this->flags2 = gPlayerEntity.flags2;
pEVar3 = this->attachedEntity;
if (pEVar3 != NULL) {
this->action = 1;
@@ -51,7 +51,7 @@ void sub_08018CBC(Entity *this)
this->attachedEntity->spriteSettings.b.draw = 0;
}
else {
if (gLinkState.field_0x1c == 0) {
if (gPlayerState.field_0x1c == 0) {
DeleteThisEntity();
}
this->action = 2;
@@ -59,14 +59,14 @@ void sub_08018CBC(Entity *this)
this->spriteIndex = 0xa6;
this->palette.raw = 0x33;
this->spriteVramOffset = 0;
(this->entityType).form = gLinkState.field_0x1d[0] - 1;
(this->entityType).form = gPlayerState.field_0x1d[0] - 1;
this->actionDelay = gUnk_080B3DE0[(this->entityType).form * 2];
this->field_0x44 = gUnk_080B3DE0[(this->entityType).form * 2 + 1];
this->field_0x40 = 0x1b;
this->boundingBox = gUnk_080B3DE8[(this->entityType).form];
(u32 *)gLinkEntity.field_0x70.WORD = this;
sub_08078CD0(&gLinkEntity);
(u32 *)gLinkEntity.field_0x70.WORD = pEVar3;
(u32 *)gPlayerEntity.field_0x70.WORD = this;
sub_08078CD0(&gPlayerEntity);
(u32 *)gPlayerEntity.field_0x70.WORD = pEVar3;
InitializeAnimation(this, (this->entityType).form + 10);
sub_08018FA0(this);
}
@@ -79,10 +79,10 @@ void sub_08018DE8(Entity *this)
bVar1 = this->attachedEntity->field_0x3a & 4;
if (bVar1 == 0) {
gLinkState.field_0x1c = bVar1;
gPlayerState.field_0x1c = bVar1;
DeleteThisEntity();
}
switch (gLinkState.field_0x1c) {
switch (gPlayerState.field_0x1c) {
case 0:
sub_08018F6C(this);
break;
@@ -95,5 +95,5 @@ void sub_08018DE8(Entity *this)
sub_08018FA0(this);
break;
}
sub_08078CD0(&gLinkEntity);
sub_08078CD0(&gPlayerEntity);
}
+5 -5
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "manager.h"
extern void* GetCurrentRoomProperty(u8);
@@ -19,13 +19,13 @@ void sub_08057CB4(Entity * this) {
return;
}
}
if (this->actionDelay == 0 || gLinkState.field_0x10[2] == 0x1e) {
if (this->actionDelay == 0 || gPlayerState.field_0x10[2] == 0x1e) {
for (i = ((UnkManagerHelperStruct*) this->field_0x20);i->field_0x00 != 0xFFFF; i++) {
tmp = (i->field_0x07.all & 0x3);
if (((tmp & (gLinkEntity.collisionLayer)) != 0) &&
(((gLinkState.flags.all & 0x80) != 0) || ((i->field_0x07.b.unk2) != 0)) &&
if (((tmp & (gPlayerEntity.collisionLayer)) != 0) &&
(((gPlayerState.flags.all & 0x80) != 0) || ((i->field_0x07.b.unk2) != 0)) &&
(CheckPlayerInRegion(i->field_0x00,i->field_0x02,i->field_0x04,i->field_0x05) != 0) &&
(gLinkEntity.height.HALF.HI == 0)) {
(gPlayerEntity.height.HALF.HI == 0)) {
DoExitTransition(GetCurrentRoomProperty(i->field_0x06));
}
}
+9 -9
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "manager.h"
#include "flags.h"
#include "area.h"
@@ -55,7 +55,7 @@ void sub_080585DC(Manager*);
void sub_08058408(Manager* this){
u32 tmp2;
tmp2 = (gLinkState.flags.all & 0x08);
tmp2 = (gPlayerState.flags.all & 0x08);
if (tmp2 != 0) return;
if (!CheckPlayerInRegion(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) return;
switch (this->unk_0a) {
@@ -63,7 +63,7 @@ void sub_08058408(Manager* this){
return;
case 2:
sub_080585DC(this);
if ((gLinkState.flags.all & 0x80) == 0) return;
if ((gPlayerState.flags.all & 0x80) == 0) return;
case 0:
default:
sub_080585DC(this);
@@ -85,7 +85,7 @@ void sub_08058408(Manager* this){
u32 sub_0805848C(Manager* this) {
switch (gLinkState.field_0xa8[0]-5) {
switch (gPlayerState.field_0xa8[0]-5) {
case 0:
case 2:
case 3:
@@ -122,11 +122,11 @@ extern void UnfreezeTime(void);
void sub_08058514(Manager* this) {
switch (this->unk_0d) {
case 1:
if ((gLinkState.flags.all & 0x1235) != 0)
if ((gPlayerState.flags.all & 0x1235) != 0)
return;
if (gLinkEntity.height.HALF.HI != 0)
if (gPlayerEntity.height.HALF.HI != 0)
return;
gLinkState.jumpStatus = 0;
gPlayerState.jumpStatus = 0;
sub_08078AA8(this->unk_36, this->unk_35);
this->unk_0d++;
this->unk_0e = 0x1E;
@@ -138,8 +138,8 @@ void sub_08058514(Manager* this) {
}
return;
case 3:
if (gLinkEntity.action != 1 && gLinkEntity.action != 9) return;
gLinkState.field_0x8b = 1;
if (gPlayerEntity.action != 1 && gPlayerEntity.action != 9) return;
gPlayerState.field_0x8b = 1;
UnfreezeTime();
SetFlag(this->unk_3c);
DeleteThisEntity();
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
s32 ModHealth(s32 deltaHealth)
@@ -15,6 +15,6 @@ s32 ModHealth(s32 deltaHealth)
newHealth = (u32)gStats.maxHealth;
}
gStats.health = newHealth;
gLinkEntity.currentHealth = newHealth;
gPlayerEntity.currentHealth = newHealth;
return newHealth;
}
+1 -1
View File
@@ -1,5 +1,5 @@
#include "global.h"
#include "link.h"
#include "player.h"
extern u16 gWalletSizes[4];
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
@@ -28,7 +28,7 @@ void Anju(Entity *this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitializeAnimation(this,(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitializeAnimation(this,(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+4 -4
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "functions.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "room.h"
typedef struct {
@@ -118,8 +118,8 @@ void sub_0806346C(Entity* this) {
s32 iVar2;
s32 iVar3;
iVar3 = (gLinkEntity.x.HALF.HI - this->x.HALF.HI);
iVar2 = (gLinkEntity.y.HALF.HI - this->y.HALF.HI);
iVar3 = (gPlayerEntity.x.HALF.HI - this->x.HALF.HI);
iVar2 = (gPlayerEntity.y.HALF.HI - this->y.HALF.HI);
iVar3 += 0x30;
iVar2 += 0x18;
@@ -139,7 +139,7 @@ void sub_0806346C(Entity* this) {
iVar3 >>= 4;
iVar2 >>= 4;
bVar1 = gUnk_0810C8F0[(gLinkEntity.animationState >> 1) + iVar3 * 4 + iVar2 * 0x18];
bVar1 = gUnk_0810C8F0[(gPlayerEntity.animationState >> 1) + iVar3 * 4 + iVar2 * 0x18];
if (bVar1 != this->entityType.parameter) {
gUnk_0810C89C_struct* temp = &gUnk_0810C89C[bVar1];
sub_08078850(this, 1, temp->unk_04, temp);
+3 -3
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "structures.h"
extern void (*gUnk_081140D4[])(Entity*);
@@ -37,10 +37,10 @@ void sub_0806CF30(Entity* this) {
case 0:
case 1:
if (gScreenTransition.frameCount % 4 == 0) {
if (gLinkEntity.x.HALF.HI < this->x.HALF.HI && this->field_0x68.HWORD - 32 < this->x.HALF.HI) {
if (gPlayerEntity.x.HALF.HI < this->x.HALF.HI && this->field_0x68.HWORD - 32 < this->x.HALF.HI) {
this->x.HALF.HI--;
}
if (gLinkEntity.x.HALF.HI > this->x.HALF.HI && this->field_0x68.HWORD + 32 > this->x.HALF.HI) {
if (gPlayerEntity.x.HALF.HI > this->x.HALF.HI && this->field_0x68.HWORD + 32 > this->x.HALF.HI) {
this->x.HALF.HI++;
}
}
+5 -5
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "functions.h"
#include "flags.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "textbox.h"
@@ -122,7 +122,7 @@ void FUN_08068b2c(Entity* this) {
if (this->interactType == '\x02') {
this->action = 2;
this->interactType = '\0';
uVar1 = sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
uVar1 = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
InitAnimationForceUpdate(this, uVar1);
sub_0806F118(this);
} else {
@@ -345,16 +345,16 @@ void sub_08068E78(Entity* this) {
}
void sub_08068E90(Entity* this) {
LinkState* s = &gLinkState;
PlayerState* s = &gPlayerState;
*(u16*)&s->field_0xac = (1 << (gUnk_08111740[this->actionDelay] - 1)) | *(u16*)&s->field_0xac;
}
void sub_08068EB4(void) {
gLinkState.field_0xab = 0;
gPlayerState.field_0xab = 0;
}
void sub_08068EC4(Entity* param_1, Entity* param_2) {
if (gUnk_08111740[param_1->actionDelay] == gLinkState.field_0xab) {
if (gUnk_08111740[param_1->actionDelay] == gPlayerState.field_0xab) {
*(u16*)&param_2->flags = gUnk_0811172A[param_1->actionDelay];
*(u32*)&param_2->animationState = 1;
} else {
+2 -2
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "sprite.h"
#include "link.h"
#include "player.h"
extern void DeleteThisEntity();
extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*);
@@ -35,7 +35,7 @@ void Carpenter(Entity* this) {
this->action = 2;
this->interactType = 0;
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + 4 + (this->entityType.form * 8));
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 + (this->entityType.form * 8));
sub_0806F118(this);
} else {
sub_0807DDAC(this, 0);
+4 -4
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
extern void sub_0806ED78(Entity*);
extern void sub_0806920C(Entity*);
@@ -19,7 +19,7 @@ extern u32 gUnk_08111938[];
extern void PlaySFX(u32);
extern u32 Random();
extern u32 UpdateFuseInteraction(Entity*);
extern LinkState gLinkState;
extern PlayerState gPlayerState;
void Cow(Entity* ent) {
gUnk_08111914[ent->action](ent);
@@ -191,7 +191,7 @@ void Cow_ShowDialogue(Entity* ent) {
void sub_0806920C(Entity* ent) {
// TODO: figure out what bitfield flag this is
u32 var0 = gLinkState.flags.all & 0x80;
u32 var0 = gPlayerState.flags.all & 0x80;
u32 var1 = -var0 >> 0x1F;
if (var1 != ent->field_0x6c.HALF.HI) {
@@ -210,7 +210,7 @@ void sub_0806924C(Entity* ent) {
s8 itype = ent->interactType;
if (itype != 0) {
// TODO: figure out what bitfield flag this is
if ((gLinkState.flags.all & 0x80) != 0) {
if ((gPlayerState.flags.all & 0x80) != 0) {
if (itype == 2) {
ent->action = 4;
sub_0806F118(ent);
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
@@ -36,7 +36,7 @@ void Dampe(Entity* this) {
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + 4);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4);
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+4 -4
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "functions.h"
void sub_08065A64(Entity* this);
@@ -56,7 +56,7 @@ void sub_08065A50(Entity* this) {
void sub_08065A64(Entity* this) {
u32 uVar2;
uVar2 = -(gLinkState.flags.all & 0x80) >> 0x1f;
uVar2 = -(gPlayerState.flags.all & 0x80) >> 0x1f;
if (uVar2 != this->field_0x68.HALF.HI) {
if (uVar2 == 0) {
sub_08078778(this);
@@ -69,7 +69,7 @@ void sub_08065A64(Entity* this) {
void sub_08065AA4(Entity* this) {
if (this->interactType != 0) {
if (gLinkState.flags.all & 0x80) {
if (gPlayerState.flags.all & 0x80) {
if (this->interactType == 2) {
this->action = 4;
sub_0806F118(this);
@@ -78,7 +78,7 @@ void sub_08065AA4(Entity* this) {
sub_0805E3A0(this, 2);
sub_08065A50(this);
}
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_08065A50(this);
sub_080791D0();
+2 -2
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "functions.h"
#include "npc.h"
#include "link.h"
#include "player.h"
extern void sub_0805E3A0(Entity*, u32);
extern u32 sub_0801E99C(Entity*);
@@ -41,7 +41,7 @@ void sub_0805FE48(Entity *this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
}
else {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "npc.h"
#include "flags.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "structures.h"
extern void sub_0805E3A0(Entity*, u32);
+2 -2
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "npc.h"
#include "link.h"
#include "player.h"
extern void sub_0805E3A0(Entity*, u32);
extern u32 sub_0801E99C(Entity*);
@@ -26,7 +26,7 @@ void Gentari(Entity *this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+179 -135
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "flags.h"
#include "textbox.h"
#include "room.h"
@@ -30,6 +30,12 @@ extern u32 sub_0805ACC0(Entity*);
extern void sub_0807DDAC(Entity*, u32);
extern void sub_0807DDE4(Entity*);
extern void sub_0807000C(Entity*);
extern void sub_0806EE04(Entity*, void*, u32);
extern Entity* sub_080A7EE0(int);
extern void sub_08078778(Entity*);
extern void sub_0807DD64(Entity*);
void sub_08063DC8(Entity*);
void sub_08063F20(Entity*);
extern void (*const gUnk_0810F544[])(Entity*);
extern void (*const gUnk_0810F550[])(Entity*);
@@ -40,157 +46,195 @@ extern SpriteLoadData gUnk_0810F524[];
extern void* gUnk_0810F6BC[];
extern ScreenTransition gScreenTransition;
void Guard(Entity *this)
{
if ((this->flags & 2) != 0) {
gUnk_0810F544[this->action](this);
}
else {
sub_08063D24(this);
}
void Guard(Entity* this) {
if ((this->flags & 2) != 0) {
gUnk_0810F544[this->action](this);
} else {
sub_08063D24(this);
}
}
void sub_08063D24(Entity *this)
{
gUnk_0810F550[this->action](this);
sub_0806ED78(this);
void sub_08063D24(Entity* this) {
gUnk_0810F550[this->action](this);
sub_0806ED78(this);
}
NAKED
void sub_08063D44(Entity* this) {
asm(".include \"asm/non_matching/guard/sub_08063D44.inc\"");
}
Entity* ent;
u32 temp, idx;
void sub_08063DC8(Entity *this)
{
if ((this->entityType).form == 0xff) {
this->action = 2;
this->actionDelay = 0x1e;
this->animationState = sub_0806F5A4(GetFacingDirection(this,&gLinkEntity));
InitAnimationForceUpdate(this, this->animationState + 4);
}
else {
sub_0806EE20(this);
if (this->field_0x3e != this->animationState) {
this->animationState = this->field_0x3e;
InitializeAnimation(this, this->animationState + 4);
if (gUnk_03003DBC > 0x46)
return;
temp = this->entityType.subtype;
temp ^= 0x15;
idx = ((-temp | temp) >> 0x1f) * 4;
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
return;
InitializeAnimation(this, 4);
sub_0806EE04(this, gUnk_0810F6BC[this->entityType.form], 0);
switch (this->entityType.form) {
case 0 ... 3:
ent = sub_080A7EE0(0xc);
ent->parent = this;
ent->field_0xf = 0x3c;
break;
case 4 ... 5:
sub_08078778(this);
break;
}
else {
GetNextFrame(this);
}
if (this->interactType != 0) {
this->action = 3;
this->interactType = 0;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this,&gLinkEntity)));
sub_08064428(this);
}
}
}
void sub_08063E54(Entity *this)
{
if (--this->actionDelay == 0) {
SetRoomFlag(0xf);
}
}
void sub_08063E6C(Entity *this)
{
if ((gTextBox.doTextBox & 0x7f) == 0) {
this->action = 1;
InitializeAnimation(this, this->animationState + 4);
}
}
NAKED
void sub_08063E90(Entity* this) {
asm(".include \"asm/non_matching/guard/sub_08063E90.inc\"");
}
void sub_08063F20(Entity *this)
{
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
GetNextFrame(this);
if (this->interactType != 0) {
this->action++;
this->interactType = 0;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + *(s8 *)&this->field_0x70);
sub_08064428(this);
}
this->entityType.form = 0;
sub_08063DC8(this);
}
void sub_08063F78(Entity *this)
{
if ((gTextBox.doTextBox & 0x7f) == 0) {
this->action = this->action - 1;
InitializeAnimation(this,(this->animationState >> 1) + 4 + *(s8 *)&this->field_0x70);
}
}
void Guard_Head(Entity *this)
{
u8 bVar1;
u32 uVar2;
u32 pbVar3;
u32 uVar4;
u32 pbVar5;
uVar2 = this->frames.all & 0x3f;
pbVar5 = (this->frameIndex & 0x3f);
uVar4 = this->frameSpriteSettings & 0x3f;
if ((this->entityType).subtype == 0x15) {
if ((this->frameIndex & 0x40) != 0) {
pbVar5 = pbVar5 + 0x21;
pbVar3 = 0xffffffff;
uVar4 = 0;
void sub_08063DC8(Entity* this) {
if ((this->entityType).form == 0xff) {
this->action = 2;
this->actionDelay = 0x1e;
this->animationState = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
InitAnimationForceUpdate(this, this->animationState + 4);
} else {
sub_0806EE20(this);
if (this->field_0x3e != this->animationState) {
this->animationState = this->field_0x3e;
InitializeAnimation(this, this->animationState + 4);
} else {
GetNextFrame(this);
}
if (this->interactType != 0) {
this->action = 3;
this->interactType = 0;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_08064428(this);
}
}
else {
pbVar3 = (uVar2 + 0x19);
if ((this->frameSpriteSettings & 0x3f) != 0) {
uVar4 += 0x1f;
}
}
void sub_08063E54(Entity* this) {
if (--this->actionDelay == 0) {
SetRoomFlag(0xf);
}
}
else {
pbVar3 = (uVar2 + 0x46);
pbVar5 = pbVar5 + 0x2d;
if ((this->frameSpriteSettings & 0x3f) != 0) {
uVar4 += 0x4c;
}
void sub_08063E6C(Entity* this) {
if ((gTextBox.doTextBox & 0x7f) == 0) {
this->action = 1;
InitializeAnimation(this, this->animationState + 4);
}
}
uVar4--;
SetExtraSpriteFrame(this, 0, pbVar3);
SetExtraSpriteFrame(this, 1, pbVar5);
SetExtraSpriteFrame(this, 2, uVar4);
SetSpriteSubEntryOffsetData1(this, 1, 0);
SetSpriteSubEntryOffsetData2(this, 1, 2);
sub_0807000C(this);
}
void sub_08064030(Entity *arg0,Entity *arg1)
{
*(u32*)&arg1->animationState = (-gRoomVars.greatFairyState | gRoomVars.greatFairyState) >> 0x1f;
void sub_08063E90(Entity* this) {
Entity* ent;
u32 temp, idx;
u32 unk;
temp = this->entityType.subtype;
temp ^= 0x15;
idx = ((-temp | temp) >> 0x1f) * 4;
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
return;
this->action++;
if (this->actionDelay) {
this->field_0x70.BYTES.byte0 = 8;
} else {
this->field_0x70.BYTES.byte0 = 0;
}
this->actionDelay = 0;
unk = sub_0805ACC0(this);
if (unk == 0) {
this->field_0x68.HWORD = this->x.HALF.HI;
this->field_0x6a.HWORD = this->y.HALF.HI;
} else {
this->field_0x68.HWORD = unk >> 0x10;
this->field_0x6a.HWORD = unk;
}
this->field_0x70.BYTES.byte1 = 0;
this->collisionLayer = 1;
UpdateSpriteForCollisionLayer(this);
sub_0807DD64(this);
sub_08063F20(this);
}
void sub_08064044(void)
{
gScreenTransition.unk = 1;
void sub_08063F20(Entity* this) {
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
GetNextFrame(this);
if (this->interactType != 0) {
this->action++;
this->interactType = 0;
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + *(s8*)&this->field_0x70);
sub_08064428(this);
}
}
void sub_08064050(Entity *arg0, struct_08064050 *arg1)
{
u32 unk;
arg1->unk2 = 0;
switch (arg0->entityType.parameter) {
case 0x11:
arg1->unk2 = 1;
break;
case 0x12:
arg1->unk2 = 2;
break;
case 0x13:
arg1->unk2 = 3;
}
void sub_08063F78(Entity* this) {
if ((gTextBox.doTextBox & 0x7f) == 0) {
this->action = this->action - 1;
InitializeAnimation(this, (this->animationState >> 1) + 4 + *(s8*)&this->field_0x70);
}
}
void Guard_Head(Entity* this) {
u8 bVar1;
u32 uVar2;
u32 pbVar3;
u32 uVar4;
u32 pbVar5;
uVar2 = this->frames.all & 0x3f;
pbVar5 = (this->frameIndex & 0x3f);
uVar4 = this->frameSpriteSettings & 0x3f;
if ((this->entityType).subtype == 0x15) {
if ((this->frameIndex & 0x40) != 0) {
pbVar5 = pbVar5 + 0x21;
pbVar3 = 0xffffffff;
uVar4 = 0;
} else {
pbVar3 = (uVar2 + 0x19);
if ((this->frameSpriteSettings & 0x3f) != 0) {
uVar4 += 0x1f;
}
}
} else {
pbVar3 = (uVar2 + 0x46);
pbVar5 = pbVar5 + 0x2d;
if ((this->frameSpriteSettings & 0x3f) != 0) {
uVar4 += 0x4c;
}
}
uVar4--;
SetExtraSpriteFrame(this, 0, pbVar3);
SetExtraSpriteFrame(this, 1, pbVar5);
SetExtraSpriteFrame(this, 2, uVar4);
SetSpriteSubEntryOffsetData1(this, 1, 0);
SetSpriteSubEntryOffsetData2(this, 1, 2);
sub_0807000C(this);
}
void sub_08064030(Entity* arg0, Entity* arg1) {
*(u32*)&arg1->animationState = (-gRoomVars.greatFairyState | gRoomVars.greatFairyState) >> 0x1f;
}
void sub_08064044(void) {
gScreenTransition.unk = 1;
}
void sub_08064050(Entity* arg0, struct_08064050* arg1) {
u32 unk;
arg1->unk2 = 0;
switch (arg0->entityType.parameter) {
case 0x11:
arg1->unk2 = 1;
break;
case 0x12:
arg1->unk2 = 2;
break;
case 0x13:
arg1->unk2 = 3;
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
#include "functions.h"
#include "entity.h"
extern Entity gLinkEntity;
extern Entity gPlayerEntity;
extern void (*gUnk_0810FF5C[])(Entity* this);
extern void (*gUnk_0810FF64[])(Entity* this);
@@ -41,7 +41,7 @@ void sub_080658BC(Entity* this) {
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
@@ -41,7 +41,7 @@ void MayorHagen(Entity *this)
this->action = v;
this->interactType = 0;
this->field_0x68.HALF.HI = this->animIndex;
InitAnimationForceUpdate(this,4 + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this,4 + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
break;
}
+1 -1
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "flags.h"
#include "textbox.h"
#include "npc.h"
@@ -40,7 +40,7 @@ void Mutoh(Entity* this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + 4);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4);
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+4 -4
View File
@@ -3,7 +3,7 @@
#include "functions.h"
#include "npc.h"
#include "textbox.h"
#include "link.h"
#include "player.h"
#include "room.h"
#include "structures.h"
@@ -145,14 +145,14 @@ void sub_08060528(Entity *this)
this->action = 3;
this->interactType = 0;
sub_0806F118(this);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
}
else {
if (this->interactType != 0) {
this->action = 2;
this->interactType = 0;
sub_080606D8(this);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
}
else {
sub_0807DD94(this, 0);
@@ -192,7 +192,7 @@ void sub_08060528(Entity *this)
sub_080606C0(this);
}
if ((-1 < this->height.WORD) &&
((gLinkEntity.collisionLayer == 0 || (this->collisionLayer == gLinkEntity.collisionLayer)))) {
((gPlayerEntity.collisionLayer == 0 || (this->collisionLayer == gPlayerEntity.collisionLayer)))) {
sub_0806ED78(this);
}
sub_0800451C(this);
+1 -1
View File
@@ -49,7 +49,7 @@ void Smith(Entity *this)
this->action = 4;
this->interactType = 0;
iVar4 = (this->animIndex == 0xc) ? 8 : 0;
iVar2 = sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
iVar2 = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
InitAnimationForceUpdate(this, iVar2 + iVar4);
sub_0806F118(this);
}
+2 -2
View File
@@ -2,7 +2,7 @@
#include "entity.h"
#include "textbox.h"
#include "functions.h"
#include "link.h"
#include "player.h"
extern void (*gUnk_0810FEC4[])(Entity* this);
extern void (*gUnk_0810FEBC[])(Entity* this);
@@ -126,7 +126,7 @@ void sub_080656D4(Entity* this) {
void sub_0806574C(Entity* this) {
u32 j;
j = (this->animIndex & ~3) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
j = (this->animIndex & ~3) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
if (this->animIndex != j) {
InitAnimationForceUpdate(this, j);
}
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
typedef struct {
u8 filler[8];
@@ -41,7 +41,7 @@ void Teachers(Entity* this) {
this->interactType = 0;
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this,
(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
+1 -1
View File
@@ -50,7 +50,7 @@ void sub_0806ABFC(Entity *this)
s32 unk;
u8 field_0x68;
Entity *link = &gLinkEntity;
Entity *link = &gPlayerEntity;
if (sub_080041A0(this, link, 0x18, 0x18)) {
unk = GetFacingDirection(this, link) & (u8)0x1e;
}
+3 -3
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "npc.h"
#include "link.h"
#include "player.h"
#include "textbox.h"
#include "flags.h"
#include "structures.h"
@@ -145,7 +145,7 @@ void sub_08061D64(Entity* this) {
this->interactType = 0;
sub_0806F118(this);
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
} else {
sub_0807DDAC(this, 0);
sub_0807DDE4(this);
@@ -158,7 +158,7 @@ void sub_08061D64(Entity* this) {
this->interactType = 0;
sub_08062048(this);
this->field_0x68.HALF.HI = this->animIndex;
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
}
}
}
+2 -2
View File
@@ -20,7 +20,7 @@ extern void sub_0806F62C(Entity*, u32, u32);
extern void PlaySFX(u32);
extern void SetTileType(u32, u32, u32);
extern Entity gLinkEntity;
extern Entity gPlayerEntity;
extern RoomControls gRoomControls;
extern void (*gUnk_08110BD8[])(Entity* ent);
@@ -86,7 +86,7 @@ void sub_08066D94(Entity* ent) {
SetGlobalFlag(ZELDA_CHASE);
npc = CreateNPC(0x2E, 0, 0);
if (npc != NULL) {
npc->animationState = gLinkEntity.animationState;
npc->animationState = gPlayerEntity.animationState;
npc->flags |= 0x20;
npc->animationState = GetAnimationState(ent);
roomID = gRoomControls.roomID;
+1 -1
View File
@@ -63,7 +63,7 @@ void (*const gObjectFunctions[])(Entity*) = {
/*0x39*/ BossDoor,
/*0x3a*/ Object3A,
/*0x3b*/ MacroMushromStalks,
/*0x3c*/ MacroLink,
/*0x3c*/ MacroPlayer,
/*0x3d*/ Object3D,
/*0x3e*/ Object3E,
/*0x3f*/ GiantLeaf,
+5 -5
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "room.h"
#include "link.h"
#include "player.h"
#include "flags.h"
extern void sub_0809F7BC(Entity*);
@@ -25,8 +25,8 @@ extern void sub_0807BB68(u32*, u32, u32);
extern u8 gUnk_02034490;
extern u32 gScreenTransition;
extern void* gUnk_080DD750;
extern Entity gLinkEntity;
extern LinkState gLinkState;
extern Entity gPlayerEntity;
extern PlayerState gPlayerState;
extern u8 gUnk_081247C0[];
extern u16 gUnk_081247C8[];
extern u32 gUnk_081247D0;
@@ -123,7 +123,7 @@ void sub_0809F69C(Entity* this) {
if (--this->actionDelay == 0) {
this->actionDelay = 30;
this->action = 4;
gRoomControls.cameraTarget = &gLinkEntity;
gRoomControls.cameraTarget = &gPlayerEntity;
PlaySFX(115);
}
}
@@ -131,7 +131,7 @@ void sub_0809F69C(Entity* this) {
void sub_0809F6CC(Entity* this) {
if (((gRoomControls.unk6 & 4) == 0) && (--this->actionDelay == 0)) {
gLinkState.field_0x8b = 1;
gPlayerState.field_0x8b = 1;
DeleteThisEntity();
}
}
+2 -2
View File
@@ -32,12 +32,12 @@ void GreatFairy(Entity* this) {
void GreatFairy_CallBehavior(Entity* this) {
GreatFairy_Behaviors[this->action](this);
if ((gLinkEntity.y.HALF.HI - gRoomControls.roomOriginY) < 168) {
if ((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) < 168) {
gRoomControls.cameraTarget = this;
gRoomControls.unk5 = 2;
} else {
gRoomControls.cameraTarget = &gLinkEntity;
gRoomControls.cameraTarget = &gPlayerEntity;
gRoomControls.unk5 = 2;
}
}
+1 -1
View File
@@ -63,7 +63,7 @@ static void sub_0808E714(Entity* this) {
static void sub_0808E764(Entity* this) {
sub_08080CB4(this);
if (!(gLinkState.flags.all & 0x80) && sub_08017850(this)) {
if (!(gPlayerState.flags.all & 0x80) && sub_08017850(this)) {
SetFlag(this->cutsceneBeh.HWORD);
CreateItemEntity(0x62, 0, 0);
DeleteThisEntity();
+3 -3
View File
@@ -166,9 +166,9 @@ void sub_0808692C(Entity* this) {
static u8 sub_08086954(Entity* this) {
if (sub_0800445C(this)) {
if (sub_0806ED9C(this, 6, 20) >= 0 &&
gLinkEntity.animationState == 0 &&
(u16)gLinkState.field_0x90.HALF.LO == 0x400 &&
gLinkState.jumpStatus == 0) {
gPlayerEntity.animationState == 0 &&
(u16)gPlayerState.field_0x90.HALF.LO == 0x400 &&
gPlayerState.jumpStatus == 0) {
this->actionDelay--;
}
} else {
+5 -5
View File
@@ -3,7 +3,7 @@
#include "room.h"
#include "random.h"
extern Entity gLinkEntity;
extern Entity gPlayerEntity;
extern u16 gScreenTransition[];
extern void (*MaskActionFuncs[])(Entity *);
@@ -76,20 +76,20 @@ void sub_080929A4(Entity *this) {
// Probably related to knocking it down
void sub_08092A94(Entity *this) {
// Check for the first frame of bonking animation
if (gLinkEntity.action != 6) {
if (gPlayerEntity.action != 6) {
return;
}
if (gLinkEntity.animationState != 0) {
if (gPlayerEntity.animationState != 0) {
return;
}
// Check if link is close enough to the mask
if (this->y.HALF.HI + 40 < gLinkEntity.y.HALF.HI) {
if (this->y.HALF.HI + 40 < gPlayerEntity.y.HALF.HI) {
return;
}
if (this->x.HALF.HI - gLinkEntity.x.HALF.HI >= this->field_0xf || this->x.HALF.HI - gLinkEntity.x.HALF.HI <= -this->field_0xf) {
if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->field_0xf || this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->field_0xf) {
return;
}
+110 -119
View File
@@ -3,6 +3,13 @@
#include "functions.h"
#include "room.h"
extern u32 sub_08091DDC(Entity*);
extern u32 sub_080002B4(Entity*, u32, u32);
extern u32 sub_08007DD6(u32, u32);
extern void sub_08017744(Entity*);
extern u32 sub_080002B8(Entity*);
extern void sub_08091C0C(Entity*);
typedef struct {
u16 field_0x0;
u16 field_0x2;
@@ -17,6 +24,9 @@ extern void (*const gUnk_081223A8[])(Entity*);
extern struct_030010EC gUnk_030010EC[];
extern BoundingBox gUnk_080FD310;
extern const s8 gUnk_081223C8[];
extern const u32 gUnk_081223D8[];
void Minecart(Entity* this) {
gUnk_081223A8[this->action](this);
this->bitfield = 0;
@@ -26,7 +36,7 @@ void sub_080916EC(Entity* this) {
struct_030010EC* unk = &gUnk_030010EC[this->actionDelay];
*(struct_030010EC**)&this->cutsceneBeh.HWORD = unk;
if ((gRoomControls.roomID != unk->field_0x4) || (gLinkState.flags.all & 0x1000) != 0) {
if ((gRoomControls.roomID != unk->field_0x4) || (gPlayerState.flags.all & 0x1000) != 0) {
DeleteThisEntity();
}
this->x.HALF.HI = gRoomControls.roomOriginX + ((unk->field_0x0 & 0x3f) << 4) + 8;
@@ -56,8 +66,8 @@ void sub_080917DC(Entity* this) {
PlaySFX(0x13b);
} else {
if (sub_0800445C(this) != 0) {
if (((gLinkState.flags.all & 0x40080) == 0) && (gLinkState.field_0x1c == 0) &&
(gLinkState.heldObject == 0) && (gLinkState.jumpStatus == 0)) {
if (((gPlayerState.flags.all & 0x40080) == 0) && (gPlayerState.field_0x1c == 0) &&
(gPlayerState.heldObject == 0) && (gPlayerState.jumpStatus == 0)) {
this->actionDelay++;
} else {
this->actionDelay = 0;
@@ -68,12 +78,12 @@ void sub_080917DC(Entity* this) {
if ((this->entityType).parameter == 0) {
if (8 < this->actionDelay) {
this->action = this->action + 1;
gLinkState.jumpStatus = 0x81;
gLinkState.flags.all |= 0x4000000;
gLinkEntity.field_0x20 = 0x20000;
gLinkEntity.nonPlanarMovement = 0x100;
gLinkEntity.flags &= 0x7f;
ResetLink();
gPlayerState.jumpStatus = 0x81;
gPlayerState.flags.all |= 0x4000000;
gPlayerEntity.field_0x20 = 0x20000;
gPlayerEntity.nonPlanarMovement = 0x100;
gPlayerEntity.flags &= 0x7f;
ResetPlayer();
sub_0807A108();
PlaySFX(0x7c);
}
@@ -85,21 +95,21 @@ void sub_080917DC(Entity* this) {
void sub_080918A4(Entity *this)
{
if (sub_080041A0(this, &gLinkEntity, 2, 2) != 0) {
gLinkEntity.x.HALF.HI = this->x.HALF.HI;
gLinkEntity.y.HALF.HI = this->y.HALF.HI;
if (gLinkEntity.height.HALF.HI > -0x10) {
if ((s32)gLinkEntity.field_0x20 > -1) {
if (sub_080041A0(this, &gPlayerEntity, 2, 2) != 0) {
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
if (gPlayerEntity.height.HALF.HI > -0x10) {
if ((s32)gPlayerEntity.field_0x20 > -1) {
return;
}
gLinkEntity.animationState = this->animationState << 1;
gLinkState.flags.all = (gLinkState.flags.all ^ 0x4000000) | 0x1000;
gPlayerEntity.animationState = this->animationState << 1;
gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x4000000) | 0x1000;
this->action++;
this->field_0xf = 1;
this->flags |= 0x20;
this->damageType = 0x97;
this->field_0x3c = (gLinkEntity.field_0x3c + 1) | 0x20;
this->flags2 = gLinkEntity.flags2;
this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20;
this->flags2 = gPlayerEntity.flags2;
this->field_0x40 = 0x18;
this->field_0x44 = 8;
sub_0801766C(this);
@@ -108,118 +118,99 @@ void sub_080918A4(Entity *this)
}
}
else {
gLinkEntity.direction = GetFacingDirection(&gLinkEntity, this);
gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, this);
}
if (gLinkEntity.field_0x20 < 0) {
gLinkEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
if (gPlayerEntity.field_0x20 < 0) {
gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
}
}
#if 0
typedef struct {
u8 field_0x0;
u8 field_0x1;
} struct_081223C8;
extern struct_081223C8 gUnk_081223C8[];
extern u32 gUnk_081223D8[];
void sub_080919AC(Entity *this)
{
u32 iVar2;
u32 uVar3;
u32 uVar4;
struct_081223C8* temp;
u32 iVar2;
u32 uVar3;
gRoomControls.unk5 = 7;
if ((gLinkState.flags.all & 0x1000) == 0) {
this->action = 1;
}
else {
if ((gLinkEntity.frames.all & 0xf) == 0) {
this->flags = this->flags & 0x7f;
CopyPosition(this,&gLinkEntity);
if ((gLinkEntity.frames.all & 0xf0) == 0x10) {
this->spriteOffsetY = 1;
}
else {
this->spriteOffsetY = 0;
}
gRoomControls.unk5 = 7;
if ((gPlayerState.flags.all & 0x1000) == 0) {
this->action = 1;
return;
}
else {
this->flags = this->flags | 0x80;
gLinkEntity.nonPlanarMovement = 0;
sub_0806F69C(this);
CopyPosition(this,&gLinkEntity);
gLinkEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
if (!sub_08091DDC(this)) {
if ((gScreenTransition.field_0x0 & 0xf) == 0) {
PlaySFX(0x138);
}
if (--this->field_0xf == 0xff) {
PlaySFX(0x7b);
this->field_0xf = 0x3c;
if ((gPlayerEntity.frames.all & 0xf) == 0) {
this->flags = this->flags & 0x7f;
CopyPosition(this,&gPlayerEntity);
if ((gPlayerEntity.frames.all & 0xf0) == 0x10) {
this->spriteOffsetY = 1;
} else {
this->spriteOffsetY = 0;
}
uVar3 = sub_03005800(this, gUnk_081223C8[this->animationState].field_0x0, gUnk_081223C8[this->animationState].field_0x1);
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
if (iVar2 == 0) {
this->direction = this->direction ^ 0x10;
this->animationState = this->animationState ^ 2;
}
else {
switch(uVar3) {
case 100:
this->flags = this->flags & 0xdf;
this->damageType = 1;
this->field_0x3c = 0x47;
this->field_0x40 = 0x44;
this->flags2 = 0x80;
this->action = 6;
sub_08017744(this);
gLinkState.jumpStatus = 0x41;
gLinkState.flags.all = (gLinkState.flags.all ^ 0x1000) | 0x4000000;
gLinkEntity.field_0x20 = 0x20000;
gLinkEntity.nonPlanarMovement = 0x200;
gLinkEntity.animationState = this->animationState << 1;
gLinkEntity.direction = this->direction;
gLinkEntity.flags |= 0x80;
sub_08004168(this);
InitAnimationForceUpdate(this, this->animationState + 0xc);
PlaySFX(0x78);
PlaySFX(0x139);
return;
case 0x67:
case 0x68:
case 0x69:
case 0x6a:
case 0x6c:
case 0x6d:
case 0x6e:
case 0x6f:
if (uVar3 == sub_080002B8()) {
sub_08091C0C(this);
gLinkEntity.animationState *= 2;
return;
}
} else {
this->flags = this->flags | 0x80;
gPlayerEntity.nonPlanarMovement = 0;
sub_0806F69C(this);
CopyPosition(this,&gPlayerEntity);
gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
if (!sub_08091DDC(this)) {
if ((gScreenTransition.frameCount & 0xf) == 0) {
PlaySFX(0x138);
}
if (--this->field_0xf == 0xff) {
PlaySFX(0x7b);
this->field_0xf = 0x3c;
}
uVar3 = sub_080002B4(this, gUnk_081223C8[this->animationState * 2], gUnk_081223C8[this->animationState * 2 + 1]);
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
if (iVar2 == 0) {
this->direction = this->direction ^ 0x10;
this->animationState = this->animationState ^ 2;
} else {
switch (uVar3) {
case 0x64:
this->flags = this->flags & 0xdf;
this->damageType = 1;
this->field_0x3c = 0x47;
this->field_0x40 = 0x44;
this->flags2 = 0x80;
this->action = 6;
sub_08017744(this);
gPlayerState.jumpStatus = 0x41;
gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x1000) | 0x4000000;
gPlayerEntity.field_0x20 = 0x20000;
gPlayerEntity.nonPlanarMovement = 0x200;
gPlayerEntity.animationState = this->animationState << 1;
gPlayerEntity.direction = this->direction;
gPlayerEntity.flags |= 0x80;
sub_08004168(this);
InitAnimationForceUpdate(this, this->animationState + 0xc);
PlaySFX(0x78);
PlaySFX(0x139);
return;
case 0x67:
case 0x68:
case 0x69:
case 0x6a:
case 0x6c:
case 0x6d:
case 0x6e:
case 0x6f:
if (uVar3 == sub_080002B8(this)) {
sub_08091C0C(this);
gPlayerEntity.animationState = this->animationState << 1;
return;
}
break;
}
}
gPlayerEntity.animationState = this->animationState << 1;
if (this->animIndex == this->animationState) {
UpdateAnimationSingleFrame(this);
}
else {
InitAnimationForceUpdate(this, this->animationState);
}
}
gLinkEntity.animationState *= 2;
if (this->animIndex == this->animationState) {
UpdateAnimationSingleFrame(this);
}
else {
InitAnimationForceUpdate(this, this->animationState);
}
}
}
}
}
#else
NAKED
void sub_080919AC(Entity *this) {
asm(".include \"asm/non_matching/minecart/sub_080919AC.inc\"");
}
#endif
+1 -1
View File
@@ -236,7 +236,7 @@ void sub_0808F498(Entity* this) {
DeleteThisEntity();
}
if (gLinkState.field_0x1c != 1) {
if (gPlayerState.field_0x1c != 1) {
DeleteThisEntity();
}
} else {
+6 -6
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "player.h"
#include "flags.h"
extern u32 sub_080041A0(Entity*, Entity*, u32, u32);
@@ -58,7 +58,7 @@ void sub_08099E58(Entity *this)
void sub_08099E8C(Entity *this)
{
if (sub_080041A0(this, &gLinkEntity, 0xc, 0xc)) {
if (sub_080041A0(this, &gPlayerEntity, 0xc, 0xc)) {
if (this->previousActionFlag == 0) {
sub_08099ECC(this);
sub_0805E4E0(this, 0x1e);
@@ -74,8 +74,8 @@ void nullsub_534(Entity* this) {}
void sub_08099ECC(Entity *this)
{
this->previousActionFlag = 1;
CopyPosition(this, &gLinkEntity);
gLinkState.linkAction = 3;
gLinkState.field_0x34[4] = 0;
gLinkState.flags.all |= 0x8000;
CopyPosition(this, &gPlayerEntity);
gPlayerState.playerAction = 3;
gPlayerState.field_0x34[4] = 0;
gPlayerState.flags.all |= 0x8000;
}
+2 -2
View File
@@ -7,7 +7,7 @@ extern void sub_08080CB4(Entity*);
extern void (*gUnk_08124824[])(Entity*);
extern Entity gLinkEntity;
extern Entity gPlayerEntity;
void ObjectA8(Entity *this)
{
@@ -26,7 +26,7 @@ void ObjectA8(Entity *this)
case 0x1e:
case 0x1f:
this->action = 5;
this->attachedEntity = &gLinkEntity;
this->attachedEntity = &gPlayerEntity;
CreateItemEntity((this->entityType).form, 0, 0);
DeleteThisEntity();
}
+169
View File
@@ -0,0 +1,169 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
#include "flags.h"
#include "player.h"
#include "room.h"
extern void (*const gUnk_0811F090[])(Entity*);
extern void (*const gUnk_0811F0A8[])(Entity*);
extern BoundingBox gUnk_080FD338; // TODO: should be const
extern BoundingBox gUnk_080FD340; // TODO: should be const
extern u32 sub_08016A30(Entity*);
extern u32 sub_080001DA(u32, u32);
extern u32 GetTileTypeByEntity(Entity*);
extern void sub_08078930(Entity*);
extern void sub_08082824(Entity*);
extern u32 sub_080002B8(Entity*);
extern void sub_08082850(Entity*, Entity*);
extern void sub_08082608(Entity*);
void Pot(Entity* this) {
gUnk_0811F090[this->action](this);
this->bitfield = 0;
}
void sub_0808222C(Entity* this) {
if (this->entityType.parameter == 1 && CheckFlags(this->field_0x86)) {
DeleteThisEntity();
}
this->action = 1;
this->boundingBox = &gUnk_080FD338;
this->nonPlanarMovement = 0x80;
this->y.HALF.HI += 3;
this->possibleBool = 0;
this->flags |= 0x80;
this->currentHealth = 1;
this->field_0x3c = 7;
this->damageType = 0x6E;
this->flags2 = 0x84;
this->field_0x1c = 0x12;
if (this->collisionLayer == 0) {
sub_08016A30(this);
}
this->field_0x70.HALF.LO = sub_080001DA(COORD_TO_TILE(this), this->collisionLayer);
if ((u16)this->field_0x70.HALF.LO == 0x4000) {
DeleteThisEntity();
}
SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
InitializeAnimation(this, 5);
}
void sub_08082310(Entity* this) {
u32 tileType;
u32 var0 = this->bitfield & 0x7F;
switch (var0) {
case 0x13:
this->action = 3;
this->previousActionFlag = 0;
break;
case 0x1D:
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
this->action = 5;
this->field_0x20 = 0x2A000;
this->spriteOffsetY = 0;
this->spriteSettings.b.shadow = 1;
this->spritePriority.b1 = 3;
this->flags &= 0x7F;
sub_08082824(this);
break;
default:
tileType = GetTileTypeByEntity(this);
if (tileType != 0x4000) {
switch (tileType) {
case 0x4004:
case 0x4003:
case 0x4002:
case 0x4001:
this->direction = (tileType - 0x4001) * 8;
this->actionDelay = 32;
this->action = 4;
if (gPlayerState.flags.all & 0x80) {
this->nonPlanarMovement >>= 1;
this->actionDelay = 64;
}
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
sub_08004488(0x10F);
break;
case 0x4067:
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
DeleteThisEntity();
break;
default:
if (sub_080002B8(this) == 13) {
CreateFx(this, 0, 0);
} else if (tileType == 0x4005) {
gPlayerState.field_0xab = 4;
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
}
sub_08082850(this, NULL);
break;
}
} else {
sub_08078930(this);
}
break;
}
}
void sub_080824F8(Entity* this) {
gUnk_0811F0A8[this->previousActionFlag](this);
}
void sub_08082510(Entity* this) {
this->flags |= 0x80;
this->boundingBox = &gUnk_080FD340;
this->field_0x3c = 7;
this->damageType = 1;
this->flags2 = gPlayerEntity.flags2;
this->spriteOffsetY = 0;
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
this->previousActionFlag++;
}
void nullsub_511(Entity* this) {
}
void sub_08082588(Entity* this) {
this->spritePriority.b1 = 3;
}
void sub_0808259C(Entity* this) {
switch (sub_080043E8(this)) {
case 2:
CreateFx(this, 11, 0);
break;
case 1:
CreateFx(this, 0, 0);
break;
case 3:
CreateFx(this, 12, 0);
break;
default:
sub_08082850(this, &gPlayerEntity);
return;
}
DeleteThisEntity();
}
void sub_080825E8(Entity* this) {
DeleteThisEntity();
}
void sub_080825F0(Entity* this) {
if (gPlayerState.heldObject == 0) {
sub_08082608(this);
}
}
void sub_08082608(Entity* this) {
this->action = 1;
this->previousActionFlag = 0;
}
+20 -4
View File
@@ -12,8 +12,8 @@ extern void SetTile(u32, u32, u32);
extern void (*const gUnk_081205D0[])(Entity*);
extern s8 gUnk_080B4488[][2];
extern u16 gUnk_081205E0[];
extern s8 gUnk_080B4488[];
void Railtrack(Entity* this) {
gUnk_081205D0[this->action](this);
@@ -135,14 +135,30 @@ void sub_0808543C(Entity *this)
u32 uVar2;
s8 temp;
temp = gUnk_080B4488[(this->animationState >> 1) << 1];
temp = gUnk_080B4488[this->animationState / 2][0];
uVar2 = COORD_TO_TILE(this);
SetTile(this->field_0x74, uVar2 - temp, this->collisionLayer);
SetTile(this->field_0x76, uVar2, this->collisionLayer);
SetTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer);
}
NAKED
u32 sub_080854A8(Entity *this) {
asm(".include \"asm/non_matching/railtrack/sub_080854A8.inc\"");
u16 var0;
u16* var1;
s8* var2;
var0 = gUnk_081205E0[this->animationState / 2];
var2 = gUnk_080B4488[this->animationState / 2];
var1 = (u16 *)this->field_0x70.WORD;
if (var0 != *(var1 - var2[0])) {
return TRUE;
}
if (var0 != *var1) {
return TRUE;
}
if (var0 != *(var1 + var2[0])) {
return TRUE;
}
return FALSE;
}
+2 -2
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "flags.h"
#include "link.h"
#include "player.h"
#include "room.h"
extern void sub_0809E96C(Entity*);
@@ -34,7 +34,7 @@ void sub_0809E83C(Entity* this) {
void sub_0809E86C(Entity* this) {
if (sub_0800419C(this, &gLinkEntity, 0x30, 0x30)) {
if (sub_0800419C(this, &gPlayerEntity, 0x30, 0x30)) {
if (CheckGlobalFlag(EZERO_1ST)) {
if (((gScreenTransition & 3) == 0)) {
sub_080A2B80(this);
+3 -3
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "room.h"
#include "link.h"
#include "player.h"
void SetTile(u32 tileIndex, s32 tilePosition, s32 layerIndex);
s32 GetTileType(s32 tilePosition, s32 layerIndex);
@@ -29,8 +29,8 @@ void sub_080A0EF0(Entity* ent) {
tileIndex = GetTileType(ent->field_0x80.HWORD, 1);
if (tileIndex != 0x407D) {
sub_08078B48();
gLinkEntity.x.WORD = ent->x.WORD;
gLinkEntity.y.HALF.HI = ent->y.HALF.HI + 4;
gPlayerEntity.x.WORD = ent->x.WORD;
gPlayerEntity.y.HALF.HI = ent->y.HALF.HI + 4;
DeleteThisEntity();
}
}
+20 -20
View File
@@ -5,7 +5,7 @@
#include "functions.h"
#include "flags.h"
#include "npc.h"
#include "link.h"
#include "player.h"
#include "screen.h"
#include "main.h"
#include "structures.h"
@@ -218,7 +218,7 @@ void sub_0804B580(void) {
sub_080575C8(0x20);
if (gLinkEntity.y.HALF.HI - gRoomControls.roomOriginY > 0x40)
if (gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY > 0x40)
LoadRoomEntityList(&gUnk_080D6138);
}
@@ -391,8 +391,8 @@ void sub_0804B7E8(void) {
if (CheckLocalFlag(0x91)) {
ClearLocalFlag(0x91);
DoFade(5, 0x100);
gLinkEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x50;
gLinkEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x50;
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
sub_080751E8(1, 2, &gUnk_08010A5C);
}
}
@@ -417,8 +417,8 @@ void sub_0804B86C(void) {
if (CheckLocalFlag(0x91) != 0) {
ClearLocalFlag(0x91);
DoFade(5, 0x100);
gLinkEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x50;
gLinkEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x50;
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
sub_080751E8(1, 2, &gUnk_08010A5C);
}
}
@@ -445,8 +445,8 @@ void sub_0804B8F0(void) {
if (CheckLocalFlag(0x91)) {
ClearLocalFlag(0x91);
DoFade(5, 0x100);
gLinkEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x60;
gLinkEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x60;
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
sub_080751E8(1, 2, &gUnk_08010A5C);
}
}
@@ -652,8 +652,8 @@ extern u32 gUnk_08009E88;
void sub_0804BC70(void) {
if (!CheckLocalFlag(0x9f)) {
DoFade(5, 0x100);
gLinkEntity.x.HALF.HI = gRoomControls.roomOriginX + 0xb0;
gLinkEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x40;
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0xb0;
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x40;
sub_080751E8(0, 6, &gUnk_08009E88);
}
if (!CheckGlobalFlag(TABIDACHI)) {
@@ -2057,7 +2057,7 @@ extern EntityData gUnk_080DE4C8;
void sub_0804CBB0(void) {
if ((gLinkEntity.y.HALF.HI - gRoomControls.roomOriginY) < (gRoomControls.filler2[4] >> 1)) {
if ((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) < (gRoomControls.filler2[4] >> 1)) {
if (!CheckLocalFlag(0x17)) {
LoadRoomEntityList(&gUnk_080DE4C8);
}
@@ -2425,7 +2425,7 @@ void sub_0804CED8(void) {
if (CheckGlobalFlag(LV2_CLEAR)) {
gUnk_0200B650 = 0;
gScreen.lcd.lcdControl2 &= 0xfdff;
sub_0807AABC(&gLinkEntity);
sub_0807AABC(&gPlayerEntity);
LoadRoomEntityList(&gUnk_080E1814);
} else {
PlaySFX(0x80100000);
@@ -3511,14 +3511,14 @@ void sub_0804D6F0(void) {
if ((gScreenTransition.field_0x38 & 1) && gScreenTransition.field_0x39) {
if (gScreenTransition.field_0x3c == 1) {
gLinkEntity.x.HALF.HI = gScreenTransition.field_0x48;
gLinkEntity.y.HALF.HI = gScreenTransition.field_0x4a + 8;
gPlayerEntity.x.HALF.HI = gScreenTransition.field_0x48;
gPlayerEntity.y.HALF.HI = gScreenTransition.field_0x4a + 8;
} else {
if (gScreenTransition.field_0x3c) {
return;
}
gLinkEntity.x.HALF.HI = gScreenTransition.field_0x44;
gLinkEntity.y.HALF.HI = gScreenTransition.field_0x46 + 8;
gPlayerEntity.x.HALF.HI = gScreenTransition.field_0x44;
gPlayerEntity.y.HALF.HI = gScreenTransition.field_0x46 + 8;
}
}
}
@@ -4738,7 +4738,7 @@ void sub_0804E7A4(void)
{
// dog food
if ((GetInventoryValue(0x36) == 1) && !CheckGlobalFlag(BIN_DOGFOOD) &&
(gLinkState.flags.all & 0x80) == 0) {
(gPlayerState.flags.all & 0x80) == 0) {
LoadRoomEntityList(&gUnk_080F30CC);
}
}
@@ -4764,7 +4764,7 @@ void sub_0804E7DC(void)
gArea.musicIndex = gArea.pMusicIndex;
PlaySFX(0x800b0036);
}
if ((gLinkState.flags.all & 8) == 0) {
if ((gPlayerState.flags.all & 8) == 0) {
LoadRoomEntityList(&gUnk_080F31D8);
}
}
@@ -4773,8 +4773,8 @@ extern u32 gUnk_08009E58;
void sub_0804E864(void)
{
gLinkEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90;
gLinkEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90;
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
sub_080751E8(1, 6, &gUnk_08009E58);
ModHealth(0xa0);
}
-7
View File
@@ -1,7 +0,0 @@
#include "global.h"
extern u8 gArea;
bool32 sub_08052620(u32 r0) {
return gArea == 0x81;
}
-10
View File
@@ -1,10 +0,0 @@
#include "global.h"
extern u8 gUnk_08127D30[69];
u32 sub_08052638(u32 r0) {
// u32 r1 = gUnk_08127D30;
// u32 r1 = gUnk_08127D30;
return gUnk_08127D30[r0 * 4] == 129;
}