From 067fac11d0cf900c50c5e175e8a20560b07cf9e0 Mon Sep 17 00:00:00 2001 From: David Benepe Date: Mon, 5 Jul 2021 15:08:33 -0500 Subject: [PATCH] Decompiled some display lists. --- src/camera.c | 262 ------------------------------------------- src/menu.c | 2 +- src/unknown_00BC20.c | 10 +- src/unknown_06B2B0.c | 24 ++-- 4 files changed, 18 insertions(+), 280 deletions(-) diff --git a/src/camera.c b/src/camera.c index fe83c233..62ad9aac 100644 --- a/src/camera.c +++ b/src/camera.c @@ -549,269 +549,7 @@ void func_80066C80(s32 *arg0, s32 *arg1, s32 *arg2, s32 *arg3) { } -#if 1 GLOBAL_ASM("asm/non_matchings/camera/func_80066CDC.s") -#else -// Work in progress! - -void func_80066CDC(Gfx **dlist, s32 *arg1) { - u32 sp58; - u32 sp54; - u32 sp50; - u32 sp4C; - s32 sp34; - s32 sp2C; - u32 temp_a0; - u32 temp_a0_3; - u32 temp_a0_4; - u32 temp_a2; - u32 temp_a3; - u32 temp_a3_2; - u32 temp_t0; - u32 temp_t1_2; - u32 temp_v0; - u32 temp_v0_3; - u32 temp_v0_4; - u32 temp_v1_10; - u32 temp_v1_3; - u32 temp_v1_4; - s32 phi_t1; - s32 phi_v1; - f32 phi_f6; - f32 phi_f18; - f32 phi_f16; - f32 phi_f8; - f32 phi_f6_2; - f32 phi_f18_2; - f32 phi_f8_2; - f32 phi_f16_2; - u32 phi_a1; - f32 phi_f8_3; - f32 phi_f16_3; - f32 phi_f16_4; - u32 phi_t3; - u32 phi_a3_2; - u32 phi_t5; - u32 phi_t4; - - sp34 = D_80120CE4; - phi_t1 = D_80120CE4; - if (func_8000E184() && D_80120CE0 == 0) { - D_80120CE4 = 1; - phi_t1 = 0; - } - temp_v0 = func_8007A520(); - temp_t0 = temp_v0 >> 0x10; - temp_a3 = temp_t0 >> 1; - - if (gScreenViewports[phi_t1].flags & 1) { - sp2C = D_80120CE4; - D_80120CE4 = phi_t1; - fast3d_cmd( - (*dlist)++, - ((((s32)(gScreenViewports[D_80120CE4].unk24 * 4.0f)) & 0xFFF) | 0xED000000) | (((s32)(gScreenViewports[D_80120CE4].unk20 * 4.0f)) & 0xFFF) << 0xC, - (((s32)(gScreenViewports[D_80120CE4].unk2C * 4.0f)) & 0xFFF) | (((s32)(gScreenViewports[D_80120CE4].unk28 * 4.0f)) & 0xFFF) << 0xC - ) - func_80068158(dlist, 0, 0, 0, 0); - D_80120CE4 = sp2C; - if (arg1 != 0) { - func_80067D3C(dlist, arg1); - } - D_80120CE4 = sp34; - return; - } - temp_t1_2 = temp_v0 & 0xFFFF; - phi_v1 = D_80120CE0; - if (D_80120CE0 == 2) { - phi_v1 = 3; - } - temp_a2 = temp_t1_2 >> 1; - sp54 = temp_a2; - sp58 = temp_a3; - if (osTvType == 0) { - sp58 = 0x91; - } - - switch(phi_v1) { - case 0: - phi_t3 = sp58; - if (osTvType == 0) { - phi_t3 = sp58 - 0x12; - } - phi_f16_4 = temp_t0; - if (temp_t0 < 0) { - phi_f16_4 = temp_t0 + 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - 0xED000000, - ((((s32)(temp_t1_2 * 4.0f)) & 0xFFF) << 0xC) | (((s32)(phi_f16_4 * 4.0f)) & 0xFFF) - ) - sp4C = temp_a2; - phi_a3_2 = temp_a2; - break; - case 1: - if (D_80120CE4 == 0) { - temp_v0_4 = temp_t0 >> 2; - phi_t3 = temp_v0_4; - if (osTvType == 0) { - phi_t3 = temp_v0_4 - 0xC; - } - phi_f8_3 = temp_a3 - (temp_t0 >> 7); - if (phi_f8_3 < 0) { - phi_f8_3 += 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - 0xED000000, - ((((s32)(temp_t1_2 * 4.0f)) & 0xFFF) << 0xC) | (((s32)(phi_f8_3 * 4.0f)) & 0xFFF) - ) - } else { - temp_v1_10 = temp_t0 >> 7; - phi_f16_3 = temp_t0 - temp_v1_10; - if (phi_f16_3 < 0) { - phi_f16_3 += 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - (((s32)((temp_a3 + temp_v1_10) * 4.0f)) & 0xFFF) | 0xED000000, - ((((s32)(temp_t1_2 * 4.0f)) & 0xFFF) << 0xC) | (((s32)(phi_f16_3 * 4.0f)) & 0xFFF) - ) - phi_t3 = temp_a3 + (temp_t0 >> 2); - } - sp4C = temp_a2; - phi_a3_2 = temp_a2; - break; - case 2: - if (D_80120CE4 == 0) { - phi_f8_2 = temp_t0; - if (temp_t0 < 0) { - phi_f8_2 = temp_t0 + 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - 0xED000000, - ((((s32)((temp_a2 - (temp_t1_2 >> 8)) * 4.0f)) & 0xFFF) << 0xC) | (((s32)(phi_f8_2 * 4.0f)) & 0xFFF) - ) - phi_a1 = temp_t1_2 >> 2; - } else { - temp_a0_4 = temp_t1_2 >> 8; - phi_f16_2 = temp_t0; - if (temp_t0 < 0) { - phi_f16_2 = temp_t0 + 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - (((s32)((temp_a2 + temp_a0_4) * 4.0f) & 0xFFF) << 0xC) | 0xED000000, - (((s32)((temp_t1_2 - temp_a0_4) * 4.0f) & 0xFFF) << 0xC) | (((s32)(phi_f16_2 * 4.0f)) & 0xFFF) - ) - phi_a1 = temp_a2 + (temp_t1_2 >> 2); - } - sp4C = phi_a1; - phi_t3 = sp58; - phi_a3_2 = phi_a1; - break; - case 3: - switch(D_80120CE4) { - case 0: - phi_f6_2 = temp_a2 - (temp_t1_2 >> 8); - if (phi_f6_2 < 0) { - phi_f6_2 += 4294967296.0f; - } - phi_f18_2 = temp_a3 - (temp_t0 >> 7); - if (phi_f18_2 < 0) { - phi_f18_2 += 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - ((((s32)(0U * 4.0f) & 0xFFF) << 0xC) | 0xED000000) | (((s32)(0U * 4.0f)) & 0xFFF), - (((s32)(phi_f6_2 * 4.0f) & 0xFFF) << 0xC) | (((s32)(phi_f18_2 * 4.0f)) & 0xFFF) - ) - phi_t5 = 0U; - phi_t4 = 0U; - break; - case 1: - temp_a0_3 = temp_t1_2 >> 8; - phi_f8 = temp_a3 - (temp_t0 >> 7); - if (phi_f8 < 0) { - phi_f8 += 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - ((((s32)((temp_a2 + temp_a0_3) * 4.0f)) & 0xFFF) << 0xC) | 0xED000000, - ((((s32)(((temp_a2 * 2) - temp_a0_3) * 4.0f)) & 0xFFF) << 0xC) | (((s32)(phi_f8 * 4.0f)) & 0xFFF) - ) - phi_t5 = 0U; - phi_t4 = temp_a2; - break; - case 2: - temp_v1_4 = temp_t0 >> 7; - phi_f16 = (temp_a3 * 2) - temp_v1_4; - if (phi_f16 < 0) { - phi_f16 += 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - (((s32)((temp_a3 + temp_v1_4) * 4.0f)) & 0xFFF) | 0xED000000, - ((((s32)((temp_a2 - (temp_t1_2 >> 8)) * 4.0f)) & 0xFFF) << 0xC) | (((s32)(phi_f16 * 4.0f)) & 0xFFF) - ) - phi_t5 = temp_a3; - phi_t4 = 0U; - break; - case 3: - temp_a0 = temp_t1_2 >> 8; - temp_v1_3 = temp_t0 >> 7; - phi_f6 = (temp_a2 * 2) - temp_a0; - if (phi_f6 < 0) { - phi_f6 += 4294967296.0f; - } - phi_f18 = (temp_a3 * 2) - temp_v1_3; - if (phi_f18 < 0) { - phi_f18 += 4294967296.0f; - } - fast3d_cmd( - (*dlist)++, - (((((s32)((temp_a2 + temp_a0) * 4.0f)) & 0xFFF) << 0xC) | 0xED000000) | (((s32)((temp_a3 + temp_v1_3) * 4.0f)) & 0xFFF), - ((((s32)(phi_f6 * 4.0f) & 0xFFF)) << 0xC) | (((s32)(phi_f18 * 4.0f)) & 0xFFF) - ) - phi_t5 = temp_a3; - phi_t4 = temp_a2; - break; - default: - phi_t5 = 0; - phi_t4 = 0; - break; - } - temp_v0_3 = phi_t5 + sp58; - temp_a3_2 = phi_t4 + sp54; - phi_t3 = temp_v0_3; - phi_a3_2 = temp_a3_2; - if (osTvType == 0) { - phi_t3 = temp_v0_3 - 6; - phi_a3_2 = temp_a3_2; - if (D_80120CE4 < 2) { - phi_t3 = temp_v0_3 - 0x14; - phi_a3_2 = temp_a3_2; - } - } - break; - default: - phi_t3 = sp50; - phi_a3_2 = sp4C; - break; - } - - if (osTvType == 0) { - phi_a3_2 -= 4; - } - func_80068158(dlist, sp54, sp58, phi_a3_2, phi_t3); - if (arg1 != 0) { - func_80067D3C(dlist, arg1); - } - D_80120CE4 = sp34; -} -#endif - GLOBAL_ASM("asm/non_matchings/camera/func_80067A3C.s") GLOBAL_ASM("asm/non_matchings/camera/func_80067D3C.s") diff --git a/src/menu.c b/src/menu.c index b03b60e5..136a9762 100644 --- a/src/menu.c +++ b/src/menu.c @@ -3333,7 +3333,7 @@ s32 menu_track_select_loop(s32 arg0) { } func_8008E4EC(); - fast3d_cmd(D_801263A0++, 0xB6000000, 0x00001000) // gSPClearGeometryMode(D_801263A0++, G_CULL_FRONT) + gSPClearGeometryMode(D_801263A0++, G_CULL_FRONT) switch(D_801267D0) { case 0: diff --git a/src/unknown_00BC20.c b/src/unknown_00BC20.c index 44ea77d9..077e0204 100644 --- a/src/unknown_00BC20.c +++ b/src/unknown_00BC20.c @@ -7,7 +7,7 @@ #include "types.h" #include "macros.h" #include "structs.h" -#include "fast3d.h" +#include "f3ddkr.h" #include "asset_sections.h" /************ .data ************/ @@ -922,21 +922,21 @@ void func_80012C3C(Gfx** dlist){ s32 i; Gfx *tmp; for(i = 0; i