Skip to content

Commit

Permalink
Remove superVU. (#3386)
Browse files Browse the repository at this point in the history
* Remove superVU, as well as the VUClipFlagHack, which was SuperVU only.
  • Loading branch information
arcum42 committed May 25, 2020
1 parent 3c65ddf commit 2b115d0
Show file tree
Hide file tree
Showing 34 changed files with 9 additions and 12,539 deletions.
17 changes: 0 additions & 17 deletions bin/GameIndex.dbf
Expand Up @@ -56,7 +56,6 @@
-- Game Fixes (gameFixName = 1)
---------------------------------------------
-- VuAddSubHack = 1 // Tri-ace games, they use an encryption algorithm that requires VU ADDI opcode to be bit-accurate.
-- VuClipFlagHack = 1 // Persona games, maybe others. It's to do with the VU clip flag (sVU-only).
-- FpuCompareHack = 1 // Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu.
-- FpuMulHack = 1 // Tales of Destiny hangs.
-- FpuNegDivHack = 1 // Gundam games messed up camera-view. Dakar 2's sky showing over 3D. Others...
Expand Down Expand Up @@ -3125,7 +3124,6 @@ Region = NTSC-K
Serial = SCKA-20099
Name = Persona 3
Region = NTSC-K
VuClipFlagHack = 1
---------------------------------------------
Serial = SCKA-20101
Name = Seiken Densetsu 4 (Dawn of Mana)
Expand All @@ -3139,7 +3137,6 @@ Region = NTSC-K
Serial = SCKA-20109
Name = Persona 3 FES [Independent Starting Version]
Region = NTSC-K
VuClipFlagHack = 1
MemCardFilter = SCKA-20109/SCKA-20099
---------------------------------------------
Serial = SCKA-20114
Expand All @@ -3158,7 +3155,6 @@ Serial = SCKA-20132
Name = Shin Megami Tensei: Persona 4
Region = NTSC-K
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SCKA-24008
Name = SOCOM - U.S. Navy SEALs
Expand Down Expand Up @@ -17695,7 +17691,6 @@ Serial = SLES-55018
Name = Shin Megami Tensei: Persona 3
Region = PAL-E
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SLES-55019
Name = Ratchet & Clank - Size Matters
Expand Down Expand Up @@ -18081,7 +18076,6 @@ Compat = 5
Serial = SLES-55354
Name = Shin Megami Tensei: Persona 3 FES
Region = PAL-E
VuClipFlagHack = 1
MemCardFilter = SLES-55354/SLES-55018
---------------------------------------------
Serial = SLES-55355
Expand Down Expand Up @@ -18233,7 +18227,6 @@ Region = PAL-M5
Serial = SLES-55474
Name = Shin Megami Tensei: Persona 4
Region = PAL-E
VuClipFlagHack = 1
---------------------------------------------
Serial = SLES-55476
Name = Scooby-Doo! First Frights
Expand Down Expand Up @@ -27428,7 +27421,6 @@ Serial = SLPM-66445
Name = Persona 3
Region = NTSC-J
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SLPM-66446
Name = Beat Down - Fists of Vengeance [CapKore]
Expand Down Expand Up @@ -28359,13 +28351,11 @@ Region = NTSC-J
Serial = SLPM-66689
Name = Persona 3 FES [Append Edition]
Region = NTSC-J
VuClipFlagHack = 1
MemCardFilter = SLPM-66445/SLPM-66689/SLPM-66690
---------------------------------------------
Serial = SLPM-66690
Name = Persona 3 FES [Independent Starting Version]
Region = NTSC-J
VuClipFlagHack = 1
MemCardFilter = SLPM-66445/SLPM-66689/SLPM-66690
---------------------------------------------
Serial = SLPM-66691
Expand Down Expand Up @@ -29447,7 +29437,6 @@ Serial = SLPM-66978
Name = Persona 4 [Konami-style Special Edition]
Region = NTSC-J
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SLPM-66987
Name = Kowloon Youma Gakuen Ki [Best Version]
Expand Down Expand Up @@ -29923,12 +29912,10 @@ Serial = SLPM-74277
Name = Persona 3 FES [PlayStation 2 The Best]
Region = NTSC-J
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SLPM-74278
Name = Persona 4 [PlayStation 2 The Best]
Region = NTSC-J
VuClipFlagHack = 1
---------------------------------------------
Serial = SLPM-74286
Name = Shin Sangoku Musou 5 Special [PlayStation 2 The Best]
Expand Down Expand Up @@ -42478,7 +42465,6 @@ Serial = SLUS-21569
Name = Shin Megami Tensei: Persona 3
Region = NTSC-U
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SLUS-21570
Name = Heatseeker
Expand Down Expand Up @@ -42748,7 +42734,6 @@ Serial = SLUS-21621
Name = Shin Megami Tensei: Persona 3 FES
Region = NTSC-U
Compat = 5
VuClipFlagHack = 1
MemCardFilter = SLUS-21621/SLUS-21569
---------------------------------------------
Serial = SLUS-21622
Expand Down Expand Up @@ -43525,13 +43510,11 @@ Serial = SLUS-21782
Name = Shin Megami Tensei: Persona 4
Region = NTSC-U
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SLUS-21782B
Name = Shin Megami Tensei: Persona 4
Region = NTSC-U
Compat = 5
VuClipFlagHack = 1
---------------------------------------------
Serial = SLUS-21783
Name = Space Chimps
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Expand Up @@ -126,7 +126,7 @@ run_clangtidy()
compile_json=compile_commands.json
cpp_list=cpp_file.txt
summary=clang_tidy_summary.txt
grep '"file"' $compile_json | sed -e 's/"//g' -e 's/^\s*file\s*:\s*//' | grep -v "aVUzerorec.S" | sort -u > $cpp_list
grep '"file"' $compile_json | sed -e 's/"//g' -e 's/^\s*file\s*:\s*//' | sort -u > $cpp_list

# EXAMPLE
#
Expand Down
12 changes: 0 additions & 12 deletions cmake/BuildParameters.cmake
Expand Up @@ -20,7 +20,6 @@
#-------------------------------------------------------------------------------
# Misc option
#-------------------------------------------------------------------------------
option(DISABLE_SVU "Disable superVU (don't use it)")
option(DISABLE_BUILD_DATE "Disable including the binary compile date")

if(DISABLE_BUILD_DATE OR openSUSE)
Expand Down Expand Up @@ -222,11 +221,6 @@ if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386")
endif()
endif()

# Don't bother porting SuperVU
if (NOT Linux)
set(DISABLE_SVU TRUE)
endif()

add_definitions(-D_ARCH_32=1 -D_M_X86=1 -D_M_X86_32=1)
set(_ARCH_32 1)
set(_M_X86 1)
Expand All @@ -235,9 +229,6 @@ elseif(${PCSX2_TARGET_ARCHITECTURES} MATCHES "x86_64")
# x86_64 requires -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# SuperVU will not be ported
set(DISABLE_SVU TRUE)

if(NOT DEFINED ARCH_FLAG)
if (DISABLE_ADVANCE_SIMD)
if (USE_ICC)
Expand Down Expand Up @@ -309,9 +300,6 @@ option(USE_PGO_OPTIMIZE "Enable PGO optimization (use profile)")
# Note1: Builtin strcmp/memcmp was proved to be slower on Mesa than stdlib version.
# Note2: float operation SSE is impacted by the PCSX2 SSE configuration. In particular, flush to zero denormal.
set(COMMON_FLAG "-pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp -mfpmath=sse")
if (DISABLE_SVU)
set(COMMON_FLAG "${COMMON_FLAG} -DDISABLE_SVU")
endif()

if(USE_VTUNE)
set(COMMON_FLAG "${COMMON_FLAG} -DENABLE_VTUNE")
Expand Down
24 changes: 1 addition & 23 deletions pcsx2/CMakeLists.txt
Expand Up @@ -153,7 +153,6 @@ set(pcsx2Headers
MTVU.h
Memory.h
MemoryTypes.h
NakedAsm.h
Patch.h
PathDefs.h
Plugins.h
Expand Down Expand Up @@ -562,14 +561,6 @@ set(pcsx2x86Sources
x86/newVif_Unpack.cpp
x86/newVif_UnpackSSE.cpp
)
if (NOT DISABLE_SVU)
set(pcsx2x86Sources ${pcsx2x86Sources}
x86/sVU_Lower.cpp
x86/sVU_Micro.cpp
x86/sVU_Upper.cpp
x86/sVU_zerorec.cpp
)
endif()

# x86 headers
set(pcsx2x86Headers
Expand Down Expand Up @@ -610,20 +601,8 @@ set(pcsx2x86Headers
x86/newVif_HashBucket.h
x86/newVif_UnpackSSE.h
x86/R5900_Profiler.h
x86/sVU_Micro.h
x86/sVU_zerorec.h
)

# collect .S files
if (NOT DISABLE_SVU)
set(pcsx2SSources x86/aVUzerorec.S)
# change language of .S-files to c++
set_source_files_properties(${pcsx2SSources} PROPERTIES LANGUAGE CXX)
else()
set(pcsx2SSources "")
endif()


# common Sources
set(Common
${pcsx2Sources}
Expand All @@ -647,8 +626,7 @@ set(Common
${pcsx2x86Sources}
${pcsx2x86Headers}
${pcsx2ZipToolsSources}
${pcsx2ZipToolsHeaders}
${pcsx2SSources})
${pcsx2ZipToolsHeaders})

# platform sources
# Linux
Expand Down
3 changes: 0 additions & 3 deletions pcsx2/Config.h
Expand Up @@ -43,7 +43,6 @@ enum GamefixId
GamefixId_FIRST = 0,

Fix_VuAddSub = GamefixId_FIRST,
Fix_VuClipFlag,
Fix_FpuCompare,
Fix_FpuMultiply,
Fix_FpuNegDiv,
Expand Down Expand Up @@ -347,7 +346,6 @@ struct Pcsx2Config
BITFIELD32()
bool
VuAddSubHack : 1, // Tri-ace games, they use an encryption algorithm that requires VU ADDI opcode to be bit-accurate.
VuClipFlagHack : 1, // Persona games, maybe others. It's to do with the VU clip flag (again).
FpuCompareHack : 1, // Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu.
FpuMulHack : 1, // Tales of Destiny hangs.
FpuNegDivHack : 1, // Gundam games messed up camera-view.
Expand Down Expand Up @@ -537,7 +535,6 @@ TraceLogFilters& SetTraceConfig();
//------------ SPECIAL GAME FIXES!!! ---------------
#define CHECK_VUADDSUBHACK (EmuConfig.Gamefixes.VuAddSubHack) // Special Fix for Tri-ace games, they use an encryption algorithm that requires VU addi opcode to be bit-accurate.
#define CHECK_FPUCOMPAREHACK (EmuConfig.Gamefixes.FpuCompareHack) // Special Fix for Digimon Rumble Arena 2, fixes spinning/hanging on intro-menu.
#define CHECK_VUCLIPFLAGHACK (EmuConfig.Gamefixes.VuClipFlagHack) // Special Fix for Persona games, maybe others. It's to do with the VU clip flag (again).
#define CHECK_FPUMULHACK (EmuConfig.Gamefixes.FpuMulHack) // Special Fix for Tales of Destiny hangs.
#define CHECK_FPUNEGDIVHACK (EmuConfig.Gamefixes.FpuNegDivHack) // Special Fix for Gundam games messed up camera-view.
#define CHECK_XGKICKHACK (EmuConfig.Gamefixes.XgKickHack) // Special Fix for Erementar Gerad, adds more delay to VU XGkick instructions. Corrects the color of some graphics.
Expand Down
30 changes: 0 additions & 30 deletions pcsx2/NakedAsm.h

This file was deleted.

3 changes: 0 additions & 3 deletions pcsx2/Pcsx2Config.cpp
Expand Up @@ -316,7 +316,6 @@ void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled )
switch(id)
{
case Fix_VuAddSub: VuAddSubHack = enabled; break;
case Fix_VuClipFlag: VuClipFlagHack = enabled; break;
case Fix_FpuCompare: FpuCompareHack = enabled; break;
case Fix_FpuMultiply: FpuMulHack = enabled; break;
case Fix_FpuNegDiv: FpuNegDivHack = enabled; break;
Expand All @@ -343,7 +342,6 @@ bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const
switch(id)
{
case Fix_VuAddSub: return VuAddSubHack;
case Fix_VuClipFlag: return VuClipFlagHack;
case Fix_FpuCompare: return FpuCompareHack;
case Fix_FpuMultiply: return FpuMulHack;
case Fix_FpuNegDiv: return FpuNegDivHack;
Expand All @@ -370,7 +368,6 @@ void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
ScopedIniGroup path( ini, L"Gamefixes" );

IniBitBool( VuAddSubHack );
IniBitBool( VuClipFlagHack );
IniBitBool( FpuCompareHack );
IniBitBool( FpuMulHack );
IniBitBool( FpuNegDivHack );
Expand Down
44 changes: 1 addition & 43 deletions pcsx2/System.cpp
Expand Up @@ -101,8 +101,7 @@ RecompiledCodeReserve& RecompiledCodeReserve::SetProfilerName( const wxString& s
return *this;
}

// This error message is shared by R5900, R3000, and microVU recompilers. It is not used by the
// SuperVU recompiler, since it has its own customized message.
// This error message is shared by R5900, R3000, and microVU recompilers.
void RecompiledCodeReserve::ThrowIfNotOk() const
{
if (IsOk()) return;
Expand Down Expand Up @@ -334,12 +333,6 @@ CpuInitializer< CpuType >::~CpuInitializer()
class CpuInitializerSet
{
public:
#ifndef DISABLE_SVU
// Note: Allocate sVU first -- it's the most picky.
CpuInitializer<recSuperVU0> superVU0;
CpuInitializer<recSuperVU1> superVU1;
#endif

CpuInitializer<recMicroVU0> microVU0;
CpuInitializer<recMicroVU1> microVU1;

Expand Down Expand Up @@ -501,14 +494,6 @@ bool SysCpuProviderPack::IsRecAvailable_MicroVU1() const { return CpuProviders->
BaseException* SysCpuProviderPack::GetException_MicroVU0() const { return CpuProviders->microVU0.ExThrown.get(); }
BaseException* SysCpuProviderPack::GetException_MicroVU1() const { return CpuProviders->microVU1.ExThrown.get(); }

#ifndef DISABLE_SVU
bool SysCpuProviderPack::IsRecAvailable_SuperVU0() const { return CpuProviders->superVU0.IsAvailable(); }
bool SysCpuProviderPack::IsRecAvailable_SuperVU1() const { return CpuProviders->superVU1.IsAvailable(); }
BaseException* SysCpuProviderPack::GetException_SuperVU0() const { return CpuProviders->superVU0.ExThrown.get(); }
BaseException* SysCpuProviderPack::GetException_SuperVU1() const { return CpuProviders->superVU1.ExThrown.get(); }
#endif


void SysCpuProviderPack::CleanupMess() noexcept
{
try
Expand All @@ -534,15 +519,8 @@ bool SysCpuProviderPack::HadSomeFailures( const Pcsx2Config::RecompilerOptions&
{
return (recOpts.EnableEE && !IsRecAvailable_EE()) ||
(recOpts.EnableIOP && !IsRecAvailable_IOP()) ||
#ifndef DISABLE_SVU
(recOpts.EnableVU0 && recOpts.UseMicroVU0 && !IsRecAvailable_MicroVU0()) ||
(recOpts.EnableVU1 && recOpts.UseMicroVU0 && !IsRecAvailable_MicroVU1()) ||
(recOpts.EnableVU0 && !recOpts.UseMicroVU0 && !IsRecAvailable_SuperVU0()) ||
(recOpts.EnableVU1 && !recOpts.UseMicroVU1 && !IsRecAvailable_SuperVU1())
#else
(recOpts.EnableVU0 && !IsRecAvailable_MicroVU0()) ||
(recOpts.EnableVU1 && !IsRecAvailable_MicroVU1())
#endif
;

}
Expand All @@ -559,31 +537,11 @@ void SysCpuProviderPack::ApplyConfig() const
CpuVU1 = CpuProviders->interpVU1;

if( EmuConfig.Cpu.Recompiler.EnableVU0 )
#ifndef DISABLE_SVU
CpuVU0 = EmuConfig.Cpu.Recompiler.UseMicroVU0 ? (BaseVUmicroCPU*)CpuProviders->microVU0 : (BaseVUmicroCPU*)CpuProviders->superVU0;
#else
CpuVU0 = (BaseVUmicroCPU*)CpuProviders->microVU0;
#endif

if( EmuConfig.Cpu.Recompiler.EnableVU1 )
#ifndef DISABLE_SVU
CpuVU1 = EmuConfig.Cpu.Recompiler.UseMicroVU1 ? (BaseVUmicroCPU*)CpuProviders->microVU1 : (BaseVUmicroCPU*)CpuProviders->superVU1;
#else
CpuVU1 = (BaseVUmicroCPU*)CpuProviders->microVU1;
#endif
}

#ifndef DISABLE_SVU
// This is a semi-hacky function for convenience
BaseVUmicroCPU* SysCpuProviderPack::getVUprovider(int whichProvider, int vuIndex) const {
switch (whichProvider) {
case 0: return vuIndex ? (BaseVUmicroCPU*)CpuProviders->interpVU1 : (BaseVUmicroCPU*)CpuProviders->interpVU0;
case 1: return vuIndex ? (BaseVUmicroCPU*)CpuProviders->superVU1 : (BaseVUmicroCPU*)CpuProviders->superVU0;
case 2: return vuIndex ? (BaseVUmicroCPU*)CpuProviders->microVU1 : (BaseVUmicroCPU*)CpuProviders->microVU0;
}
return NULL;
}
#endif

// Resets all PS2 cpu execution caches, which does not affect that actual PS2 state/condition.
// This can be called at any time outside the context of a Cpu->Execute() block without
Expand Down

0 comments on commit 2b115d0

Please sign in to comment.