Putting some nonmatch functions from site

This commit is contained in:
Tal Hayon
2022-07-13 15:24:22 +03:00
parent 4ef3f4e351
commit 09602b00af
26 changed files with 1057 additions and 274 deletions
+71 -2
View File
@@ -376,8 +376,77 @@ void sub_080880D8(FigurineDeviceEntity* this) {
}
}
ASM_FUNC("asm/non_matching/figurineDevice/sub_08088160.inc",
bool32 sub_08088160(FigurineDeviceEntity* this, s32 param_2))
NONMATCH("asm/non_matching/figurineDevice/sub_08088160.inc",
bool32 sub_08088160(FigurineDeviceEntity* this, s32 param_2)) {
u8 bVar1;
bool32 condition;
u32 uVar3;
bool32 result;
const struct_080FC3E4* ptr;
u32 tmp;
ptr = &gUnk_080FC3E4[param_2];
result = FALSE;
if (this->unk_7c >= ptr->unk_6) {
result = TRUE;
} else {
switch (ptr->unk_6) {
case 0x8:
case 0x40:
if (CheckLocalFlagByBank(ptr->unk_0, ptr->unk_4)) {
result = TRUE;
}
return result;
break;
case 0x10:
if (CheckKinstoneFused(gUnk_080FC3E4[param_2].unk_4)) {
result = TRUE;
}
return result;
break;
default:
return result;
case 0x20:
switch (gUnk_080FC3E4[param_2].unk_4) {
case 0:
if (CheckKinstoneFused(0x20) || CheckKinstoneFused(0x10) || CheckKinstoneFused(0x19)) {
result = TRUE;
}
break;
case 1:
if ((u8)this->unk_7c >= 5 && CheckKinstoneFused(0x28)) {
result = TRUE;
}
break;
case 2:
if (CheckKinstoneFused(0x54) || CheckKinstoneFused(0x56) || CheckKinstoneFused(0x3d)) {
result = TRUE;
}
break;
case 3:
if (CheckKinstoneFused(0x3b) || CheckKinstoneFused(0x4a) || CheckKinstoneFused(0xd)) {
result = TRUE;
}
break;
case 4:
if (CheckKinstoneFused(0x49) || CheckKinstoneFused(0x55) || CheckKinstoneFused(0x3c)) {
result = TRUE;
}
break;
case 5:
if (this->unk_7c >= 2 && CheckGlobalFlag(MACHI_MACHIHOKORI)) {
result = TRUE;
}
default:
return result;
}
break;
}
}
return result;
}
END_NONMATCH
void sub_0808826C(FigurineDeviceEntity* this) {
s32 tmp = 0x64;
+89 -1
View File
@@ -54,7 +54,95 @@ const u8 gUnk_08123DDC[] = {
9, 4, 0, 0, 1, 5, 0, 0, 1, 4, 0, 0, 1, 3, 0, 0, 1, 2, 0, 0, 2, 1, 0, 0, 10, 4, 0, 0,
};
ASM_FUNC("asm/non_matching/frozenOctorok/FrozenOctorok_Init.inc", void FrozenOctorok_Init(FrozenOctorokEntity* this))
NONMATCH("asm/non_matching/frozenOctorok/FrozenOctorok_Init.inc", void FrozenOctorok_Init(FrozenOctorokEntity* this)) {
OctorokBossHeap* heap;
Entity*** pppEVar2;
FrozenOctorokEntity* pEVar3;
FrozenOctorokEntity* obj1;
FrozenOctorokEntity* obj2;
u32 uVar3;
u32 type;
super->action = 1;
switch (super->type) {
case 0:
SetDefaultPriority(super, 6);
this->unk_7e = 0;
case 6:
super->timer = 1;
super->direction = 0x10;
this->unk_79 = 0xf0;
super->x.HALF.HI = gRoomControls.origin_x + 0x108;
super->y.HALF.HI = gRoomControls.origin_y + 0x168;
super->spriteRendering.b0 = 3;
this->unk_76 = 0xa0;
this->unk_74 = 0xa0;
this->unk_7b = -0x80;
if (super->type == 0) {
super->spriteOffsetX = 0x29;
super->spriteOffsetY = -0x20;
heap = (OctorokBossHeap*)zMalloc(sizeof(OctorokBossHeap));
this->heap = heap;
if (heap == NULL) {
DeleteThisEntity();
return;
}
super->myHeap = heap;
this->heap->tailCount = 5;
for (uVar3 = 0; uVar3 < 4; uVar3++) {
super->child = CreateObjectWithParent(super, FROZEN_OCTOROK, uVar3 + 1, 0);
if (super->child != NULL) {
((FrozenOctorokEntity*)super->child)->heap = this->heap;
this->heap->legObjects[uVar3] = (OctorokBossEntity*)super->child;
}
}
obj1 = (FrozenOctorokEntity*)CreateObjectWithParent(super, FROZEN_OCTOROK, 5, 0);
super->child = (Entity*)obj1;
if (obj1 != NULL) {
obj1->heap = this->heap;
}
obj2 = (FrozenOctorokEntity*)CreateObjectWithParent(super, FROZEN_OCTOROK, 6, 0);
super->parent = (Entity*)obj2;
if (obj2 != NULL) {
obj2->heap = this->heap;
}
} else {
super->spriteOffsetX = 0xd7;
super->spriteOffsetY = -0x20;
}
break;
case 1:
case 2:
case 3:
case 4:
super->timer = 0x10;
this->unk_79 = 0;
if ((super->type & 2) == 0) {
super->subtimer = 2;
} else {
super->subtimer = 0xfe;
}
this->unk_74 = 0x100;
if ((super->type & 1) == 0) {
this->unk_76 = 0xff00;
} else {
this->unk_76 = 0x100;
}
break;
case 5:
this->unk_76 = 0x100;
this->unk_74 = 0x100;
this->unk_79 = 0x1c;
this->heap->mouthObject = (OctorokBossEntity*)this;
break;
case 7:
return;
}
InitializeAnimation(super, gUnk_08123DDC[super->type * 4]);
FrozenOctorok_Action1(this);
}
END_NONMATCH
void (*const FrozenOctorok_Action1SubActions[])(FrozenOctorokEntity*) = {
FrozenOctorok_Action1SubAction0, FrozenOctorok_Action1SubAction1, FrozenOctorok_Action1SubAction2,
+4 -4
View File
@@ -1118,14 +1118,14 @@ NONMATCH("asm/non_matching/object6A/sub_08095EAC.inc",
b = 0xF;
vel = 0x40000;
speed = gUnk_08122B0E[Random() & 7];
super->type2 = -1;
e->type2 = -1;
}
x = a - (Random() & b);
y = a - (Random() & b);
PositionRelative(super, e, Q_16_16(x), Q_16_16(y));
super->zVelocity = vel;
super->speed = speed;
PositionRelative(super, e, x << 16, y << 16);
e->zVelocity = vel;
e->speed = speed;
}
}
END_NONMATCH
+82 -1
View File
@@ -58,7 +58,88 @@ void PushableFurniture(PushableFurnitureEntity* this) {
}
}
ASM_FUNC("asm/non_matching/pushableFurniture/sub_0808F990.inc", void sub_0808F990(PushableFurnitureEntity* this))
NONMATCH("asm/non_matching/pushableFurniture/sub_0808F990.inc", void sub_0808F990(PushableFurnitureEntity* this)) {
s32 uVar1;
bool32 bVar2;
u32 uVar3;
u32 sVar4;
u16 uVar5;
SpritePriority* pSVar6;
Entity* pEVar7;
super->action = 1;
super->speed = 0x80;
super->subtimer = super->timer;
super->timer = 0;
super->updatePriority = 3;
this->unk_81 = 0;
this->unk_83 = 0;
super->spriteRendering.b3 = 2;
if (super->type == 1) {
super->spritePriority.b0 = 4;
this->unk_80 = 0;
} else {
this->unk_80 = 1;
super->spritePriority.b0 = 5;
if ((super->type == 2) || (super->type == 4)) {
super->y.HALF.HI += 2;
super->spriteOffsetY = -2;
super->subAction = 0;
super->frameIndex = 0;
}
}
switch (super->subtimer) {
default:
bVar2 = FALSE;
if (*(u16*)&super->type == 0x101) {
uVar1 = (s8)super->subtimer;
sVar4 = super->y.HALF_U.HI;
} else {
uVar1 = (s8)super->subtimer;
sVar4 = super->x.HALF_U.HI;
}
this->unk_7e = sVar4 + (u32)uVar1;
if (super->parent == NULL) {
uVar3 = CheckFlags((u32)this->unk_86);
} else {
if ((this->unk_82 & 0x80) != 0) {
if (super->parent->action == 2) {
bVar2++;
}
break;
}
uVar3 = CheckLocalFlag((u32)this->unk_82);
}
if (uVar3 != 0) {
bVar2++;
}
break;
case 0:
bVar2 = FALSE;
break;
case 0x80:
bVar2 = TRUE;
if (*(u16*)&super->type == 0x101) {
uVar5 = super->y.HALF.HI;
} else {
uVar5 = super->x.HALF.HI;
}
this->unk_7e = uVar5;
break;
}
if (bVar2) {
this->unk_81 = 1;
if (*(u16*)&super->type == 0x101) {
super->y.HALF.HI = this->unk_7e;
} else {
super->x.HALF.HI = this->unk_7e;
}
}
sub_0808FF50(this);
}
END_NONMATCH
void PushableFurniture_Action1(PushableFurnitureEntity* this) {
if (this->unk_81 == 0) {
+30 -1
View File
@@ -251,7 +251,36 @@ u32 sub_0808968C(u32 param_1) {
return 0;
}
ASM_FUNC("asm/non_matching/pushableStatue/sub_080896B0.inc", bool32 sub_080896B0(void))
NONMATCH("asm/non_matching/pushableStatue/sub_080896B0.inc", bool32 sub_080896B0(void)) {
s16 uVar1;
s16 iVar2;
u8* puVar3;
LayerStruct* puVar5;
u32 uVar4;
const s16* ptr;
u32 tmp1;
u32 tmp2;
u32 val;
if (((gPlayerState.heldObject & 0x1f) == 0x12) && ((gPlayerEntity.frame & 1) != 0)) {
ptr = &gUnk_080B4468[gPlayerEntity.animationState & 6];
uVar1 = gUnk_080B4488[gPlayerEntity.animationState >> 1];
uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity, -ptr[0], -ptr[1]) - uVar1;
val = sub_080B1AE0(uVar4, gPlayerEntity.collisionLayer);
if ((1 < val - 0x26) && (val != 0x29)) {
puVar5 = GetLayerByIndex((u32)gPlayerEntity.collisionLayer);
iVar2 = (s32)(uVar4 * 0x10000) >> 0x10;
puVar3 = puVar5->collisionData;
tmp1 = puVar3[iVar2];
tmp2 = puVar3[(iVar2 - uVar1)];
if ((tmp1 == 0) && (tmp2 == 0)) {
return TRUE;
}
}
}
return FALSE;
}
END_NONMATCH
void (*const PushableStatue_Actions[])(PushableStatueEntity*) = {
PushableStatue_Init, PushableStatue_Action1, PushableStatue_Action2, PushableStatue_Action3, PushableStatue_Action4,