move declarations; a little research

This commit is contained in:
Zhengwen Jiang 2022-02-08 09:39:41 -06:00 committed by Cleverking2003
parent 631bdff499
commit 9be6447dea
8 changed files with 34 additions and 31 deletions

View File

@ -35,13 +35,15 @@ struct Unk_02023720 {
u32 unk0C;
};
#include "sprite.h"
struct LevelInfo_1A0 {
u16 unk0;
u16 unk2;
u16 unk4;
u8 unk6;
u8 unk7;
u32 unk8;
void *unk8;
u32 unkC;
u16 *unk10;
u16 unk14;
@ -117,7 +119,7 @@ struct LevelInfo {
u16 unkBA;
u16 roomWidth;
u16 roomHeight;
u8 fillerC0[0xC0];
struct Unk_03002400 unkC0[3];
struct LevelInfo_1A0 unk180[3];
struct Unk_0888562C *unk1E0;
const struct LevelInfo_1E4 *objlistPtr;
@ -129,7 +131,7 @@ struct LevelInfo {
u16 unk5FA;
u8 filler5FC[0x40];
u8 filler63C[0x20];
u16 filler65C;
u16 unk65C;
u8 unk65E;
u8 unk65F[3];
u16 unk662;
@ -164,8 +166,6 @@ struct Object {
u16 unk22;
};
#include "sprite.h"
struct ObjectBase {
u8 unk0;
u8 unk1;
@ -649,6 +649,7 @@ extern const u8 gUnk_08D61120[];
extern const struct Unk_08353510 *const gUnk_08D6112C[];
extern const union __attribute__((transparent_union)) {
const struct LevelInfo_1A0 *unk; // might be another struct
// probably never used (removed debug data right before gLevelObjLists? )
const struct LevelInfo_1E4 *obj;
} gLevelObjLists[287];

View File

@ -66,28 +66,7 @@ struct Unk_02022930_0 *sub_0803CAE4(u8);
void sub_0803CFC4(u8, u16, u8, s8, s8, s8, u16); /* TODO: signed vs unsigned */
void sub_0803D280(u8, u8);
void sub_0803D2A8(u8, u8);
struct Kirby *sub_0803D368(struct ObjectBase *);
struct Kirby *sub_0803D46C(struct ObjectBase *);
struct Kirby *sub_0803D5CC(struct ObjectBase *);
u16 sub_0803D6B4(struct Object2*);
void sub_0803DBC8(struct Object4 *);
void sub_0803DCCC(struct Task*);
u32 sub_0803DD58(u8);
u32 sub_0803DE54(u32, u16, u8);
u8 sub_0803DF24(u16);
u8 sub_0803DFAC(u16, u8);
void sub_0803E2B0(struct ObjectBase*, s8, s8, s8, s8);
void sub_0803E308(struct ObjectBase*, s8, s8, s8, s8);
void sub_0803E380(struct ObjectBase*);
void sub_0803E3B0(struct Object4 *);
void sub_0803E458(void);
void sub_0803E4D4(u8);
void sub_0803E558(u8);
void sub_08044EA8(struct Kirby *);
void sub_080476C4(struct Kirby *);
void sub_08047EF0(struct Kirby *);
u8 sub_0804BAD8(struct Kirby *);
void sub_0804D9D4(struct Kirby *);
void sub_0804F894(struct Kirby *);
bool8 sub_080525C0(struct Kirby *);
void sub_08052BB4(struct Kirby *);

View File

@ -71,4 +71,25 @@ struct Kirby {
extern struct Kirby gKirbys[];
struct Kirby *sub_0803D368(struct ObjectBase *);
struct Kirby *sub_0803D46C(struct ObjectBase *);
struct Kirby *sub_0803D5CC(struct ObjectBase *);
u16 sub_0803D6B4(struct Object2*);
void sub_0803DBC8(struct Object4 *);
void sub_0803DCCC(struct Task *);
u32 sub_0803DD58(u8);
u32 sub_0803DE54(u32, u16, u8);
u8 sub_0803DF24(u16);
u8 sub_0803DFAC(u16, u8);
void sub_0803E2B0(struct ObjectBase *, s8, s8, s8, s8);
void sub_0803E308(struct ObjectBase *, s8, s8, s8, s8);
void sub_0803E380(struct ObjectBase*);
void sub_0803E3B0(struct Object4 *);
void sub_0803E458(void);
void sub_0803E4D4(u8);
void sub_0803E558(u8);
void sub_08044EA8(struct Kirby *);
void sub_08047EF0(struct Kirby *);
u8 sub_0804BAD8(struct Kirby *);
#endif

View File

@ -1,5 +1,6 @@
#include "gordo.h"
#include "object.h"
#include "kirby.h"
static void GordoInitType0(struct Object2*);
static void GordoInitType1(struct Object2*);

View File

@ -53,6 +53,7 @@ void sub_080463BC(struct Kirby *);
void sub_080464AC(struct Kirby *);
void sub_08046D60(struct Kirby *);
void sub_08046E10(struct Kirby *);
void sub_080476C4(struct Kirby *);
void sub_08047814(struct Kirby *);
void sub_08047EF0(struct Kirby *);
void sub_0804805C(struct Kirby *);
@ -79,6 +80,7 @@ void sub_0804CE74(struct Kirby *);
void sub_0804D0A4(struct Kirby *);
void sub_0804D2DC(struct Kirby *);
void sub_0804D4E4(struct Kirby *);
void sub_0804D9D4(struct Kirby *);
extern const struct Unk_02021590 gUnk_0834D918[], gUnk_0834D940[], gUnk_0834EC24[];
extern const struct Unk_02021590 *const gUnk_08D60FB4[], *const gUnk_08D60FDC[];

View File

@ -17,7 +17,7 @@ void sub_08153060(struct Unk_03002400 *r4) {
r4->unk14 = r6->unk0.unk0;
r4->unk16 = r6->unk0.unk2;
a = r6->unk0.unk8;
a = (uintptr_t)r6->unk0.unk8;
b = r6->unk0.unkC;
if (!(r4->unk2E & 8)) {
gUnk_03002EC0[gUnk_030039A4].unk0 = a;

View File

@ -15,9 +15,9 @@ void sub_08153CB8(struct Unk_03002400 *ip) {
r5 = r3->unk4;
if (!(ip->unk2E & 0x200)) {
if (!ip->unk2B)
r4 = r3->unk8;
r4 = (uintptr_t)r3->unk8;
else
r4 = r3->unk8 + r3->unkC + (ip->unk2B-1) * r5;
r4 = (uintptr_t)r3->unk8 + r3->unkC + (ip->unk2B-1) * r5;
} else {
r4 = ip->unk4 + r3->unkC + ip->unk2B * r5;
}

View File

@ -94,7 +94,6 @@ void sub_0815604C(struct Sprite *sb) {
}
}
do ; while (0); // boom!
r4->all.attr0 += ((sl + r5) & 0xFF);
r4->all.attr1 += ((sp00 + r7) & 0x1FF);
r4->all.attr0 |= sp14;