From 87884ccc6c7cb61168021ed0f8af3821fe472ca6 Mon Sep 17 00:00:00 2001 From: David Benepe Date: Fri, 2 Jul 2021 17:34:43 -0500 Subject: [PATCH] Decompiled the rest of the .data F3DDKR display lists --- include/f3ddkr.h | 7 +++++-- src/screen_asset.c | 1 - src/unknown_09F8F0.c | 26 +++++++++++++------------- src/unknown_0B3D40.c | 30 +++++++++++++++--------------- src/unknown_0C0D70.c | 39 +++++++++++++++++++-------------------- src/unknown_0C4800.c | 34 +++++++++++++++++++++------------- 6 files changed, 73 insertions(+), 64 deletions(-) diff --git a/include/f3ddkr.h b/include/f3ddkr.h index f30247b6..0828fcfc 100644 --- a/include/f3ddkr.h +++ b/include/f3ddkr.h @@ -1,11 +1,11 @@ #ifndef _F3DDKR_H_ #define _F3DDKR_H_ -// This file is an extension of PR/gbi.h - #include "PR/mbi.h" #include "PR/gbi.h" +// This file is an extension of PR/gbi.h + // Color combiner values. These need better names! #define DKR_CC_UNK0 0, 0, 0, COMBINED, COMBINED, 0, PRIMITIVE, 0 #define DKR_CC_UNK1 ENVIRONMENT, COMBINED, ENV_ALPHA, COMBINED, COMBINED, 0, PRIMITIVE, 0 @@ -18,6 +18,9 @@ #define DKR_CC_UNK8 COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED #define DKR_CC_UNK9 PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0 #define DKR_CC_UNK10 TEXEL0, 0, SCALE, 0, 0, 0, 0, TEXEL0 +#define DKR_CC_UNK11 ENVIRONMENT, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL0, 0, PRIMITIVE, 0 + +#define DKR_CC_ENVIRONMENT 0, 0, 0, ENVIRONMENT, 0, 0, 0, ENVIRONMENT #define DKR_CC_DECALFADEPRIM 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0 // For some reason DKR has a value for G_MDSFT_BLENDMASK, despite the fact that it is unsupported. diff --git a/src/screen_asset.c b/src/screen_asset.c index ac9d849e..aee03656 100644 --- a/src/screen_asset.c +++ b/src/screen_asset.c @@ -19,7 +19,6 @@ u8 *load_screen(s32 screenIndex) { s32 screenTableCount, start, size; s32 *screenTable; - screenTable = (u8 *)load_asset_section_from_rom(ASSET_SCREENS_TABLE); screenTableCount = 0; diff --git a/src/unknown_09F8F0.c b/src/unknown_09F8F0.c index efb25721..94d0e26c 100644 --- a/src/unknown_09F8F0.c +++ b/src/unknown_09F8F0.c @@ -4,6 +4,7 @@ #include "types.h" #include "macros.h" #include "structs.h" +#include "f3ddkr.h" typedef struct { u8 unk0[0x4C4]; @@ -226,19 +227,18 @@ s32 D_800E2914[2] = { 0, 0 }; s32 D_800E291C = 0; s32 D_800E2920[2] = { 0, 0 }; -// Fast3D (F3DDKR) display list -u32 D_800E2928[] = { - 0xE7000000, 0x00000000, - 0xBA001402, 0x00000000, - 0xBA001001, 0x00000000, - 0xBA000E02, 0x00000000, - 0xBA001102, 0x00000000, - 0xBA001301, 0x00000000, - 0xBA000C02, 0x00002000, - 0xBA000903, 0x00000C00, - 0xB9000002, 0x00000000, - 0xB900031D, 0x00504340, - 0xB8000000, 0x00000000 +Gfx D_800E2928[] = { + gsDPPipeSync(), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetTextureLOD(G_TL_TILE), + gsDPSetTextureLUT(G_TT_NONE), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTexturePersp(G_TP_NONE), + gsDPSetTextureFilter(G_TF_BILERP), + gsDPSetTextureConvert(G_TC_FILT), + gsDPSetAlphaCompare(G_AC_NONE), + gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), + gsSPEndDisplayList(), }; /* Size: 0x10 Bytes */ diff --git a/src/unknown_0B3D40.c b/src/unknown_0B3D40.c index f647032e..4552977c 100644 --- a/src/unknown_0B3D40.c +++ b/src/unknown_0B3D40.c @@ -3,6 +3,7 @@ #include "types.h" #include "macros.h" +#include "f3ddkr.h" /************ .data ************/ @@ -24,21 +25,20 @@ u8 D_800E2EF4[196] = { 0x00, 0x00, 0x00, 0x00 }; -// Fast3D (F3DDKR) display list -u32 D_800E2FB8[] = { - 0xE7000000, 0x00000000, - 0xBA001402, 0x00000000, - 0xBA001001, 0x00000000, - 0xBA000E02, 0x00000000, - 0xBA001102, 0x00000000, - 0xBA001301, 0x00000000, - 0xBA000C02, 0x00002000, - 0xBA000903, 0x00000C00, - 0xB9000002, 0x00000000, - 0xB900031D, 0x00504240, - 0xFB000000, 0xFFFFFFFF, - 0xFA000000, 0x00000000, - 0xB8000000, 0x00000000 +Gfx D_800E2FB8[] = { + gsDPPipeSync(), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetTextureLOD(G_TL_TILE), + gsDPSetTextureLUT(G_TT_NONE), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTexturePersp(G_TP_NONE), + gsDPSetTextureFilter(G_TF_BILERP), + gsDPSetTextureConvert(G_TC_FILT), + gsDPSetAlphaCompare(G_AC_NONE), + gsDPSetRenderMode(G_RM_XLU_SURF, G_RM_XLU_SURF2), + gsDPSetEnvColor(255, 255, 255, 255), + gsDPSetPrimColor(0, 0, 0, 0, 0, 0), + gsSPEndDisplayList(), }; /*******************************/ diff --git a/src/unknown_0C0D70.c b/src/unknown_0C0D70.c index 0403cf6f..21e00d2f 100644 --- a/src/unknown_0C0D70.c +++ b/src/unknown_0C0D70.c @@ -3,6 +3,7 @@ #include "types.h" #include "macros.h" +#include "f3ddkr.h" /************ .data ************/ @@ -20,19 +21,18 @@ s32 D_800E31C8 = 0; s32 D_800E31CC = 0; s32 D_800E31D0[2] = { 0, 0 }; -// Fast3D (F3DDKR) display list -u32 D_800E31D8[] = { - 0xE7000000, 0x00000000, - 0xBA001402, 0x00000000, - 0xBA001001, 0x00000000, - 0xBA000E02, 0x00000000, - 0xBA001102, 0x00000000, - 0xBA001301, 0x00000000, - 0xBA000C02, 0x00002000, - 0xBA000903, 0x00000C00, - 0xB9000002, 0x00000000, - 0xB900031D, 0x00504340, - 0xB8000000, 0x00000000 +Gfx D_800E31D8[] = { + gsDPPipeSync(), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetTextureLOD(G_TL_TILE), + gsDPSetTextureLUT(G_TT_NONE), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTexturePersp(G_TP_NONE), + gsDPSetTextureFilter(G_TF_BILERP), + gsDPSetTextureConvert(G_TC_FILT), + gsDPSetAlphaCompare(G_AC_NONE), + gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), + gsSPEndDisplayList(), }; s16 D_800E3230[28] = { @@ -168,13 +168,12 @@ s8 D_800E3554[244] = { 0, 0, 0, 0 }; -// Fast3D (F3DDKR) display list -u32 D_800E3648[] = { - 0xE7000000, 0x00000000, - 0xB6000000, 0x00010000, - 0xFCFFFFFF, 0xFFFE793C, - 0xEF080C0F, 0x00504340, - 0xB8000000, 0x00000000 +Gfx D_800E3648[] = { + gsDPPipeSync(), + gsSPClearGeometryMode(G_FOG), + gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + gsDPSetOtherMode(DKR_OMH_1CYC_POINT, DKR_OML_COMMON | G_RM_CLD_SURF | G_RM_CLD_SURF2), + gsSPEndDisplayList(), }; s8 D_800E3670 = 0; diff --git a/src/unknown_0C4800.c b/src/unknown_0C4800.c index 7e4808f2..b3d46816 100644 --- a/src/unknown_0C4800.c +++ b/src/unknown_0C4800.c @@ -7,22 +7,30 @@ #include "macros.h" #include "asset_sections.h" #include "libultra_internal.h" +#include "f3ddkr.h" /************ .data ************/ -// Fast3D (F3DDKR) display list -u32 D_800E3690[] = { - 0xE7000000, 0x00000000, - 0xBA001001, 0x00000000, - 0xBA000E02, 0x00000000, - 0xB9000002, 0x00000000, - 0xB6000000, 0x00010001, - 0xE7000000, 0x00000000, - 0xB8000000, 0x00000000, - 0xFC5616AC, 0x112CFE7F, - 0xEF000C0F, 0x00504240, - 0xFCFFFFFF, 0xFFFEFB7D, - 0xEF000C0F, 0x00504240 +Gfx D_800E3690[] = { + gsDPPipeSync(), + gsDPSetTextureLOD(G_TL_TILE), + gsDPSetTextureLUT(G_TT_NONE), + gsDPSetAlphaCompare(G_AC_NONE), + gsSPClearGeometryMode(G_ZBUFFER | G_FOG), + gsDPPipeSync(), + gsSPEndDisplayList(), +}; + +// Unused? +Gfx D_800E36C8[][2] = { + { + gsDPSetCombineMode(DKR_CC_UNK11, DKR_CC_UNK11), + gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2), + }, + { + gsDPSetCombineMode(DKR_CC_ENVIRONMENT, DKR_CC_ENVIRONMENT), + gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2), + }, }; s8 D_800E36E8 = 0;