From 1e44c2f3d0fad0c56d6412884329fb22afba7dbf Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 27 Apr 2021 03:11:19 +1000 Subject: [PATCH] GameSettings: Add trait to force LUT fastmem Should help with games like CMR2 and Lagnacure (which are constantly invalidating code), and THPS series (which use memory mirrors). --- data/database/gamesettings.ini | 126 ++++++++++++++++++++++++++ src/frontend-common/game_list.h | 2 +- src/frontend-common/game_settings.cpp | 13 +++ src/frontend-common/game_settings.h | 1 + 4 files changed, 141 insertions(+), 1 deletion(-) diff --git a/data/database/gamesettings.ini b/data/database/gamesettings.ini index fecd283f3..82ff2f546 100644 --- a/data/database/gamesettings.ini +++ b/data/database/gamesettings.ini @@ -850,3 +850,129 @@ DisplayActiveStartOffset = -44 # SCES-20900 (Final Fantasy VII (Spain) (Disc 3)) [SCES-20900] DisplayActiveStartOffset = -44 + + +# SLPS-02878 (Colin McRae - The Rally 02 (Japan)) +[SLPS-02878] +ForceRecompilerLUTFastmem = True + + +# SLES-02605 (Colin McRae Rally 2.0 (Europe) (En,Fr,De,Es,It)) +[SLES-02605] +ForceRecompilerLUTFastmem = True + + +# SLUS-01222 (Colin McRae Rally 2.0 (USA) (En,Fr,Es)) +[SLUS-01222] +ForceRecompilerLUTFastmem = True + + +# SLPM-86429 (Tony Hawk's Pro Skater (Japan)) +[SLPM-86429] +ForceRecompilerLUTFastmem = True + + +# SLPM-86943 (Tony Hawk's Pro Skater (Japan)) +[SLPM-86943] +ForceRecompilerLUTFastmem = True + + +# SLUS-00860 (Tony Hawk's Pro Skater (USA)) +[SLUS-00860] +ForceRecompilerLUTFastmem = True + + +# SLED-02879 (Tony Hawk's Pro Skater 2 (Australia) (Demo)) +[SLED-02879] +ForceRecompilerLUTFastmem = True + + +# SLED-03048 (Tony Hawk's Pro Skater 2 (Europe) (Demo)) +[SLED-03048] +ForceRecompilerLUTFastmem = True + + +# SLES-02908 (Tony Hawk's Pro Skater 2 (Europe, Australia)) +[SLES-02908] +ForceRecompilerLUTFastmem = True + + +# SLES-02909 (Tony Hawk's Pro Skater 2 (France)) +[SLES-02909] +ForceRecompilerLUTFastmem = True + + +# SLES-02910 (Tony Hawk's Pro Skater 2 (Germany)) +[SLES-02910] +ForceRecompilerLUTFastmem = True + + +# SLPM-86751 (Tony Hawk's Pro Skater 2 (Japan)) +[SLPM-86751] +ForceRecompilerLUTFastmem = True + + +# SLUS-01066 (Tony Hawk's Pro Skater 2 (USA)) +[SLUS-01066] +ForceRecompilerLUTFastmem = True + + +# SLUS-90086 (Tony Hawk's Pro Skater 2 (USA) (Demo)) +[SLUS-90086] +ForceRecompilerLUTFastmem = True + + +# SLES-03645 (Tony Hawk's Pro Skater 3 (Europe)) +[SLES-03645] +ForceRecompilerLUTFastmem = True + + +# SLES-03646 (Tony Hawk's Pro Skater 3 (France)) +[SLES-03646] +ForceRecompilerLUTFastmem = True + + +# SLES-03647 (Tony Hawk's Pro Skater 3 (Germany)) +[SLES-03647] +ForceRecompilerLUTFastmem = True + + +# SLUS-01419 (Tony Hawk's Pro Skater 3 (USA)) +[SLUS-01419] +ForceRecompilerLUTFastmem = True + + +# SLES-03954 (Tony Hawk's Pro Skater 4 (Europe)) +[SLES-03954] +ForceRecompilerLUTFastmem = True + + +# SLES-03956 (Tony Hawk's Pro Skater 4 (France)) +[SLES-03956] +ForceRecompilerLUTFastmem = True + + +# SLES-03955 (Tony Hawk's Pro Skater 4 (Germany)) +[SLES-03955] +ForceRecompilerLUTFastmem = True + + +# SLUS-01485 (Tony Hawk's Pro Skater 4 (USA)) +[SLUS-01485] +ForceRecompilerLUTFastmem = True + + +# SLPS-02833 (Lagnacure (Japan) (Artdink Best Choice)) +[SLPS-02833] +ForceRecompilerLUTFastmem = True + + +# SCPS-45120 (Lagnacure (Japan, Asia)) +[SCPS-45120] +ForceRecompilerLUTFastmem = True + + +# SLPS-01009 (Lagnacure (Japan, Asia)) +[SLPS-01009] +ForceRecompilerLUTFastmem = True + diff --git a/src/frontend-common/game_list.h b/src/frontend-common/game_list.h index 789c72f54..8d9e43e1d 100644 --- a/src/frontend-common/game_list.h +++ b/src/frontend-common/game_list.h @@ -129,7 +129,7 @@ private: enum : u32 { GAME_LIST_CACHE_SIGNATURE = 0x45434C47, - GAME_LIST_CACHE_VERSION = 26 + GAME_LIST_CACHE_VERSION = 27 }; using CacheMap = std::unordered_map; diff --git a/src/frontend-common/game_settings.cpp b/src/frontend-common/game_settings.cpp index dbd075be8..2d2e35b49 100644 --- a/src/frontend-common/game_settings.cpp +++ b/src/frontend-common/game_settings.cpp @@ -35,6 +35,7 @@ std::array, static_cast(Trait::Count)> {"ForcePGXPCPUMode", TRANSLATABLE("GameSettingsTrait", "Force PGXP CPU Mode")}, {"ForceRecompilerMemoryExceptions", TRANSLATABLE("GameSettingsTrait", "Force Recompiler Memory Exceptions")}, {"ForceRecompilerICache", TRANSLATABLE("GameSettingsTrait", "Force Recompiler ICache")}, + {"ForceRecompilerLUTFastmem", TRANSLATABLE("GameSettingsTrait", "Force Recompiler LUT Fastmem")}, }}; const char* GetTraitName(Trait trait) @@ -1240,10 +1241,22 @@ void Entry::ApplySettings(bool display_osd_messages) const } if (HasTrait(Trait::ForceRecompilerMemoryExceptions)) + { + Log_WarningPrint("Memory exceptions for recompiler forced by game settings."); g_settings.cpu_recompiler_memory_exceptions = true; + } if (HasTrait(Trait::ForceRecompilerICache)) + { + Log_WarningPrint("ICache for recompiler forced by game settings."); g_settings.cpu_recompiler_icache = true; + } + + if (g_settings.cpu_fastmem_mode == CPUFastmemMode::MMap && HasTrait(Trait::ForceRecompilerLUTFastmem)) + { + Log_WarningPrint("LUT fastmem for recompiler forced by game settings."); + g_settings.cpu_fastmem_mode = CPUFastmemMode::LUT; + } } } // namespace GameSettings diff --git a/src/frontend-common/game_settings.h b/src/frontend-common/game_settings.h index efe155541..bf7e946dc 100644 --- a/src/frontend-common/game_settings.h +++ b/src/frontend-common/game_settings.h @@ -27,6 +27,7 @@ enum class Trait : u32 ForcePGXPCPUMode, ForceRecompilerMemoryExceptions, ForceRecompilerICache, + ForceRecompilerLUTFastmem, Count };