From fb063c9d123dec3bf7d8e79f04e0ab8671a4ffed Mon Sep 17 00:00:00 2001 From: Rinnegatamante Date: Fri, 3 Jul 2020 12:50:00 +0200 Subject: [PATCH] Several adjustments to some gfx microcodes. Thanks to Salvy. --- Source/HLEGraphics/Microcode.cpp | 68 ++++----- Source/HLEGraphics/uCodes/Ucode.cpp | 4 +- Source/HLEGraphics/uCodes/Ucode.h | 9 +- Source/HLEGraphics/uCodes/Ucode_Conker.h | 95 +++--------- Source/HLEGraphics/uCodes/Ucode_GBI0.h | 57 ++++---- Source/HLEGraphics/uCodes/Ucode_GBI1.h | 147 +------------------ Source/HLEGraphics/uCodes/Ucode_GBI2.h | 178 +---------------------- Source/OSHLE/ultra_gbi.h | 33 ++--- 8 files changed, 116 insertions(+), 475 deletions(-) diff --git a/Source/HLEGraphics/Microcode.cpp b/Source/HLEGraphics/Microcode.cpp index f11a8766..955f642e 100644 --- a/Source/HLEGraphics/Microcode.cpp +++ b/Source/HLEGraphics/Microcode.cpp @@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Debug/DBGConsole.h" #include "Utility/AuxFunc.h" +#include "OSHLE/ultra_gbi.h" + // Limit cache ucode entries to 6 // In theory we should never reach this max #define MAX_UCODE_CACHE_ENTRIES 6 @@ -153,8 +155,8 @@ static const MicrocodeData gMicrocodeData[] = { GBI_LL, GBI_1, 2, 0xdd560323, false, "GBI_LL" }, // Toukon Road - Brave Spirits { GBI_BETA, GBI_0, 5, 0x64cc729d, true, "GBI_BETA" }, // Wave Race 64 (v.1.1) { GBI_1, GBI_1, 2, 0x9fb58257, true, "GBI_MK (F3DEX)"}, // Mario Kart 64 - { GBI_0, GBI_0, 10, 0xf4c3491b, true, "GBI_SM (F3DEX)"}, // Super Mario 64 - { GBI_0, GBI_0, 10, 0xe908848d, true, "GBI_CU (F3DEX)"}, // Cruise'n USA + { GBI_0, GBI_0, 10, 0xf4c3491b, true, "GBI_SM (F3D) "}, // Super Mario 64 + { GBI_0, GBI_0, 10, 0xe908848d, true, "GBI_CU (F3D) "}, // Cruise'n USA }; UcodeInfo GBIMicrocode_SetCache(u32 index, u32 code_base, u32 data_base, u32 ucode_stride, u32 ucode_version, const MicroCodeInstruction * ucode_function) @@ -296,7 +298,7 @@ UcodeInfo GBIMicrocode_DetectVersion( u32 code_base, u32 code_size, u32 data_bas default: { ucode_stride = 10; - sprintf(cur_ucode, "F3D [Hash: 0x%08x]", code_hash); + sprintf(cur_ucode, "GBI_0 (F3D) [Hash: 0x%08x]", code_hash); } break; } @@ -306,9 +308,9 @@ UcodeInfo GBIMicrocode_DetectVersion( u32 code_base, u32 code_size, u32 data_bas if (is_custom_ucode) { GBIMicrocode_SetCustomArray(ucode_version, ucode_offset); if (ucode_beta_persp) { - SetCommand(0xb2, DLParser_GBI1_RDPHalf_1); - SetCommand(0xb3, DLParser_GBI1_RDPHalf_2); - SetCommand(0xb4, DLParser_GBI0_PerspNorm_Beta); + SetCommand(G_GBI1_RDPHALF_CONT, DLParser_GBI1_RDPHalf_1); + SetCommand(G_GBI1_RDPHALF_2, DLParser_GBI1_RDPHalf_2); + SetCommand(G_GBI1_RDPHALF_1, DLParser_GBI0_PerspNorm_Beta); } return GBIMicrocode_SetCache(i, code_base, data_base, ucode_stride, ucode_version, gCustomInstruction); } @@ -333,38 +335,38 @@ static void GBIMicrocode_SetCustomArray( u32 ucode_version, u32 ucode_offset ) switch( ucode_version ) { case GBI_GE: - SetCommand( 0xb4, DLParser_RDPHalf1_GoldenEye); - SetCommand( 0xbd, DLParser_GBI1_MoveWord); + SetCommand( G_GBI1_RDPHALF_1, DLParser_RDPHalf1_GoldenEye); + SetCommand( G_GBI1_POPMTX, DLParser_GBI1_MoveWord); break; case GBI_BETA: - SetCommand( 0x04, DLParser_GBI0_Vtx_Beta); - SetCommand( 0xbf, DLParser_GBI0_Tri1_Beta); - SetCommand( 0xb1, DLParser_GBI0_Tri2_Beta); - SetCommand( 0xb5, DLParser_GBI0_Line3D_Beta); + SetCommand( G_GBI1_VTX, DLParser_GBI0_Vtx_Beta); + SetCommand( G_GBI1_TRI1, DLParser_GBI0_Tri1_Beta); + SetCommand( G_GBI1_TRI2, DLParser_GBI0_Tri2_Beta); + SetCommand( G_GBI1_LINE3D, DLParser_GBI0_Line3D_Beta); break; case GBI_LL: SetCommand( 0x80, DLParser_Last_Legion_0x80); - SetCommand( 0x00, DLParser_Last_Legion_0x00); - SetCommand( 0xe4, DLParser_TexRect_Last_Legion); + SetCommand( G_GBI1_SPNOOP, DLParser_Last_Legion_0x00); + SetCommand( G_RDP_TEXRECT, DLParser_TexRect_Last_Legion); break; case GBI_PD: - SetCommand( 0x04, DLParser_Vtx_PD); - SetCommand( 0x07, DLParser_Set_Vtx_CI_PD); - SetCommand( 0xb4, DLParser_RDPHalf1_GoldenEye); + SetCommand( G_GBI1_VTX, DLParser_Vtx_PD); + SetCommand( G_GBI1_RESERVED2, DLParser_Set_Vtx_CI_PD); + SetCommand( G_GBI1_RDPHALF_1, DLParser_RDPHalf1_GoldenEye); break; case GBI_DKR: - SetCommand( 0x01, DLParser_Mtx_DKR); - SetCommand( 0x04, DLParser_GBI0_Vtx_DKR); - SetCommand( 0x05, DLParser_DMA_Tri_DKR); - SetCommand( 0x07, DLParser_DLInMem); - SetCommand( 0xbc, DLParser_MoveWord_DKR); - SetCommand( 0xbf, DLParser_Set_Addr_DKR); - SetCommand( 0xbb, DLParser_GBI1_Texture_DKR); + SetCommand( G_GBI1_MTX, DLParser_Mtx_DKR); + SetCommand( G_GBI1_VTX, DLParser_GBI0_Vtx_DKR); + SetCommand( G_GBI1_RESERVED1, DLParser_DMA_Tri_DKR); + SetCommand( G_GBI1_RESERVED2, DLParser_DLInMem); + SetCommand( G_GBI1_MOVEWORD, DLParser_MoveWord_DKR); + SetCommand( G_GBI1_TRI1, DLParser_Set_Addr_DKR); + SetCommand( G_GBI1_TEXTURE, DLParser_GBI1_Texture_DKR); break; case GBI_CONKER: - SetCommand( 0x01, DLParser_Vtx_Conker); - SetCommand( 0x05, DLParser_Tri1_Conker); - SetCommand( 0x06, DLParser_Tri2_Conker); + SetCommand( G_GBI2_VTX, DLParser_Vtx_Conker); + SetCommand( G_GBI2_TRI1, DLParser_Tri1_Conker); + SetCommand( G_GBI2_TRI2, DLParser_Tri2_Conker); SetCommand( 0x10, DLParser_Tri4_Conker); SetCommand( 0x11, DLParser_Tri4_Conker); SetCommand( 0x12, DLParser_Tri4_Conker); @@ -381,16 +383,16 @@ static void GBIMicrocode_SetCustomArray( u32 ucode_version, u32 ucode_offset ) SetCommand( 0x1d, DLParser_Tri4_Conker); SetCommand( 0x1e, DLParser_Tri4_Conker); SetCommand( 0x1f, DLParser_Tri4_Conker); - SetCommand( 0xdb, DLParser_MoveWord_Conker); - SetCommand( 0xdc, DLParser_MoveMem_Conker); + SetCommand( G_GBI2_MOVEWORD, DLParser_MoveWord_Conker); + SetCommand( G_GBI2_MOVEMEM, DLParser_MoveMem_Conker); break; case GBI_ACCLAIM: - SetCommand( 0xdc, DLParser_MoveMem_Acclaim); + SetCommand( G_GBI2_MOVEMEM, DLParser_MoveMem_Acclaim); break; case GBI_AM: - SetCommand( 0x01, DLParser_GBI2_Vtx_AM); - SetCommand( 0xd7, DLParser_GBI2_Texture_AM); - SetCommand( 0xdb, DLParser_GBI2_MoveWord_AM); + SetCommand( G_GBI2_VTX, DLParser_GBI2_Vtx_AM); + SetCommand( G_GBI2_TEXTURE, DLParser_GBI2_Texture_AM); + SetCommand( G_GBI2_MOVEWORD, DLParser_GBI2_MoveWord_AM); break; default: break; diff --git a/Source/HLEGraphics/uCodes/Ucode.cpp b/Source/HLEGraphics/uCodes/Ucode.cpp index 8653119c..dbe367c7 100644 --- a/Source/HLEGraphics/uCodes/Ucode.cpp +++ b/Source/HLEGraphics/uCodes/Ucode.cpp @@ -90,9 +90,9 @@ const MicroCodeInstruction gNormalInstruction[MAX_UCODE_TABLE][256] = DLParser_Nothing, DLParser_Nothing, DLParser_Nothing, DLParser_Nothing, //b0 DLParser_Nothing,DLParser_GBI0_Tri4, DLParser_GBI1_RDPHalf_Cont, DLParser_GBI1_RDPHalf_2, - DLParser_GBI1_RDPHalf_1, DLParser_GBI1_Line3D, DLParser_GBI1_GeometryMode, DLParser_GBI1_GeometryMode, + DLParser_GBI1_RDPHalf_1, DLParser_GBI0_Line3D, DLParser_GBI1_GeometryMode, DLParser_GBI1_GeometryMode, DLParser_GBI1_EndDL, DLParser_GBI1_SetOtherModeL, DLParser_GBI1_SetOtherModeH, DLParser_GBI1_Texture, - DLParser_GBI1_MoveWord, DLParser_GBI1_PopMtx, DLParser_GBI1_CullDL, DLParser_GBI1_Tri1, + DLParser_GBI1_MoveWord, DLParser_GBI1_PopMtx, DLParser_GBI0_CullDL, DLParser_GBI0_Tri1, //c0 DLParser_GBI1_Noop, DLParser_Nothing, DLParser_Nothing, DLParser_Nothing, diff --git a/Source/HLEGraphics/uCodes/Ucode.h b/Source/HLEGraphics/uCodes/Ucode.h index 2284aa24..47d01f9e 100644 --- a/Source/HLEGraphics/uCodes/Ucode.h +++ b/Source/HLEGraphics/uCodes/Ucode.h @@ -37,6 +37,12 @@ void DLParser_GBI1_Tri2_T( MicroCodeCommand command ); template< u32 VertexStride > void DLParser_GBI1_Line3D_T( MicroCodeCommand command ); +UcodeFunc( DLParser_GBI0_Vtx ); +UcodeFunc( DLParser_GBI0_CullDL ); +UcodeFunc( DLParser_GBI0_Tri1 ); +UcodeFunc( DLParser_GBI0_Line3D ); +UcodeFunc( DLParser_GBI0_Tri4 ); + UcodeFunc( DLParser_GBI1_CullDL ); UcodeFunc( DLParser_GBI1_DL ); UcodeFunc( DLParser_GBI1_BranchZ ); @@ -52,7 +58,6 @@ UcodeFunc( DLParser_GBI2_SetOtherModeH ); UcodeFunc( DLParser_GBI1_Texture ); UcodeFunc( DLParser_GBI2_Texture ); -UcodeFunc( DLParser_GBI0_Vtx ); UcodeFunc( DLParser_GBI1_Vtx ); UcodeFunc( DLParser_GBI2_Vtx ); UcodeFunc( DLParser_GBI1_ModifyVtx ); @@ -61,8 +66,6 @@ UcodeFunc( DLParser_GBI1_Mtx ); UcodeFunc( DLParser_GBI2_Mtx ); UcodeFunc( DLParser_GBI1_PopMtx ); -UcodeFunc( DLParser_GBI0_Tri4 ); - UcodeFunc( DLParser_GBI2_Quad ); UcodeFunc( DLParser_GBI2_Line3D ); UcodeFunc( DLParser_GBI2_Tri1 ); diff --git a/Source/HLEGraphics/uCodes/Ucode_Conker.h b/Source/HLEGraphics/uCodes/Ucode_Conker.h index 7f3aa4e1..464f7a30 100644 --- a/Source/HLEGraphics/uCodes/Ucode_Conker.h +++ b/Source/HLEGraphics/uCodes/Ucode_Conker.h @@ -30,9 +30,6 @@ void DLParser_Vtx_Conker( MicroCodeCommand command ) { if( g_CI.Format != G_IM_FMT_RGBA || (gRDPOtherMode.L == CONKER_SHADOW) ) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Skipping Conker TnL (Vtx -> Off-Screen/Shadow)"); - #endif return; } @@ -40,17 +37,8 @@ void DLParser_Vtx_Conker( MicroCodeCommand command ) u32 len = ((command.inst.cmd0 >> 1 )& 0x7F) ; u32 n = ((command.inst.cmd0 >> 12)& 0xFF); u32 v0 = len - n; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Address[0x%08x] Len[%d] v0[%d] Num[%d]", address, len, v0, n); - #endif gRenderer->SetNewVertexInfoConker( address, v0, n ); - -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - gNumVertices += n; - DLParser_DumpVtxInfo( address, v0, n ); -#endif - } //***************************************************************************** @@ -69,9 +57,6 @@ void DLParser_Tri1_Conker( MicroCodeCommand command ) { do { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Tri1 (Culled -> Off-Screen/Shadow)"); - #endif command.inst.cmd0 = *pCmdBase++; command.inst.cmd1 = *pCmdBase++; pc += 8; @@ -120,9 +105,6 @@ void DLParser_Tri2_Conker( MicroCodeCommand command ) { do { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Tri2 (Culled -> Off-Screen/Shadow)"); - #endif command.inst.cmd0 = *pCmdBase++; command.inst.cmd1 = *pCmdBase++; pc += 8; @@ -176,9 +158,6 @@ void DLParser_Tri4_Conker( MicroCodeCommand command ) { do { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Tri4 (Culled -> Off-Screen)"); - #endif command.inst.cmd0 = *(u32 *)(g_pu8RamBase + pc+0); command.inst.cmd1 = *(u32 *)(g_pu8RamBase + pc+4); pc += 8; @@ -261,9 +240,6 @@ void DLParser_MoveMem_Conker( MicroCodeCommand command ) u32 light_idx = (offset2 / 48); if (light_idx < 2) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MV_LOOKAT" ); - #endif return; } @@ -276,9 +252,6 @@ void DLParser_MoveMem_Conker( MicroCodeCommand command ) } break; default: - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" GBI2 MoveMem Type: Unknown"); - #endif break; } } @@ -288,7 +261,6 @@ void DLParser_MoveMem_Conker( MicroCodeCommand command ) //***************************************************************************** void DLParser_MoveWord_Conker( MicroCodeCommand command ) { -#if 1 u8 index = (u8)(( command.inst.cmd0 >> 16) & 0xFF); switch (index) { @@ -314,58 +286,35 @@ void DLParser_MoveWord_Conker( MicroCodeCommand command ) break; case 0x10: // moveword coord mod - { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MoveWord_Conker: coord mod"); - #endif - if ( (command.inst.cmd0 & 8) == 0 ) { - u32 idx = (command.inst.cmd0 >> 1) & 3; - u32 pos = command.inst.cmd0 & 0x30; - - switch(pos) + if ( (command.inst.cmd0 & 8) == 0 ) { - case 0: - gRenderer->SetCoordMod( 0+idx, (s16)(command.inst.cmd1 >> 16) ); - gRenderer->SetCoordMod( 1+idx, (s16)(command.inst.cmd1 & 0xFFFF) ); - break; - case 0x10: - gRenderer->SetCoordMod( 4+idx, (command.inst.cmd1 >> 16) / 65536.0f ); - gRenderer->SetCoordMod( 5+idx, (command.inst.cmd1 & 0xFFFF) / 65536.0f ); - gRenderer->SetCoordMod( 12+idx, gRenderer->GetCoordMod(0+idx) + gRenderer->GetCoordMod(4+idx) ); - gRenderer->SetCoordMod( 13+idx, gRenderer->GetCoordMod(1+idx) + gRenderer->GetCoordMod(5+idx) ); - break; - case 0x20: - gRenderer->SetCoordMod( 8+idx, (s16)(command.inst.cmd1 >> 16) ); - gRenderer->SetCoordMod( 9+idx, (s16)(command.inst.cmd1 & 0xFFFF) ); - break; + u32 idx = (command.inst.cmd0 >> 1) & 3; + u32 pos = command.inst.cmd0 & 0x30; + + switch(pos) + { + case 0: + gRenderer->SetCoordMod( 0+idx, (s16)(command.inst.cmd1 >> 16) ); + gRenderer->SetCoordMod( 1+idx, (s16)(command.inst.cmd1 & 0xFFFF) ); + break; + case 0x10: + gRenderer->SetCoordMod( 4+idx, (command.inst.cmd1 >> 16) / 65536.0f ); + gRenderer->SetCoordMod( 5+idx, (command.inst.cmd1 & 0xFFFF) / 65536.0f ); + gRenderer->SetCoordMod( 12+idx, gRenderer->GetCoordMod(0+idx) + gRenderer->GetCoordMod(4+idx) ); + gRenderer->SetCoordMod( 13+idx, gRenderer->GetCoordMod(1+idx) + gRenderer->GetCoordMod(5+idx) ); + break; + case 0x20: + gRenderer->SetCoordMod( 8+idx, (s16)(command.inst.cmd1 >> 16) ); + gRenderer->SetCoordMod( 9+idx, (s16)(command.inst.cmd1 & 0xFFFF) ); + break; + } } } - } - break; + break; default: - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MoveWord_Conker: Unknown"); - #endif break; - } - -#else - u32 type = (command.inst.cmd0 >> 16) & 0xFF; - - if( type != G_MW_NUMLIGHT ) - { - DLParser_GBI2_MoveWord( command ); - } - else - { - u32 num_lights = command.inst.cmd1 / 48; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_NUMLIGHT: %d", num_lights); -#endif - gRenderer->SetNumLights(num_lights); } -#endif } diff --git a/Source/HLEGraphics/uCodes/Ucode_GBI0.h b/Source/HLEGraphics/uCodes/Ucode_GBI0.h index 1308fb49..9d628ef1 100644 --- a/Source/HLEGraphics/uCodes/Ucode_GBI0.h +++ b/Source/HLEGraphics/uCodes/Ucode_GBI0.h @@ -28,22 +28,42 @@ void DLParser_GBI0_Vtx( MicroCodeCommand command ) u32 addr = RDPSegAddr(command.vtx0.addr); u32 v0 = command.vtx0.v0; u32 n = command.vtx0.n + 1; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Address[0x%08x] v0[%d] Num[%d] Len[0x%04x]", addr, v0, n, command.vtx0.len); -#endif -#ifdef DAEDALUS_ENABLE_ASSERTS - // Never seen or should happen, but just in case.. - DAEDALUS_ASSERT( (v0 + n) < 80, "Warning, attempting to load into invalid vertex positions"); - DAEDALUS_ASSERT( (addr + (n*16)) < MAX_RAM_ADDRESS, "Address out of range (0x%08x)", addr ); - #endif + gRenderer->SetNewVertexInfo( addr, v0, n ); +} -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - gNumVertices += n; - DLParser_DumpVtxInfo( addr, v0, n ); -#endif +//***************************************************************************** +// +//***************************************************************************** +void DLParser_GBI0_CullDL( MicroCodeCommand command ) +{ + u32 first = (command.inst.cmd0 & 0x00FFFFFF) / 40; + u32 last = (command.inst.cmd1 / 40) - 1; + if( gRenderer->TestVerts( first, last ) ) + { + return; + } + + DLParser_PopDL(); } + +//***************************************************************************** +// +//***************************************************************************** +void DLParser_GBI0_Tri1( MicroCodeCommand command ) +{ + DLParser_GBI1_Tri1_T< 10 >(command); +} + +//***************************************************************************** +// +//***************************************************************************** +void DLParser_GBI0_Line3D( MicroCodeCommand command ) +{ + DLParser_GBI1_Line3D_T< 10 >(command); +} + //***************************************************************************** // //***************************************************************************** @@ -53,9 +73,6 @@ inline bool AddTri4( u32 v0, u32 v1, u32 v2 ) { if( v0 == v1 ) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Tri: %d,%d,%d (Culled -> Empty?)", v0, v1, v2); - #endif return false; } else @@ -119,14 +136,4 @@ void DLParser_GBI0_Tri4( MicroCodeCommand command ) } } -//***************************************************************************** -// Actually line3d, not supported I think. -//***************************************************************************** -/* -void DLParser_GBI0_Quad( MicroCodeCommand command ) -{ - DAEDALUS_ERROR("GBI0_Quad : Not supported in ucode0 ? ( Ignored )"); -} -*/ - #endif // HLEGRAPHICS_UCODES_UCODE_GBI0_H_ diff --git a/Source/HLEGraphics/uCodes/Ucode_GBI1.h b/Source/HLEGraphics/uCodes/Ucode_GBI1.h index 65159fc2..c490f913 100644 --- a/Source/HLEGraphics/uCodes/Ucode_GBI1.h +++ b/Source/HLEGraphics/uCodes/Ucode_GBI1.h @@ -39,25 +39,13 @@ void DLParser_GBI1_Vtx( MicroCodeCommand command ) u32 v0 = command.vtx1.v0; u32 n = command.vtx1.n; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Address 0x%08x, v0: %d, Num: %d, Length: 0x%04x", addr, v0, n, command.vtx1.len); - DAEDALUS_ASSERT( (v0 + n) <= 64, "Warning, attempting to load into invalid vertex positions"); -#endif // Wetrix if ( addr > MAX_RAM_ADDRESS ) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Address out of range - ignoring load"); - #endif return; } gRenderer->SetNewVertexInfo( addr, v0, n ); - -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - gNumVertices += n; - DLParser_DumpVtxInfo( addr, v0, n ); -#endif } //***************************************************************************** @@ -72,9 +60,6 @@ void DLParser_GBI1_ModifyVtx( MicroCodeCommand command ) // Cures crash after swinging in Mario Golf if( vert > 80 ) { - #ifdef DAEDALUS_DEBUG_CONSOLE - DAEDALUS_ERROR("ModifyVtx: Invalid vertex number: %d", vert); - #endif return; } @@ -87,13 +72,7 @@ void DLParser_GBI1_ModifyVtx( MicroCodeCommand command ) void DLParser_GBI1_Mtx( MicroCodeCommand command ) { u32 address = RDPSegAddr(command.mtx1.addr); -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Command: %s %s %s Length %d Address 0x%08x", - command.mtx1.projection == 1 ? "Projection" : "ModelView", - command.mtx1.load == 1 ? "Load" : "Mul", - command.mtx1.push == 1 ? "Push" : "NoPush", - command.mtx1.len, address); -#endif + // Load matrix from address if (command.mtx1.projection) { @@ -110,9 +89,6 @@ void DLParser_GBI1_Mtx( MicroCodeCommand command ) //***************************************************************************** void DLParser_GBI1_PopMtx( MicroCodeCommand command ) { -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Command: (%s)", command.inst.cmd1 ? "Projection" : "ModelView"); -#endif // Do any of the other bits do anything? // So far only Extreme-G seems to Push/Pop projection matrices // Can't pop projection matrix @@ -132,13 +108,9 @@ void DLParser_GBI1_MoveMem( MicroCodeCommand command ) { case G_MV_VIEWPORT: { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MV_VIEWPORT. Address: 0x%08x", address); - #endif RDP_MoveMemViewport( address ); } break; - case G_MV_L0: case G_MV_L1: case G_MV_L2: @@ -156,40 +128,13 @@ void DLParser_GBI1_MoveMem( MicroCodeCommand command ) case G_MV_MATRIX_1: { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Force Matrix(1): addr=%08X", address); - #endif // Rayman 2, Donald Duck, Tarzan, all wrestling games use this gRenderer->ForceMatrix( address ); // ForceMatrix takes four cmds gDlistStack.address[gDlistStackPointer] += 24; } break; - - //Next 3 MATRIX commands should not appear, since they were in the previous command. - //case G_MV_MATRIX_2: /*IGNORED*/ DL_PF(" G_MV_MATRIX_2"); break; - //case G_MV_MATRIX_3: /*IGNORED*/ DL_PF(" G_MV_MATRIX_3"); break; - //case G_MV_MATRIX_4: /*IGNORED*/ DL_PF(" G_MV_MATRIX_4"); break; - /* - - // Next 3 cmds are always ignored - case G_MV_LOOKATY: - DL_PF(" G_MV_LOOKATY"); - break; - case G_MV_LOOKATX: - DL_PF(" G_MV_LOOKATX"); - break; - case G_MV_TXTATT: - DL_PF(" G_MV_TXTATT"); - break; -*/ - default: - { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" GBI1 MoveMem Type: Ignored!!"); - #endif - } break; } @@ -211,9 +156,6 @@ void DLParser_GBI1_MoveWord( MicroCodeCommand command ) { case G_MW_MATRIX: { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_MATRIX(1)"); - #endif gRenderer->InsertMatrix(command.inst.cmd0, command.inst.cmd1); } break; @@ -221,9 +163,6 @@ void DLParser_GBI1_MoveWord( MicroCodeCommand command ) case G_MW_NUMLIGHT: { u32 num_lights = ((value - 0x80000000) >> 5) - 1; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_NUMLIGHT: Val:%d", num_lights); - #endif gRenderer->SetNumLights(num_lights); } @@ -238,9 +177,6 @@ void DLParser_GBI1_MoveWord( MicroCodeCommand command ) case G_MW_SEGMENT: { u32 segment = (offset >> 2) & 0xF; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_SEGMENT Seg[%d] = 0x%08x", segment, value); - #endif gSegments[segment] = value; } break; @@ -269,9 +205,6 @@ void DLParser_GBI1_MoveWord( MicroCodeCommand command ) { u32 field_offset = (offset & 0x7); u32 light_idx = offset >> 5; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_LIGHTCOL/0x%08x: 0x%08x", offset, value); -#endif if (field_offset == 0) { // Light col @@ -286,24 +219,10 @@ void DLParser_GBI1_MoveWord( MicroCodeCommand command ) case G_MW_POINTS: // Used in FIFA 98 { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_POINTS"); - #endif gRenderer->ModifyVertexInfo( (offset % 40), (offset / 40), value); } break; -/* - case G_MW_PERSPNORM: - DL_PF(" G_MW_PERSPNORM"); - break; -*/ - default: - { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" GBI1 MoveWord Type: Ignored!!"); - #endif - } break; } @@ -316,25 +235,12 @@ void DLParser_GBI1_CullDL( MicroCodeCommand command ) { u32 first = command.culldl.first; u32 last = command.culldl.end; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Culling using verts %d to %d\n", first, last); -#endif if( last < first ) return; if( gRenderer->TestVerts( first, last ) ) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Display list is visible, returning"); - #endif return; } -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - ++gNumDListsCulled; -#endif -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" No vertices were visible, culling rest of display list"); - #endif - DLParser_PopDL(); } @@ -343,16 +249,6 @@ void DLParser_GBI1_CullDL( MicroCodeCommand command ) //***************************************************************************** void DLParser_GBI1_DL( MicroCodeCommand command ) { -#if defined(DAEDALUS_DEBUG_DISPLAYLIST) || defined(DAEDALUS_ENABLE_ASSERTS) - u32 addr = RDPSegAddr(command.dlist.addr); - DAEDALUS_ASSERT( addr < MAX_RAM_ADDRESS, "Dlist address out of range" ); - DAEDALUS_ASSERT( gDlistStackPointer < 9, "Dlist array is getting too deep" ); - - DL_PF(" Address=0x%08x %s", addr, (command.dlist.param==G_DL_NOPUSH)? "Jump" : (command.dlist.param==G_DL_PUSH)? "Push" : "?"); - DL_PF(" \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/"); - DL_PF(" ############################################"); -#endif - if( command.dlist.param == G_DL_PUSH ) gDlistStackPointer++; @@ -410,16 +306,10 @@ void DLParser_GBI1_GeometryMode( MicroCodeCommand command ) if(command.inst.cmd & 1) { gGeometryMode._u32 |= mask; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Setting mask -> 0x%08x", mask); - #endif } else { gGeometryMode._u32 &= ~mask; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Clearing mask -> 0x%08x", mask); - #endif } TnLMode TnL; @@ -441,18 +331,6 @@ void DLParser_GBI1_GeometryMode( MicroCodeCommand command ) TnL.CullBack = gGeometryMode.GBI1_CullBack; gRenderer->SetTnLMode( TnL._u32 ); -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" ZBuffer %s", (gGeometryMode.GBI1_Zbuffer) ? "On" : "Off"); - DL_PF(" Culling %s", (gGeometryMode.GBI1_CullBack) ? "Back face" : (gGeometryMode.GBI1_CullFront) ? "Front face" : "Off"); - DL_PF(" Shade %s", (gGeometryMode.GBI1_Shade) ? "On" : "Off"); - DL_PF(" Smooth Shading %s", (gGeometryMode.GBI1_ShadingSmooth) ? "On" : "Off"); - DL_PF(" Lighting %s", (gGeometryMode.GBI1_Lighting) ? "On" : "Off"); - DL_PF(" Texture %s", (gGeometryMode.GBI1_Texture) ? "On" : "Off"); - DL_PF(" Texture Gen %s", (gGeometryMode.GBI1_TexGen) ? "On" : "Off"); - DL_PF(" Texture Gen Linear %s", (gGeometryMode.GBI1_TexGenLin) ? "On" : "Off"); - DL_PF(" Fog %s", (gGeometryMode.GBI1_Fog) ? "On" : "Off"); - DL_PF(" LOD %s", (gGeometryMode.GBI1_Lod) ? "On" : "Off"); -#endif } //***************************************************************************** @@ -463,10 +341,6 @@ void DLParser_GBI1_SetOtherModeL( MicroCodeCommand command ) const u32 mask = ((1 << command.othermode.len) - 1) << command.othermode.sft; gRDPOtherMode.L = (gRDPOtherMode.L & ~mask) | command.othermode.data; - -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DLDebug_DumpRDPOtherModeL(mask, command.othermode.data); -#endif } //***************************************************************************** @@ -477,10 +351,6 @@ void DLParser_GBI1_SetOtherModeH( MicroCodeCommand command ) const u32 mask = ((1 << command.othermode.len) - 1) << command.othermode.sft; gRDPOtherMode.H = (gRDPOtherMode.H & ~mask) | command.othermode.data; - -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DLDebug_DumpRDPOtherModeH(mask, command.othermode.data); -#endif } //***************************************************************************** @@ -488,18 +358,12 @@ void DLParser_GBI1_SetOtherModeH( MicroCodeCommand command ) //***************************************************************************** void DLParser_GBI1_Texture( MicroCodeCommand command ) { -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Level[%d] Tile[%d] %s", command.texture.level, command.texture.tile, command.texture.enable_gbi0? "enable":"disable"); -#endif - gRenderer->SetTextureTile( command.texture.tile); gRenderer->SetTextureEnable( command.texture.enable_gbi0); f32 scale_s = f32(command.texture.scaleS) / (65535.0f * 32.0f); f32 scale_t = f32(command.texture.scaleT) / (65535.0f * 32.0f); -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" ScaleS[%0.4f] ScaleT[%0.4f]", scale_s*32.0f, scale_t*32.0f); -#endif + gRenderer->SetTextureScale( scale_s, scale_t ); } @@ -509,10 +373,6 @@ void DLParser_GBI1_Texture( MicroCodeCommand command ) //***************************************************************************** void DLParser_GBI1_Reserved( MicroCodeCommand command ) { - // Not implemented! - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_UNIMPLEMENTED_ERROR( "RDP: Reserved" ); - #endif } //***************************************************************************** @@ -683,9 +543,6 @@ void DLParser_GBI1_Line3D( MicroCodeCommand command ) { // This removes the tris that cover the screen in Flying Dragon // Actually this wrong, we should support line3D properly here.. - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DAEDALUS_ERROR("Flying Dragon Hack -- Skipping Line3D"); - #endif return; } diff --git a/Source/HLEGraphics/uCodes/Ucode_GBI2.h b/Source/HLEGraphics/uCodes/Ucode_GBI2.h index 35870836..53289c2b 100644 --- a/Source/HLEGraphics/uCodes/Ucode_GBI2.h +++ b/Source/HLEGraphics/uCodes/Ucode_GBI2.h @@ -61,12 +61,6 @@ void DLParser_GBI2_Vtx_AM( MicroCodeCommand command ) return; } - // Check that address is valid... - // Only games I seen that set this are Mario Golf/Tennis, but it looks like is caused by a dynarec issue, anyways they crash eventually - #ifdef DAEDALUS_ENABLE_ASSERTS - DAEDALUS_ASSERT( (address + (n*16) ) < MAX_RAM_ADDRESS, "Address out of range (0x%08x)", address ); - #endif - gRenderer->SetNewVertexInfoDAM( address, v0, n ); } @@ -76,13 +70,7 @@ void DLParser_GBI2_Vtx_AM( MicroCodeCommand command ) void DLParser_GBI2_Mtx( MicroCodeCommand command ) { u32 address = RDPSegAddr(command.mtx2.addr); -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Command: %s %s %s Length %d Address 0x%08x", - command.mtx2.projection ? "Projection" : "ModelView", - command.mtx2.load ? "Load" : "Mul", - command.mtx2.nopush == 0 ? "Push" : "No Push", - command.mtx2.len, address); -#endif + // Load matrix from address if (command.mtx2.projection) { @@ -123,9 +111,6 @@ void DLParser_GBI2_MoveWord_AM( MicroCodeCommand command ) { case G_MW_MATRIX: { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_MATRIX(2)"); - #endif gRenderer->InsertMatrix(command.inst.cmd0, command.inst.cmd1); } break; @@ -133,9 +118,6 @@ void DLParser_GBI2_MoveWord_AM( MicroCodeCommand command ) case G_MW_NUMLIGHT: { u32 num_lights = value / 24; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_NUMLIGHT: %d", num_lights); - #endif gRenderer->SetNumLights(num_lights); } break; @@ -143,9 +125,6 @@ void DLParser_GBI2_MoveWord_AM( MicroCodeCommand command ) { u32 segment = offset >> 2; u32 address = value; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF( " G_MW_SEGMENT Segment[%d] = 0x%08x", segment, address ); -#endif gSegments[segment] = address; } break; @@ -186,9 +165,6 @@ void DLParser_GBI2_MoveWord_AM( MicroCodeCommand command ) { u32 light_idx = offset / 0x18; u32 field_offset = (offset & 0x7); -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_LIGHTCOL/0x%08x: 0x%08x", command.mw2.offset, command.mw2.value); -#endif if (field_offset == 0) { u8 r = ((value>>24)&0xFF); @@ -199,11 +175,6 @@ void DLParser_GBI2_MoveWord_AM( MicroCodeCommand command ) } break; default: - { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Ignored!!"); - #endif - } break; } } @@ -220,9 +191,6 @@ void DLParser_GBI2_MoveWord( MicroCodeCommand command ) { case G_MW_MATRIX: { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_MATRIX(2)"); - #endif gRenderer->InsertMatrix(command.inst.cmd0, command.inst.cmd1); } break; @@ -230,9 +198,6 @@ void DLParser_GBI2_MoveWord( MicroCodeCommand command ) case G_MW_NUMLIGHT: { u32 num_lights = value / 24; - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_NUMLIGHT: %d", num_lights); - #endif gRenderer->SetNumLights(num_lights); } break; @@ -240,9 +205,6 @@ void DLParser_GBI2_MoveWord( MicroCodeCommand command ) { u32 segment = offset >> 2; u32 address = value; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF( " G_MW_SEGMENT Segment[%d] = 0x%08x", segment, address ); -#endif gSegments[segment] = address; } break; @@ -270,9 +232,6 @@ void DLParser_GBI2_MoveWord( MicroCodeCommand command ) { u32 light_idx = offset / 0x18; u32 field_offset = (offset & 0x7); -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MW_LIGHTCOL/0x%08x: 0x%08x", command.mw2.offset, command.mw2.value); -#endif if (field_offset == 0) { u8 r = ((value>>24)&0xFF); @@ -283,66 +242,10 @@ void DLParser_GBI2_MoveWord( MicroCodeCommand command ) } break; default: - { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Ignored!!"); - #endif - } break; } } -//***************************************************************************** -// -//***************************************************************************** -/* - -001889F8: DC08060A 80188708 CMD Zelda_MOVEMEM Movemem[0806] <- 80188708 -!light 0 color 0.12 0.16 0.35 dir 0.01 0.00 0.00 0.00 (2 lights) [ 1E285A00 1E285A00 01000000 00000000 ] -data(00188708): 1E285A00 1E285A00 01000000 00000000 -00188A00: DC08090A 80188718 CMD Zelda_MOVEMEM Movemem[0809] <- 80188718 -!light 1 color 0.23 0.25 0.30 dir 0.01 0.00 0.00 0.00 (2 lights) [ 3C404E00 3C404E00 01000000 00000000 ] -data(00188718): 3C404E00 3C404E00 01000000 00000000 -00188A08: DC080C0A 80188700 CMD Zelda_MOVEMEM Movemem[080C] <- 80188700 -!light 2 color 0.17 0.16 0.26 dir 0.23 0.31 0.70 0.00 (2 lights) [ 2C294300 2C294300 1E285A00 1E285A00 ] -*/ -/* -ZeldaMoveMem: 0xdc080008 0x801984d8 -SetScissor: x0=416 y0=72 x1=563 y1=312 mode=0 -// Mtx -ZeldaMoveWord:0xdb0e0000 0x00000041 Ignored -ZeldaMoveMem: 0xdc08000a 0x80198538 -ZeldaMoveMem: 0xdc08030a 0x80198548 - -ZeldeMoveMem: Unknown Type. 0xdc08000a 0x80198518 -ZeldeMoveMem: Unknown Type. 0xdc08030a 0x80198528 -ZeldeMoveMem: Unknown Type. 0xdc08000a 0x80198538 -ZeldeMoveMem: Unknown Type. 0xdc08030a 0x80198548 -ZeldeMoveMem: Unknown Type. 0xdc08000a 0x80198518 -ZeldeMoveMem: Unknown Type. 0xdc08030a 0x80198528 -ZeldeMoveMem: Unknown Type. 0xdc08000a 0x80198538 -ZeldeMoveMem: Unknown Type. 0xdc08030a 0x80198548 - - -0xa4001120: <0x0c000487> JAL 0x121c Seg2Addr(t8) dram -0xa4001124: <0x332100fe> ANDI at = t9 & 0x00fe -0xa4001128: <0x937309c1> LBU s3 <- 0x09c1(k1) len -0xa400112c: <0x943402f0> LHU s4 <- 0x02f0(at) dmem -0xa4001130: <0x00191142> SRL v0 = t9 >> 0x0005 -0xa4001134: <0x959f0336> LHU ra <- 0x0336(t4) -0xa4001138: <0x080007f6> J 0x1fd8 SpMemXfer -0xa400113c: <0x0282a020> ADD s4 = s4 + v0 dmem - -ZeldaMoveMem: 0xdc08000a 0x8010e830 Type: 0a Len: 08 Off: 4000 -ZeldaMoveMem: 0xdc08030a 0x8010e840 Type: 0a Len: 08 Off: 4018 -// Light -ZeldaMoveMem: 0xdc08060a 0x800ff368 Type: 0a Len: 08 Off: 4030 -ZeldaMoveMem: 0xdc08090a 0x800ff360 Type: 0a Len: 08 Off: 4048 -//VP -ZeldaMoveMem: 0xdc080008 0x8010e3c0 Type: 08 Len: 08 Off: 4000 - -*/ - //***************************************************************************** // //***************************************************************************** @@ -365,9 +268,6 @@ void DLParser_GBI2_MoveMem( MicroCodeCommand command ) u32 light_idx = offset / 24; if (light_idx < 2) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MV_LOOKAT" ); - #endif return; } @@ -382,35 +282,12 @@ void DLParser_GBI2_MoveMem( MicroCodeCommand command ) case G_GBI2_MV_MATRIX: { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Force Matrix(2): addr=%08X", address); - #endif // Rayman 2, Donald Duck, Tarzan, all wrestling games use this gRenderer->ForceMatrix( address ); // ForceMatrix takes two cmds gDlistStack.address[gDlistStackPointer] += 8; } break; -/* - case G_GBI2_MVO_L0: - case G_GBI2_MVO_L1: - case G_GBI2_MVO_L2: - case G_GBI2_MVO_L3: - case G_GBI2_MVO_L4: - case G_GBI2_MVO_L5: - case G_GBI2_MVO_L6: - case G_GBI2_MVO_L7: - DL_PF("MoveMem Light(2)"); - break; - case G_GBI2_MV_POINT: - DL_PF("MoveMem Point(2)"); - break; - - case G_GBI2_MVO_LOOKATY: - DL_PF("MoveMem LOOKATY(2)"); - break; -*/ - case 0x00: case 0x02: { @@ -422,9 +299,6 @@ void DLParser_GBI2_MoveMem( MicroCodeCommand command ) break; default: -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DBGConsole_Msg(0, "GBI2 MoveMem: Unknown Type. 0x%08x 0x%08x", command.inst.cmd0, command.inst.cmd1); -#endif break; } } @@ -446,9 +320,6 @@ void DLParser_MoveMem_Acclaim( MicroCodeCommand command ) if (offset <= 24 * 3) { u32 light_idx = offset / 24; if (light_idx < 2) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" G_MV_LOOKAT" ); - #endif } else { light_idx -= 2; N64Light *light = (N64Light*)(g_pu8RamBase + address); @@ -471,9 +342,6 @@ void DLParser_MoveMem_Acclaim( MicroCodeCommand command ) break; case G_GBI2_MV_MATRIX: { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Force Matrix(2): addr=%08X", address); - #endif gRenderer->ForceMatrix( address ); // ForceMatrix takes two cmds gDlistStack.address[gDlistStackPointer] += 8; @@ -496,20 +364,12 @@ void DLParser_GBI2_DL_Count( MicroCodeCommand command ) // For SSB and Kirby, otherwise we'll end up scrapping the pc if (address == 0) { - #ifdef DAEDALUS_DEBUG_CONSOLE - DAEDALUS_ERROR("Invalid DL Count"); - #endif return; } gDlistStackPointer++; gDlistStack.address[gDlistStackPointer] = address; gDlistStack.limit = (command.inst.cmd0) & 0xFFFF; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Address=0x%08x %s", address, (command.dlist.param==G_DL_NOPUSH)? "Jump" : (command.dlist.param==G_DL_PUSH)? "Push" : "?"); - DL_PF(" \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/"); - DL_PF(" ############################################"); -#endif } //***************************************************************************** @@ -519,17 +379,6 @@ void DLParser_GBI2_GeometryMode( MicroCodeCommand command ) { gGeometryMode._u32 &= command.inst.arg0; gGeometryMode._u32 |= command.inst.arg1; -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" 0x%08x 0x%08x =(x & 0x%08x) | 0x%08x", command.inst.cmd0, command.inst.cmd1, command.inst.arg0, command.inst.arg1); - DL_PF(" ZBuffer %s", (gGeometryMode.GBI2_Zbuffer) ? "On" : "Off"); - DL_PF(" Culling %s", (gGeometryMode.GBI2_CullBack) ? "Back face" : (gGeometryMode.GBI2_CullFront) ? "Front face" : "Off"); - DL_PF(" Smooth Shading %s", (gGeometryMode.GBI2_ShadingSmooth) ? "On" : "Off"); - DL_PF(" Lighting %s", (gGeometryMode.GBI2_Lighting) ? "On" : "Off"); - DL_PF(" Texture Gen %s", (gGeometryMode.GBI2_TexGen) ? "On" : "Off"); - DL_PF(" Texture Gen Linear %s", (gGeometryMode.GBI2_TexGenLin) ? "On" : "Off"); - DL_PF(" Fog %s", (gGeometryMode.GBI2_Fog) ? "On" : "Off"); - DL_PF(" PointLight %s", (gGeometryMode.GBI2_PointLight) ? "On" : "Off"); -#endif TnLMode TnL; TnL._u32 = 0; @@ -559,10 +408,6 @@ void DLParser_GBI2_SetOtherModeL( MicroCodeCommand command ) const u32 mask = (u32)((s32)(0x80000000) >> command.othermode.len) >> command.othermode.sft; gRDPOtherMode.L = (gRDPOtherMode.L & ~mask) | command.othermode.data; - -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DLDebug_DumpRDPOtherModeL(mask, command.othermode.data); -#endif } //***************************************************************************** @@ -574,10 +419,6 @@ void DLParser_GBI2_SetOtherModeH( MicroCodeCommand command ) const u32 mask = (u32)((s32)(0x80000000) >> command.othermode.len) >> command.othermode.sft; gRDPOtherMode.H = (gRDPOtherMode.H & ~mask) | command.othermode.data; - -#ifdef DAEDALUS_DEBUG_DISPLAYLIST - DLDebug_DumpRDPOtherModeH(mask, command.othermode.data); -#endif } //***************************************************************************** @@ -585,17 +426,12 @@ void DLParser_GBI2_SetOtherModeH( MicroCodeCommand command ) //***************************************************************************** void DLParser_GBI2_Texture( MicroCodeCommand command ) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Level[%d] Tile[%d] %s", command.texture.level, command.texture.tile, command.texture.enable_gbi2 ? "enable":"disable"); - #endif gRenderer->SetTextureTile( command.texture.tile ); gRenderer->SetTextureEnable( command.texture.enable_gbi2 ); f32 scale_s = f32(command.texture.scaleS) / (65535.0f * 32.0f); f32 scale_t = f32(command.texture.scaleT) / (65535.0f * 32.0f); - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" ScaleS[%0.4f], ScaleT[%0.4f]", scale_s*32.0f, scale_t*32.0f); - #endif + gRenderer->SetTextureScale( scale_s, scale_t ); } @@ -604,19 +440,12 @@ void DLParser_GBI2_Texture( MicroCodeCommand command ) //***************************************************************************** void DLParser_GBI2_Texture_AM( MicroCodeCommand command ) { - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" Level[%d] Tile[%d] %s", command.texture.level, command.texture.tile, command.texture.enable_gbi2 ? "enable":"disable"); - #endif gRenderer->SetTextureTile( command.texture.tile ); gRenderer->SetTextureEnable( command.texture.enable_gbi2 ); f32 scale_s = 1.0f / (65535.0f * 32.0f); f32 scale_t = 1.0f / (65535.0f * 32.0f); - #ifdef DAEDALUS_DEBUG_DISPLAYLIST - DL_PF(" ScaleS[%0.4f], ScaleT[%0.4f]", scale_s*32.0f, scale_t*32.0f); - #endif - gRenderer->SetTextureScale( scale_s, scale_t ); gRenderer->SetTextureScaleDAM(command.inst.cmd1); } @@ -626,9 +455,6 @@ void DLParser_GBI2_Texture_AM( MicroCodeCommand command ) //***************************************************************************** void DLParser_GBI2_DMA_IO( MicroCodeCommand command ) { - #ifdef DAEDALUS_DEBUG_CONSOLE - DL_UNIMPLEMENTED_ERROR( "G_DMA_IO" ); - #endif } //***************************************************************************** diff --git a/Source/OSHLE/ultra_gbi.h b/Source/OSHLE/ultra_gbi.h index d2d2d7e2..dad84f3f 100644 --- a/Source/OSHLE/ultra_gbi.h +++ b/Source/OSHLE/ultra_gbi.h @@ -56,16 +56,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** // GBI1 //***************************************************************************** -#define G_GBI1_SPNOOP 0 -#define G_GBI1_MTX 1 -#define G_GBI1_RESERVED0 2 -#define G_GBI1_MOVEMEM 3 -#define G_GBI1_VTX 4 -#define G_GBI1_RESERVED1 5 -#define G_GBI1_DL 6 -#define G_GBI1_RESERVED2 7 -#define G_GBI1_RESERVED3 8 -#define G_GBI1_SPRITE2D_BASE 9 +#define G_GBI1_SPNOOP 0x00 +#define G_GBI1_MTX 0x01 +#define G_GBI1_RESERVED0 0x02 +#define G_GBI1_MOVEMEM 0x03 +#define G_GBI1_VTX 0x04 +#define G_GBI1_RESERVED1 0x05 +#define G_GBI1_DL 0x06 +#define G_GBI1_RESERVED2 0x07 +#define G_GBI1_RESERVED3 0x08 +#define G_GBI1_SPRITE2D_BASE 0x09 #define G_GBI1_NOOP 0xc0 /* 0 */ #define G_GBI1_TRI1 0xbf @@ -81,14 +81,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define G_GBI1_LINE3D 0xb5 #define G_GBI1_RDPHALF_1 0xb4 #define G_GBI1_RDPHALF_2 0xb3 -//#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) -# define G_GBI1_MODIFYVTX 0xb2 -# define G_GBI1_TRI2 0xb1 -# define G_GBI1_BRANCH_Z 0xb0 -# define G_GBI1_LOAD_UCODE 0xaf -//#else -# define G_GBI1_RDPHALF_CONT 0xb2 -//#endif +#define G_GBI1_MODIFYVTX 0xb2 +#define G_GBI1_TRI2 0xb1 +#define G_GBI1_BRANCH_Z 0xb0 +#define G_GBI1_LOAD_UCODE 0xaf +#define G_GBI1_RDPHALF_CONT 0xb2 // Overloaded for sprite microcode #define G_GBI1_SPRITE2D_SCALEFLIP 0xbe