unify struct fields

This commit is contained in:
Zhengwen Jiang 2022-07-12 14:35:35 -05:00 committed by Egor Ananyin
parent 1978db59fc
commit 2a50673fc8
22 changed files with 1043 additions and 1467 deletions

View File

@ -253,7 +253,7 @@ struct ObjectBase {
u8 filler6[2];
u32 flags;
u32 unkC;
struct Sprite unk10;
struct Sprite sprite;
s8 unk38;
s8 unk39;
s8 unk3A;
@ -268,8 +268,8 @@ struct ObjectBase {
s32 unk4C;
s16 xspeed;
s16 yspeed;
s8 unk54;
s8 unk55;
s8 objBase54;
s8 objBase55;
u8 unk56;
u8 unk57;
u32 unk58;
@ -334,15 +334,15 @@ struct Object4 {
s16 unk4;
u16 flags;
s16 unk8;
struct Sprite unkC; // ObjectBase::unk10
s32 unk34; // ObjectBase::x
s32 unk38; // ObjectBase::y
struct Sprite sprite;
s32 x;
s32 y;
s16 unk3C;
s16 unk3E;
s8 unk40; // ObjectBase::unk54
s8 unk41; // ObjectBase::unk55
s8 objBase54;
s8 objBase55;
u16 roomId;
void *unk44; // ObjectBase::parent
void *parent;
}; /* size = 0x48 */
struct Object5 {

View File

@ -265,57 +265,56 @@
sub_0815604C(sprite); \
})
// TODO: take struct Object4 *
#define Macro_080FC150(objBase) ({ \
#define Macro_080FC150(objBase /* obj4 */) ({ \
s32 _r0; \
\
if ((objBase)->flags & 1) \
{ \
struct Sprite *_r0 = &(objBase)->unk10; \
struct Sprite *_r0 = &(objBase)->sprite; \
\
_r0->unk8 = (objBase)->unk10.unk8 | 0x400; \
_r0->unk8 = (objBase)->sprite.unk8 | 0x400; \
} \
else \
{ \
struct Sprite *_r0 = &(objBase)->unk10; \
struct Sprite *_r0 = &(objBase)->sprite; \
\
_r0->unk8 = (objBase)->unk10.unk8 & ~0x400; \
_r0->unk8 = (objBase)->sprite.unk8 & ~0x400; \
} \
if (!((objBase)->flags & 8)) \
{ \
if (((objBase)->unk10.unk1B != (objBase)->unk10.unk1A || (objBase)->unk10.unk18 != (objBase)->unk10.unkC) \
&& (objBase)->unk10.unk1C) \
if (((objBase)->sprite.unk1B != (objBase)->sprite.unk1A || (objBase)->sprite.unk18 != (objBase)->sprite.unkC) \
&& (objBase)->sprite.unk1C) \
{ \
(objBase)->unk1 = 0; \
(objBase)->unk2 = 0; \
(objBase)->flags &= ~4; \
} \
_r0 = sub_08155128(&(objBase)->unk10); \
_r0 = sub_08155128(&(objBase)->sprite); \
if (!_r0) \
{ \
(objBase)->flags |= 2; \
if ((objBase)->flags & 4 && (objBase)->unk10.unk1C) \
if ((objBase)->flags & 4 && (objBase)->sprite.unk1C) \
{ \
(objBase)->unk10.unk1B = 0xFF; \
(objBase)->sprite.unk1B = 0xFF; \
(objBase)->flags &= ~4; \
(objBase)->unk1 = 0; \
(objBase)->unk2 = _r0; \
sub_08155128(&(objBase)->unk10); \
sub_08155128(&(objBase)->sprite); \
} \
} \
else \
{ \
(objBase)->unk2 += (objBase)->unk10.unk1C; \
(objBase)->unk2 += (objBase)->sprite.unk1C; \
(objBase)->unk1 = (objBase)->unk2 >> 4; \
(objBase)->flags &= ~2; \
} \
} \
(objBase)->unk10.unk10 = ((objBase)->x >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unkC >> 8) + (objBase)->unk54; \
(objBase)->unk10.unk12 = ((objBase)->y >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unk10 >> 8) + (objBase)->unk55; \
if ((objBase)->unk10.unk1C) \
(objBase)->sprite.unk10 = ((objBase)->x >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unkC >> 8) + (objBase)->objBase54; \
(objBase)->sprite.unk12 = ((objBase)->y >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unk10 >> 8) + (objBase)->objBase55; \
if ((objBase)->sprite.unk1C) \
{ \
(objBase)->unk54 = 0; \
(objBase)->unk55 = 0; \
(objBase)->objBase54 = 0; \
(objBase)->objBase55 = 0; \
} \
})

View File

@ -104,7 +104,7 @@ void *CreateAbilityStar(struct Object *arg0, u8 arg1) {
gUnk_0203AD34 = 1;
}
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x580;
obj->base.sprite.unk14 = 0x580;
sub_080AA91C(obj);
return obj;
}
@ -412,13 +412,13 @@ static void sub_080A9FBC(struct Object2* arg0, s16 arg1, s16 arg2) {
obj = TaskGetStructPtr(task, obj2);
sub_0803E3B0(obj);
obj->unk0 = 3;
obj->unk34 = arg0->base.x;
obj->unk38 = arg0->base.y;
obj->unk44 = arg0;
obj->x = arg0->base.x;
obj->y = arg0->base.y;
obj->parent = arg0;
obj->roomId = arg0->base.roomId;
obj->flags |= 0x4000;
obj->unk34 = arg1 * 256;
obj->unk38 = arg2 * 256;
obj->x = arg1 * 256;
obj->y = arg2 * 256;
switch (arg0->subtype) {
case 0:
r2 = 0x600;
@ -449,17 +449,17 @@ static void sub_080A9FBC(struct Object2* arg0, s16 arg1, s16 arg2) {
break;
}
if (gUnk_0203AD40 & 1) {
sub_080709F8(obj, &obj->unkC, 0xd, 0x2c2, 0, 0xa);
sub_080709F8(obj, &obj->sprite, 0xd, 0x2c2, 0, 0xa);
}
else {
sub_080709F8(obj, &obj->unkC, 0xd, 0x2c2, 1, 0xa);
sub_080709F8(obj, &obj->sprite, 0xd, 0x2c2, 1, 0xa);
}
}
static void sub_080AA108(void) {
struct Sprite sprite, *sprite2;
struct Object4 *obj_2, *obj = TaskGetStructPtr(gCurTask, obj_2);
struct Object2 *obj2 = obj->unk44;
struct Object2 *obj2 = obj->parent;
struct Kirby *kirby = &gKirbys[gUnk_0203AD3C];
if (obj->flags & 0x1000) {
TaskDestroy(gCurTask);
@ -481,31 +481,31 @@ static void sub_080AA108(void) {
KirbySomething(obj);
}
obj->flags |= 4;
if (obj->unk34 >= gCurLevelInfo[kirby->base.base.base.unk56].unkC - 0x1c00
&& obj->unk34 <= gCurLevelInfo[kirby->base.base.base.unk56].unkC + 0x10c00
&& obj->unk38 >= gCurLevelInfo[kirby->base.base.base.unk56].unk10 - 0x1c00
&& obj->unk38 <= gCurLevelInfo[kirby->base.base.base.unk56].unk10 + 0xbc00) {
if (obj->x >= gCurLevelInfo[kirby->base.base.base.unk56].unkC - 0x1c00
&& obj->x <= gCurLevelInfo[kirby->base.base.base.unk56].unkC + 0x10c00
&& obj->y >= gCurLevelInfo[kirby->base.base.base.unk56].unk10 - 0x1c00
&& obj->y <= gCurLevelInfo[kirby->base.base.base.unk56].unk10 + 0xbc00) {
switch (obj2->object->subtype1) {
case 0:
if ((obj->unk38 >> 8) < obj->unk4) {
if ((obj->y >> 8) < obj->unk4) {
obj->flags |= 0x1000;
return;
}
break;
case 1:
if ((obj->unk34 >> 8) > obj->unk4) {
if ((obj->x >> 8) > obj->unk4) {
obj->flags |= 0x1000;
return;
}
break;
case 2:
if ((obj->unk38 >> 8) > obj->unk4) {
if ((obj->y >> 8) > obj->unk4) {
obj->flags |= 0x1000;
return;
}
break;
default:
if ((obj->unk34 >> 8) < obj->unk4) {
if ((obj->x >> 8) < obj->unk4) {
goto lab;
}
break;
@ -516,10 +516,10 @@ static void sub_080AA108(void) {
obj->flags |= 0x1000;
return;
}
Macro_08107BA8_4(obj, &obj->unkC, &sprite, 13, &obj->unkC);
Macro_08107BA8_4(obj, &obj->sprite, &sprite, 13, &obj->sprite);
if (!(obj->flags & 0x800)) {
obj->unk34 += obj->unk3C;
obj->unk38 -= obj->unk3E;
obj->x += obj->unk3C;
obj->y -= obj->unk3E;
}
sub_0806FAC8(obj);
}
@ -545,7 +545,7 @@ void *CreateAbilityStatue(struct Object *arg0, u8 arg1) {
sub_0803E2B0(&obj->base, -4, -4, 4, 8);
sub_0803E308(&obj->base, -4, -4, 4, 8);
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x780;
obj->base.sprite.unk14 = 0x780;
if (obj->object->subtype2 != 0) {
obj->base.flags |= 1;
}

View File

@ -30,7 +30,7 @@ void* CreateBigWaddleDee(struct Object* arg0, u8 arg1) {
obj->base.flags |= 1;
}
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x6c0;
obj->base.sprite.unk14 = 0x6c0;
switch (arg0->subtype1) {
default:
case 0:

View File

@ -19,7 +19,7 @@ void* CreateBlockin(struct Object* arg0, u8 arg1) {
sub_0803E2B0(&obj->base, -5, -5, 5, 4);
sub_0803E308(&obj->base, -6, -10, 6, 7);
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x700;
obj->base.sprite.unk14 = 0x700;
gUnk_08351648[obj->type].unk10(obj);
obj->unk9E = 0;
obj->unk7C = 0;
@ -62,12 +62,12 @@ static void sub_080A47C8(struct Object2* arg0) {
}
else {
if (arg0->base.counter <= 0x13) {
arg0->base.unk54 = gUnk_08350BCC[arg0->base.counter][0];
arg0->base.unk55 = gUnk_08350BCC[arg0->base.counter][1];
arg0->base.objBase54 = gUnk_08350BCC[arg0->base.counter][0];
arg0->base.objBase55 = gUnk_08350BCC[arg0->base.counter][1];
}
else if (arg0->base.counter <= 0x21) {
arg0->base.unk54 = gUnk_08350BB0[(arg0->base.counter - 0x14)][0];
arg0->base.unk55 = gUnk_08350BB0[(arg0->base.counter - 0x14)][1];
arg0->base.objBase54 = gUnk_08350BB0[(arg0->base.counter - 0x14)][0];
arg0->base.objBase55 = gUnk_08350BB0[(arg0->base.counter - 0x14)][1];
}
arg0->base.counter++;
}

View File

@ -52,7 +52,7 @@ void *CreateBonkers(struct Object *arg0, u8 arg1) {
sub_0803E2B0(&obj->base, -10, -22, 16, 10);
sub_0803E308(&obj->base, -12, -24, 20, 10);
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x6c0;
obj->base.sprite.unk14 = 0x6c0;
obj->unk9E = 0;
obj->unk7C = sub_0809EF88;
sub_080D1488(obj);

View File

@ -38,7 +38,7 @@ void* CreateBonus(struct Object* arg0, u8 arg1) {
obj->base.unk4C = obj->base.y;
}
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x700;
obj->base.sprite.unk14 = 0x700;
if (obj->type == OBJ_SMALL_FOOD) {
obj->unk83 = obj->object->subtype1;
}

View File

@ -21,8 +21,8 @@
u32 _var2 = 0x200; \
\
if ( \
(kirby)->base.base.base.unk10.unkC == 0x127 && \
(kirby)->base.base.base.unk10.unk1A == 1 \
(kirby)->base.base.base.sprite.unkC == 0x127 && \
(kirby)->base.base.base.sprite.unk1A == 1 \
) \
_var2 |= 2; \
\
@ -3194,8 +3194,8 @@ static u16 sub_080072BC(struct Kirby *arg0, struct Unk_3007DE0 *arg1, u16 arg2)
u32 var5 = 0x200;
if (
arg0->base.base.base.unk10.unkC == 0x127 &&
arg0->base.base.base.unk10.unk1A == 1
arg0->base.base.base.sprite.unkC == 0x127 &&
arg0->base.base.base.sprite.unk1A == 1
)
var5 |= 2;
@ -3391,8 +3391,8 @@ static u16 sub_08007720(struct Kirby *arg0, struct Unk_3007DE0 *arg1, u16 arg2)
u32 var5 = 0x200;
if (
arg0->base.base.base.unk10.unkC == 0x127 &&
arg0->base.base.base.unk10.unk1A == 1
arg0->base.base.base.sprite.unkC == 0x127 &&
arg0->base.base.base.sprite.unk1A == 1
)
var5 |= 2;
@ -4597,7 +4597,7 @@ static u16 sub_080099C4(struct Kirby *arg0, struct Unk_3007DE0 *arg1, u16 arg2)
case 0x50: {
u8 uVar2;
if (arg0->base.base.base.unk10.unkC == 0x127 && arg0->base.base.base.unk10.unk1A == 1) {
if (arg0->base.base.base.sprite.unkC == 0x127 && arg0->base.base.base.sprite.unk1A == 1) {
uVar2 = sub_080023E4(arg0->base.base.base.unk56, arg1->unk1C, arg1->unk1E - 1);
if ((gUnk_082D88B8[uVar2] & 0x200) == 0) {

View File

@ -254,7 +254,7 @@ static void sub_080A2B6C(struct Object2* arg0) {
arg0->unk9F = 0xff;
}
}
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
if (--arg0->base.counter == 0) {
arg0->kirby3 = sub_0803D368(&arg0->base);
if (arg0->base.x > arg0->kirby3->base.base.base.x) {
@ -312,7 +312,7 @@ static void sub_080A2E38(struct Object2* arg0) {
arg0->unk9F = 0xFF;
#endif
}
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
if (--arg0->base.counter == 0) {
arg0->kirby3 = sub_0803D368(&arg0->base);
if (arg0->base.x > arg0->kirby3->base.base.base.x) {
@ -376,7 +376,7 @@ static void sub_080A3008(struct Object2* arg0) {
#endif
}
}
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
if (--arg0->base.counter == 0) {
arg0->kirby3 = sub_0803D368(&arg0->base);
if (arg0->base.x > arg0->kirby3->base.base.base.x) {
@ -495,16 +495,16 @@ static void sub_080A31D8(struct Object2* arg0) {
arg0->base.flags |= 0x800;
}
else {
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
}
}
else {
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
}
}
else {
arg0->base.counter--;
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
}
}
else {
@ -600,16 +600,16 @@ static void sub_080A31D8(struct Object2* arg0) {
arg0->base.flags |= 0x800;
}
else {
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
}
}
else {
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
}
}
else {
arg0->base.counter--;
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
}
}
}
@ -702,7 +702,7 @@ static void sub_080A389C(struct Object2* arg0) {
if (abs(arg0->base.xspeed) <= 0x17f) {
arg0->unk83 = 4;
if (arg0->base.yspeed > 0x80) {
arg0->base.unk10.unk1A = 2;
arg0->base.sprite.unk1A = 2;
if (arg0->base.yspeed > 0x180) {
if (arg0->base.yspeed > 0x240) {
arg0->unk83 = 0;
@ -833,5 +833,5 @@ static void sub_080A3B94(struct Object2* arg0) {
arg0->base.xspeed = -0x48;
}
arg0->base.yspeed += 8;
arg0->base.unk55 = gUnk_083533F4[arg0->base.unk1 >> 1];
arg0->base.objBase55 = gUnk_083533F4[arg0->base.unk1 >> 1];
}

View File

@ -204,8 +204,8 @@ void sub_080F5A6C(struct DarkMetaKnight *dmk)
dmk->obj2.unk9E = 0;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
SpriteSomething(&sprite, 0x6000000, 0x394, 1, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 3, 0xFF, 0, 0, 0, 0, 0x10, dmk2->unkB4->unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 1, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.sprite.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 3, 0xFF, 0, 0, 0, 0, 0x10, dmk2->unkB4->sprite.unk1F & 0xF, 0x80000);
}
dmk->obj2.unk9F = 0x36;
}
@ -343,8 +343,8 @@ void sub_080F5DA0(struct DarkMetaKnight *dmk)
{
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
sub_0803CD98(dmk->obj2.base.unk10.unk1F, 0x394, 1, 0x390, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->unk10.unk1F, 0x394, 3, 0x391, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk->obj2.base.sprite.unk1F, 0x394, 1, 0x390, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->sprite.unk1F, 0x394, 3, 0x391, 0, dmk->obj2.base.counter);
}
dmk->obj2.base.counter += 2;
if (dmk->obj2.base.counter > 0x100)
@ -519,8 +519,8 @@ void sub_080F6544(struct DarkMetaKnight *dmk)
dmk->obj2.base.xspeed = 0;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
sub_0803CD98(dmk->obj2.base.unk10.unk1F, 0x390, 0, 0x394, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->unk10.unk1F, 0x391, 0, 0x394, 2, dmk->obj2.base.counter);
sub_0803CD98(dmk->obj2.base.sprite.unk1F, 0x390, 0, 0x394, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->sprite.unk1F, 0x391, 0, 0x394, 2, dmk->obj2.base.counter);
}
dmk->obj2.base.counter += 2;
if (dmk->obj2.base.counter > 0x100)
@ -544,8 +544,8 @@ void sub_080F6728(struct DarkMetaKnight *dmk)
dmk->obj2.unk85 = 0;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
SpriteSomething(&sprite, 0x6000000, 0x394, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 2, 0xFF, 0, 0, 0, 0, 0x10, dmk->unkB4->unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.sprite.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 2, 0xFF, 0, 0, 0, 0, 0x10, dmk->unkB4->sprite.unk1F & 0xF, 0x80000);
}
}
@ -647,8 +647,8 @@ void sub_080F6AEC(struct DarkMetaKnight *dmk, u8 a2)
if (dmk->unkBC) dmk->unkBC->flags |= 0x1000;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
SpriteSomething(&sprite, 0x6000000, 0x394, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 2, 0xFF, 0, 0, 0, 0, 0x10, dmk->unkB4->unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.sprite.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 2, 0xFF, 0, 0, 0, 0, 0x10, dmk->unkB4->sprite.unk1F & 0xF, 0x80000);
}
dmk->obj2.base.flags |= 1;
dmk->obj2.base.flags &= ~8;
@ -746,8 +746,8 @@ void sub_080F704C(struct DarkMetaKnight *dmk)
dmk->obj2.unk9F = 0;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
SpriteSomething(&sprite, 0x6000000, 0x394, 1, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 3, 0xFF, 0, 0, 0, 0, 0x10, dmk->unkB4->unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 1, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.sprite.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x394, 3, 0xFF, 0, 0, 0, 0, 0x10, dmk->unkB4->sprite.unk1F & 0xF, 0x80000);
}
}
@ -791,8 +791,8 @@ void sub_080F714C(struct DarkMetaKnight *dmk)
{
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
sub_0803CD98(dmk->obj2.base.unk10.unk1F, 0x394, 1, 0x390, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->unk10.unk1F, 0x394, 3, 0x391, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk->obj2.base.sprite.unk1F, 0x394, 1, 0x390, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->sprite.unk1F, 0x394, 3, 0x391, 0, dmk->obj2.base.counter);
}
dmk->obj2.base.counter += 2;
if (dmk->obj2.base.counter > 0x100)
@ -1702,8 +1702,8 @@ void sub_080F93E0(struct DarkMetaKnight *dmk)
if (dmk->obj2.unk83 == 0x10)
{
dmk->obj2.base.yspeed = 0;
dmk->obj2.base.unk54 += 2 * (gUnk_0203AD40 & 2);
dmk->unkB4->unk54 = dmk->obj2.base.unk54;
dmk->obj2.base.objBase54 += 2 * (gUnk_0203AD40 & 2);
dmk->unkB4->objBase54 = dmk->obj2.base.objBase54;
if (!--dmk->obj2.unk9E)
{
dmk->obj2.unk83 = 0x11;
@ -1849,8 +1849,8 @@ void sub_080F96B4(struct DarkMetaKnight *dmk)
void sub_080F99BC(struct DarkMetaKnight *dmk)
{
dmk->obj2.base.flags |= 8;
dmk->obj2.base.unk54 += gUnk_0203AD40 & 2;
dmk->unkB4->unk54 = dmk->obj2.base.unk54;
dmk->obj2.base.objBase54 += gUnk_0203AD40 & 2;
dmk->unkB4->objBase54 = dmk->obj2.base.objBase54;
if (!--dmk->obj2.base.counter)
{
dmk->obj2.base.flags &= ~8;
@ -2184,8 +2184,8 @@ void sub_080FA82C(struct DarkMetaKnight *dmk)
dmk->obj2.unk83 = 0x1D;
if (dmk->unkCA > 1)
{
dmk->obj2.base.unk54 = gUnk_083571BC[(dmk->obj2.unk9F/4) & 3];
dmk->unkB4->unk54 = dmk->obj2.base.unk54;
dmk->obj2.base.objBase54 = gUnk_083571BC[(dmk->obj2.unk9F/4) & 3];
dmk->unkB4->objBase54 = dmk->obj2.base.objBase54;
}
break;
case 0x1D:
@ -2212,8 +2212,8 @@ void sub_080FA82C(struct DarkMetaKnight *dmk)
}
if (dmk->unkCA > 1)
{
dmk->obj2.base.unk54 = gUnk_083571BC[(dmk->obj2.unk9F/2) & 3];
dmk->unkB4->unk54 = dmk->obj2.base.unk54;
dmk->obj2.base.objBase54 = gUnk_083571BC[(dmk->obj2.unk9F/2) & 3];
dmk->unkB4->objBase54 = dmk->obj2.base.objBase54;
}
break;
}
@ -2397,9 +2397,9 @@ void sub_080FB2CC(struct DarkMetaKnight *dmk)
{
if (dmk->obj2.base.counter > 3)
{
dmk->obj2.base.unk54 = gUnk_083571B4[(dmk->obj2.base.counter >> 1) & 3] >> 9;
dmk->obj2.base.objBase54 = gUnk_083571B4[(dmk->obj2.base.counter >> 1) & 3] >> 9;
if (dmk->obj2.base.flags & 1)
dmk->obj2.base.xspeed = -dmk->obj2.base.unk54;
dmk->obj2.base.xspeed = -dmk->obj2.base.objBase54;
}
if (dmk->obj2.base.unk62 & 4)
{
@ -2559,8 +2559,8 @@ void sub_080FB700(struct DarkMetaKnight *dmk)
{
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
sub_0803CD98(dmk->obj2.base.unk10.unk1F, 0x390, 0, 0x394, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->unk10.unk1F, 0x391, 0, 0x394, 2, dmk->obj2.base.counter);
sub_0803CD98(dmk->obj2.base.sprite.unk1F, 0x390, 0, 0x394, 0, dmk->obj2.base.counter);
sub_0803CD98(dmk2->unkB4->sprite.unk1F, 0x391, 0, 0x394, 2, dmk->obj2.base.counter);
}
dmk->obj2.base.counter += 4;
if (dmk->obj2.base.counter > 0x100)
@ -2656,10 +2656,10 @@ void sub_080FB9FC(struct DarkMetaKnight *dmk)
}
if (dmk->obj2.base.counter >= 0x90)
{
dmk->obj2.base.unk54 = gUnk_083571BC[(dmk->obj2.base.counter>>2) & 3];
dmk->obj2.base.unk55 = gUnk_083571BC[((dmk->obj2.base.counter+1)>>2) & 3];
dmk2->unkB4->unk54 = dmk->obj2.base.unk54;
dmk2->unkB4->unk55 = dmk->obj2.base.unk55;
dmk->obj2.base.objBase54 = gUnk_083571BC[(dmk->obj2.base.counter>>2) & 3];
dmk->obj2.base.objBase55 = gUnk_083571BC[((dmk->obj2.base.counter+1)>>2) & 3];
dmk2->unkB4->objBase54 = dmk->obj2.base.objBase54;
dmk2->unkB4->objBase55 = dmk->obj2.base.objBase55;
}
if (dmk->obj2.base.counter >= 0xD0)
{
@ -2725,8 +2725,8 @@ void sub_080FB9FC(struct DarkMetaKnight *dmk)
{
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == dmk->obj2.base.roomId)
{
SpriteSomething(&sprite, 0x6000000, 0x390, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x391, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk2->unkB4->unk10.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x390, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk->obj2.base.sprite.unk1F & 0xF, 0x80000);
SpriteSomething(&sprite, 0x6000000, 0x391, 0, 0xFF, 0, 0, 0, 0, 0x10, dmk2->unkB4->sprite.unk1F & 0xF, 0x80000);
}
for (i = 0; i < gUnk_0203AD44; ++i)
{
@ -2772,9 +2772,9 @@ struct ObjectBase *sub_080FBFE8(struct DarkMetaKnight *dmk)
objBase->flags |= 1;
sub_0803E2B0(objBase, 0, 0, 0, 0);
sub_0803E308(objBase, 0, 0, 0, 0);
sub_080708DC(objBase, &objBase->unk10, 0x30, gUnk_083570EC[0].unk0, gUnk_083570EC[0].unk2, 0x1C);
objBase->unk10.unk1F = 0;
Macro_081050E8(objBase, &objBase->unk10, 0x391, 1);
sub_080708DC(objBase, &objBase->sprite, 0x30, gUnk_083570EC[0].unk0, gUnk_083570EC[0].unk2, 0x1C);
objBase->sprite.unk1F = 0;
Macro_081050E8(objBase, &objBase->sprite, 0x391, 1);
return objBase;
}
@ -2782,7 +2782,7 @@ void sub_080FC150(void)
{
struct Sprite sprite;
struct ObjectBase *objBase2 = TaskGetStructPtr(gCurTask, objBase2), *objBase = objBase2;
struct Sprite *unk10 = &objBase->unk10;
struct Sprite *unk10 = &objBase->sprite;
struct DarkMetaKnight *dmk = objBase->parent;
if (objBase->flags & 0x1000)
@ -2805,11 +2805,11 @@ void sub_080FC150(void)
objBase->y = dmk->obj2.base.y;
if (Macro_0810B1F4(objBase))
{
objBase->unk54 = dmk->obj2.base.unk54;
objBase->unk55 = dmk->obj2.base.unk55;
objBase->objBase54 = dmk->obj2.base.objBase54;
objBase->objBase55 = dmk->obj2.base.objBase55;
}
Macro_08107BA8_4(objBase, unk10, &sprite, 0x30, &objBase->unk10);
Macro_081050E8(objBase, &objBase->unk10, 0x391, !objBase->unk10.unk1F);
Macro_08107BA8_4(objBase, unk10, &sprite, 0x30, &objBase->sprite);
Macro_081050E8(objBase, &objBase->sprite, 0x391, !objBase->sprite.unk1F);
if (unk10->unkC != gUnk_083570EC[dmk->obj2.unk83].unk0 || unk10->unk1A != gUnk_083570EC[dmk->obj2.unk83].unk2)
{
unk10->unkC = gUnk_083570EC[dmk->obj2.unk83].unk0;
@ -2822,13 +2822,13 @@ void sub_080FC150(void)
sub_0803D9A8(objBase);
return;
}
if (!objBase->unk10.unk20[0].unk0)
if (!objBase->sprite.unk20[0].unk0)
{
objBase->flags &= ~0x200;
if (!objBase->unk10.unk16)
if (!objBase->sprite.unk16)
{
if (!(dmk->obj2.base.flags & 2))
objBase->unk10.unk20[0].unk0 = -1;
objBase->sprite.unk20[0].unk0 = -1;
objBase->flags |= 0x200;
}
}
@ -2836,14 +2836,11 @@ void sub_080FC150(void)
if (!(objBase->flags & 0x400)
&& gKirbys[gUnk_0203AD3C].base.base.base.roomId == objBase->roomId)
{
objBase->unk10.unk10 += gUnk_0203AD18[0];
objBase->unk10.unk12 += gUnk_0203AD18[1];
if (objBase->flags & 0x4000)
sub_081564D8(&objBase->unk10);
else
sub_0815604C(&objBase->unk10);
objBase->sprite.unk10 += gUnk_0203AD18[0];
objBase->sprite.unk12 += gUnk_0203AD18[1];
Macro_0803DBC8(objBase, &objBase->sprite);
}
if (objBase->unk10.unk20[0].unk0 != -1)
if (objBase->sprite.unk20[0].unk0 != -1)
objBase->flags &= ~0x200;
SetPointerSomething(objBase);
}
@ -2857,15 +2854,15 @@ struct Object4 *sub_080FC5F8(struct DarkMetaKnight *dmk)
sub_0803E3B0(obj4);
obj4->unk0 = 3;
obj4->unk34 = dmk->obj2.base.x;
obj4->unk38 = dmk->obj2.base.y;
obj4->unk44 = dmk;
obj4->x = dmk->obj2.base.x;
obj4->y = dmk->obj2.base.y;
obj4->parent = dmk;
obj4->roomId = dmk->obj2.base.roomId;
obj4->unk3C = 0x40;
obj4->unk3E = -0x15;
sub_080709F8(obj4, &obj4->unkC, 0xC, 0x392, 0, 0x18);
obj4->unkC.unk1F = 0;
Macro_081050E8(obj4, &obj4->unkC, 0x390, 1);
sub_080709F8(obj4, &obj4->sprite, 0xC, 0x392, 0, 0x18);
obj4->sprite.unk1F = 0;
Macro_081050E8(obj4, &obj4->sprite, 0x390, 1);
return obj4;
}
@ -2877,18 +2874,18 @@ void sub_080FC6D4(void)
if (obj4->flags & 0x1000)
TaskDestroy(gCurTask);
else if (((struct DarkMetaKnight *)obj4->unk44)->obj2.base.flags & 0x1000)
else if (((struct DarkMetaKnight *)obj4->parent)->obj2.base.flags & 0x1000)
obj4->flags |= 0x1000;
else
{
Macro_08107BA8_4(obj4, &obj4->unkC, &sprite, 0xC, &obj4->unkC);
Macro_081050E8(obj4, &obj4->unkC, 0x390, !obj4->unkC.unk1F);
dmk = obj4->unk44;
Macro_08107BA8_4(obj4, &obj4->sprite, &sprite, 0xC, &obj4->sprite);
Macro_081050E8(obj4, &obj4->sprite, 0x390, !obj4->sprite.unk1F);
dmk = obj4->parent;
if (dmk)
{
if (dmk->obj2.base.unk0 && dmk->obj2.base.flags & 0x1000)
{
obj4->unk44 = NULL;
obj4->parent = NULL;
dmk = NULL;
}
if (!dmk)
@ -2912,8 +2909,8 @@ void sub_080FC6D4(void)
{
if (!(obj4->flags & 0x800))
{
obj4->unk34 += obj4->unk3C;
obj4->unk38 -= obj4->unk3E;
obj4->x += obj4->unk3C;
obj4->y -= obj4->unk3E;
}
sub_0806FAC8(obj4);
}
@ -2927,20 +2924,20 @@ void sub_080FC9C8(struct DarkMetaKnight *dmk)
sub_0803E3B0(obj4);
obj4->unk0 = 3;
obj4->unk34 = dmk->obj2.base.x;
obj4->unk38 = dmk->obj2.base.y;
obj4->unk44 = dmk;
obj4->x = dmk->obj2.base.x;
obj4->y = dmk->obj2.base.y;
obj4->parent = dmk;
obj4->roomId = dmk->obj2.base.roomId;
sub_080709F8(obj4, &obj4->unkC, 0xC, 0x392, 1, 0x19);
obj4->unkC.unk1F = 0;
Macro_081050E8(obj4, &obj4->unkC, 0x390, 1);
sub_080709F8(obj4, &obj4->sprite, 0xC, 0x392, 1, 0x19);
obj4->sprite.unk1F = 0;
Macro_081050E8(obj4, &obj4->sprite, 0x390, 1);
}
void sub_080FCA94(void)
{
struct Object4 *tmp = TaskGetStructPtr(gCurTask, tmp), *obj4 = tmp;
struct Sprite sprite;
struct DarkMetaKnight *dmk, *dmk2 = obj4->unk44;
struct DarkMetaKnight *dmk, *dmk2 = obj4->parent;
if (obj4->flags & 0x1000)
TaskDestroy(gCurTask);
@ -2948,14 +2945,14 @@ void sub_080FCA94(void)
obj4->flags |= 0x1000;
else
{
Macro_08107BA8_4(obj4, &obj4->unkC, &sprite, 0xC, &obj4->unkC);
Macro_081050E8(obj4, &obj4->unkC, 0x390, !obj4->unkC.unk1F);
dmk = obj4->unk44;
Macro_08107BA8_4(obj4, &obj4->sprite, &sprite, 0xC, &obj4->sprite);
Macro_081050E8(obj4, &obj4->sprite, 0x390, !obj4->sprite.unk1F);
dmk = obj4->parent;
if (dmk)
{
if (dmk->obj2.base.unk0 && dmk->obj2.base.flags & 0x1000)
{
obj4->unk44 = NULL;
obj4->parent = NULL;
dmk = NULL;
}
if (!dmk)
@ -2983,8 +2980,8 @@ void sub_080FCA94(void)
{
if (!(obj4->flags & 0x800))
{
obj4->unk34 += obj4->unk3C;
obj4->unk38 -= obj4->unk3E;
obj4->x += obj4->unk3C;
obj4->y -= obj4->unk3E;
}
sub_0806FAC8(obj4);
}
@ -2998,22 +2995,22 @@ void sub_080FCD98(struct DarkMetaKnight *dmk)
sub_0803E3B0(obj4);
obj4->unk0 = 3;
obj4->unk34 = dmk->obj2.base.x;
obj4->unk38 = dmk->obj2.base.y;
obj4->unk44 = dmk;
obj4->x = dmk->obj2.base.x;
obj4->y = dmk->obj2.base.y;
obj4->parent = dmk;
obj4->roomId = dmk->obj2.base.roomId;
obj4->unk3C = 0x100;
obj4->unk3E = 0x200;
sub_080709F8(obj4, &obj4->unkC, 4, 0x392, 2, 0x19);
obj4->unkC.unk1F = 0;
Macro_081050E8(obj4, &obj4->unkC, 0x390, 1);
sub_080709F8(obj4, &obj4->sprite, 4, 0x392, 2, 0x19);
obj4->sprite.unk1F = 0;
Macro_081050E8(obj4, &obj4->sprite, 0x390, 1);
}
void sub_080FCE70(void)
{
struct Object4 *tmp = TaskGetStructPtr(gCurTask, tmp), *obj4 = tmp;
struct Sprite sprite;
struct DarkMetaKnight *dmk, *dmk2 = obj4->unk44;
struct DarkMetaKnight *dmk, *dmk2 = obj4->parent;
if (obj4->flags & 0x1000)
TaskDestroy(gCurTask);
@ -3021,14 +3018,14 @@ void sub_080FCE70(void)
obj4->flags |= 0x1000;
else
{
Macro_08107BA8_4(obj4, &obj4->unkC, &sprite, 4, &obj4->unkC);
Macro_081050E8(obj4, &obj4->unkC, 0x390, !obj4->unkC.unk1F);
dmk = obj4->unk44;
Macro_08107BA8_4(obj4, &obj4->sprite, &sprite, 4, &obj4->sprite);
Macro_081050E8(obj4, &obj4->sprite, 0x390, !obj4->sprite.unk1F);
dmk = obj4->parent;
if (dmk)
{
if (dmk->obj2.base.unk0 && dmk->obj2.base.flags & 0x1000)
{
obj4->unk44 = NULL;
obj4->parent = NULL;
dmk = NULL;
}
if (!dmk)
@ -3051,16 +3048,16 @@ void sub_080FCE70(void)
{
struct Object4 *obj4_2 = sub_0808AE30(&dmk2->obj2.base, 0, 0x2B4, 0);
obj4_2->unk34 = obj4->unk34;
obj4_2->unk38 = obj4->unk38;
obj4_2->x = obj4->x;
obj4_2->y = obj4->y;
obj4->flags |= 0x1000;
}
else
{
if (!(obj4->flags & 0x800))
{
obj4->unk34 += obj4->unk3C;
obj4->unk38 -= obj4->unk3E;
obj4->x += obj4->unk3C;
obj4->y -= obj4->unk3E;
}
sub_0806FAC8(obj4);
}
@ -3074,15 +3071,15 @@ void sub_080FD194(struct DarkMetaKnight *dmk)
sub_0803E3B0(obj4);
obj4->unk0 = 3;
obj4->unk34 = dmk->obj2.base.x;
obj4->unk38 = dmk->obj2.base.y;
obj4->unk44 = dmk;
obj4->x = dmk->obj2.base.x;
obj4->y = dmk->obj2.base.y;
obj4->parent = dmk;
obj4->roomId = dmk->obj2.base.roomId;
obj4->unk3C = -0x100;
obj4->unk3E = 0x200;
sub_080709F8(obj4, &obj4->unkC, 4, 0x392, 3, 0x19);
obj4->unkC.unk1F = 0;
Macro_081050E8(obj4, &obj4->unkC, 0x390, 1);
sub_080709F8(obj4, &obj4->sprite, 4, 0x392, 3, 0x19);
obj4->sprite.unk1F = 0;
Macro_081050E8(obj4, &obj4->sprite, 0x390, 1);
}
// the same as sub_080FCE70
@ -3090,7 +3087,7 @@ void sub_080FD26C(void)
{
struct Object4 *tmp = TaskGetStructPtr(gCurTask, tmp), *obj4 = tmp;
struct Sprite sprite;
struct DarkMetaKnight *dmk, *dmk2 = obj4->unk44;
struct DarkMetaKnight *dmk, *dmk2 = obj4->parent;
if (obj4->flags & 0x1000)
TaskDestroy(gCurTask);
@ -3098,14 +3095,14 @@ void sub_080FD26C(void)
obj4->flags |= 0x1000;
else
{
Macro_08107BA8_4(obj4, &obj4->unkC, &sprite, 4, &obj4->unkC);
Macro_081050E8(obj4, &obj4->unkC, 0x390, !obj4->unkC.unk1F);
dmk = obj4->unk44;
Macro_08107BA8_4(obj4, &obj4->sprite, &sprite, 4, &obj4->sprite);
Macro_081050E8(obj4, &obj4->sprite, 0x390, !obj4->sprite.unk1F);
dmk = obj4->parent;
if (dmk)
{
if (dmk->obj2.base.unk0 && dmk->obj2.base.flags & 0x1000)
{
obj4->unk44 = NULL;
obj4->parent = NULL;
dmk = NULL;
}
if (!dmk)
@ -3128,16 +3125,16 @@ void sub_080FD26C(void)
{
struct Object4 *obj4_2 = sub_0808AE30(&dmk2->obj2.base, 0, 0x2B4, 0);
obj4_2->unk34 = obj4->unk34;
obj4_2->unk38 = obj4->unk38;
obj4->flags |= 0x1000u;
obj4_2->x = obj4->x;
obj4_2->y = obj4->y;
obj4->flags |= 0x1000;
}
else
{
if (!(obj4->flags & 0x800))
{
obj4->unk34 += obj4->unk3C;
obj4->unk38 -= obj4->unk3E;
obj4->x += obj4->unk3C;
obj4->y -= obj4->unk3E;
}
sub_0806FAC8(obj4);
}
@ -3163,9 +3160,9 @@ struct ObjectBase *sub_080FD590(struct DarkMetaKnight *dmk)
objBase->xspeed = 0x100;
objBase->yspeed = 0x400;
sub_0803E308(objBase, -4, -4, 4, 8);
sub_080708DC(objBase, &objBase->unk10, 0x10, 0x392, 4, 0x1A);
objBase->unk10.unk1F = 0;
Macro_081050E8(objBase, &objBase->unk10, 0x390, 1);
sub_080708DC(objBase, &objBase->sprite, 0x10, 0x392, 4, 0x1A);
objBase->sprite.unk1F = 0;
Macro_081050E8(objBase, &objBase->sprite, 0x390, 1);
return objBase;
}
@ -3174,8 +3171,8 @@ void sub_080FD6BC(void)
struct Sprite sprite;
struct ObjectBase *objBase2 = TaskGetStructPtr(gCurTask, objBase2), *objBase = objBase2;
Macro_08107BA8_4(objBase, &objBase->unk10, &sprite, 0x10, &objBase->unk10);
Macro_081050E8(objBase, &objBase->unk10, 0x390, !objBase->unk10.unk1F);
Macro_08107BA8_4(objBase, &objBase->sprite, &sprite, 0x10, &objBase->sprite);
Macro_081050E8(objBase, &objBase->sprite, 0x390, !objBase->sprite.unk1F);
if (!sub_0806F780(objBase))
{
objBase->flags |= 4;
@ -3192,7 +3189,7 @@ void sub_080FD6BC(void)
sub_0809D8C8(objBase);
if (objBase->unk62 & 4)
{
objBase->unk10.unk1A = 5;
objBase->sprite.unk1A = 5;
objBase->flags |= 0x100;
objBase->yspeed = 0;
}
@ -3208,17 +3205,17 @@ struct Object4 *sub_080FD8B4(struct DarkMetaKnight *dmk)
sub_0803E3B0(obj4);
obj4->unk0 = 3;
obj4->unk34 = dmk->obj2.base.x;
obj4->unk38 = dmk->obj2.base.y;
obj4->unk44 = dmk;
obj4->x = dmk->obj2.base.x;
obj4->y = dmk->obj2.base.y;
obj4->parent = dmk;
obj4->roomId = dmk->obj2.base.roomId;
obj4->unk3C = 0;
obj4->unk3E = 0;
obj4->unk38 -= 0x3800;
obj4->unk34 -= 0x3000;
sub_080709F8(obj4, &obj4->unkC, 0x50, 0x3A3, 0, 0x1A);
obj4->unkC.unk1F = 0;
Macro_081050E8(obj4, &obj4->unkC, 0x3A3, 1);
obj4->y -= 0x3800;
obj4->x -= 0x3000;
sub_080709F8(obj4, &obj4->sprite, 0x50, 0x3A3, 0, 0x1A);
obj4->sprite.unk1F = 0;
Macro_081050E8(obj4, &obj4->sprite, 0x3A3, 1);
return obj4;
}
@ -3232,14 +3229,14 @@ void sub_080FD9AC(void)
TaskDestroy(gCurTask);
else
{
Macro_08107BA8_4(obj4, &obj4->unkC, &sprite, 0x50, &obj4->unkC);
Macro_081050E8(obj4, &obj4->unkC, 0x3A3, !obj4->unkC.unk1F);
dmk = obj4->unk44;
Macro_08107BA8_4(obj4, &obj4->sprite, &sprite, 0x50, &obj4->sprite);
Macro_081050E8(obj4, &obj4->sprite, 0x3A3, !obj4->sprite.unk1F);
dmk = obj4->parent;
if (dmk)
{
if (dmk->obj2.base.unk0 && dmk->obj2.base.flags & 0x1000)
{
obj4->unk44 = NULL;
obj4->parent = NULL;
dmk = NULL;
}
if (!dmk)
@ -3258,8 +3255,8 @@ void sub_080FD9AC(void)
obj4->flags |= 4;
if (obj4->unk4 <= 0xF)
{
obj4->unk40 = gUnk_083571BC[(obj4->unk4 >> 1) & 3];
obj4->unk41 = gUnk_083571BC[((obj4->unk4+1) >> 1) & 3];
obj4->objBase54 = gUnk_083571BC[(obj4->unk4 >> 1) & 3];
obj4->objBase55 = gUnk_083571BC[((obj4->unk4+1) >> 1) & 3];
}
if (++obj4->unk4 > 0x34)
obj4->flags |= 0x1000;
@ -3267,8 +3264,8 @@ void sub_080FD9AC(void)
{
if (!(obj4->flags & 0x800))
{
obj4->unk34 += obj4->unk3C;
obj4->unk38 -= obj4->unk3E;
obj4->x += obj4->unk3C;
obj4->y -= obj4->unk3E;
}
sub_0806FAC8(obj4);
}
@ -3347,9 +3344,9 @@ void sub_080FDC68(struct DarkMetaKnight *dmk, struct Kirby *kirby, u8 a3)
}
sub_0803E2B0(objBase, -0xA, -0x14, 8, 0x14);
sub_0803E308(objBase, -2, -2, 2, 2);
sub_080708DC(objBase, &objBase->unk10, 0x20, 0x391, 0x23, 0xA);
objBase->unk10.unk1F = 0;
Macro_081050E8(objBase, &objBase->unk10, 0x391, 1);
sub_080708DC(objBase, &objBase->sprite, 0x20, 0x391, 0x23, 0xA);
objBase->sprite.unk1F = 0;
Macro_081050E8(objBase, &objBase->sprite, 0x391, 1);
PlaySfx(objBase, 452);
sub_0806FE64(1, objBase);
}
@ -3359,13 +3356,13 @@ void sub_080FDF78(void)
struct Sprite sprite;
struct ObjectBase *objBase2 = TaskGetStructPtr(gCurTask, objBase2), *objBase = objBase2;
Macro_08107BA8_4(objBase, &objBase->unk10, &sprite, 0x20, &objBase->unk10);
Macro_081050E8(objBase, &objBase->unk10, 0x391, !objBase->unk10.unk1F);
Macro_08107BA8_4(objBase, &objBase->sprite, &sprite, 0x20, &objBase->sprite);
Macro_081050E8(objBase, &objBase->sprite, 0x391, !objBase->sprite.unk1F);
if (objBase->flags & 1)
objBase->unk54 = 0x10;
objBase->objBase54 = 0x10;
else
objBase->unk54 = -0x10;
objBase->unk55 = -0x20;
objBase->objBase54 = -0x10;
objBase->objBase55 = -0x20;
if (objBase->parent && ((struct DarkMetaKnight *)objBase->parent)->obj2.unk80 < 1)
{
objBase->parent = NULL;
@ -3391,22 +3388,22 @@ void sub_080FE1D0(struct DarkMetaKnight *dmk)
sub_0803E3B0(obj4);
obj4->unk0 = 3;
obj4->unk34 = dmk->obj2.base.x;
obj4->unk38 = dmk->obj2.base.y;
obj4->unk44 = dmk;
obj4->x = dmk->obj2.base.x;
obj4->y = dmk->obj2.base.y;
obj4->parent = dmk;
obj4->roomId = dmk->obj2.base.roomId;
obj4->flags |= dmk->obj2.base.flags & 1;
obj4->flags ^= 1;
sub_080709F8(obj4, &obj4->unkC, 0x2A, 0x391, 0x22, 0x19);
obj4->unkC.unk1F = 0;
Macro_081050E8(obj4, &obj4->unkC, 0x391, 1);
sub_080709F8(obj4, &obj4->sprite, 0x2A, 0x391, 0x22, 0x19);
obj4->sprite.unk1F = 0;
Macro_081050E8(obj4, &obj4->sprite, 0x391, 1);
}
void sub_080FE2AC(void)
{
struct Object4 *tmp = TaskGetStructPtr(gCurTask, tmp), *obj4 = tmp;
struct Sprite sprite;
struct DarkMetaKnight *dmk, *dmk2 = obj4->unk44;
struct DarkMetaKnight *dmk, *dmk2 = obj4->parent;
if (obj4->flags & 0x1000)
TaskDestroy(gCurTask);
@ -3414,14 +3411,14 @@ void sub_080FE2AC(void)
obj4->flags |= 0x1000;
else
{
Macro_08107BA8_4(obj4, &obj4->unkC, &sprite, 0x2A, &obj4->unkC);
Macro_081050E8(obj4, &obj4->unkC, 0x391, !obj4->unkC.unk1F);
dmk = obj4->unk44;
Macro_08107BA8_4(obj4, &obj4->sprite, &sprite, 0x2A, &obj4->sprite);
Macro_081050E8(obj4, &obj4->sprite, 0x391, !obj4->sprite.unk1F);
dmk = obj4->parent;
if (dmk)
{
if (dmk->obj2.base.unk0 && dmk->obj2.base.flags & 0x1000)
{
obj4->unk44 = NULL;
obj4->parent = NULL;
dmk = NULL;
}
if (!dmk)
@ -3546,27 +3543,27 @@ void sub_080FE954(struct ObjectBase *objBase, u8 a2)
sub_0803E3B0(obj4);
obj4->unk0 = 3;
obj4->unk34 = objBase->x;
obj4->unk38 = objBase->y;
obj4->unk44 = objBase;
obj4->x = objBase->x;
obj4->y = objBase->y;
obj4->parent = objBase;
obj4->roomId = objBase->roomId;
obj4->flags |= objBase->flags & 1;
var = (a2 & 3);
*&obj4->unk40 = var << 1; // fake
*&obj4->objBase54 = var << 1; // fake
if (!(obj4->flags & 1))
obj4->unk40 = -obj4->unk40;
obj4_2->unk38 = objBase->y - ((((a2 & 3) << 3) | (a2 & 3)) << 10);
sub_080709F8(obj4, &obj4->unkC, 0x1E, 0x397, a2, 0x19);
obj4->unkC.unk1F = 0;
Macro_081050E8(obj4, &obj4->unkC, 0x397, 1);
obj4->objBase54 = -obj4->objBase54;
obj4_2->y = objBase->y - ((((a2 & 3) << 3) | (a2 & 3)) << 10);
sub_080709F8(obj4, &obj4->sprite, 0x1E, 0x397, a2, 0x19);
obj4->sprite.unk1F = 0;
Macro_081050E8(obj4, &obj4->sprite, 0x397, 1);
}
void sub_080FEA70(void)
{
struct Object4 *tmp = TaskGetStructPtr(gCurTask, tmp), *obj4 = tmp;
struct Sprite sprite;
s8 unk40 = obj4->unk40;
struct DarkMetaKnight *dmk, *dmk2 = obj4->unk44;
s8 objBase54 = obj4->objBase54;
struct DarkMetaKnight *dmk, *dmk2 = obj4->parent;
if (obj4->flags & 0x1000)
TaskDestroy(gCurTask);
@ -3574,27 +3571,27 @@ void sub_080FEA70(void)
obj4->flags |= 0x1000;
else
{
Macro_08107BA8_4(obj4, &obj4->unkC, &sprite, 0x2A, &obj4->unkC);
Macro_081050E8(obj4, &obj4->unkC, 0x1E, !obj4->unkC.unk1F);
obj4->unk34 = dmk2->obj2.base.x;
if (obj4->unkC.unk1A > 3 && obj4->unkC.unk1A < 8)
Macro_08107BA8_4(obj4, &obj4->sprite, &sprite, 0x2A, &obj4->sprite);
Macro_081050E8(obj4, &obj4->sprite, 0x1E, !obj4->sprite.unk1F);
obj4->x = dmk2->obj2.base.x;
if (obj4->sprite.unk1A > 3 && obj4->sprite.unk1A < 8)
{
obj4->flags |= 4;
if (dmk2->obj2.base.counter == 0x24)
obj4->unkC.unk1A += 0xE;
obj4->sprite.unk1A += 0xE;
}
if (obj4->unkC.unk1A < 4)
if (obj4->sprite.unk1A < 4)
{
obj4->flags |= 4;
if (dmk2->obj2.base.counter == 0x12)
obj4->unkC.unk1A += 0xE;
obj4->sprite.unk1A += 0xE;
}
dmk = obj4->unk44;
dmk = obj4->parent;
if (dmk)
{
if (dmk->obj2.base.unk0 && dmk->obj2.base.flags & 0x1000)
{
obj4->unk44 = NULL;
obj4->parent = NULL;
dmk = NULL;
}
if (!dmk)
@ -3610,59 +3607,8 @@ void sub_080FEA70(void)
_080FEC9C:
KirbySomething(obj4);
}
{
s32 r0;
if (obj4->flags & 1)
{
struct Sprite *r0 = &obj4->unkC;
r0->unk8 = obj4->unkC.unk8 | 0x400;
}
else
{
struct Sprite *r0 = &obj4->unkC;
r0->unk8 = obj4->unkC.unk8 & ~0x400;
}
if (!(obj4->flags & 8))
{
if ((obj4->unkC.unk1B != obj4->unkC.unk1A || obj4->unkC.unk18 != obj4->unkC.unkC)
&& obj4->unkC.unk1C)
{
obj4->unk1 = 0;
obj4->unk2 = 0;
obj4->flags &= ~4;
}
r0 = sub_08155128(&obj4->unkC);
if (!r0)
{
obj4->flags |= 2;
if (obj4->flags & 4 && obj4->unkC.unk1C)
{
obj4->unkC.unk1B = 0xFF;
obj4->flags &= ~4;
obj4->unk1 = 0;
obj4->unk2 = r0;
sub_08155128(&obj4->unkC);
}
}
else
{
obj4->unk2 += obj4->unkC.unk1C;
obj4->unk1 = obj4->unk2 >> 4;
obj4->flags &= ~2;
}
}
obj4->unkC.unk10 = (obj4->unk34 >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unkC >> 8) + obj4->unk40;
obj4->unkC.unk12 = (obj4->unk38 >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unk10 >> 8) + obj4->unk41;
if (obj4->unkC.unk1C)
{
obj4->unk40 = 0;
obj4->unk41 = 0;
}
}
if (obj4->unkC.unk1A > 0xD && obj4->flags & 2)
Macro_080FC150(obj4);
if (obj4->sprite.unk1A > 0xD && obj4->flags & 2)
{
obj4->flags |= 0x1000;
return;
@ -3670,13 +3616,10 @@ void sub_080FEA70(void)
if (!(obj4->flags & 0x400)
&& gKirbys[gUnk_0203AD3C].base.base.base.roomId == obj4->roomId)
{
obj4->unkC.unk10 += gUnk_0203AD18[0];
obj4->unkC.unk12 += gUnk_0203AD18[1];
if (obj4->flags & 0x4000)
sub_081564D8(&obj4->unkC);
else
sub_0815604C(&obj4->unkC);
obj4->sprite.unk10 += gUnk_0203AD18[0];
obj4->sprite.unk12 += gUnk_0203AD18[1];
Macro_0803DBC8(obj4, &obj4->sprite);
}
obj4->unk40 = unk40;
obj4->objBase54 = objBase54;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -135,7 +135,7 @@ void *CreateFoleyLeaves(struct Object *r6, u8 r5) {
sub_0803E2B0(&r4->base, -8, -8, 8, 8);
sub_0803E308(&r4->base, -7, -5, 7, 7);
ObjectInitSprite(r4);
r4->base.unk10.unk14 = 0x640;
r4->base.sprite.unk14 = 0x640;
gUnk_08351648[r4->type].unk10(r4);
return r4;
}
@ -196,8 +196,8 @@ static void sub_080C0D18(struct Object2 *r3) {
if (r3->base.counter > 10) {
sub_080C0CBC(r3);
} else {
r3->base.unk54 = gUnk_08350BCC[r3->base.counter][1];
r3->base.unk55 = gUnk_08350BCC[r3->base.counter][1];
r3->base.objBase54 = gUnk_08350BCC[r3->base.counter][1];
r3->base.objBase55 = gUnk_08350BCC[r3->base.counter][1];
++r3->base.counter;
}
}

View File

@ -36,7 +36,7 @@ void *CreateGiantRocky(struct Object *r5, u8 r4)
sub_0803E2B0(&r6->base, -8, -2, 8, 10);
sub_0803E308(&r6->base, -8, -8, 8, 10);
ObjectInitSprite(r6);
r6->base.unk10.unk14 = 1728;
r6->base.sprite.unk14 = 1728;
gUnk_08351648[r6->type].unk10(r6);
r6->unk9E = 0;
r6->unk7C = 0;

View File

@ -96,7 +96,7 @@ void* CreateHeavyKnight(struct Object* arg0, u8 arg1) {
sub_0803E2B0(&obj->base, -9, -6, 9, 10);
sub_0803E308(&obj->base, -7, -7, 7, 14);
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x6c0;
obj->base.sprite.unk14 = 0x6c0;
gUnk_08351648[obj->type].unk10(obj);
obj->unk9E = 0;
obj->unk7C = 0;

File diff suppressed because it is too large Load Diff

View File

@ -301,91 +301,23 @@ static void sub_080B2780(struct Object2* arg0) {
}
sub_0803E2B0(&laser->base, 2, -3, 10, 3);
sub_0803E308(&laser->base, 16, -1, 18, 1);
sub_080708DC(&laser->base, &laser->base.unk10, 4, 0x321, 6, 9);
laser->base.unk10.unk1F = 0;
if (arg0->base.unkC & 0x10) {
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == laser->base.roomId) {
laser->base.unk10.unk1F = sub_0803DF24(gUnk_08351648[OBJ_DROPPY].unk8);
if (laser->base.unk10.unk1F == 0xff) {
laser->base.unk10.unk1F = sub_0803DFAC(gUnk_08351648[OBJ_DROPPY].unk8, 0);
}
}
else {
laser->base.unk10.unk1F = 0;
}
}
else {
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == laser->base.roomId) {
laser->base.unk10.unk1F = sub_0803DF24(0x321);
if (laser->base.unk10.unk1F == 0xff) {
laser->base.unk10.unk1F = sub_0803DFAC(0x321, 0);
}
}
else {
laser->base.unk10.unk1F = arg0->base.unkC & 0x10;
}
}
sub_080708DC(&laser->base, &laser->base.sprite, 4, 0x321, 6, 9);
laser->base.sprite.unk1F = 0;
if (arg0->base.unkC & 0x10)
Macro_081050E8(&laser->base, &laser->base.sprite, gUnk_08351648[OBJ_DROPPY].unk8, 1);
else
Macro_081050E8(&laser->base, &laser->base.sprite, 0x321, 1);
PlaySfx(&laser->base, 0x13c);
}
static u32 sub_080B2A30(struct Laser* arg0) {
struct Sprite sprite, *sprite2, *sprite3;
struct Sprite sprite;
struct Object2 *parent = arg0->base.parent;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == arg0->base.roomId) {
if (arg0->base.flags & 0x4000) {
if (arg0->base.unk10.unk0 == 0) {
(sprite2 = &arg0->base.unk10)->unk0 = sub_0803DE54(4, arg0->base.unk10.unkC, arg0->base.unk10.unk1A);
sprite2->unk8 = arg0->base.unk10.unk8 & ~0x80000;
CpuCopy32(sprite2, &sprite, sizeof(struct Sprite));
sub_0815521C(&sprite, arg0->base.unk1);
sprite2->unk8 = arg0->base.unk10.unk8 | 0x80000;
}
}
else {
if (arg0->base.unk10.unk0 == 0) {
(sprite3 = &arg0->base.unk10)->unk0 = sub_081570B0(4);
sprite3->unk8 = arg0->base.unk10.unk8 & ~0x80000;
CpuCopy32(&arg0->base.unk10, &sprite, sizeof(struct Sprite));
sub_0815521C(&sprite, arg0->base.unk1);
}
}
}
else {
if (arg0->base.unk10.unk0 != 0) {
bool8 val = arg0->base.flags & 0x4000;
if (!(arg0->base.flags & 0x4000)) {
sub_08157190(arg0->base.unk10.unk0);
arg0->base.unk10.unk0 = val;
}
}
arg0->base.unk10.unk8 |= 0x80000;
}
if (parent->base.unkC & 0x10) {
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == arg0->base.roomId) {
if (arg0->base.unk10.unk1F == 0) {
arg0->base.unk10.unk1F = sub_0803DF24(gUnk_08351648[OBJ_DROPPY].unk8);
if (arg0->base.unk10.unk1F == 0xff) {
arg0->base.unk10.unk1F = sub_0803DFAC(gUnk_08351648[OBJ_DROPPY].unk8, 0);
}
}
}
else {
arg0->base.unk10.unk1F = 0;
}
}
else {
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == arg0->base.roomId) {
if (arg0->base.unk10.unk1F == 0) {
arg0->base.unk10.unk1F = sub_0803DF24(0x321);
if (arg0->base.unk10.unk1F == 0xff) {
arg0->base.unk10.unk1F = sub_0803DFAC(0x321, 0);
}
}
}
else {
arg0->base.unk10.unk1F = parent->base.unkC & 0x10;
}
}
Macro_08107BA8_4(&arg0->base, &arg0->base.sprite, &sprite, 4, &arg0->base.sprite);
if (parent->base.unkC & 0x10)
Macro_081050E8(&arg0->base, &arg0->base.sprite, gUnk_08351648[OBJ_DROPPY].unk8, !arg0->base.sprite.unk1F);
else
Macro_081050E8(&arg0->base, &arg0->base.sprite, 0x321, !arg0->base.sprite.unk1F);
if (arg0->unk88 != 0 && arg0->base.flags & 2) {
arg0->base.flags |= 0x1000;
return 1;
@ -457,7 +389,7 @@ static void sub_080B2D68(struct Object2* arg0) {
}
static u32 sub_080B2D74(struct Laser* arg0) {
arg0->base.unk10.unk1A = 7;
arg0->base.sprite.unk1A = 7;
arg0->unk88 = 1;
arg0->base.flags &= ~0x200;
arg0->base.flags &= ~0x100;

View File

@ -80,7 +80,7 @@ void* CreateMetalGuardian(struct Object* arg0, u8 arg1) {
obj->base.unk5C &= ~7;
obj->base.unk5C |= 3;
ObjectInitSprite(obj);
obj->base.unk10.unk14 = 0x6C0;
obj->base.sprite.unk14 = 0x6C0;
if (obj->object->subtype1 != 0) {
sub_080BE25C(obj);
}
@ -165,10 +165,10 @@ static void sub_080BD634(struct Object2* arg0) {
else {
if (arg0->base.unk1 <= 7) {
if (arg0->base.flags & 1) {
arg0->base.unk54 = -gUnk_08354BA0[arg0->base.unk1];
arg0->base.objBase54 = -gUnk_08354BA0[arg0->base.unk1];
}
else {
arg0->base.unk54 = gUnk_08354BA0[arg0->base.unk1];
arg0->base.objBase54 = gUnk_08354BA0[arg0->base.unk1];
}
}
if (arg0->base.flags & 2) {
@ -246,22 +246,22 @@ static void sub_080BDA70(struct Object2* arg0, u8 arg1) {
laser->base.yspeed = 0x5a2;
sub_0803E2B0(&laser->base, 2, -3, 10, 3);
sub_0803E308(&laser->base, 16, -1, 18, 1);
sub_080708DC(&laser->base, &laser->base.unk10, 0xc, 0x311, 9, 0x1b);
laser->base.unk10.unk8 |= 0x800;
sub_080708DC(&laser->base, &laser->base.sprite, 0xc, 0x311, 9, 0x1b);
laser->base.sprite.unk8 |= 0x800;
break;
case 2:
laser->base.xspeed = 0x5a2;
laser->base.yspeed = -0x5a2;
sub_0803E2B0(&laser->base, 2, -3, 10, 3);
sub_0803E308(&laser->base, 16, -1, 18, 1);
sub_080708DC(&laser->base, &laser->base.unk10, 0xc, 0x311, 9, 0x1b);
sub_080708DC(&laser->base, &laser->base.sprite, 0xc, 0x311, 9, 0x1b);
break;
default:
laser->base.xspeed = 0x800;
laser->base.yspeed = 0;
sub_0803E2B0(&laser->base, 2, -3, 10, 3);
sub_0803E308(&laser->base, 16, -1, 18, 1);
sub_080708DC(&laser->base, &laser->base.unk10, 0xc, 0x311, 8, 0x1b);
sub_080708DC(&laser->base, &laser->base.sprite, 0xc, 0x311, 8, 0x1b);
break;
}
if (arg0->base.flags & 1) {
@ -272,22 +272,22 @@ static void sub_080BDA70(struct Object2* arg0, u8 arg1) {
else {
laser->base.x += 0x800;
}
laser->base.unk10.unk1F = 0;
laser->base.sprite.unk1F = 0;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == laser->base.roomId) {
laser->base.unk10.unk1F = sub_0803DF24(0x311);
if (laser->base.unk10.unk1F == 0xff) {
laser->base.unk10.unk1F = sub_0803DFAC(0x311, 0);
laser->base.sprite.unk1F = sub_0803DF24(0x311);
if (laser->base.sprite.unk1F == 0xff) {
laser->base.sprite.unk1F = sub_0803DFAC(0x311, 0);
}
}
else {
laser->base.unk10.unk1F = 0;
laser->base.sprite.unk1F = 0;
}
}
static u32 sub_080BDD1C(struct MetalGuardianLaser* arg0) {
struct Sprite sprite;
Macro_08107BA8_4(&arg0->base, &arg0->base.unk10, &sprite, 0xc, &arg0->base.unk10);
Macro_081050E8(&arg0->base, &arg0->base.unk10, 0x311, !arg0->base.unk10.unk1F);
Macro_08107BA8_4(&arg0->base, &arg0->base.sprite, &sprite, 0xc, &arg0->base.sprite);
Macro_081050E8(&arg0->base, &arg0->base.sprite, 0x311, !arg0->base.sprite.unk1F);
if (arg0->unk88 != 0 && arg0->base.flags & 2) {
arg0->base.flags |= 0x1000;
return 1;
@ -339,16 +339,16 @@ static void sub_080BDE7C(struct Object2* arg0) {
}
sub_0803E2B0(&laser->base, 2, -3, 10, 3);
sub_0803E308(&laser->base, 16, -1, 18, 1);
sub_080708DC(&laser->base, &laser->base.unk10, 0xc, 0x311, 7, 0x1b);
laser->base.unk10.unk1F = 0;
sub_080708DC(&laser->base, &laser->base.sprite, 0xc, 0x311, 7, 0x1b);
laser->base.sprite.unk1F = 0;
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == laser->base.roomId) {
laser->base.unk10.unk1F = sub_0803DF24(0x311);
if (laser->base.unk10.unk1F == 0xff) {
laser->base.unk10.unk1F = sub_0803DFAC(0x311, 0);
laser->base.sprite.unk1F = sub_0803DF24(0x311);
if (laser->base.sprite.unk1F == 0xff) {
laser->base.sprite.unk1F = sub_0803DFAC(0x311, 0);
}
}
else {
laser->base.unk10.unk1F = 0;
laser->base.sprite.unk1F = 0;
}
PlaySfx(&laser->base, 0x139);
}
@ -356,8 +356,8 @@ static void sub_080BDE7C(struct Object2* arg0) {
static u32 sub_080BE0E8(struct MetalGuardianLaser* arg0) {
struct Sprite sprite;
arg0->base.flags |= 4;
Macro_08107BA8_4(&arg0->base, &arg0->base.unk10, &sprite, 0xc, &arg0->base.unk10);
Macro_081050E8(&arg0->base, &arg0->base.unk10, 0x311, !arg0->base.unk10.unk1F);
Macro_08107BA8_4(&arg0->base, &arg0->base.sprite, &sprite, 0xc, &arg0->base.sprite);
Macro_081050E8(&arg0->base, &arg0->base.sprite, 0x311, !arg0->base.sprite.unk1F);
return 0;
}
@ -389,7 +389,7 @@ static u32 sub_080BE2A8(struct MetalGuardianLaser* arg0) {
}
static u32 sub_080BE2C4(struct MetalGuardianLaser* arg0) {
arg0->base.unk10.unk1A = 10;
arg0->base.sprite.unk1A = 10;
arg0->unk88 = 1;
arg0->base.flags &= ~0x200;
arg0->base.flags &= ~0x100;

View File

@ -87,47 +87,47 @@ static void sub_080C2438(struct Object2 *r6) {
sub_0803E3B0(r4);
r4->unk0 = 3;
r4->unk34 = r6->base.x;
r4->unk38 = r6->base.y;
r4->unk44 = r6;
r4->x = r6->base.x;
r4->y = r6->base.y;
r4->parent = r6;
r4->roomId = r6->base.roomId;
r4->unk3C = 0x20;
r4->unk3E = 0x40;
if (r6->base.flags & 1) {
r4->unk34 += 0xC00;
r4->x += 0xC00;
r4->unk3C = -r4->unk3C;
} else {
r4->flags |= 1;
r4->unk34 -= 0xC00;
r4->x -= 0xC00;
}
if (Macro_0810B1F4(&r6->base))
r4->flags |= 0x2000;
sub_080709F8(r4, &r4->unkC, 1, 0x322, 6, 12);
r4->unkC.unk1F = 0;
sub_080709F8(r4, &r4->sprite, 1, 0x322, 6, 12);
r4->sprite.unk1F = 0;
if (r6->base.unkC & 0x10)
Macro_081050E8(r4, &r4->unkC, gUnk_08351648[OBJ_DROPPY].unk8, 1);
Macro_081050E8(r4, &r4->sprite, gUnk_08351648[OBJ_DROPPY].unk8, 1);
else
Macro_081050E8(r4, &r4->unkC, 0x322, 1);
Macro_081050E8(r4, &r4->sprite, 0x322, 1);
}
static void sub_080C25CC(void) {
struct Object4 *r0, *r5 = TaskGetStructPtr(gCurTask, r0);
struct Object2 *r6 = r5->unk44, *r3;
struct Object2 *r6 = r5->parent, *r3;
struct Sprite sprite;
if (r5->flags & 0x1000) {
TaskDestroy(gCurTask);
return;
}
Macro_08107BA8_4(r5, &r5->unkC, &sprite, 1, &r5->unkC);
Macro_08107BA8_4(r5, &r5->sprite, &sprite, 1, &r5->sprite);
if (r6->base.unkC & 0x10)
Macro_081050E8(r5, &r5->unkC, gUnk_08351648[OBJ_DROPPY].unk8, !r5->unkC.unk1F);
Macro_081050E8(r5, &r5->sprite, gUnk_08351648[OBJ_DROPPY].unk8, !r5->sprite.unk1F);
else
Macro_081050E8(r5, &r5->unkC, 0x322, !r5->unkC.unk1F);
r3 = r5->unk44;
Macro_081050E8(r5, &r5->sprite, 0x322, !r5->sprite.unk1F);
r3 = r5->parent;
if (r3) {
if (r3->base.unk0 && r3->base.flags & 0x1000) {
r5->unk44 = NULL;
r5->parent = NULL;
r3 = NULL;
}
if (!r3)
@ -146,8 +146,8 @@ static void sub_080C25CC(void) {
r5->flags |= 0x1000;
} else {
if (!(r5->flags & 0x800)) {
r5->unk34 += r5->unk3C;
r5->unk38 -= r5->unk3E;
r5->x += r5->unk3C;
r5->y -= r5->unk3E;
}
sub_0806FAC8(r5);
}

View File

@ -166,9 +166,9 @@ void ObjectMain(void) {
obj->base.unkC &= ~8;
}
}
if (obj->base.unk10.unk20[0].unk0 == 0) {
if (obj->base.unk10.unk16 == 0) {
obj->base.unk10.unk20[0].unk0 = -1;
if (obj->base.sprite.unk20[0].unk0 == 0) {
if (obj->base.sprite.unk16 == 0) {
obj->base.sprite.unk20[0].unk0 = -1;
}
}
sub_0809A7A4();
@ -202,13 +202,13 @@ void ObjectDestroy(struct Task* arg0) {
}
}
if (gUnk_08351648[obj->type].unk8 & 0x1000) {
if (obj->base.unk10.unk1F != 0) {
sub_0803E4D4(obj->base.unk10.unk1F);
if (obj->base.sprite.unk1F != 0) {
sub_0803E4D4(obj->base.sprite.unk1F);
}
}
if (obj->base.unk10.unk0 != 0) {
if (obj->base.sprite.unk0 != 0) {
if (!(obj->base.flags & 0x4000)) {
sub_08157190(obj->base.unk10.unk0);
sub_08157190(obj->base.sprite.unk0);
}
}
if (obj->unk8C != NULL) {
@ -274,8 +274,8 @@ static void sub_0809A580(struct Task *task) {
break;
}
}
if (obj->base.unk10.unk0 && !(obj->base.flags & 0x4000))
sub_08157190(obj->base.unk10.unk0);
if (obj->base.sprite.unk0 && !(obj->base.flags & 0x4000))
sub_08157190(obj->base.sprite.unk0);
if (obj->unk8C)
EwramFree(obj->unk8C);
if (obj->base.unk56 != 0xFF)
@ -289,17 +289,17 @@ static void sub_0809A630(struct Object2 *obj) {
s32 v4;
if (!gUnk_08351648[obj->type].unkC) return;
r6 = &obj->base.unk10;
r6 = &obj->base.sprite;
if (!(obj->base.unkC & 0x200)) {
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == obj->base.roomId) {
if (!obj->base.unk10.unk0) {
if (!obj->base.sprite.unk0) {
if (obj->base.flags & 0x4000) {
r6->unk0 = sub_0803DD58(obj->type);
r6->unk8 &= ~0x80000;
CpuCopy32(r6, &sprite, sizeof(struct Sprite));
sub_0815521C(&sprite, obj->base.unk1);
} else {
obj->base.unk10.unk0 = sub_081570B0(gUnk_08351648[obj->type].unkC);
obj->base.sprite.unk0 = sub_081570B0(gUnk_08351648[obj->type].unkC);
r6->unk8 &= ~0x80000;
CpuCopy32(r6, &sprite, sizeof(struct Sprite));
sub_0815521C(&sprite, obj->base.unk1);
@ -321,10 +321,10 @@ static void sub_0809A630(struct Object2 *obj) {
r6->unk1F = v4;
}
} else {
if (obj->base.unk10.unk0) {
if (obj->base.sprite.unk0) {
if (!(obj->base.flags & 0x4000))
sub_08157190(obj->base.unk10.unk0);
obj->base.unk10.unk0 = 0;
sub_08157190(obj->base.sprite.unk0);
obj->base.sprite.unk0 = 0;
}
r6->unk8 |= 0x80000;
r6->unk1F = 0;
@ -338,7 +338,7 @@ static void sub_0809A7A4(void) {
struct Sprite *r6;
if (gUnk_08351648[r7->type].unkC) {
r6 = &r7->base.unk10;
r6 = &r7->base.sprite;
if (r7->base.flags & 1)
r6->unk8 &= ~0x400;
else
@ -369,12 +369,12 @@ static void sub_0809A7A4(void) {
}
if (!(r7->base.flags & 0x400) && gKirbys[gUnk_0203AD3C].base.base.base.roomId == r7->base.roomId)
{
r6->unk10 = (r7->base.x >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unkC >> 8) + r7->base.unk54;
r6->unk12 = (r7->base.y >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unk10 >> 8) + r7->base.unk55;
r6->unk10 = (r7->base.x >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unkC >> 8) + r7->base.objBase54;
r6->unk12 = (r7->base.y >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unk10 >> 8) + r7->base.objBase55;
r6->unk10 += gUnk_0203AD18[0];
r6->unk12 += gUnk_0203AD18[1];
r7->base.unk55 = 0;
r7->base.unk54 = 0;
r7->base.objBase55 = 0;
r7->base.objBase54 = 0;
if (r7->base.flags & 0x4000)
sub_081564D8(r6);
else
@ -442,13 +442,13 @@ static void sub_0809AA10(struct Object2 *r10, struct ObjectBase *sp00) {
if (r10->type != OBJ_DARK_MIND_FORM_2) {
struct Object4 *r0 = sub_0808AE30(&r10->base, 0, 0x2A3, 0);
r0->unkC.unk14 = 0x240;
r0->sprite.unk14 = 0x240;
Rand32();
r0->unk34 += 0x800;
r0->unk34 -= ((gRngVal >> 16) & 0xFFF);
r0->x += 0x800;
r0->x -= ((gRngVal >> 16) & 0xFFF);
Rand32();
r0->unk38 += 0x800;
r0->unk38 -= ((gRngVal >> 16) & 0xFFF);
r0->y += 0x800;
r0->y -= ((gRngVal >> 16) & 0xFFF);
}
if (sp04 < r7) {
sp04 = r7;
@ -479,13 +479,13 @@ static void sub_0809AA10(struct Object2 *r10, struct ObjectBase *sp00) {
if (r10->type != OBJ_DARK_MIND_FORM_2) {
struct Object4 *r0 = sub_0808AE30(&r10->base, 0, 0x2A3, 2);
r0->unkC.unk14 = 0x240;
r0->sprite.unk14 = 0x240;
Rand32();
r0->unk34 += 0x800;
r0->unk34 -= ((gRngVal >> 16) & 0xFFF);
r0->x += 0x800;
r0->x -= ((gRngVal >> 16) & 0xFFF);
Rand32();
r0->unk38 += 0x800;
r0->unk38 -= ((gRngVal >> 16) & 0xFFF);
r0->y += 0x800;
r0->y -= ((gRngVal >> 16) & 0xFFF);
}
if (sp04 < r7) {
sp04 = r7;
@ -502,13 +502,13 @@ static void sub_0809AA10(struct Object2 *r10, struct ObjectBase *sp00) {
if (r10->type != OBJ_DARK_MIND_FORM_2) {
struct Object4 *r0 = sub_0808AE30(&r10->base, 0, 0x2A3, 0);
r0->unkC.unk14 = 0x240;
r0->sprite.unk14 = 0x240;
Rand32();
r0->unk34 += 0x800;
r0->unk34 -= ((gRngVal >> 16) & 0xFFF);
r0->x += 0x800;
r0->x -= ((gRngVal >> 16) & 0xFFF);
Rand32();
r0->unk38 += 0x800;
r0->unk38 -= ((gRngVal >> 16) & 0xFFF);
r0->y += 0x800;
r0->y -= ((gRngVal >> 16) & 0xFFF);
}
if (sp04 < r7) {
sp04 = r7;
@ -787,7 +787,7 @@ void sub_0809B1E4(struct Object2 *r4) {
}
r4->base.flags |= 0xB00;
r4->base.counter = 0;
r4->base.unk10.unk1C = 0;
r4->base.sprite.unk1C = 0;
r4->unk78 = sub_0809F88C;
} else {
if (!(r4->base.flags & 0x4000000)) {
@ -850,13 +850,13 @@ static void sub_0809B6A8(struct Object2 *r3) {
r3->base.unkC &= ~0x4000;
r3->base.unk5C |= 0x80;
if (r3->unk9E < 8) {
r3->base.unk55 = gUnk_08352DD0[r3->unk9E];
r3->base.objBase55 = gUnk_08352DD0[r3->unk9E];
++r3->unk9E;
}
if (r3->base.counter > 10) {
if (!(r3->base.flags & 0x4000000))
r3->base.flags &= ~0x800;
r3->base.unk55 = 0;
r3->base.objBase55 = 0;
r3->base.counter = 0;
if (r3->base.yspeed)
r3->base.flags |= 0x20;
@ -1018,7 +1018,7 @@ static void sub_0809C180(struct Object2 *r4) {
}
r4->base.yspeed = 0;
if (r4->base.counter < 8)
r4->base.unk55 = gUnk_08352DD0[r4->base.counter];
r4->base.objBase55 = gUnk_08352DD0[r4->base.counter];
if (r4->base.counter > 10)
r4->unk78 = sub_0809BEF8;
++r4->base.counter;
@ -1288,7 +1288,7 @@ static void sub_0809CE80(struct Object2 *r4) {
struct Object2 *obj;
if (r4->base.counter < 8)
r4->base.unk54 = gUnk_08352DD0[r4->base.counter];
r4->base.objBase54 = gUnk_08352DD0[r4->base.counter];
if (++r4->base.counter > 30) {
r6 = OBJ_SMALL_FOOD;
r12 = 0;
@ -1491,12 +1491,12 @@ static void sub_0809D710(struct Object2 *r3) {
static void sub_0809D7C8(struct Object2 *r8) {
u8 r4;
struct Sprite *r7 = &r8->base.unk10;
struct Sprite *r7 = &r8->base.sprite;
if (r8->base.unk10.unk0 && !(r8->base.flags & 0x400)
if (r8->base.sprite.unk0 && !(r8->base.flags & 0x400)
&& gKirbys[gUnk_0203AD3C].base.base.base.roomId == r8->base.roomId) {
r7->unk10 = (r8->base.x >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unkC >> 8) + r8->base.unk54;
r7->unk12 = (r8->base.y >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unk10 >> 8) + r8->base.unk55;
r7->unk10 = (r8->base.x >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unkC >> 8) + r8->base.objBase54;
r7->unk12 = (r8->base.y >> 8) - (gCurLevelInfo[gUnk_0203AD3C].unk10 >> 8) + r8->base.objBase55;
r7->unk10 += gUnk_0203AD18[0];
r7->unk12 += gUnk_0203AD18[1];
r4 = r7->unk1C;
@ -1637,9 +1637,9 @@ static void sub_0809E424(struct Object2 *sb) {
TaskGetStructPtr(task, r7);
sub_0803E3B0(r7);
r7->unk0 = 3;
r7->unk34 = sb->base.x;
r7->unk38 = sb->base.y;
r7->unk44 = sb;
r7->x = sb->base.x;
r7->y = sb->base.y;
r7->parent = sb;
r7->roomId = sb->base.roomId;
r7->flags |= 0x4000;
Rand32();
@ -1651,12 +1651,12 @@ static void sub_0809E424(struct Object2 *sb) {
if (Macro_0810B1F4(&sb->base))
r7->flags |= 0x2000;
r7->flags |= 0x4000;
sub_080709F8(r7, &r7->unkC, 0x6012000, 0x297, 1, 12);
sub_080709F8(r7, &r7->sprite, 0x6012000, 0x297, 1, 12);
}
static void sub_0809E55C(void) {
struct Object4 *r0_, *r7 = TaskGetStructPtr(gCurTask, r0_);
struct Object2 *ip = r7->unk44;
struct Object2 *ip = r7->parent;
u16 r1;
if (r7->flags & 0x1000) {
@ -1692,8 +1692,8 @@ static void sub_0809E55C(void) {
} else {
r7->unk3E -= gUnk_08352DF8[r7->unk1 >> 1];
}
r7->unk34 = ip->base.x + r7->unk3C;
r7->unk38 = ip->base.y + r7->unk3E;
r7->x = ip->base.x + r7->unk3C;
r7->y = ip->base.y + r7->unk3E;
sub_0806FAC8(r7);
}
}
@ -1706,9 +1706,9 @@ void sub_0809E79C(struct Object2 *sb) {
TaskGetStructPtr(task, r7);
sub_0803E3B0(r7);
r7->unk0 = 3;
r7->unk34 = sb->base.x;
r7->unk38 = sb->base.y;
r7->unk44 = sb;
r7->x = sb->base.x;
r7->y = sb->base.y;
r7->parent = sb;
r7->roomId = sb->base.roomId;
r7->flags |= 0x4000;
Rand32();
@ -1720,12 +1720,12 @@ void sub_0809E79C(struct Object2 *sb) {
if (Macro_0810B1F4(&sb->base))
r7->flags |= 0x2000;
r7->flags |= 0x4000;
sub_080709F8(r7, &r7->unkC, 0x6012000, 0x29D, 0, 12);
sub_080709F8(r7, &r7->sprite, 0x6012000, 0x29D, 0, 12);
}
static void sub_0809E8D4(void) {
struct Object4 *r0_, *r7 = TaskGetStructPtr(gCurTask, r0_);
struct Object2 *ip = r7->unk44;
struct Object2 *ip = r7->parent;
u16 r1;
if (r7->flags & 0x1000) {
@ -1753,8 +1753,8 @@ static void sub_0809E8D4(void) {
r1 = Rand16();
r7->unk3E = ({12 - ((r1 % 16) + (r1 % 8));}) << 8;
}
r7->unk34 = ip->base.x + r7->unk3C;
r7->unk38 = ip->base.y + r7->unk3E;
r7->x = ip->base.x + r7->unk3C;
r7->y = ip->base.y + r7->unk3E;
switch (r7->unk1) {
case 0:
r7->unk3C += 0x100;
@ -1792,9 +1792,9 @@ static void sub_0809EB90(struct Object2 *sb) {
TaskGetStructPtr(task, r7);
sub_0803E3B0(r7);
r7->unk0 = 3;
r7->unk34 = sb->base.x;
r7->unk38 = sb->base.y;
r7->unk44 = sb;
r7->x = sb->base.x;
r7->y = sb->base.y;
r7->parent = sb;
r7->roomId = sb->base.roomId;
r7->unk8 = 0;
r7->flags |= 0x4000;
@ -1808,12 +1808,12 @@ static void sub_0809EB90(struct Object2 *sb) {
if (Macro_0810B1F4(&sb->base))
r7->flags |= 0x2000;
r7->flags |= 0x4000;
sub_080709F8(r7, &r7->unkC, 0x6012000, 0x29e, 0, 12);
sub_080709F8(r7, &r7->sprite, 0x6012000, 0x29e, 0, 12);
}
static void sub_0809ECD0(void) {
struct Object4 *r0_, *r7 = TaskGetStructPtr(gCurTask, r0_);
struct Object2 *ip = r7->unk44;
struct Object2 *ip = r7->parent;
if (r7->flags & 0x1000) {
TaskDestroy(gCurTask);
@ -1870,8 +1870,8 @@ static void sub_0809ECD0(void) {
r7->unk3C += r7->unk4;
r7->unk4 -= 7;
}
r7->unk34 = ip->base.x + r7->unk3C;
r7->unk38 = ip->base.y + r7->unk3E;
r7->x = ip->base.x + r7->unk3C;
r7->y = ip->base.y + r7->unk3E;
sub_0806FAC8(r7);
}
}
@ -2021,17 +2021,17 @@ void ObjectInitSprite(struct Object2* arg0) {
if (gUnk_08351648[arg0->type].unkC != 0) {
if (gKirbys[gUnk_0203AD3C].base.base.base.roomId == arg0->base.roomId) {
if (arg0->base.flags & 0x4000) {
arg0->base.unk10.unk0 = sub_0803DD58(arg0->type);
arg0->base.sprite.unk0 = sub_0803DD58(arg0->type);
}
else {
arg0->base.unk10.unk0 = sub_081570B0(gUnk_08351648[arg0->type].unkC);
arg0->base.sprite.unk0 = sub_081570B0(gUnk_08351648[arg0->type].unkC);
}
arg0->base.unk10.unk14 = r7 << 6;
arg0->base.unk10.unkC = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk0;
arg0->base.unk10.unk1A = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk2;
arg0->base.unk10.unk16 = 0;
arg0->base.unk10.unk1B = 0xff;
arg0->base.unk10.unk1C = 0x10;
arg0->base.sprite.unk14 = r7 << 6;
arg0->base.sprite.unkC = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk0;
arg0->base.sprite.unk1A = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk2;
arg0->base.sprite.unk16 = 0;
arg0->base.sprite.unk1B = 0xff;
arg0->base.sprite.unk1C = 0x10;
r4 = gUnk_08351648[arg0->type].unk8;
if (arg0->base.unkC & 0x10) {
r4 = gUnk_08351648[OBJ_DROPPY].unk8;
@ -2046,26 +2046,26 @@ void ObjectInitSprite(struct Object2* arg0) {
ret = 0;
}
}
arg0->base.unk10.unk1F = ret;
arg0->base.unk10.unk10 = arg0->base.x >> 8;
arg0->base.unk10.unk12 = arg0->base.y >> 8;
arg0->base.unk10.unk8 = 0x42000;
arg0->base.unk10.unk20[0].unk0 = -1;
sub_08155128(&arg0->base.unk10);
arg0->base.sprite.unk1F = ret;
arg0->base.sprite.unk10 = arg0->base.x >> 8;
arg0->base.sprite.unk12 = arg0->base.y >> 8;
arg0->base.sprite.unk8 = 0x42000;
arg0->base.sprite.unk20[0].unk0 = -1;
sub_08155128(&arg0->base.sprite);
}
else {
arg0->base.unk10.unk0 = 0;
arg0->base.unk10.unk14 = r7 << 6;
arg0->base.unk10.unkC = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk0;
arg0->base.unk10.unk1A = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk2;
arg0->base.unk10.unk16 = 0;
arg0->base.unk10.unk1B = 0xff;
arg0->base.unk10.unk1C = 0x10;
arg0->base.unk10.unk1F = 0;
arg0->base.unk10.unk10 = arg0->base.x >> 8;
arg0->base.unk10.unk12 = arg0->base.y >> 8;
arg0->base.unk10.unk8 = 0xc2000;
sub_08155128(&arg0->base.unk10);
arg0->base.sprite.unk0 = 0;
arg0->base.sprite.unk14 = r7 << 6;
arg0->base.sprite.unkC = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk0;
arg0->base.sprite.unk1A = gUnk_08351648[arg0->type].unk14[arg0->unk83].unk2;
arg0->base.sprite.unk16 = 0;
arg0->base.sprite.unk1B = 0xff;
arg0->base.sprite.unk1C = 0x10;
arg0->base.sprite.unk1F = 0;
arg0->base.sprite.unk10 = arg0->base.x >> 8;
arg0->base.sprite.unk12 = arg0->base.y >> 8;
arg0->base.sprite.unk8 = 0xc2000;
sub_08155128(&arg0->base.sprite);
}
}
}
@ -2075,7 +2075,7 @@ void *CreateEmpty(struct Object *r6, u8 r7) {
struct Object2 *r4;
sub_0803E380(&TaskGetStructPtr(task, r4)->base);
r4->base.unk10.unk0 = 0;
r4->base.sprite.unk0 = 0;
r4->base.unk0 = 1;
r4->base.roomId = gCurLevelInfo[r7].currentRoom;
r4->base.unk56 = r7;
@ -2150,7 +2150,7 @@ void sub_0809F840(struct Object2 *obj) {
static void sub_0809F88C(struct Object2 *obj) {
++obj->base.counter;
obj->base.unk10.unk1C = 0;
obj->base.sprite.unk1C = 0;
if (obj->base.counter == 2) {
obj->base.flags |= 0x1000;
sub_0809DA30(obj);
@ -2161,14 +2161,14 @@ static void sub_0809F8BC(struct Object2 *obj) {
struct Object3 *obj3 = obj->base.parent;
obj->base.flags |= 0x2F00;
obj->base.unk10.unk8 &= ~0x800;
obj->base.unk10.unk8 |= obj3->base.unk10.unk8 & 0x800;
obj->base.sprite.unk8 &= ~0x800;
obj->base.sprite.unk8 |= obj3->base.sprite.unk8 & 0x800;
obj->base.flags &= ~1;
obj->base.flags |= (obj3->base.flags & 1);
obj->base.x = obj3->base.x;
obj->base.y = obj3->base.y;
obj->base.unk54 = obj3->base.unk54;
obj->base.unk55 = obj3->base.unk55;
obj->base.objBase54 = obj3->base.objBase54;
obj->base.objBase55 = obj3->base.objBase55;
if (obj3->base.flags & 0x1000)
obj->base.flags |= 0x1000;
}

View File

@ -141,12 +141,12 @@ static void sub_080C2D44(struct Object2 *r3) {
r3->base.flags |= 4;
r5 = r3->base.parent;
ip = &r5->base;
if (ip->unk10.unk8 & 0x800)
r3->base.unk10.unk8 |= 0x800;
if (ip->sprite.unk8 & 0x800)
r3->base.sprite.unk8 |= 0x800;
else
r3->base.unk10.unk8 &= ~0x800;
r3->base.unk54 = ip->unk54;
r3->base.unk55 = ip->unk55;
r3->base.sprite.unk8 &= ~0x800;
r3->base.objBase54 = ip->objBase54;
r3->base.objBase55 = ip->objBase55;
if (r5->type == OBJ_SHOTZO_1) {
r5->base.flags |= 0x40;
r5->base.flags &= ~0x20;
@ -174,8 +174,8 @@ static void sub_080C2D44(struct Object2 *r3) {
return;
}
}
if (ip->unk10.unkC == 0x330) {
if (!ip->unk10.unk1A) {
if (ip->sprite.unkC == 0x330) {
if (!ip->sprite.unk1A) {
if (ip->flags & 1)
r3->base.x = ip->x + 0x100;
else
@ -183,13 +183,13 @@ static void sub_080C2D44(struct Object2 *r3) {
r3->base.y = ip->y + (gUnk_08355490[ip->unk1] * 0x100);
} else {
r3->base.x = ip->x;
if (r3->base.unk10.unk8 & 0x800)
if (r3->base.sprite.unk8 & 0x800)
r3->base.y = ip->y + 0x1200;
else
r3->base.y = ip->y - 0x1200;
}
} else if (ip->unk10.unkC == 0x308) {
if (!ip->unk10.unk1A) {
} else if (ip->sprite.unkC == 0x308) {
if (!ip->sprite.unk1A) {
if (ip->flags & 1)
r3->base.x = ip->x + 0x100;
else
@ -200,14 +200,14 @@ static void sub_080C2D44(struct Object2 *r3) {
r3->base.x = ip->x + 0x100;
else
r3->base.x = ip->x - 0x100;
if (r3->base.unk10.unk8 & 0x800)
if (r3->base.sprite.unk8 & 0x800)
r3->base.y = ip->y + 0x1100;
else
r3->base.y = ip->y - 0x1100;
}
} else {
r3->base.x = ip->x;
if (r3->base.unk10.unk8 & 0x800)
if (r3->base.sprite.unk8 & 0x800)
r3->base.y = ip->y + 0x1200;
else
r3->base.y = ip->y - 0x1200;

View File

@ -324,7 +324,7 @@ void sub_080BB080(struct Object2* arg0, u8 arg1) {
}
sub_0803E2B0(obj, -2, -2, 2, 2);
sub_0803E308(obj, 0, 0, 0, 0);
sub_080708DC(obj, &obj->unk10, 0x12, 0x334, 0, 0xc);
sub_080708DC(obj, &obj->sprite, 0x12, 0x334, 0, 0xc);
PlaySfx(obj, 0x13d);
}
@ -344,7 +344,7 @@ static void sub_080BB290(void) {
obj->x += obj->xspeed;
obj->y -= obj->yspeed;
}
Macro_08107BA8_4(obj, &obj->unk10, &sprite, 0x12, &obj->unk10);
Macro_08107BA8_4(obj, &obj->sprite, &sprite, 0x12, &obj->sprite);
sub_0806F8BC(obj);
}
}
@ -355,26 +355,26 @@ void sub_080BB470(struct Object2* arg0) {
struct Object4 *obj2, *obj = TaskGetStructPtr(task, obj2);
sub_0803E3B0(obj);
obj->unk0 = 3;
obj->unk34 = arg0->base.x;
obj->unk38 = arg0->base.y;
obj->unk44 = arg0;
obj->x = arg0->base.x;
obj->y = arg0->base.y;
obj->parent = arg0;
obj->roomId = arg0->base.roomId;
obj->flags |= 0x4000;
obj->unk3C = 0x300;
obj->unk3E = 0;
if (arg0->base.flags & 1) {
obj->unk34 -= 0xa00;
obj->x -= 0xa00;
obj->unk3C = -obj->unk3C;
obj->flags |= 1;
}
else {
obj->unk34 += 0xa00;
obj->x += 0xa00;
obj->flags &= ~1;
}
if (Macro_0810B1F4(&arg0->base)) {
obj->flags |= 0x2000;
}
sub_080709F8(obj, &obj->unkC, 0x12, 0x334, 1, 0xc);
sub_080709F8(obj, &obj->sprite, 0x12, 0x334, 1, 0xc);
}
static void sub_080BB568(void) {
@ -386,12 +386,12 @@ static void sub_080BB568(void) {
TaskDestroy(gCurTask);
else
{
r1 = obj->unk44;
r1 = obj->parent;
if (r1)
{
if (r1->base.unk0 && r1->base.flags & 0x1000)
{
obj->unk44 = NULL;
obj->parent = NULL;
r1 = NULL;
}
if (!r1)
@ -419,10 +419,10 @@ static void sub_080BB568(void) {
obj->unk3C -= 0x50;
}
obj->unk3E = 0x40;
Macro_08107BA8_4(obj, &obj->unkC, &sprite, 0x12, &obj->unkC);
Macro_08107BA8_4(obj, &obj->sprite, &sprite, 0x12, &obj->sprite);
if (!(obj->flags & 0x800)) {
obj->unk34 += obj->unk3C;
obj->unk38 -= obj->unk3E;
obj->x += obj->unk3C;
obj->y -= obj->unk3E;
}
sub_0806FAC8(obj);
}
@ -434,9 +434,9 @@ void sub_080BB804(struct Object2* arg0, u8 arg1) {
struct Object4 *obj2, *obj = TaskGetStructPtr(task, obj2);
sub_0803E3B0(obj);
obj->unk0 = 3;
obj->unk34 = arg0->base.x;
obj->unk38 = arg0->base.y;
obj->unk44 = arg0;
obj->x = arg0->base.x;
obj->y = arg0->base.y;
obj->parent = arg0;
obj->roomId = arg0->base.roomId;
obj->flags |= 0x4000;
obj->unk3C = 0;
@ -444,12 +444,12 @@ void sub_080BB804(struct Object2* arg0, u8 arg1) {
obj->unk8 = arg1;
if (arg0->base.flags & 1) {
obj->unk34 -= 0xa00;
obj->x -= 0xa00;
obj->unk3C = -obj->unk3C;
obj->flags |= 1;
}
else {
obj->unk34 += 0xa00;
obj->x += 0xa00;
#ifndef NONMATCHING
asm("":::"r2");
#endif
@ -458,7 +458,7 @@ void sub_080BB804(struct Object2* arg0, u8 arg1) {
if (Macro_0810B1F4(&arg0->base)) {
obj->flags |= 0x2000;
}
sub_080709F8(obj, &obj->unkC, 0x12, 0x334, 2, 0xc);
sub_080709F8(obj, &obj->sprite, 0x12, 0x334, 2, 0xc);
}
static void sub_080BB8FC(void) {
@ -470,12 +470,12 @@ static void sub_080BB8FC(void) {
TaskDestroy(gCurTask);
else
{
r1 = obj->unk44;
r1 = obj->parent;
if (r1)
{
if (r1->base.unk0 && r1->base.flags & 0x1000)
{
obj->unk44 = NULL;
obj->parent = NULL;
r1 = NULL;
}
if (!r1)
@ -514,10 +514,10 @@ static void sub_080BB8FC(void) {
obj->unk3C = -obj->unk3C;
}
obj->unk4++;
Macro_08107BA8_4(obj, &obj->unkC, &sprite, 0x12, &obj->unkC);
Macro_08107BA8_4(obj, &obj->sprite, &sprite, 0x12, &obj->sprite);
if (!(obj->flags & 0x800)) {
obj->unk34 += obj->unk3C;
obj->unk38 -= obj->unk3E;
obj->x += obj->unk3C;
obj->y -= obj->unk3E;
}
sub_0806FAC8(obj);
}

View File

@ -287,13 +287,13 @@ static void sub_080B6DDC(struct Object2* arg0, u8 arg1) {
}
sub_0803E2B0(obj, -2, -2, 2, 2);
sub_0803E308(obj, 0, 0, 0, 0);
sub_080708DC(obj, &obj->unk10, 8, 0x330, 0xa, 0xc);
obj->unk10.unk1F = 0;
sub_080708DC(obj, &obj->sprite, 8, 0x330, 0xa, 0xc);
obj->sprite.unk1F = 0;
if (arg0->base.unkC & 0x10) {
Macro_081050E8(obj, &obj->unk10, gUnk_08351648[OBJ_DROPPY].unk8, 1);
Macro_081050E8(obj, &obj->sprite, gUnk_08351648[OBJ_DROPPY].unk8, 1);
}
else {
Macro_081050E8(obj, &obj->unk10, 0x308, 1);
Macro_081050E8(obj, &obj->sprite, 0x308, 1);
}
PlaySfx(obj, 0x13a);
}
@ -302,12 +302,12 @@ static void sub_080B7068(void) {
struct Sprite sprite;
struct ObjectBase *obj2, *obj = TaskGetStructPtr(gCurTask, obj2);
struct Object2 *parent = obj->parent;
Macro_08107BA8_4(obj, &obj->unk10, &sprite, 8, &obj->unk10);
Macro_08107BA8_4(obj, &obj->sprite, &sprite, 8, &obj->sprite);
if (parent->base.unkC & 0x10) {
Macro_081050E8(obj, &obj->unk10, gUnk_08351648[OBJ_DROPPY].unk8, obj->unk10.unk1F == 0);
Macro_081050E8(obj, &obj->sprite, gUnk_08351648[OBJ_DROPPY].unk8, obj->sprite.unk1F == 0);
}
else {
Macro_081050E8(obj, &obj->unk10, 0x308, obj->unk10.unk1F == 0);
Macro_081050E8(obj, &obj->sprite, 0x308, obj->sprite.unk1F == 0);
}
parent = obj->parent;
if (obj->roomId != 0xffff && parent->base.flags & 0x1000) {