Merge pull request #178 from AntonioCastelli/decomp

Decompiled four non-matching functions.
This commit is contained in:
AntonioCastelli
2021-12-01 19:47:11 -08:00
committed by GitHub
5 changed files with 463 additions and 87 deletions
+7 -3
View File
@@ -450,7 +450,8 @@ typedef struct LevelModel {
/* Size: 8 bytes. */
typedef struct LevelObjectEntryCommon {
u16 id; // Upper 9 bits = Object ID to load, Lower 7 bits = Total entry length.
u8 object_id; // 9-bit object ID to load (uses size'a MSB).
u8 size; // 7-bit total entry length (MSB is used in object_id).
s16 x, y, z; // Position in level
} LevelObjectEntryCommon;
@@ -607,7 +608,9 @@ typedef struct Object_64 {
u8 unkFC;
u8 padFD[0xB];
s32 unk108;
u8 pad10C[0x54];
u8 pad10C[0xC];
s32 unk118;
u8 pad11C[0x44];
s16 unk160;
s16 unk162;
s16 unk164;
@@ -618,7 +621,8 @@ typedef struct Object_64 {
u8 unk193;
u8 pad194[0x26];
u16 unk1BA;
u8 pad1BC[0x1B];
u8 pad1BC[0x1A];
s8 unk1D6;
s8 unk1D7;
u8 pad1D8[0x1A];
u8 unk1F2;
+149
View File
@@ -117,7 +117,156 @@ void func_80072708(void) {
}
GLOBAL_ASM("asm/non_matchings/controller_pak/func_80072718.s")
#ifdef NON_MATCHING
s32 func_80072C54(s32 arg0) {
// v0 v1 a1 a2 a3 t0 t1 t2 t3 t4 t5 t6 t7 t8
u32 v0;
u32 v1;
s32 a1;
u32 a2;
u8 *a3;
s32 t0;
u32 *t1;
u32 *t2;
u8 **t3;
u32 t4;
u32 t5;
u32 t6;
u32 t7;
u32 t8;
u32 t9;
v1 = 0;
if (arg0 <= 0) {
return v1;
}
// L80072C64
v0 = 1 << (arg0 + 0x1F);
if (arg0 != 0) {
a1 = -(arg0 & 3);
t0 = a1 + arg0;
if (a1 != 0) {
// L80072CA0
do {
a2 = D_801241F4;
a1 = arg0 - 1;
t6 = v0 >> 1;
if (a2 == 0) {
a3 = D_801241EC;
a2 = 0x80;
t8 = *a3;
D_801241EC = a3 + 1;
D_801241F4 = 0x80;
D_801241F0 = t8;
}
// L80072CCC
arg0 = a1;
if (D_801241F0 & a2 != 0) {
v1 |= v0;
}
// L80072CE4
v0 = t6;
D_801241F4 = a2 >> 1;
} while (t0 != a1);
if (a1 == 0) {
return v1; // should jump to end
}
}
// L80072CF4
t1 = &D_801241F4;
t2 = &D_801241F0;
t3 = &D_801241EC;
t4 = 128;
// L80072D10
do {
a2 = *t1;
t6 = v0 >> 1;
arg0 -= 4;
if (a2 == 0) {
a3 = *t3;
a2 = t4;
t9 = *a3;
*t3 = a3 + 1;
*t1 = t4;
*t2 = t9;
}
// L80072D3C
a1 = *t2;
t8 = a2 << 1;
t7 = a1 & a2;
a2 = t8;
if (t7 != 0) {
v1 |= v0;
}
// L80072D54
v0 = t6;
*t1 = t8;
if (t8 == 0) {
a3 = *t3;
a2 = t4;
a1 = *a3;
*t3 = a3 + 1;
*t1 = t4;
*t2 = a1;
}
// L80072D7C
t7 = a1 & a2;
t6 = v0 >> 1;
if (t7 != 0) {
v1 |= v0;
}
// L80072D8C
t8 = a2 >> 1;
*t1 = t8;
a2 = t8;
v0 = t6;
if (t8 == 0) {
a3 = *t3;
a2 = t4;
a1 = *a3;
*t3 = a3 + 1;
*t1 = t4;
*t2 = a1;
}
// L80072DBC
t7 = a1 & a2;
t6 = v0 >> 1;
if (t7 != 0) {
v1 |= v0;
}
// L80072DCC
t8 = a2 >> 1;
*t1 = t8;
a2 = t8;
v0 = t6;
if (t8 == 0) {
a3 = *t3;
a2 = t4;
a1 = *a3;
*t3 = a3 + 1;
*t1 = t4;
*t2 = a1;
}
// L80072DFC
t7 = a1 & a2;
t6 = v0 >> 1;
if (t7 != 0) {
v1 |= v0;
}
// L80072E0C
t8 = a2 >> 1;
*t1 = t8;
v0 = t6;
} while (arg0 != 0);
}
// L80072E1C
return v1;
}
#else
GLOBAL_ASM("asm/non_matchings/controller_pak/func_80072C54.s")
#endif
GLOBAL_ASM("asm/non_matchings/controller_pak/func_80072E28.s")
GLOBAL_ASM("asm/non_matchings/controller_pak/func_8007306C.s")
GLOBAL_ASM("asm/non_matchings/controller_pak/func_800732E8.s")
+253 -83
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -211,7 +211,7 @@ s8 func_8002341C(void);
s32 func_80023568(void);
s8 func_800235C0(void);
void func_800235D0(s32 arg0);
void func_800238BC(Object *arg0);
void func_800238BC(Object *arg0, void *arg1);
void run_object_loop_func(Object *obj, s32 arg1);
void func_8002458C(s32 arg0);
s16 *func_80024594(s32 *arg0, s32 *arg1);
+53
View File
@@ -1184,7 +1184,60 @@ void obj_loop_world_key(Object *worldKeyObj, s32 speed) {
worldKeyObj->y_rotation += speed * 256;
}
#ifdef NON_MATCHING
typedef struct unknown_struct_8003DFCC {
u8 pad0[8];
u8 unk8;
u8 unk9;
u8 unkA;
} unknown_struct_8003DFCC;
void func_8003DFCC(Object *arg0, unknown_struct_8003DFCC *arg1) {
f32 temp_f0;
s32 temp_v0;
Object_64 *temp_v0_2;
f32 phi_f0;
arg0->unk4C->unk14 = 2;
arg0->unk4C->unk11 = 4;
arg0->unk4C->unk10 = 0x14;
temp_v0 = get_filtered_cheats();
if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_BLUE) {
arg1->unk9 = 0U;
} else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_RED) {
arg1->unk9 = 1U;
} else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_GREEN) {
arg1->unk9 = 2U;
} else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_YELLOW) {
arg1->unk9 = 3U;
} else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_RAINBOW) {
arg1->unk9 = 4U;
}
if ((s32) arg1->unk8 >= 6) {
arg1->unk8 = 0U;
}
if ((s32) arg0->unk3A >= (s32) arg0->descriptor_ptr->unk55) {
arg0->unk3A = 0;
}
arg0->unk3A = (s8) arg1->unk9;
arg0->unk78 = (s32) arg0->unk3A;
phi_f0 = arg1->unkA;
if (arg1->unkA < 10.0f) {
phi_f0 = 10.0f;
}
temp_f0 = phi_f0 / 64.0f;
arg0->scale = (f32) (arg0->descriptor_ptr->unkC * temp_f0);
arg0->unk64->unk4 = 0;
arg0->unk64->unk0_a.unk0 = arg0->scale;
arg0->unk7C.word = 0;
if (get_filtered_cheats() & CHEAT_DISABLE_WEAPONS) {
gParticlePtrList_addObject(arg0);
}
}
#else
GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003DFCC.s")
#endif
GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003E140.s")
void func_8003E5B0(s32 arg0, s32 arg1) {