mirror of
https://github.com/jiangzhengwenjz/katam.git
synced 2024-11-26 22:50:39 +00:00
more kirby; name some fields
This commit is contained in:
parent
a5fad42fd3
commit
48170b35cb
3763
asm/code_0803E324.s
3763
asm/code_0803E324.s
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 26 KiB |
@ -48,18 +48,18 @@ struct Unk_02023720_Mgr {
|
||||
#include "sprite.h"
|
||||
|
||||
struct LevelInfo_1A0 {
|
||||
u16 unk0;
|
||||
u16 unk2;
|
||||
u16 width;
|
||||
u16 height;
|
||||
u16 unk4;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
void *unk8;
|
||||
u32 unkC;
|
||||
u16 *unk10;
|
||||
u16 unk14;
|
||||
u16 unk16;
|
||||
const u16 *unk18;
|
||||
u32 unk1C;
|
||||
void *tileset; // from what I see, this is usually without deduplication
|
||||
u32 numTiles;
|
||||
u16 *palette;
|
||||
u16 paletteOffset;
|
||||
u16 paletteSize; // in hwords
|
||||
u16 *tilemap; // we still need the tilemap for palette info even w/o deduplication
|
||||
u32 roomId;
|
||||
}; /* size = 0x20 */
|
||||
|
||||
struct LevelInfo_1A0_Full {
|
||||
@ -745,7 +745,7 @@ extern const union __attribute__((transparent_union)) {
|
||||
extern const struct LevelInfo_1E8 *const gUnk_08D63C28[];
|
||||
extern const struct Unk_08D60FA4 *const gUnk_08D60FA4[];
|
||||
extern const struct Unk_08930E5C *const gUnk_08D640A4[];
|
||||
extern const struct LevelInfo_1A0 *gUnk_08D64A24[];
|
||||
extern const struct LevelInfo_1A0 *const gUnk_08D64A24[];
|
||||
|
||||
extern const struct RoomProps gRoomProps[];
|
||||
|
||||
|
@ -177,6 +177,15 @@ void sub_0807D2D0(struct Kirby *);
|
||||
void sub_0807D4B0(struct Kirby *);
|
||||
void sub_0807D690(struct Kirby *);
|
||||
void sub_0807DBCC(struct Object2 *);
|
||||
void sub_0807E190(struct Kirby *);
|
||||
void sub_0807E66C(struct Kirby *);
|
||||
void sub_0807EA78(struct Kirby *);
|
||||
void sub_0807EBAC(struct Kirby *);
|
||||
void sub_0807ECE0(struct Kirby *);
|
||||
void sub_0807EF0C(struct Kirby *);
|
||||
void sub_0807F128(struct Kirby *);
|
||||
void sub_0807F720(struct Kirby *);
|
||||
void sub_0807F9EC(struct Kirby *);
|
||||
void sub_08080004(struct Kirby *);
|
||||
void sub_08082380(struct Object2 *, u8);
|
||||
void sub_08082B5C(struct Kirby *);
|
||||
@ -250,6 +259,7 @@ void sub_08093390(struct Kirby *, s16, s16);
|
||||
void sub_0809361C(struct Kirby *, u32);
|
||||
void sub_08093918(struct Kirby *, u8);
|
||||
void sub_08093C74(struct ObjectBase *);
|
||||
void sub_0809447C(struct Kirby *);
|
||||
void sub_0809513C(struct ObjectBase *, u8, u8);
|
||||
void sub_08098184(struct ObjectBase *);
|
||||
void sub_080982C4(struct ObjectBase *);
|
||||
@ -258,6 +268,7 @@ void sub_080988B0(struct ObjectBase *);
|
||||
void sub_08098A78(struct Kirby *, u8);
|
||||
void sub_08098E54(struct Kirby *, s8, s8, s16, s16);
|
||||
void sub_08099118(struct Kirby *);
|
||||
void sub_08099A60(struct Kirby *);
|
||||
|
||||
void sub_080A8C28(struct Object2*, u8, u8);
|
||||
void sub_080A9038(struct Kirby *, bool8);
|
||||
|
@ -9872,7 +9872,7 @@ void sub_08113C10(struct Object2 *r4)
|
||||
|
||||
void sub_08113C34(UNUSED s32 a1, u8 offset)
|
||||
{
|
||||
const u16 *src = gUnk_08D64A24[gRoomProps[0x396].backgroundIdx]->unk18;
|
||||
const u16 *src = gUnk_08D64A24[gRoomProps[0x396].backgroundIdx]->tilemap;
|
||||
u16 i, j, *dst = ((offset << 10) & 0x7FFFF) + (u16 *)0x6000540;
|
||||
|
||||
for (i = 0; i < 0x16; ++i)
|
||||
|
855
src/kirby.c
855
src/kirby.c
@ -204,6 +204,27 @@ void sub_08064738(struct Kirby *);
|
||||
void sub_0806487C(struct Kirby *);
|
||||
void sub_080649FC(struct Kirby *);
|
||||
void sub_08064B54(struct Kirby *);
|
||||
void sub_08064D68(struct Kirby *);
|
||||
void sub_08064DF4(struct Kirby *);
|
||||
void sub_080650E8(struct Kirby *);
|
||||
void sub_08065160(struct Kirby *);
|
||||
void sub_0806541C(struct Kirby *);
|
||||
void sub_08065498(struct Kirby *);
|
||||
void sub_08065578(struct Kirby *);
|
||||
void sub_08065778(struct Kirby *);
|
||||
void sub_08065BD8(struct Kirby *);
|
||||
void sub_08065C5C(struct Kirby *);
|
||||
void sub_08065E2C(struct Kirby *);
|
||||
void sub_08065F28(struct Kirby *);
|
||||
void sub_08066130(struct Kirby *);
|
||||
void sub_0806621C(struct Kirby *);
|
||||
void sub_08066458(struct Kirby *);
|
||||
void sub_080667E4(struct Kirby *);
|
||||
void sub_0806A5D8(struct Kirby *);
|
||||
void sub_0806A638(struct Kirby *);
|
||||
void sub_0806A674(struct Kirby *);
|
||||
void sub_0806A6D4(struct Kirby *);
|
||||
void sub_0806A704(struct Kirby *);
|
||||
|
||||
extern const struct Unk_02021590 gUnk_0834D918[], gUnk_0834D940[], gUnk_0834EC24[];
|
||||
extern const struct Unk_02021590 *const gUnk_08D60FB4[], *const gUnk_08D60FDC[];
|
||||
@ -3016,18 +3037,18 @@ void sub_08043360(struct Kirby *kirby)
|
||||
|
||||
#define Macro_080435F8_3(kirby) \
|
||||
({ \
|
||||
if ((kirby)->base.base.base.unk58 & 2) \
|
||||
{ \
|
||||
(kirby)->base.base.base.yspeed -= 8; \
|
||||
if ((kirby)->base.base.base.yspeed < -0xE0) \
|
||||
(kirby)->base.base.base.yspeed = -0xE0; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(kirby)->base.base.base.yspeed -= 38; \
|
||||
if ((kirby)->base.base.base.yspeed < -0x280) \
|
||||
(kirby)->base.base.base.yspeed = -0x280; \
|
||||
} \
|
||||
if ((kirby)->base.base.base.unk58 & 2) \
|
||||
{ \
|
||||
(kirby)->base.base.base.yspeed -= 8; \
|
||||
if ((kirby)->base.base.base.yspeed < -0xE0) \
|
||||
(kirby)->base.base.base.yspeed = -0xE0; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(kirby)->base.base.base.yspeed -= 38; \
|
||||
if ((kirby)->base.base.base.yspeed < -0x280) \
|
||||
(kirby)->base.base.base.yspeed = -0x280; \
|
||||
} \
|
||||
})
|
||||
|
||||
#define Macro_080435F8_2(kirby) \
|
||||
@ -12110,13 +12131,7 @@ void sub_0805E210(struct Kirby *kirby)
|
||||
Macro_0803FF64_6(kirby);
|
||||
else
|
||||
{
|
||||
if (!(kirby->base.base.base.unk62 & 4))
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 38;
|
||||
if (kirby->base.base.base.yspeed < -0x280)
|
||||
kirby->base.base.base.yspeed = -0x280;
|
||||
Macro_080435F8_2(kirby);
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
if (kirby->base.base.base.unk62 & 1)
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
@ -12175,13 +12190,7 @@ void sub_0805E448(struct Kirby *kirby)
|
||||
}
|
||||
if (kirby->unkD4 == 104)
|
||||
{
|
||||
if (!(kirby->base.base.base.unk62 & 4))
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 38;
|
||||
if (kirby->base.base.base.yspeed < -0x280)
|
||||
kirby->base.base.base.yspeed = -0x280;
|
||||
Macro_080435F8_2(kirby);
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
if (++kirby->base.base.base.counter > 3)
|
||||
{
|
||||
kirby->unkD4 = 53;
|
||||
@ -12962,13 +12971,7 @@ void sub_0805F878(struct Kirby *kirby)
|
||||
Macro_0803FF64_6(kirby);
|
||||
else
|
||||
{
|
||||
if (!(kirby->base.base.base.unk62 & 4))
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 38;
|
||||
if (kirby->base.base.base.yspeed < -0x280)
|
||||
kirby->base.base.base.yspeed = -0x280;
|
||||
Macro_080435F8_2(kirby);
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
}
|
||||
@ -14548,13 +14551,7 @@ void sub_08063404(struct Kirby *kirby)
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (!(kirby->base.base.base.unk62 & 4))
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 38;
|
||||
if (kirby->base.base.base.yspeed < -0x280)
|
||||
kirby->base.base.base.yspeed = -0x280;
|
||||
Macro_080435F8_2(kirby);
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -gUnk_0834C468[kirby->base.base.base.unk1];
|
||||
else
|
||||
@ -14598,22 +14595,7 @@ void sub_080635CC(struct Kirby *kirby)
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
if (!(kirby->base.base.base.unk62 & 4))
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2) // pointless
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 38;
|
||||
if (kirby->base.base.base.yspeed < -0x280)
|
||||
kirby->base.base.base.yspeed = -0x280;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 38;
|
||||
if (kirby->base.base.base.yspeed < -0x280)
|
||||
kirby->base.base.base.yspeed = -0x280;
|
||||
}
|
||||
Macro_080435F8_2(kirby);
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
}
|
||||
|
||||
void sub_080636B0(struct Kirby *kirby)
|
||||
@ -15192,3 +15174,764 @@ void sub_080649FC(struct Kirby *kirby)
|
||||
if (kirby->base.base.base.unk62 & 1)
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
}
|
||||
|
||||
void sub_08064B54(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->unkD4 == 54 || kirby->unkD4 == 106)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
sub_0805BE80(kirby);
|
||||
}
|
||||
else if (!(kirby->base.base.base.unk58 & 2))
|
||||
{
|
||||
sub_0805BBB4(kirby);
|
||||
if (kirby->base.base.base.yspeed < 0)
|
||||
sub_08044EA8(kirby);
|
||||
else
|
||||
sub_08043360(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
if (kirby->base.base.base.unk62 & 1)
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
}
|
||||
|
||||
void sub_08064CA4(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
kirby->base.base.base.flags &= ~0x40;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
if (kirby->unk118 & 0x40)
|
||||
sub_08065578(kirby);
|
||||
else
|
||||
{
|
||||
if (kirby->base.base.base.flags & 0x20)
|
||||
{
|
||||
if (kirby->unk118 & 0x80)
|
||||
{
|
||||
kirby->unkD4 = 103;
|
||||
kirby->base.base.unk78 = sub_08066458;
|
||||
kirby->unkD8 = 1;
|
||||
}
|
||||
else
|
||||
sub_080650E8(kirby);
|
||||
}
|
||||
else if (kirby->unk118 & 0x30)
|
||||
{
|
||||
if (kirby->base.base.base.flags & 0x10)
|
||||
sub_0806541C(kirby);
|
||||
else
|
||||
sub_08064D68(kirby);
|
||||
}
|
||||
else
|
||||
sub_0806A5D8(kirby);
|
||||
}
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
}
|
||||
|
||||
void sub_08064D68(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
kirby->base.base.base.xspeed = 0x100;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 111;
|
||||
kirby->base.base.unk78 = sub_08064DF4;
|
||||
sub_0807F720(kirby);
|
||||
kirby->base.base.base.flags |= 0x20;
|
||||
}
|
||||
|
||||
void sub_08064DF4(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->unkD4 == 111)
|
||||
{
|
||||
if (kirby->base.base.base.yspeed < 0)
|
||||
{
|
||||
kirby->base.base.base.yspeed += 0x40;
|
||||
if (kirby->base.base.base.yspeed > 0)
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 0x40;
|
||||
if (kirby->base.base.base.yspeed < 0)
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
}
|
||||
if (kirby->base.base.base.unk1 == 4)
|
||||
{
|
||||
kirby->base.base.base.yspeed = 0x200;
|
||||
kirby->base.base.base.xspeed = 0x360;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
sub_08092C10(kirby);
|
||||
PlaySfx(&kirby->base.base.base, 212);
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 112;
|
||||
}
|
||||
}
|
||||
else if (kirby->unkD4 == 112)
|
||||
{
|
||||
kirby->base.base.base.flags |= 4;
|
||||
if (kirby->base.base.base.yspeed < 0)
|
||||
{
|
||||
kirby->base.base.base.yspeed += 0x40;
|
||||
if (kirby->base.base.base.yspeed > 0)
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirby->base.base.base.yspeed -= 0x40;
|
||||
if (kirby->base.base.base.yspeed < 0)
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
}
|
||||
if (++kirby->base.base.base.counter > 10)
|
||||
{
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 113;
|
||||
}
|
||||
if (!(kirby->unkD8 & 7))
|
||||
PlaySfx(&kirby->base.base.base, 212);
|
||||
++kirby->unkD8;
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_0805B1B8(kirby);
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
}
|
||||
sub_0805B1B8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_080650E8(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
kirby->base.base.base.yspeed >>= 1;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->base.base.base.flags |= 0x20;
|
||||
kirby->unkD4 = 111;
|
||||
kirby->base.base.unk78 = sub_08065160;
|
||||
sub_0807F720(kirby);
|
||||
}
|
||||
|
||||
void sub_08065160(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->unkD4 == 111)
|
||||
{
|
||||
if (kirby->base.base.base.unk1 == 4)
|
||||
{
|
||||
sub_08092C10(kirby);
|
||||
PlaySfx(&kirby->base.base.base, 212);
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 112;
|
||||
}
|
||||
}
|
||||
else if (kirby->unkD4 == 112)
|
||||
{
|
||||
kirby->base.base.base.flags |= 4;
|
||||
if (++kirby->base.base.base.counter > 10)
|
||||
{
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 113;
|
||||
}
|
||||
if (!(kirby->unkD8 & 7))
|
||||
PlaySfx(&kirby->base.base.base, 212);
|
||||
++kirby->unkD8;
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_0805B1B8(kirby);
|
||||
if (kirby->base.base.base.flags & 2
|
||||
|| kirby->base.base.base.unk62 & 4)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (kirby->unkD4 != 113
|
||||
&& kirby->base.base.base.unk62 & 4)
|
||||
{
|
||||
kirby->unkD4 = 113;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_0806541C(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
kirby->base.base.base.yspeed = 0x2A0;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->base.base.base.flags |= 0x20;
|
||||
kirby->unkD4 = 110;
|
||||
kirby->base.base.unk78 = sub_08065498;
|
||||
sub_0807F9EC(kirby);
|
||||
sub_08092C10(kirby);
|
||||
}
|
||||
|
||||
void sub_08065498(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_08065578(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 106;
|
||||
kirby->base.base.unk78 = sub_0806A704;
|
||||
}
|
||||
|
||||
void sub_080655E0(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
kirby->base.base.base.flags |= 4;
|
||||
if (kirby->base.base.base.counter == 6)
|
||||
{
|
||||
sub_08092C10(kirby);
|
||||
kirby->base.base.base.xspeed = 0xE0;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
kirby->base.base.base.yspeed = 0x3C0;
|
||||
kirby->base.base.base.flags |= 0x20;
|
||||
kirby->unkD4 = 108;
|
||||
PlaySfx(&kirby->base.base.base, 211);
|
||||
}
|
||||
if (kirby->unkD4 == 108 && kirby->base.base.base.unk1 == 1)
|
||||
sub_08099A60(kirby);
|
||||
if (kirby->base.base.base.counter > 15)
|
||||
{
|
||||
kirby->unkD4 = 109;
|
||||
kirby->base.base.unk78 = sub_08065778;
|
||||
}
|
||||
if (kirby->base.base.base.counter > 6)
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
++kirby->base.base.base.counter;
|
||||
}
|
||||
|
||||
void sub_08065778(struct Kirby *kirby) // identical to sub_08065498
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_08065858(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (!(kirby->unk118 & 2))
|
||||
sub_08065BD8(kirby);
|
||||
else if (++kirby->base.base.base.counter > 9)
|
||||
sub_0806A638(kirby);
|
||||
else
|
||||
{
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08065900(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
kirby->base.base.base.flags |= 4;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
if (!(kirby->unk118 & 2))
|
||||
sub_0806A674(kirby);
|
||||
else
|
||||
{
|
||||
if (kirby->base.base.base.counter <= 30
|
||||
&& ++kirby->base.base.base.counter == 30)
|
||||
kirby->unkD8 = 1;
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08065A0C(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.unk1 == 5)
|
||||
{
|
||||
if (kirby->hp == 1)
|
||||
{
|
||||
sub_0807F128(kirby);
|
||||
sub_08089B14(&kirby->base.base.base);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (kirby->base.base.base.counter > 30)
|
||||
sub_0807EF0C(kirby);
|
||||
else
|
||||
sub_0807ECE0(kirby);
|
||||
sub_08092C10(kirby);
|
||||
}
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
sub_0806A6D4(kirby);
|
||||
else
|
||||
{
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08065AF8(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_08065BD8(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
kirby->base.base.base.xspeed = 0xC0;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 53;
|
||||
kirby->base.base.unk78 = sub_08065C5C;
|
||||
sub_0807E66C(kirby);
|
||||
sub_08092C10(kirby);
|
||||
}
|
||||
|
||||
void sub_08065C5C(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.unk1 > 4 && kirby->unk11A & 2)
|
||||
{
|
||||
if (kirby->unk118 & 0x40)
|
||||
{
|
||||
sub_08065578(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->unk118 & 0x30)
|
||||
{
|
||||
sub_08064D68(kirby);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (kirby->unkD6 && kirby->unk118 & 2)
|
||||
++kirby->unkD6;
|
||||
if (kirby->unk11A & 2)
|
||||
{
|
||||
kirby->unkD6 = 1;
|
||||
if (kirby->base.base.base.unk1 > 4)
|
||||
kirby->unkD8 = 1;
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
if (kirby->unkD6 > 9)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 27;
|
||||
kirby->base.base.unk78 = sub_08065900;
|
||||
sub_0809447C(kirby);
|
||||
}
|
||||
else if (kirby->unkD8)
|
||||
sub_08065E2C(kirby);
|
||||
else
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_08065E2C(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
kirby->base.base.base.xspeed = 0x140;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 52;
|
||||
kirby->base.base.unk78 = sub_08065F28;
|
||||
sub_0807EA78(kirby);
|
||||
PlaySfx(&kirby->base.base.base, 202);
|
||||
}
|
||||
|
||||
void sub_08065F28(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.unk1 > 0xA && kirby->unk11A & 2)
|
||||
{
|
||||
if (kirby->unk118 & 0x40)
|
||||
{
|
||||
sub_08065578(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->unk118 & 0x30)
|
||||
{
|
||||
sub_08064D68(kirby);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (kirby->unkD6 && kirby->unk118 & 2)
|
||||
++kirby->unkD6;
|
||||
if (kirby->unk11A & 2)
|
||||
{
|
||||
kirby->unkD6 = 1;
|
||||
if (kirby->base.base.base.unk1 > 0xA)
|
||||
kirby->unkD8 = 1;
|
||||
}
|
||||
if (kirby->base.base.base.unk1 == 0xC)
|
||||
{
|
||||
kirby->base.base.base.xspeed = 0x1C0;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
kirby->base.base.base.yspeed = 0x220;
|
||||
kirby->base.base.base.flags |= 0x20;
|
||||
sub_08092C10(kirby);
|
||||
}
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
if (kirby->unkD6 > 9)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 27;
|
||||
kirby->base.base.unk78 = sub_08065900;
|
||||
sub_0809447C(kirby);
|
||||
}
|
||||
else if (kirby->unkD8)
|
||||
sub_08066130(kirby);
|
||||
else
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_08066130(struct Kirby *kirby)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->unk118 & 0x20)
|
||||
kirby->base.base.base.flags |= 1;
|
||||
if (kirby->unk118 & 0x10)
|
||||
kirby->base.base.base.flags &= ~1;
|
||||
kirby->base.base.base.xspeed = kirby->base.base.base.yspeed = 0;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 54;
|
||||
kirby->base.base.unk78 = sub_0806621C;
|
||||
sub_0807EBAC(kirby);
|
||||
PlaySfx(&kirby->base.base.base, 203);
|
||||
}
|
||||
|
||||
void sub_0806621C(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->base.base.base.unk1 > 6 && kirby->unk11A & 2)
|
||||
{
|
||||
if (kirby->unk118 & 0x40)
|
||||
{
|
||||
sub_08065578(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->unk118 & 0x30)
|
||||
{
|
||||
sub_08064D68(kirby);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (kirby->base.base.base.unk1 == 2)
|
||||
{
|
||||
kirby->base.base.base.yspeed = -0x60;
|
||||
kirby->base.base.base.xspeed = 0x200;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
}
|
||||
if (kirby->unkD6 && kirby->unk118 & 2)
|
||||
++kirby->unkD6;
|
||||
if (kirby->unk11A & 2)
|
||||
{
|
||||
kirby->unkD6 = 1;
|
||||
if (kirby->base.base.base.unk1 > 6)
|
||||
kirby->unkD8 = 1;
|
||||
}
|
||||
if (!(kirby->base.base.base.flags & 2))
|
||||
{
|
||||
if (kirby->base.base.base.unk62 & 4 && ++kirby->base.base.base.counter > 8)
|
||||
{
|
||||
if (kirby->base.base.base.unk56 == gUnk_0203AD3C)
|
||||
m4aSongNumStop(203);
|
||||
goto _0806631C;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_0806631C:
|
||||
if (kirby->unkD6 > 9)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->unkD4 = 27;
|
||||
kirby->base.base.unk78 = sub_08065900;
|
||||
sub_0809447C(kirby);
|
||||
}
|
||||
else
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
Macro_080435F8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
sub_0805B1B8(kirby);
|
||||
}
|
||||
|
||||
void sub_08066458(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->base.base.base.unk58 & 2)
|
||||
{
|
||||
sub_0805BA58(kirby);
|
||||
sub_08059810(kirby);
|
||||
return;
|
||||
}
|
||||
if (kirby->unkD4 == 103)
|
||||
{
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
kirby->unkD4 = 104;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->base.base.base.counter = 0;
|
||||
sub_08092C10(kirby);
|
||||
sub_0807E190(kirby);
|
||||
PlaySfx(&kirby->base.base.base, 204);
|
||||
}
|
||||
}
|
||||
else if (kirby->unkD4 == 104)
|
||||
{
|
||||
kirby->base.base.base.flags |= 4;
|
||||
if (++kirby->base.base.base.counter & 1)
|
||||
sub_0808925C(&kirby->base.base.base);
|
||||
if (kirby->unkD8)
|
||||
{
|
||||
kirby->base.base.base.xspeed = 635;
|
||||
kirby->base.base.base.yspeed = -1100;
|
||||
}
|
||||
else
|
||||
{
|
||||
kirby->base.base.base.xspeed = 900;
|
||||
kirby->base.base.base.yspeed = -900;
|
||||
}
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
if (kirby->base.base.base.unk62 & 4)
|
||||
{
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
kirby->unkD4 = 105;
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
sub_0808925C(&kirby->base.base.base);
|
||||
}
|
||||
if (kirby->base.base.base.counter > 0x80)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
kirby->base.base.base.yspeed = 0;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed;
|
||||
if (kirby->base.base.base.flags & 2)
|
||||
{
|
||||
Macro_0803FF64_6(kirby);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (kirby->base.base.base.unk62 & 1)
|
||||
kirby->base.base.base.xspeed = 0;
|
||||
}
|
||||
|
||||
void sub_080666C0(struct Kirby *kirby)
|
||||
{
|
||||
if (kirby->hp > 0
|
||||
&& kirby->unkD4 != 39
|
||||
&& kirby->unkD4 < 123
|
||||
&& !kirby->unk110
|
||||
&& !(kirby->base.base.base.flags & 0x01000300))
|
||||
{
|
||||
kirby->unkD4 = 114;
|
||||
kirby->base.base.base.counter = 0;
|
||||
kirby->unkD6 = 0;
|
||||
kirby->unkD8 = 0;
|
||||
if (kirby->base.base.base.flags & 1)
|
||||
kirby->base.base.base.xspeed = 0x180;
|
||||
else
|
||||
kirby->base.base.base.xspeed = -0x180;
|
||||
kirby->base.base.base.yspeed = 0x2A0;
|
||||
kirby->base.base.base.y -= 0x100;
|
||||
Macro_0803EA90_1(kirby);
|
||||
Macro_0803EA90_2(kirby);
|
||||
kirby->base.base.base.flags &= ~2;
|
||||
kirby->base.base.base.flags &= ~0x40;
|
||||
kirby->base.base.base.flags |= 0x20;
|
||||
kirby->base.base.base.unk62 &= ~1;
|
||||
kirby->base.base.unk78 = sub_080667E4;
|
||||
}
|
||||
}
|
||||
|
@ -15,10 +15,10 @@ void sub_08153060(struct Unk_03002400 *r4) {
|
||||
u16 b;
|
||||
u16 *c;
|
||||
|
||||
r4->unk14 = r6->unk0.unk0;
|
||||
r4->unk16 = r6->unk0.unk2;
|
||||
a = (uintptr_t)r6->unk0.unk8;
|
||||
b = r6->unk0.unkC;
|
||||
r4->unk14 = r6->unk0.width;
|
||||
r4->unk16 = r6->unk0.height;
|
||||
a = (uintptr_t)r6->unk0.tileset;
|
||||
b = r6->unk0.numTiles;
|
||||
if (!(r4->unk2E & 8)) {
|
||||
gUnk_03002EC0[gUnk_030039A4].unk0 = a;
|
||||
gUnk_03002EC0[gUnk_030039A4].unk4 = r4->unk4;
|
||||
@ -26,9 +26,9 @@ void sub_08153060(struct Unk_03002400 *r4) {
|
||||
gUnk_030039A4 = (gUnk_030039A4 + 1) & 0x3F;
|
||||
r4->unk2E ^= 8;
|
||||
}
|
||||
c = r6->unk0.unk10;
|
||||
a = r6->unk0.unk16;
|
||||
r4->unk2A = r6->unk0.unk14;
|
||||
c = r6->unk0.palette;
|
||||
a = r6->unk0.paletteSize;
|
||||
r4->unk2A = r6->unk0.paletteOffset;
|
||||
if (!(r4->unk2E & 0x10)) {
|
||||
if (gUnk_03002440 & 0x10000)
|
||||
sub_08158334(c, r4->unk2A, a);
|
||||
@ -38,9 +38,9 @@ void sub_08153060(struct Unk_03002400 *r4) {
|
||||
}
|
||||
r4->unk2E ^= 0x10;
|
||||
}
|
||||
r4->unk10 = r6->unk0.unk18;
|
||||
r4->unk10 = r6->unk0.tilemap;
|
||||
if (r4->unk2E & 0x40) { // Can we actually trigger this condition?
|
||||
r4->unk38 = r6->unk0.unk1C;
|
||||
r4->unk38 = r6->unk0.roomId;
|
||||
r4->unk3C = r6->unk20;
|
||||
r4->unk3E = r6->unk22;
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ void sub_08153CB8(struct Unk_03002400 *ip) {
|
||||
r5 = r3->unk4;
|
||||
if (!(ip->unk2E & 0x200)) {
|
||||
if (!ip->unk2B)
|
||||
r4 = (uintptr_t)r3->unk8;
|
||||
r4 = (uintptr_t)r3->tileset;
|
||||
else
|
||||
r4 = (uintptr_t)r3->unk8 + r3->unkC + (ip->unk2B-1) * r5;
|
||||
r4 = (uintptr_t)r3->tileset + r3->numTiles + (ip->unk2B-1) * r5;
|
||||
} else {
|
||||
r4 = ip->unk4 + r3->unkC + ip->unk2B * r5;
|
||||
r4 = ip->unk4 + r3->numTiles + ip->unk2B * r5;
|
||||
}
|
||||
gUnk_03002EC0[gUnk_030039A4].unk0 = r4;
|
||||
gUnk_03002EC0[gUnk_030039A4].unk4 = ip->unk4;
|
||||
|
Loading…
Reference in New Issue
Block a user