From 85c7c71b3d6f009bcfb16a4e573f1ccdd93e8c51 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 10 Aug 2024 15:00:01 +0700 Subject: [PATCH 1/2] Add support for F3DEX 0.95 See #2774 for details. --- projects/msvc/GLideN64.vcxproj | 2 ++ projects/msvc/GLideN64.vcxproj.filters | 12 +++++++++--- src/GBI.cpp | 8 +++++++- src/GBI.h | 3 ++- src/uCodes/F3DEX095.cpp | 12 ++++++++++++ src/uCodes/F3DEX095.h | 7 +++++++ 6 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 src/uCodes/F3DEX095.cpp create mode 100644 src/uCodes/F3DEX095.h diff --git a/projects/msvc/GLideN64.vcxproj b/projects/msvc/GLideN64.vcxproj index 05318ee8a..73d370839 100644 --- a/projects/msvc/GLideN64.vcxproj +++ b/projects/msvc/GLideN64.vcxproj @@ -391,6 +391,7 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)") + @@ -540,6 +541,7 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)") + diff --git a/projects/msvc/GLideN64.vcxproj.filters b/projects/msvc/GLideN64.vcxproj.filters index 42581c680..46a4fe58b 100644 --- a/projects/msvc/GLideN64.vcxproj.filters +++ b/projects/msvc/GLideN64.vcxproj.filters @@ -443,6 +443,9 @@ Source Files\uCodes + + Source Files\uCodes + @@ -700,9 +703,15 @@ Header Files\uCodes + + Header Files\uCodes + Header Files\uCodes + + Header Files\uCodes + Header Files\uCodes @@ -820,9 +829,6 @@ Header Files - - Header Files\uCodes - diff --git a/src/GBI.cpp b/src/GBI.cpp index ff72715f2..3313627f0 100644 --- a/src/GBI.cpp +++ b/src/GBI.cpp @@ -12,6 +12,7 @@ #include "RSP.h" #include "uCodes/F3D.h" #include "uCodes/F3DEX.h" +#include "uCodes/F3DEX095.h" #include "uCodes/F3DEX2.h" #include "uCodes/F3DEX3.h" #include "uCodes/L3D.h" @@ -58,7 +59,7 @@ static const std::vector specialMicrocodes = { { S2DEX2, false, true, false, 0x02c399dd }, // Animal Forest - { F3DEX, false, false, true, 0x0ace4c3f }, // Mario Kart 64 + { F3DEX095, false, false, true, 0x0ace4c3f }, // Mario Kart 64 { F3D, true, false, false, 0x16c3a775 }, // AeroFighters { F3DEX2CBFD, true, true, false, 0x1b4ace88 }, // Conker's Bad Fur Day { F3DPD, true, true, false, 0x1c4f7869 }, // Perfect Dark @@ -209,6 +210,11 @@ void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent) F3D_Init(); m_hwlSupported = true; break; + case F3DEX095: + F3DEX095_Init(); + m_hwlSupported = true; + gSP.clipRatio = m_pCurrent->Rej ? 2U : 1U; + break; case F3DEX: F3DEX_Init(); m_hwlSupported = true; diff --git a/src/GBI.h b/src/GBI.h index 0a3c9d6df..3f009e46d 100644 --- a/src/GBI.h +++ b/src/GBI.h @@ -36,7 +36,8 @@ #define S2DEX_1_03 27 #define S2DEX_1_05 28 #define F3DEX3 29 -#define NONE 30 +#define F3DEX095 30 +#define NONE 31 // Fixed point conversion factors #define FIXED2FLOATRECIP1 0.5f diff --git a/src/uCodes/F3DEX095.cpp b/src/uCodes/F3DEX095.cpp new file mode 100644 index 000000000..047c5f734 --- /dev/null +++ b/src/uCodes/F3DEX095.cpp @@ -0,0 +1,12 @@ +#include "F3D.h" +#include "F3DEX.h" +#include "F3DEX095.h" +#include "gSP.h" +#include "GBI.h" + +// See #2774 for details +void F3DEX095_Init() +{ + F3DEX_Init(); + GBI_SetGBI(G_CULLDL, F3D_CULLDL, F3D_CullDL); +} diff --git a/src/uCodes/F3DEX095.h b/src/uCodes/F3DEX095.h new file mode 100644 index 000000000..3e22270c7 --- /dev/null +++ b/src/uCodes/F3DEX095.h @@ -0,0 +1,7 @@ +#ifndef F3DEX095_H +#define F3DEX095_H + +void F3DEX095_Init(); + +#endif + From 80a7660f02c921c470de720ac27213c8bdc0642b Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 10 Aug 2024 16:24:28 +0700 Subject: [PATCH 2/2] Update CMake file. --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8f04011f5..a49783cca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -120,6 +120,7 @@ set(GLideN64_SOURCES uCodes/F3DBETA.cpp uCodes/F3DDKR.cpp uCodes/F3DEX.cpp + uCodes/F3DEX095.cpp uCodes/F3DAM.cpp uCodes/F3DEX2.cpp uCodes/F3DEX3.cpp