From 59d6788c073d83ca3d2e213cc1d4432ed42785d2 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sun, 4 Jul 2021 13:54:21 -0700 Subject: [PATCH 01/10] Decompiled non-matching func_80072C54. --- src/controller_pak.c | 149 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/src/controller_pak.c b/src/controller_pak.c index b74fb724..a54edf70 100644 --- a/src/controller_pak.c +++ b/src/controller_pak.c @@ -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") From dc42f58661a966c00e4ef9e12b4d36ca1c7902a9 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 24 Jul 2021 21:27:06 -0700 Subject: [PATCH 02/10] Added 2nd argument to func_800238BC. --- src/unknown_00BC20.c | 168 ++++++++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 82 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 1c70d66d..a930c31b 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1441,264 +1441,268 @@ void func_800235D0(s32 arg0) { GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_800235DC.s") +<<<<<<< HEAD void func_800238BC(Object *arg0) { +======= +void func_800238BC(Object *arg0, void *arg1) { +>>>>>>> Added 2nd argument to func_800238BC. arg0->unk48 = arg0->descriptor_ptr->unk54; switch (arg0->unk48 - 1) { case 0x00: - func_8004DAB0(arg0); + func_8004DAB0(arg0, arg1); break; case 0x01: - func_80033CC0(arg0); + func_80033CC0(arg0, arg1); break; case 0x02: - func_80036C30(arg0); + func_80036C30(arg0, arg1); break; case 0x03: - func_800376E0(arg0); + func_800376E0(arg0, arg1); break; case 0x05: - func_800389AC(arg0); + func_800389AC(arg0, arg1); break; case 0x18: - func_80038A6C(arg0); + func_80038A6C(arg0, arg1); break; case 0x15: - func_80038B74(arg0); + func_80038B74(arg0, arg1); break; case 0x06: - func_80038E3C(arg0); + func_80038E3C(arg0, arg1); break; case 0x07: - func_8003FD68(arg0); + func_8003FD68(arg0, arg1); break; case 0x08: case 0x12: - func_8003FEF4(arg0); + func_8003FEF4(arg0, arg1); break; case 0x1A: - func_8004001C(arg0); + func_8004001C(arg0, arg1); break; case 0x09: - func_80039160(arg0); + func_80039160(arg0, arg1); break; case 0x0A: - func_80039190(arg0); + func_80039190(arg0, arg1); break; case 0x0B: - func_800391C8(arg0); + func_800391C8(arg0, arg1); break; case 0x0C: - func_8003ACBC(arg0); + func_8003ACBC(arg0, arg1); break; case 0x1D: - func_8003AD34(arg0); + func_8003AD34(arg0, arg1); break; case 0x28: - func_8003B058(arg0); + func_8003B058(arg0, arg1); break; case 0x0D: - func_8003B7CC(arg0); + func_8003B7CC(arg0, arg1); break; case 0x6E: - func_8003C1E0(arg0); + func_8003C1E0(arg0, arg1); break; case 0x0E: - func_8003CF18(arg0); + func_8003CF18(arg0, arg1); break; case 0x0F: - func_8003CFE0(arg0); + func_8003CFE0(arg0, arg1); break; case 0x10: - func_8003DFCC(arg0); + func_8003DFCC(arg0, arg1); break; case 0x16: - func_8003E5B0(arg0); + func_8003E5B0(arg0, arg1); break; case 0x04: case 0x11: - func_8003E5C8(arg0); + func_8003E5C8(arg0, arg1); break; case 0x19: - func_8003CF58(arg0); + func_8003CF58(arg0, arg1); break; case 0x1B: - func_80034AF0(arg0); + func_80034AF0(arg0, arg1); break; case 0x1C: - func_800400A4(arg0); + func_800400A4(arg0, arg1); break; case 0x1E: - func_80036194(arg0); + func_80036194(arg0, arg1); break; case 0x1F: - func_8003D534(arg0); + func_8003D534(arg0, arg1); break; case 0x20: - func_800403A8(arg0); + func_800403A8(arg0, arg1); break; case 0x23: - func_800403D8(arg0); + func_800403D8(arg0, arg1); break; case 0x42: - func_8004049C(arg0); + func_8004049C(arg0, arg1); break; case 0x24: - func_80040800(arg0); + func_80040800(arg0, arg1); break; case 0x25: - func_8003C9EC(arg0); + func_8003C9EC(arg0, arg1); break; case 0x26: - func_8003CE64(arg0); + func_8003CE64(arg0, arg1); break; case 0x27: - func_8003CF00(arg0); + func_8003CF00(arg0, arg1); break; case 0x2A: - func_8004092C(arg0); + func_8004092C(arg0, arg1); break; case 0x2B: - func_8004094C(arg0); + func_8004094C(arg0, arg1); break; case 0x2C: - func_8003522C(arg0); + func_8003522C(arg0, arg1); break; case 0x2D: - func_80035640(arg0); + func_80035640(arg0, arg1); break; case 0x2E: - func_80035EF8(arg0); + func_80035EF8(arg0, arg1); break; case 0x30: - func_80037A18(arg0); + func_80037A18(arg0, arg1); break; case 0x33: - func_80038854(arg0); + func_80038854(arg0, arg1); break; case 0x36: - func_8003C644(arg0); + func_8003C644(arg0, arg1); break; case 0x38: case 0x5C: - func_8003588C(arg0); + func_8003588C(arg0, arg1); break; case 0x39: - func_80035E20(arg0); + func_80035E20(arg0, arg1); break; case 0x3A: - func_800409A4(arg0); + func_800409A4(arg0, arg1); break; case 0x3C: - func_800409C8(arg0); + func_800409C8(arg0, arg1); break; case 0x3D: - func_800392B8(arg0); + func_800392B8(arg0, arg1); break; case 0x3F: - func_8003DE74(arg0); + func_8003DE74(arg0, arg1); break; case 0x40: - func_8003D3EC(arg0); + func_8003D3EC(arg0, arg1); break; case 0x41: - func_8003D038(arg0); + func_8003D038(arg0, arg1); break; case 0x43: - func_80037578(arg0); + func_80037578(arg0, arg1); break; case 0x44: - func_80037624(arg0); + func_80037624(arg0, arg1); break; case 0x45: case 0x66: - func_8003818C(arg0); + func_8003818C(arg0, arg1); break; case 0x47: case 0x5E: case 0x67: - func_800381E0(arg0); + func_800381E0(arg0, arg1); break; case 0x5F: case 0x64: - func_80038214(arg0); + func_80038214(arg0, arg1); break; case 0x60: case 0x65: - func_80038248(arg0); + func_80038248(arg0, arg1); break; case 0x46: - func_80041A90(arg0); + func_80041A90(arg0, arg1); break; case 0x6F: - func_80041E80(arg0); + func_80041E80(arg0, arg1); break; case 0x75: - func_80042014(arg0); + func_80042014(arg0, arg1); break; case 0x48: - func_80034B68(arg0); + func_80034B68(arg0, arg1); break; case 0x49: - func_80034E70(arg0); + func_80034E70(arg0, arg1); break; case 0x4A: - func_8004203C(arg0); + func_8004203C(arg0, arg1); break; case 0x4B: - func_8003D2AC(arg0); + func_8003D2AC(arg0, arg1); break; case 0x4C: - func_8003B368(arg0); + func_8003B368(arg0, arg1); break; case 0x4D: - func_80034844(arg0); + func_80034844(arg0, arg1); break; case 0x4E: - func_80034530(arg0); + func_80034530(arg0, arg1); break; case 0x51: - func_80035AE8(arg0); + func_80035AE8(arg0, arg1); break; case 0x52: - func_80037D54(arg0); + func_80037D54(arg0, arg1); break; case 0x53: - func_80037D6C(arg0); + func_80037D6C(arg0, arg1); break; case 0x58: - func_8004210C(arg0); + func_8004210C(arg0, arg1); break; case 0x57: - func_8003DC5C(arg0); + func_8003DC5C(arg0, arg1); break; case 0x59: - func_80038AC8(arg0); + func_80038AC8(arg0, arg1); break; case 0x5D: - func_80042150(arg0); + func_80042150(arg0, arg1); break; case 0x61: - func_80038D58(arg0); + func_80038D58(arg0, arg1); break; case 0x62: case 0x63: - func_8003572C(arg0); + func_8003572C(arg0, arg1); break; case 0x68: - func_8004216C(arg0); + func_8004216C(arg0, arg1); break; case 0x6B: case 0x73: - func_80033F44(arg0); + func_80033F44(arg0, arg1); break; case 0x6C: - func_80042210(arg0); + func_80042210(arg0, arg1); break; case 0x6D: - func_8003DBA0(arg0); + func_8003DBA0(arg0, arg1); break; case 0x74: - func_80042A1C(arg0); + func_80042A1C(arg0, arg1); break; } } From cc8b39a13289e0dd82f6b7fdf7915492d8c36fae Mon Sep 17 00:00:00 2001 From: Antonio Date: Sun, 25 Jul 2021 13:41:05 -0700 Subject: [PATCH 03/10] Decompiled non-matching func_8003DFCC. --- src/unknown_00BC20.c | 4 ---- src/unknown_00BC20.h | 2 +- src/unknown_0348C0.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index a930c31b..f88ceae4 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1441,11 +1441,7 @@ void func_800235D0(s32 arg0) { GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_800235DC.s") -<<<<<<< HEAD -void func_800238BC(Object *arg0) { -======= void func_800238BC(Object *arg0, void *arg1) { ->>>>>>> Added 2nd argument to func_800238BC. arg0->unk48 = arg0->descriptor_ptr->unk54; switch (arg0->unk48 - 1) { case 0x00: diff --git a/src/unknown_00BC20.h b/src/unknown_00BC20.h index 571e2833..833fb3bf 100644 --- a/src/unknown_00BC20.h +++ b/src/unknown_00BC20.h @@ -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); diff --git a/src/unknown_0348C0.c b/src/unknown_0348C0.c index a906c5e0..d5eca7eb 100644 --- a/src/unknown_0348C0.c +++ b/src/unknown_0348C0.c @@ -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 & 0x20000) { + arg1->unk9 = 0U; + } else if (temp_v0 & 0x08000) { + arg1->unk9 = 1U; + } else if (temp_v0 & 0x10000) { + arg1->unk9 = 2U; + } else if (temp_v0 & 0x40000) { + arg1->unk9 = 3U; + } else if (temp_v0 & 0x80000) { + 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() & 0x800) != 0) { + 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) { From 20218089a85b37d1663c4a64c0192ec8ec8920b7 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 9 Sep 2021 20:08:49 -0700 Subject: [PATCH 04/10] Decompiled non-matching func_80023E30. --- src/unknown_00BC20.c | 104 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index f88ceae4..07b19730 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -1703,7 +1703,111 @@ void func_800238BC(Object *arg0, void *arg1) { } } +#ifdef NON_MATCHING +s32 func_80023E30(s32 arg0) { + switch (arg0 - 1) { + case 0x00: + return 0x1F; + case 0x01: + return 0x13; + case 0x04: + return 0x16; + case 0x0B: + return 0x1B; + case 0x0D: + case 0x6E: + return 0x30; + case 0x10: + case 0x4C: + return 0x12; + case 0x45: + case 0x47: + case 0x5F: + case 0x60: + return 0x3B; + case 0x64: + case 0x65: + case 0x66: + case 0x67: + return 0x3A; + case 0x17: + return 0x04; + case 0x1E: + return 0x1B; + case 0x1F: + case 0x3F: + case 0x57: + case 0x6D: + return 0x12; + case 0x42: + return 0x30; + case 0x25: + return 0x39; + case 0x26: + return 0x12; + case 0x27: + return 0x09; + case 0x2C: + return 0x12; + case 0x2F: + return 0x09; + case 0x3E: + return 0x09; + case 0x31: + case 0x37: + case 0x4F: + case 0x53: + case 0x55: + case 0x72: + return 0x0B; + case 0x35: + return 0x0B; + case 0x49: + case 0x5E: + case 0x62: + case 0x63: + return 0x31; + case 0x5A: + return 0x01; + case 0x50: + return 0x0A; + case 0x06: + case 0x0C: + case 0x11: + case 0x19: + case 0x1D: + case 0x23: + case 0x28: + case 0x33: + case 0x36: + case 0x38: + case 0x43: + case 0x4D: + case 0x4E: + case 0x5C: + case 0x61: + case 0x6B: + case 0x73: + return 0x10; + case 0x51: + return 0x12; + case 0x30: + case 0x32: + case 0x3C: + return 0x02; + case 0x3D: + return 0x1B; + case 0x6C: + return 0x0B; + case 0x71: + return 0x01; + default: + return 0x00; + } +} +#else GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_80023E30.s") +#endif void run_object_loop_func(Object *obj, s32 arg1) { func_800B76B8(1, obj->unk4A); From fd91f18e921b3187e8874dcc1146a696aeaec9b9 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 9 Sep 2021 19:09:10 -0700 Subject: [PATCH 05/10] Decompiled func_8000E2B4. --- src/unknown_00BC20.c | 87 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 07b19730..9aa95ea9 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -601,6 +601,93 @@ void func_8000E1EC(Object *object, s32 arg1) { } GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") +<<<<<<< HEAD +======= +#else +typedef struct LevelObjectEntry8000E2B4 { + struct LevelObjectEntryCommonSplit { + u8 object_id;//2c + u8 size;//2d + s16 x, y, z;//2e,30,32 + } common; + s16 unk8;//34 + s16 unkA;//36 + s16 unkC;//38 + s16 unkE;//3a +} LevelObjectEntry8000E2B4; + +void func_8000E2B4(void) { + LevelObjectEntry8000E2B4 sp2C; + Settings *settings; + Object *player; + Object_64 *player_64; +<<<<<<< HEAD + s16 object_id; +======= + s16 phi_v1; +>>>>>>> Decompiled func_8000E2B4. + + if (D_8011AD44 == 0) { + return; + } + D_8011AD44 = (s8) (D_8011AD44 - 1); + if (D_8011AD44 != 0) { + return; + } + settings = get_settings(); + sp2C.unkE = 0; + sp2C.common.size = 0x10; + if (D_8011AD45 < 5) { +<<<<<<< HEAD + object_id = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; + } else { + object_id = D_800DC800[D_8011AD45 + 37]; + } + func_8006DB14(D_8011AD45); + sp2C.common.size = sp2C.common.size | ((s32) (object_id & 0x100) >> 1); + sp2C.unkA = 0; + sp2C.unk8 = 0; + sp2C.common.object_id = (s8) object_id; +======= + phi_v1 = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; + } else { + phi_v1 = D_800DC800[D_8011AD45 + 37]; + } + func_8006DB14(D_8011AD45); + sp2C.common.size = sp2C.common.size | ((s32) (phi_v1 & 0x100) >> 1); + sp2C.unkA = 0; + sp2C.unk8 = 0; + sp2C.common.object_id = (s8) phi_v1; +>>>>>>> Decompiled func_8000E2B4. + sp2C.common.x = D_8011AD46; + sp2C.common.y = D_8011AD48; + sp2C.common.z = D_8011AD4A; + sp2C.unkC = D_8011AD4C; + func_800521B8(1); + player = func_8000EA54(&sp2C, 0x11); + gObjectCount = 1; + (*gObjectStructArrayPtr)[0] = (s32) player; + *D_8011AEEC = (s32) player; + *D_8011AEE8 = (s32) player; + player_64 = player->unk64; + player_64->unk1D6 = (s8) D_8011AD45; + player_64->unk0_a.unk0_b.unk2 = (u8)0; + player_64->unk1D7 = (s8) D_8011AD45; + player_64->unk0_a.unk0_b.unk0 = (u16)0; + player_64->unk118 = 0; + player_64->unk0_a.unk0_b.unk3 = (s8) settings->racers[0].character; + if ((get_filtered_cheats() & 0x10) != 0) { + player->scale *= 1.4f; + } + if ((get_filtered_cheats() & 0x20) != 0) { + player->scale *= 0.714f; + } + player->unk3C_a.unk3C = 0; + player->y_rotation = D_8011AD4C; + player->y_position = D_8011AD48; +} +#endif +>>>>>>> c0e8460... Decompiled func_8000E2B4. /** * Enables or Disables time trial mode. From 074fe8bf4b4d8d6bac2a738f01859d3cff1d8f57 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 28 Oct 2021 22:50:19 -0700 Subject: [PATCH 06/10] Decompiled non-matching func_8000E2B4. --- include/structs.h | 3 ++- src/unknown_00BC20.c | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/structs.h b/include/structs.h index f19d4c1a..41a5bf66 100644 --- a/include/structs.h +++ b/include/structs.h @@ -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; diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 9aa95ea9..89aa151b 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -600,20 +600,20 @@ void func_8000E1EC(Object *object, s32 arg1) { gObjectCount = 0; } +<<<<<<< HEAD GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") <<<<<<< HEAD ======= #else +======= +#ifdef NON_MATCHING +>>>>>>> 935635f... Decompiled non-matching func_8000E2B4. typedef struct LevelObjectEntry8000E2B4 { - struct LevelObjectEntryCommonSplit { - u8 object_id;//2c - u8 size;//2d - s16 x, y, z;//2e,30,32 - } common; - s16 unk8;//34 - s16 unkA;//36 - s16 unkC;//38 - s16 unkE;//3a + LevelObjectEntryCommon common; + s16 unk8; + s16 unkA; + s16 unkC; + s16 unkE; } LevelObjectEntry8000E2B4; void func_8000E2B4(void) { @@ -641,7 +641,7 @@ void func_8000E2B4(void) { <<<<<<< HEAD object_id = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; } else { - object_id = D_800DC800[D_8011AD45 + 37]; + object_id = D_800DC7B8[D_8011AD45 + 37]; } func_8006DB14(D_8011AD45); sp2C.common.size = sp2C.common.size | ((s32) (object_id & 0x100) >> 1); @@ -686,6 +686,8 @@ void func_8000E2B4(void) { player->y_rotation = D_8011AD4C; player->y_position = D_8011AD48; } +#else +GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") #endif >>>>>>> c0e8460... Decompiled func_8000E2B4. From d92f002bcad5266b5c64f9854f96a1b6b13ce053 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sun, 7 Nov 2021 21:02:45 -0800 Subject: [PATCH 07/10] Fixed some merge conflicts. --- src/unknown_00BC20.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 89aa151b..794f4dd4 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -600,14 +600,7 @@ void func_8000E1EC(Object *object, s32 arg1) { gObjectCount = 0; } -<<<<<<< HEAD -GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") -<<<<<<< HEAD -======= -#else -======= #ifdef NON_MATCHING ->>>>>>> 935635f... Decompiled non-matching func_8000E2B4. typedef struct LevelObjectEntry8000E2B4 { LevelObjectEntryCommon common; s16 unk8; @@ -621,11 +614,7 @@ void func_8000E2B4(void) { Settings *settings; Object *player; Object_64 *player_64; -<<<<<<< HEAD s16 object_id; -======= - s16 phi_v1; ->>>>>>> Decompiled func_8000E2B4. if (D_8011AD44 == 0) { return; @@ -638,7 +627,6 @@ void func_8000E2B4(void) { sp2C.unkE = 0; sp2C.common.size = 0x10; if (D_8011AD45 < 5) { -<<<<<<< HEAD object_id = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; } else { object_id = D_800DC7B8[D_8011AD45 + 37]; @@ -648,17 +636,6 @@ void func_8000E2B4(void) { sp2C.unkA = 0; sp2C.unk8 = 0; sp2C.common.object_id = (s8) object_id; -======= - phi_v1 = ((s16*)D_800DC7A8)[settings->racers[0].character + D_8011AD45 * 10]; - } else { - phi_v1 = D_800DC800[D_8011AD45 + 37]; - } - func_8006DB14(D_8011AD45); - sp2C.common.size = sp2C.common.size | ((s32) (phi_v1 & 0x100) >> 1); - sp2C.unkA = 0; - sp2C.unk8 = 0; - sp2C.common.object_id = (s8) phi_v1; ->>>>>>> Decompiled func_8000E2B4. sp2C.common.x = D_8011AD46; sp2C.common.y = D_8011AD48; sp2C.common.z = D_8011AD4A; @@ -689,7 +666,6 @@ void func_8000E2B4(void) { #else GLOBAL_ASM("asm/non_matchings/unknown_00BC20/func_8000E2B4.s") #endif ->>>>>>> c0e8460... Decompiled func_8000E2B4. /** * Enables or Disables time trial mode. From ff307982e5ee1d8a7c552cbc202510d49dd536f9 Mon Sep 17 00:00:00 2001 From: AntonioCastelli Date: Wed, 1 Dec 2021 19:19:14 -0800 Subject: [PATCH 08/10] Use magic code macros Co-authored-by: Faschz --- src/unknown_00BC20.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 794f4dd4..0a97609c 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -653,7 +653,7 @@ void func_8000E2B4(void) { player_64->unk0_a.unk0_b.unk0 = (u16)0; player_64->unk118 = 0; player_64->unk0_a.unk0_b.unk3 = (s8) settings->racers[0].character; - if ((get_filtered_cheats() & 0x10) != 0) { + if (get_filtered_cheats() & CHEAT_BIG_CHARACTERS) { player->scale *= 1.4f; } if ((get_filtered_cheats() & 0x20) != 0) { From b3f4cce2f5e4aea27d10acc6cd8d1d785b47da3d Mon Sep 17 00:00:00 2001 From: AntonioCastelli Date: Wed, 1 Dec 2021 19:25:15 -0800 Subject: [PATCH 09/10] Use magic code macros Co-authored-by: Faschz --- src/unknown_00BC20.c | 2 +- src/unknown_0348C0.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 0a97609c..da8148be 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -656,7 +656,7 @@ void func_8000E2B4(void) { if (get_filtered_cheats() & CHEAT_BIG_CHARACTERS) { player->scale *= 1.4f; } - if ((get_filtered_cheats() & 0x20) != 0) { + if (get_filtered_cheats() & CHEAT_SMALL_CHARACTERS) { player->scale *= 0.714f; } player->unk3C_a.unk3C = 0; diff --git a/src/unknown_0348C0.c b/src/unknown_0348C0.c index d5eca7eb..887a79d0 100644 --- a/src/unknown_0348C0.c +++ b/src/unknown_0348C0.c @@ -1202,15 +1202,15 @@ void func_8003DFCC(Object *arg0, unknown_struct_8003DFCC *arg1) { arg0->unk4C->unk11 = 4; arg0->unk4C->unk10 = 0x14; temp_v0 = get_filtered_cheats(); - if (temp_v0 & 0x20000) { + if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_BLUE) { arg1->unk9 = 0U; - } else if (temp_v0 & 0x08000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_RED) { arg1->unk9 = 1U; - } else if (temp_v0 & 0x10000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_GREEN) { arg1->unk9 = 2U; - } else if (temp_v0 & 0x40000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_YELLOW) { arg1->unk9 = 3U; - } else if (temp_v0 & 0x80000) { + } else if (temp_v0 & CHEAT_ALL_BALLOONS_ARE_RAINBOW) { arg1->unk9 = 4U; } if ((s32) arg1->unk8 >= 6) { @@ -1230,7 +1230,7 @@ void func_8003DFCC(Object *arg0, unknown_struct_8003DFCC *arg1) { arg0->unk64->unk4 = 0; arg0->unk64->unk0_a.unk0 = arg0->scale; arg0->unk7C.word = 0; - if ((get_filtered_cheats() & 0x800) != 0) { + if (get_filtered_cheats() & CHEAT_DISABLE_WEAPONS) { gParticlePtrList_addObject(arg0); } } From e93a5db1ecfa2e29a151e673a3f295464e067349 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 1 Dec 2021 19:44:23 -0800 Subject: [PATCH 10/10] Added undefined struct members. --- include/structs.h | 7 +++++-- src/unknown_00BC20.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/structs.h b/include/structs.h index 41a5bf66..259455bf 100644 --- a/include/structs.h +++ b/include/structs.h @@ -608,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; @@ -619,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; diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index da8148be..e758c84f 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -11,6 +11,7 @@ #include "asset_loading.h" #include "thread0_epc.h" #include "controller_pak.h" +#include "menu.h" #include "unknown_06B2B0.h" #include "unknown_043920.h"