Skip to content

Commit

Permalink
Add support for F3DEX 0.95
Browse files Browse the repository at this point in the history
See #2774 for details.
  • Loading branch information
gonetz committed Aug 10, 2024
1 parent 0056e08 commit 85c7c71
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
2 changes: 2 additions & 0 deletions projects/msvc/GLideN64.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)")</Command>
<ClCompile Include="..\..\src\uCodes\F3DBETA.cpp" />
<ClCompile Include="..\..\src\uCodes\F3DDKR.cpp" />
<ClCompile Include="..\..\src\uCodes\F3DEX.cpp" />
<ClCompile Include="..\..\src\uCodes\F3DEX095.cpp" />
<ClCompile Include="..\..\src\uCodes\F3DEX2.cpp" />
<ClCompile Include="..\..\src\uCodes\F3DEX2ACCLAIM.cpp" />
<ClCompile Include="..\..\src\uCodes\F3DEX2CBFD.cpp" />
Expand Down Expand Up @@ -540,6 +541,7 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)")</Command>
<ClInclude Include="..\..\src\uCodes\F3DBETA.h" />
<ClInclude Include="..\..\src\uCodes\F3DDKR.h" />
<ClInclude Include="..\..\src\uCodes\F3DEX.h" />
<ClInclude Include="..\..\src\uCodes\F3DEX095.h" />
<ClInclude Include="..\..\src\uCodes\F3DEX2.h" />
<ClInclude Include="..\..\src\uCodes\F3DEX2ACCLAIM.h" />
<ClInclude Include="..\..\src\uCodes\F3DEX2CBFD.h" />
Expand Down
12 changes: 9 additions & 3 deletions projects/msvc/GLideN64.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@
<ClCompile Include="..\..\src\uCodes\F3DEX3.cpp">
<Filter>Source Files\uCodes</Filter>
</ClCompile>
<ClCompile Include="..\..\src\uCodes\F3DEX095.cpp">
<Filter>Source Files\uCodes</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\3DMath.h">
Expand Down Expand Up @@ -700,9 +703,15 @@
<ClInclude Include="..\..\src\uCodes\F3DEX.h">
<Filter>Header Files\uCodes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\uCodes\F3DEX095.h">
<Filter>Header Files\uCodes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\uCodes\F3DEX2.h">
<Filter>Header Files\uCodes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\uCodes\F3DEX3.h">
<Filter>Header Files\uCodes</Filter>
</ClInclude>
<ClInclude Include="..\..\src\uCodes\F3DEX2ACCLAIM.h">
<Filter>Header Files\uCodes</Filter>
</ClInclude>
Expand Down Expand Up @@ -820,9 +829,6 @@
<ClInclude Include="..\..\src\GLideNHQ\TxFilterExport.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\uCodes\F3DEX3.h">
<Filter>Header Files\uCodes</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\GLideN64.rc">
Expand Down
8 changes: 7 additions & 1 deletion src/GBI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -58,7 +59,7 @@ static const
std::vector<SpecialMicrocodeInfo> 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
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/GBI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/uCodes/F3DEX095.cpp
Original file line number Diff line number Diff line change
@@ -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);
}
7 changes: 7 additions & 0 deletions src/uCodes/F3DEX095.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef F3DEX095_H
#define F3DEX095_H

void F3DEX095_Init();

#endif

0 comments on commit 85c7c71

Please sign in to comment.