mirror of
https://github.com/zeldaret/tmc
synced 2026-08-20 22:24:01 -04:00
Merge branch 'master' of https://github.com/zeldaret/tmc
This commit is contained in:
+36
-44
@@ -6,7 +6,7 @@
|
||||
extern u32* GetLayerByIndex(u32);
|
||||
extern void sub_08085394(Entity*);
|
||||
extern void sub_0808543C(Entity*);
|
||||
extern void sub_08004488(u32);
|
||||
extern void EnqueueSFX(u32);
|
||||
extern u32 sub_080854A8(Entity*);
|
||||
extern void SetTile(u32, u32, u32);
|
||||
|
||||
@@ -32,7 +32,7 @@ void sub_080851AC(Entity* this) {
|
||||
}
|
||||
this->animationState = this->entityType.parameter & 2;
|
||||
if ((this->entityType).form == 3) {
|
||||
uVar1 = CheckFlags(this->field_0x86);
|
||||
uVar1 = CheckFlags(this->field_0x86.HWORD);
|
||||
this->field_0x7a.HWORD = uVar1;
|
||||
if ((u16)(uVar1 & -1) != 0) {
|
||||
this->animationState = (this->animationState + 2) & 3;
|
||||
@@ -45,16 +45,16 @@ void sub_080851AC(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08085264(Entity* this) {
|
||||
if (CheckFlags(this->field_0x86)) {
|
||||
if (CheckFlags(this->field_0x86.HWORD)) {
|
||||
this->action = 2;
|
||||
this->field_0xf = 8;
|
||||
if (this->entityType.form == 1) {
|
||||
ClearFlag(this->field_0x86);
|
||||
ClearFlag(this->field_0x86.HWORD);
|
||||
}
|
||||
this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
sub_0808543C(this);
|
||||
sub_08004488(0x151);
|
||||
EnqueueSFX(0x151);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,11 +62,11 @@ void sub_080852B4(Entity* this) {
|
||||
if (--this->field_0xf == 0) {
|
||||
this->action = 3;
|
||||
this->field_0xf = this->actionDelay;
|
||||
this->field_0x7a.HWORD = CheckFlags(this->field_0x86);
|
||||
this->field_0x7a.HWORD = CheckFlags(this->field_0x86.HWORD);
|
||||
this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
sub_08085394(this);
|
||||
sub_08004488(0x151);
|
||||
EnqueueSFX(0x151);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,13 +77,13 @@ void sub_08085308(Entity* this) {
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
if (CheckFlags(this->field_0x86) == 0) {
|
||||
if (CheckFlags(this->field_0x86.HWORD) == 0) {
|
||||
this->action = 1;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (CheckFlags(this->field_0x86) == *(u16*)&this->field_0x7a) {
|
||||
if (CheckFlags(this->field_0x86.HWORD) == *(u16*)&this->field_0x7a) {
|
||||
this->field_0xf = 0xff;
|
||||
} else {
|
||||
this->field_0xf = 1;
|
||||
@@ -96,60 +96,52 @@ void sub_08085308(Entity* this) {
|
||||
this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3;
|
||||
InitializeAnimation(this, this->animationState);
|
||||
sub_0808543C(this);
|
||||
sub_08004488(0x151);
|
||||
EnqueueSFX(0x151);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void sub_08085394(Entity *this)
|
||||
{
|
||||
void sub_08085394(Entity* this) {
|
||||
u32 uVar1;
|
||||
u16 *layerData;
|
||||
u32 iVar3;
|
||||
u32 uVar4;
|
||||
u8 *pbVar5;
|
||||
u16* layerData;
|
||||
u32 tile;
|
||||
s8 off;
|
||||
|
||||
uVar1 = gUnk_081205E0[this->animationState / 2];
|
||||
iVar3 = this->animationState / 2;
|
||||
layerData = *(u16 **)&this->field_0x70;
|
||||
uVar4 = COORD_TO_TILE(this);
|
||||
this->field_0x74.HWORD = layerData[gUnk_080B4488[iVar3]];
|
||||
pbVar5 = &this->collisionLayer;
|
||||
SetTile(uVar1, uVar4 - iVar3, *pbVar5);
|
||||
this->field_0x76 = layerData[0];
|
||||
SetTile(uVar1,uVar4, *pbVar5);
|
||||
*(u16 *)&this->field_0x78 = layerData[iVar3];
|
||||
SetTile(uVar1,uVar4 + iVar3, *pbVar5);
|
||||
}
|
||||
#endif
|
||||
off = gUnk_080B4488[this->animationState / 2][0];
|
||||
layerData = (u16*)this->field_0x70.WORD;
|
||||
tile = COORD_TO_TILE(this);
|
||||
|
||||
NAKED
|
||||
void sub_08085394(Entity* this) {
|
||||
asm(".include \"asm/non_matching/railtrack/sub_08085394.inc\"");
|
||||
this->field_0x74.HWORD = *(layerData - off);
|
||||
SetTile(uVar1, tile - off, this->collisionLayer);
|
||||
|
||||
this->field_0x76.HWORD = layerData[0x0];
|
||||
SetTile(uVar1, tile - 0x0, this->collisionLayer);
|
||||
|
||||
this->field_0x78.HWORD = layerData[off];
|
||||
SetTile(uVar1, tile + off, this->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_0808543C(Entity *this)
|
||||
{
|
||||
s8 *cVar1;
|
||||
u32 uVar2;
|
||||
s8 temp;
|
||||
void sub_0808543C(Entity* this) {
|
||||
s8* cVar1;
|
||||
u32 uVar2;
|
||||
s8 temp;
|
||||
|
||||
temp = gUnk_080B4488[this->animationState / 2][0];
|
||||
uVar2 = COORD_TO_TILE(this);
|
||||
SetTile(this->field_0x74.HWORD, uVar2 - temp, this->collisionLayer);
|
||||
SetTile(this->field_0x76.HWORD, uVar2, this->collisionLayer);
|
||||
SetTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer);
|
||||
temp = gUnk_080B4488[this->animationState / 2][0];
|
||||
uVar2 = COORD_TO_TILE(this);
|
||||
SetTile(this->field_0x74.HWORD, uVar2 - temp, this->collisionLayer);
|
||||
SetTile(this->field_0x76.HWORD, uVar2, this->collisionLayer);
|
||||
SetTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer);
|
||||
}
|
||||
|
||||
u32 sub_080854A8(Entity *this) {
|
||||
u32 sub_080854A8(Entity* this) {
|
||||
u16 var0;
|
||||
u16* var1;
|
||||
s8* var2;
|
||||
|
||||
var0 = gUnk_081205E0[this->animationState / 2];
|
||||
var2 = gUnk_080B4488[this->animationState / 2];
|
||||
var1 = (u16 *)this->field_0x70.WORD;
|
||||
var1 = (u16*)this->field_0x70.WORD;
|
||||
if (var0 != *(var1 - var2[0])) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user