From ef6f470df753bf387b46ca12646ddb1c0eec3b2a Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 16 Sep 2017 18:24:06 +0700 Subject: [PATCH] Revert "Fix implementation of 0xD5 (Special_1) command for F3DEX2 ucode." This reverts commit 8985e38bc030bff1adc5dbd4a70cc74691bb085c. --- src/F3DEX2.cpp | 7 +++++-- src/GBI.cpp | 6 +++++- src/GBI.h | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/F3DEX2.cpp b/src/F3DEX2.cpp index 5e8627ad..45ceb745 100644 --- a/src/F3DEX2.cpp +++ b/src/F3DEX2.cpp @@ -138,8 +138,11 @@ void F3DEX2_DMAIO( u32 w0, u32 w1 ) void F3DEX2_Special_1( u32 w0, u32 w1 ) { - const u32 mode = _SHIFTR( w0, 0, 8 ); - gSPCombineMatrices(mode); + const u32 param = _SHIFTR(w0, 0, 8); + if (GBI.isCombineMatrices()) + gSPCombineMatrices(param); + else + gSPDlistCount(param, w1); } void F3DEX2_Special_2( u32 w0, u32 w1 ) diff --git a/src/GBI.cpp b/src/GBI.cpp index 74111129..38d9e8fb 100644 --- a/src/GBI.cpp +++ b/src/GBI.cpp @@ -251,6 +251,7 @@ void GBIInfo::loadMicrocode(u32 uc_start, u32 uc_dstart, u16 uc_dsize) current.negativeY = true; current.textureGen = true; current.texturePersp = true; + current.combineMatrices = false; current.type = NONE; // See if we can identify it by CRC @@ -292,8 +293,11 @@ void GBIInfo::loadMicrocode(u32 uc_start, u32 uc_dstart, u16 uc_dsize) if (strncmp( &uc_str[14], "F3D", 3 ) == 0) { if (uc_str[28] == '1' || strncmp(&uc_str[28], "0.95", 4) == 0 || strncmp(&uc_str[28], "0.96", 4) == 0) type = F3DEX; - else if (uc_str[31] == '2') + else if (uc_str[31] == '2') { type = F3DEX2; + if (uc_str[35] == 'H') + current.combineMatrices = true; + } if (strncmp(&uc_str[14], "F3DF", 4) == 0) current.textureGen = false; else if (strncmp(&uc_str[14], "F3DZEX", 6) == 0) { diff --git a/src/GBI.h b/src/GBI.h index 8271dd89..019263c7 100644 --- a/src/GBI.h +++ b/src/GBI.h @@ -501,6 +501,7 @@ struct MicrocodeInfo bool negativeY; bool textureGen; bool texturePersp; + bool combineMatrices; }; struct GBIInfo @@ -518,6 +519,7 @@ struct GBIInfo bool isNegativeY() const { return m_pCurrent != nullptr ? m_pCurrent->negativeY : true; } bool isTextureGen() const { return m_pCurrent != nullptr ? m_pCurrent->textureGen: true; } bool isTexturePersp() const { return m_pCurrent != nullptr ? m_pCurrent->texturePersp: true; } + bool isCombineMatrices() const { return m_pCurrent != nullptr ? m_pCurrent->combineMatrices: false; } private: void _flushCommands();