mirror of https://github.com/zeldaret/tmc.git
Match sub_0802E7CC
This commit is contained in:
parent
526915b40f
commit
28aa812484
|
|
@ -1,16 +0,0 @@
|
|||
.syntax unified
|
||||
|
||||
.text
|
||||
lsls r1, r1, #0x18
|
||||
lsrs r1, r1, #0x16
|
||||
adds r2, r0, #0
|
||||
adds r2, #0x3c
|
||||
adds r2, r2, r1
|
||||
ldr r3, [r2]
|
||||
adds r0, r0, r1
|
||||
ldrb r0, [r0, #1]
|
||||
strb r0, [r3, #0x14]
|
||||
ldr r0, [r2]
|
||||
ldrb r0, [r0, #0x14]
|
||||
bx lr
|
||||
.syntax divided
|
||||
|
|
@ -7,7 +7,14 @@
|
|||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ u8 filler[0x2c];
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
} Gleerok_HeapStruct2;
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Gleerok_HeapStruct2 filler[11];
|
||||
/*0x2c*/ union SplitHWord unk_2c;
|
||||
/*0x2e*/ u16 filler_2e;
|
||||
/*0x30*/ u8 unk_30[6];
|
||||
|
|
@ -45,7 +52,7 @@ extern void (*const gUnk_080CD828[])(GleerokEntity*);
|
|||
extern void (*const gUnk_080CD848[])(GleerokEntity*);
|
||||
|
||||
extern u8 gUnk_080CD774[];
|
||||
extern u8 gUnk_080CD7C4[];
|
||||
extern Gleerok_HeapStruct2 gUnk_080CD7C4[];
|
||||
extern u8 gUnk_080CD884[];
|
||||
extern u8 gUnk_080CD7F8[];
|
||||
extern u8 gUnk_080CD840[];
|
||||
|
|
@ -136,8 +143,8 @@ void sub_0802D170(GleerokEntity* this) {
|
|||
return;
|
||||
|
||||
if (super->action == 1) {
|
||||
this->unk_84->filler[1] = 0x10;
|
||||
this->unk_84->filler[0x19] = 0x10;
|
||||
this->unk_84->filler[0].unk1 = 0x10;
|
||||
this->unk_84->filler[6].unk1 = 0x10;
|
||||
if (sub_0802EB08(this->unk_84, 0x40, 2) == 0 && sub_0802EA88(this->unk_84) == 0) {
|
||||
super->action = 2;
|
||||
gPlayerEntity.x.HALF.HI = gRoomControls.origin_x + 0x98;
|
||||
|
|
@ -151,7 +158,7 @@ void sub_0802D170(GleerokEntity* this) {
|
|||
super->action = 3;
|
||||
this->unk_80 = 0;
|
||||
((Entity*)this->unk_84)->parent->timer = 24;
|
||||
this->unk_84->filler[0x19] = 0;
|
||||
this->unk_84->filler[6].unk1 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -249,8 +256,8 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
|||
Entity* ent;
|
||||
Gleerok_HeapStruct* heap;
|
||||
u32 val;
|
||||
u8* ptr;
|
||||
u8* ptr2;
|
||||
Gleerok_HeapStruct2* ptr;
|
||||
Gleerok_HeapStruct2* ptr2;
|
||||
|
||||
if (CheckGlobalFlag(LV2_CLEAR)) {
|
||||
gScreen.lcd.displayControl &= 0xFDFF;
|
||||
|
|
@ -294,10 +301,10 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
|||
((GleerokEntity*)super->child)->unk_84 = this->unk_84;
|
||||
this->unk_84->entities[uvar1] = super->child;
|
||||
ptr = this->unk_84->filler;
|
||||
ptr2 = ptr + uvar1 * 4;
|
||||
ptr2[1] = 0x10;
|
||||
ptr2[0x19] = 0;
|
||||
ptr[0x35] = 0;
|
||||
ptr2 = ptr + uvar1;
|
||||
ptr2[0].unk1 = 0x10;
|
||||
ptr2[6].unk1 = 0;
|
||||
ptr[13].unk1 = 0;
|
||||
}
|
||||
} while (++uvar1 < 5);
|
||||
|
||||
|
|
@ -310,9 +317,9 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
|||
super->child->parent = super;
|
||||
((GleerokEntity*)super->child)->unk_84 = this->unk_84;
|
||||
heap->ent2 = super->child;
|
||||
heap->filler[0x15] = 0x10;
|
||||
heap->filler[0x2d] = 0;
|
||||
heap->filler[0x35] = 0;
|
||||
heap->filler[3].unk1 = 0x10;
|
||||
heap->filler[11].unk1 = 0;
|
||||
heap->filler[13].unk1 = 0;
|
||||
}
|
||||
#ifndef EU
|
||||
gPlayerState.controlMode = CONTROL_DISABLED;
|
||||
|
|
@ -325,8 +332,8 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
|||
super->flags2 |= 0x80;
|
||||
}
|
||||
ptr = gUnk_080CD7C4;
|
||||
ptr += super->type2 * 4;
|
||||
super->spritePriority.b0 = *(ptr + 1);
|
||||
ptr += super->type2;
|
||||
super->spritePriority.b0 = ptr->unk1;
|
||||
super->subtimer = 0;
|
||||
InitializeAnimation(super, 0x24);
|
||||
break;
|
||||
|
|
@ -413,15 +420,14 @@ void sub_0802D714(GleerokEntity* this) {
|
|||
Entity* enemy;
|
||||
u32 index;
|
||||
u32 val1, val2;
|
||||
u8* ptr;
|
||||
Gleerok_HeapStruct2* ptr;
|
||||
Gleerok_HeapStruct* heap;
|
||||
if (--this->unk_7c.WORD != -1)
|
||||
return;
|
||||
|
||||
for (heap = this->unk_84, index = 0, val1 = 0, val2 = 0x10, ptr = this->unk_84->filler; index < 6;
|
||||
ptr += 4, ++index) {
|
||||
*(u16*)(ptr + 0x18) = val1;
|
||||
*(ptr + 1) = val2;
|
||||
for (heap = this->unk_84, index = 0, val1 = 0, val2 = 0x10, ptr = this->unk_84->filler; index < 6; ptr++, ++index) {
|
||||
*(u16*)(ptr + 6) = val1;
|
||||
ptr->unk1 = val2;
|
||||
}
|
||||
|
||||
super->subAction = 3;
|
||||
|
|
@ -579,7 +585,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
|
|||
super->child = enemy;
|
||||
if (enemy) {
|
||||
enemy->parent = super->parent;
|
||||
super->timer = this->unk_84->filler[1];
|
||||
super->timer = this->unk_84->filler[0].unk1;
|
||||
this->unk_84->ent = super->child;
|
||||
((GleerokEntity*)super->child)->unk_84 = this->unk_84;
|
||||
}
|
||||
|
|
@ -610,8 +616,8 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
|
|||
SoundReq(SFX_BUTTON_PRESS);
|
||||
}
|
||||
} else {
|
||||
if (super->timer != this->unk_84->filler[1]) {
|
||||
if (((super->timer - this->unk_84->filler[1]) & 0x1f) > 0x10) {
|
||||
if (super->timer != this->unk_84->filler[0].unk1) {
|
||||
if (((super->timer - this->unk_84->filler[0].unk1) & 0x1f) > 0x10) {
|
||||
if (++super->frameIndex >= 0x31) {
|
||||
super->frameIndex = 0x28;
|
||||
}
|
||||
|
|
@ -621,7 +627,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
|
|||
}
|
||||
}
|
||||
|
||||
super->timer = this->unk_84->filler[1];
|
||||
super->timer = this->unk_84->filler[0].unk1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -656,13 +662,13 @@ END_NONMATCH
|
|||
void sub_0802DB84(GleerokEntity* this) {
|
||||
u32 timer;
|
||||
super->direction = GetFacingDirection(super, &gPlayerEntity);
|
||||
if (this->unk_84->filler[0x1] == super->direction) {
|
||||
if (this->unk_84->filler[0].unk1 == super->direction) {
|
||||
super->subAction = 1;
|
||||
this->unk_78 = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (((this->unk_84->filler[0x1] - super->direction) & 0x1f) > 0x10) {
|
||||
if (((this->unk_84->filler[0].unk1 - super->direction) & 0x1f) > 0x10) {
|
||||
timer = 0;
|
||||
super->timer &= 0xfe;
|
||||
} else {
|
||||
|
|
@ -690,7 +696,7 @@ void sub_0802DB84(GleerokEntity* this) {
|
|||
|
||||
void sub_0802DC1C(GleerokEntity* this) {
|
||||
u32 diff = GetFacingDirection(super, &gPlayerEntity);
|
||||
diff = (this->unk_84->filler[1] - diff) & 0x1f;
|
||||
diff = (this->unk_84->filler[0].unk1 - diff) & 0x1f;
|
||||
|
||||
if (diff > 0x10) {
|
||||
if (diff <= 0x1d) {
|
||||
|
|
@ -713,11 +719,11 @@ void sub_0802DC1C(GleerokEntity* this) {
|
|||
}
|
||||
|
||||
sub_0802EA48(this->unk_84, 5, 0x20, diff);
|
||||
if (sub_0802EA18(*(u16*)&this->unk_84->filler[0], *(u16*)&this->unk_84->filler[0x14], 4)) {
|
||||
if (sub_0802EA18(*(u16*)this->unk_84->filler, *(u16*)&this->unk_84->filler[5], 4)) {
|
||||
if (super->timer == 1) {
|
||||
*(u16*)&this->unk_84->filler[0x14] = (((this->unk_84->filler[0x1] - 4) & 0x1f) << 8) | 0xff;
|
||||
*(u16*)&this->unk_84->filler[5] = (((this->unk_84->filler[0].unk1 - 4) & 0x1f) << 8) | 0xff;
|
||||
} else {
|
||||
*(u16*)&this->unk_84->filler[0x14] = (((this->unk_84->filler[0x1] + 4) & 0x1f) << 8);
|
||||
*(u16*)&this->unk_84->filler[5] = (((this->unk_84->filler[0].unk1 + 4) & 0x1f) << 8);
|
||||
}
|
||||
|
||||
super->timer ^= 1;
|
||||
|
|
@ -734,13 +740,13 @@ void sub_0802DC1C(GleerokEntity* this) {
|
|||
void sub_0802DCE0(GleerokEntity* this) {
|
||||
if (this->unk_84->ent2->timer != 12) {
|
||||
super->direction = GetFacingDirection(super, &gPlayerEntity);
|
||||
if (this->unk_84->filler[0x15] == super->direction) {
|
||||
if (this->unk_84->filler[5].unk1 == super->direction) {
|
||||
this->unk_84->ent2->timer = 12;
|
||||
this->unk_82 = 4;
|
||||
super->subtimer = 0;
|
||||
} else {
|
||||
s32 svar1, diff;
|
||||
diff = ((this->unk_84->filler[0x15] - super->direction) & 0x1f);
|
||||
diff = ((this->unk_84->filler[5].unk1 - super->direction) & 0x1f);
|
||||
svar1 = 1;
|
||||
if (diff > 0x10) {
|
||||
svar1 = 0;
|
||||
|
|
@ -763,7 +769,7 @@ void sub_0802DCE0(GleerokEntity* this) {
|
|||
super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, 0);
|
||||
|
||||
if (super->child != NULL) {
|
||||
super->child->direction = this->unk_84->filler[0x15];
|
||||
super->child->direction = this->unk_84->filler[5].unk1;
|
||||
super->child->type2 = this->unk_84->ent2->frame & 0xf;
|
||||
super->child->parent = this->unk_84->ent2;
|
||||
super->child->child = this->unk_84->entities[0];
|
||||
|
|
@ -807,10 +813,10 @@ void sub_0802DDD8(GleerokEntity* this) {
|
|||
|
||||
if ((Random() & 1) == 0) {
|
||||
super->direction = 0;
|
||||
this->unk_7a = (this->unk_84->filler[1] + uvar1) & 0x1f;
|
||||
this->unk_7a = (this->unk_84->filler[0].unk1 + uvar1) & 0x1f;
|
||||
} else {
|
||||
super->direction = 1;
|
||||
this->unk_7a = (this->unk_84->filler[1] - uvar1) & 0x1f;
|
||||
this->unk_7a = (this->unk_84->filler[0].unk1 - uvar1) & 0x1f;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -830,7 +836,7 @@ void sub_0802DDD8(GleerokEntity* this) {
|
|||
if (this->unk_84->ent2->subtimer == 1) {
|
||||
super->child = CreateProjectileWithParent(super, GLEEROK_PROJECTILE, r2);
|
||||
if (super->child != NULL) {
|
||||
super->child->direction = this->unk_84->filler[0x15];
|
||||
super->child->direction = this->unk_84->filler[5].unk1;
|
||||
super->child->type2 = this->unk_84->ent2->frame & 0xf;
|
||||
super->child->parent = this->unk_84->ent2;
|
||||
super->child->child = this->unk_84->entities[0];
|
||||
|
|
@ -860,7 +866,7 @@ void sub_0802DDD8(GleerokEntity* this) {
|
|||
}
|
||||
sub_0802E768(this->unk_84);
|
||||
|
||||
if (this->unk_7a == this->unk_84->filler[0x15]) {
|
||||
if (this->unk_7a == this->unk_84->filler[5].unk1) {
|
||||
if (super->type2 == 1) {
|
||||
super->type2 = 2;
|
||||
super->direction ^= 1;
|
||||
|
|
@ -890,7 +896,7 @@ void sub_0802DFA8(GleerokEntity* this) {
|
|||
}
|
||||
|
||||
void sub_0802DFC0(GleerokEntity* this) {
|
||||
u32 val = this->unk_84->filler[1] & 7;
|
||||
u32 val = this->unk_84->filler[0].unk1 & 7;
|
||||
if (val) {
|
||||
if (val > 4) {
|
||||
super->direction = 0;
|
||||
|
|
@ -923,10 +929,10 @@ void sub_0802E034(GleerokEntity* this) {
|
|||
val = 0;
|
||||
} else {
|
||||
super->direction = 3;
|
||||
val = gUnk_080CD840[heap->filler[1] >> 3];
|
||||
val = gUnk_080CD840[heap->filler[0].unk1 >> 3];
|
||||
}
|
||||
|
||||
if (val != heap->filler[0x19]) {
|
||||
if (val != heap->filler[6].unk1) {
|
||||
sub_0802EA68(heap, 0, 0x40, super->direction);
|
||||
sub_0802EB08(heap, 0x40, 2);
|
||||
} else {
|
||||
|
|
@ -938,7 +944,7 @@ void sub_0802E034(GleerokEntity* this) {
|
|||
}
|
||||
|
||||
super->type2++;
|
||||
heap->filler[0x19] = 1;
|
||||
heap->filler[6].unk1 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1045,7 +1051,7 @@ void sub_0802E1D0(GleerokEntity* this) {
|
|||
void sub_0802E300(GleerokEntity* this) {
|
||||
u32 dir, tmp;
|
||||
u32 index;
|
||||
u8* ptr;
|
||||
Gleerok_HeapStruct2* ptr;
|
||||
u8* ptr2;
|
||||
Entity* ent;
|
||||
Gleerok_HeapStruct* heap;
|
||||
|
|
@ -1085,8 +1091,8 @@ void sub_0802E300(GleerokEntity* this) {
|
|||
ptr = heap->filler;
|
||||
do {
|
||||
((u16*)ptr)[0xc] = tmp;
|
||||
ptr[1] = dir;
|
||||
ptr += 4;
|
||||
ptr->unk1 = dir;
|
||||
ptr++;
|
||||
index++;
|
||||
} while (index <= 5);
|
||||
|
||||
|
|
@ -1120,7 +1126,7 @@ void sub_0802E448(GleerokEntity* this) {
|
|||
Gleerok_HeapStruct* heap = this->unk_84;
|
||||
s32 index;
|
||||
for (index = 5; index >= 0; index--) {
|
||||
u8* ptr = &heap->filler[0x30];
|
||||
u8* ptr = heap->unk_30;
|
||||
if (ptr[index] == 0) {
|
||||
CreateFx(heap->entities[0], FX_LAVA_SPLASH, 0);
|
||||
SoundReq(SFX_PLY_LAND);
|
||||
|
|
@ -1134,7 +1140,7 @@ void sub_0802E448(GleerokEntity* this) {
|
|||
}
|
||||
}
|
||||
|
||||
if (heap->filler[0x2d] <= 9) {
|
||||
if (heap->unk_2c.HALF.HI <= 9) {
|
||||
sub_0802EA68(heap, 5, 0x40, 3);
|
||||
}
|
||||
|
||||
|
|
@ -1173,9 +1179,9 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
|
|||
s32 r7;
|
||||
Gleerok_HeapStruct* heap = this->unk_84;
|
||||
CopyPosition(heap->entities[0]->parent, heap->entities[0]);
|
||||
heap->entities[0]->direction = heap->filler[1];
|
||||
heap->entities[0]->direction = heap->filler[0].unk1;
|
||||
|
||||
r6 = heap->filler[1];
|
||||
r6 = heap->filler[0].unk1;
|
||||
if (r6 > 0x10) {
|
||||
r6 ^= 0xf;
|
||||
r6 = (r6 + 1) & 0xf;
|
||||
|
|
@ -1187,29 +1193,29 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
|
|||
|
||||
heap->entities[0]->speed = ((r6 ^ 0xf) + 0x12) << 8;
|
||||
LinearMoveUpdate(heap->entities[0]);
|
||||
sp4 = *(u32*)&heap->filler[0x30];
|
||||
sp4 = *(u32*)heap->unk_30;
|
||||
sp8 = this->unk_80;
|
||||
|
||||
for (index = 0; index <= 4; index++) {
|
||||
s32 result;
|
||||
CopyPosition(heap->entities[index], heap->entities[index + 1]);
|
||||
result = FixedMul(gSineTable[heap->filler[0x19 + (index + 1) * 4]], ((u8*)sp4)[r6]);
|
||||
result = FixedMul(gSineTable[heap->filler[6 + (index + 1)].unk1], ((u8*)sp4)[r6]);
|
||||
result = FixedDiv(result, 0x100);
|
||||
result = FixedMul(gSineTable[heap->filler[0x1 + (index + 1) * 4]], result);
|
||||
result = FixedMul(gSineTable[heap->filler[(index + 1)].unk1], result);
|
||||
result = FixedDiv(result, 0x100);
|
||||
heap->entities[index]->x.WORD += result << 8;
|
||||
|
||||
result = FixedMul(gSineTable[heap->filler[0x19 + (index + 1) * 4]], ((u8*)sp4)[r6]);
|
||||
result = FixedMul(gSineTable[heap->filler[6 + (index + 1)].unk1], ((u8*)sp4)[r6]);
|
||||
result = FixedDiv(result, 0x100);
|
||||
heap->entities[index]->y.WORD -= result << 8;
|
||||
}
|
||||
|
||||
if (heap->ent2->timer == 24) {
|
||||
r7 = (heap->filler[0x15] >> 3) << 2;
|
||||
if (heap->filler[0x2d] > 0xc) {
|
||||
r7 = (heap->filler[5].unk1 >> 3) << 2;
|
||||
if (heap->unk_2c.HALF.HI > 0xc) {
|
||||
r7 += 3;
|
||||
} else {
|
||||
r7 += heap->filler[0x2d] >> 2;
|
||||
r7 += heap->unk_2c.HALF.HI >> 2;
|
||||
}
|
||||
|
||||
if (heap->ent2->animIndex != r7 + 0x18) {
|
||||
|
|
@ -1222,11 +1228,11 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
|
|||
r7 += heap->ent2->timer;
|
||||
} else {
|
||||
if (super->iframes == 0) {
|
||||
if ((super->animIndex != (heap->filler[0x15] >> 3) + 0x2f) || (super->frame & ANIM_DONE) != 0) {
|
||||
r7 = (heap->filler[0x15] >> 3) + 0x28;
|
||||
if ((super->animIndex != (heap->filler[5].unk1 >> 3) + 0x2f) || (super->frame & ANIM_DONE) != 0) {
|
||||
r7 = (heap->filler[5].unk1 >> 3) + 0x28;
|
||||
}
|
||||
} else {
|
||||
r7 = (heap->filler[0x15] >> 3) + 0x2f;
|
||||
r7 = (heap->filler[5].unk1 >> 3) + 0x2f;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1242,9 +1248,9 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
|
|||
u32 val;
|
||||
sub_0802E7CC(heap, (u8)index, 0, 0);
|
||||
r7 = heap->entities[index]->animationState * 12;
|
||||
r7 += (((s32)heap->filler[0x19 + (index + 1) * 4]) / 3) * 12;
|
||||
r7 += (((s32)heap->filler[6 + (index + 1)].unk1) / 3) * 12;
|
||||
} else {
|
||||
r7 = heap->filler[0x1 + index * 4] >> 3;
|
||||
r7 = heap->filler[index].unk1 >> 3;
|
||||
r7 += 0x48;
|
||||
}
|
||||
if (heap->entities[index]->animIndex != r7) {
|
||||
|
|
@ -1256,21 +1262,10 @@ END_NONMATCH
|
|||
|
||||
ASM_FUNC("asm/non_matching/gleerok/sub_0802E768.inc", bool32 sub_0802E768(Gleerok_HeapStruct* param_1));
|
||||
|
||||
typedef struct {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
} sub_0802E7CC_HeapStruct;
|
||||
|
||||
NONMATCH("asm/non_matching/gleerok/sub_0802E7CC.inc",
|
||||
bool32 sub_0802E7CC(Gleerok_HeapStruct* param_1, u32 param_2, u32 param_3, u32 param_4)) {
|
||||
u8* ptr;
|
||||
|
||||
param_1->entities[(u8)param_2]->animationState = ((sub_0802E7CC_HeapStruct*)param_1->filler)[(u8)param_2].unk1;
|
||||
u32 sub_0802E7CC(Gleerok_HeapStruct* param_1, u32 param_2, u32 param_3, u32 param_4) {
|
||||
param_1->entities[(u8)param_2]->animationState = param_1->filler[(u8)param_2].unk1;
|
||||
return param_1->entities[(u8)param_2]->animationState;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
ASM_FUNC("asm/non_matching/gleerok/sub_0802E7E4.inc", void sub_0802E7E4(Gleerok_HeapStruct* this));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue