Config: Don't apply upscaling fixes from GameDB in native

Also removed some stuff we no longer need
This commit is contained in:
refractionpcsx2 2023-06-24 04:14:54 +01:00
parent 3ebfc81727
commit 1458511756
4 changed files with 13 additions and 28 deletions

View File

@ -411,14 +411,12 @@ bool GameDatabaseSchema::isUserHackHWFix(GSHWFixId id)
} }
} }
u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool applyAuto) const void GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool applyAuto) const
{ {
// Only apply core game fixes if the user has enabled them. // Only apply core game fixes if the user has enabled them.
if (!applyAuto) if (!applyAuto)
Console.Warning("[GameDB] Game Fixes are disabled"); Console.Warning("[GameDB] Game Fixes are disabled");
u32 num_applied_fixes = 0;
if (eeRoundMode != GameDatabaseSchema::RoundMode::Undefined) if (eeRoundMode != GameDatabaseSchema::RoundMode::Undefined)
{ {
const SSE_RoundMode eeRM = (SSE_RoundMode)enum_cast(eeRoundMode); const SSE_RoundMode eeRM = (SSE_RoundMode)enum_cast(eeRoundMode);
@ -428,7 +426,6 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
{ {
Console.WriteLn("(GameDB) Changing EE/FPU roundmode to %d [%s]", eeRM, EnumToString(eeRM)); Console.WriteLn("(GameDB) Changing EE/FPU roundmode to %d [%s]", eeRM, EnumToString(eeRM));
config.Cpu.sseMXCSR.SetRoundMode(eeRM); config.Cpu.sseMXCSR.SetRoundMode(eeRM);
num_applied_fixes++;
} }
else else
Console.Warning("[GameDB] Skipping changing EE/FPU roundmode to %d [%s]", eeRM, EnumToString(eeRM)); Console.Warning("[GameDB] Skipping changing EE/FPU roundmode to %d [%s]", eeRM, EnumToString(eeRM));
@ -444,7 +441,6 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
{ {
Console.WriteLn("(GameDB) Changing VU0 roundmode to %d [%s]", vuRM, EnumToString(vuRM)); Console.WriteLn("(GameDB) Changing VU0 roundmode to %d [%s]", vuRM, EnumToString(vuRM));
config.Cpu.sseVU0MXCSR.SetRoundMode(vuRM); config.Cpu.sseVU0MXCSR.SetRoundMode(vuRM);
num_applied_fixes++;
} }
else else
Console.Warning("[GameDB] Skipping changing VU0 roundmode to %d [%s]", vuRM, EnumToString(vuRM)); Console.Warning("[GameDB] Skipping changing VU0 roundmode to %d [%s]", vuRM, EnumToString(vuRM));
@ -460,7 +456,6 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
{ {
Console.WriteLn("(GameDB) Changing VU1 roundmode to %d [%s]", vuRM, EnumToString(vuRM)); Console.WriteLn("(GameDB) Changing VU1 roundmode to %d [%s]", vuRM, EnumToString(vuRM));
config.Cpu.sseVU1MXCSR.SetRoundMode(vuRM); config.Cpu.sseVU1MXCSR.SetRoundMode(vuRM);
num_applied_fixes++;
} }
else else
Console.Warning("[GameDB] Skipping changing VU1 roundmode to %d [%s]", vuRM, EnumToString(vuRM)); Console.Warning("[GameDB] Skipping changing VU1 roundmode to %d [%s]", vuRM, EnumToString(vuRM));
@ -476,7 +471,6 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
config.Cpu.Recompiler.fpuOverflow = (clampMode >= 1); config.Cpu.Recompiler.fpuOverflow = (clampMode >= 1);
config.Cpu.Recompiler.fpuExtraOverflow = (clampMode >= 2); config.Cpu.Recompiler.fpuExtraOverflow = (clampMode >= 2);
config.Cpu.Recompiler.fpuFullMode = (clampMode >= 3); config.Cpu.Recompiler.fpuFullMode = (clampMode >= 3);
num_applied_fixes++;
} }
else else
Console.Warning("[GameDB] Skipping changing EE/FPU clamp mode [mode=%d]", clampMode); Console.Warning("[GameDB] Skipping changing EE/FPU clamp mode [mode=%d]", clampMode);
@ -491,7 +485,6 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
config.Cpu.Recompiler.vu0Overflow = (clampMode >= 1); config.Cpu.Recompiler.vu0Overflow = (clampMode >= 1);
config.Cpu.Recompiler.vu0ExtraOverflow = (clampMode >= 2); config.Cpu.Recompiler.vu0ExtraOverflow = (clampMode >= 2);
config.Cpu.Recompiler.vu0SignOverflow = (clampMode >= 3); config.Cpu.Recompiler.vu0SignOverflow = (clampMode >= 3);
num_applied_fixes++;
} }
else else
Console.Warning("[GameDB] Skipping changing VU0 clamp mode [mode=%d]", clampMode); Console.Warning("[GameDB] Skipping changing VU0 clamp mode [mode=%d]", clampMode);
@ -506,7 +499,6 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
config.Cpu.Recompiler.vu1Overflow = (clampMode >= 1); config.Cpu.Recompiler.vu1Overflow = (clampMode >= 1);
config.Cpu.Recompiler.vu1ExtraOverflow = (clampMode >= 2); config.Cpu.Recompiler.vu1ExtraOverflow = (clampMode >= 2);
config.Cpu.Recompiler.vu1SignOverflow = (clampMode >= 3); config.Cpu.Recompiler.vu1SignOverflow = (clampMode >= 3);
num_applied_fixes++;
} }
else else
Console.Warning("[GameDB] Skipping changing VU1 clamp mode [mode=%d]", clampMode); Console.Warning("[GameDB] Skipping changing VU1 clamp mode [mode=%d]", clampMode);
@ -525,7 +517,6 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
// are effectively booleans like the gamefixes // are effectively booleans like the gamefixes
config.Speedhacks.Set(it.first, mode); config.Speedhacks.Set(it.first, mode);
Console.WriteLn("(GameDB) Setting Speedhack '%s' to [mode=%d]", EnumToString(it.first), mode); Console.WriteLn("(GameDB) Setting Speedhack '%s' to [mode=%d]", EnumToString(it.first), mode);
num_applied_fixes++;
} }
// TODO - config - this could be simplified with maps instead of bitfields and enums // TODO - config - this could be simplified with maps instead of bitfields and enums
@ -539,14 +530,11 @@ u32 GameDatabaseSchema::GameEntry::applyGameFixes(Pcsx2Config& config, bool appl
// if the fix is present, it is said to be enabled // if the fix is present, it is said to be enabled
config.Gamefixes.Set(id, true); config.Gamefixes.Set(id, true);
Console.WriteLn("(GameDB) Enabled Gamefix: %s", EnumToString(id)); Console.WriteLn("(GameDB) Enabled Gamefix: %s", EnumToString(id));
num_applied_fixes++;
// The LUT is only used for 1 game so we allocate it only when the gamefix is enabled (save 4MB) // The LUT is only used for 1 game so we allocate it only when the gamefix is enabled (save 4MB)
if (id == Fix_GoemonTlbMiss && true) if (id == Fix_GoemonTlbMiss && true)
vtlb_Alloc_Ppmap(); vtlb_Alloc_Ppmap();
} }
return num_applied_fixes;
} }
bool GameDatabaseSchema::GameEntry::configMatchesHWFix(const Pcsx2Config::GSOptions& config, GSHWFixId id, int value) bool GameDatabaseSchema::GameEntry::configMatchesHWFix(const Pcsx2Config::GSOptions& config, GSHWFixId id, int value)
@ -663,7 +651,7 @@ bool GameDatabaseSchema::GameEntry::configMatchesHWFix(const Pcsx2Config::GSOpti
} }
} }
u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& config) const void GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& config) const
{ {
std::string disabled_fixes; std::string disabled_fixes;
@ -672,7 +660,6 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
if (!apply_auto_fixes) if (!apply_auto_fixes)
Console.Warning("[GameDB] Manual GS hardware renderer fixes are enabled, not using automatic hardware renderer fixes from GameDB."); Console.Warning("[GameDB] Manual GS hardware renderer fixes are enabled, not using automatic hardware renderer fixes from GameDB.");
u32 num_applied_fixes = 0;
for (const auto& [id, value] : gsHWFixes) for (const auto& [id, value] : gsHWFixes)
{ {
if (isUserHackHWFix(id) && !apply_auto_fixes) if (isUserHackHWFix(id) && !apply_auto_fixes)
@ -899,7 +886,6 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
} }
Console.WriteLn("[GameDB] Enabled GS Hardware Fix: %s to [mode=%d]", getHWFixName(id), value); Console.WriteLn("[GameDB] Enabled GS Hardware Fix: %s to [mode=%d]", getHWFixName(id), value);
num_applied_fixes++;
} }
// fixup skipdraw range just in case the db has a bad range (but the linter should catch this) // fixup skipdraw range just in case the db has a bad range (but the linter should catch this)
@ -917,8 +903,6 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
{ {
Host::RemoveKeyedOSDMessage("HWFixesWarning"); Host::RemoveKeyedOSDMessage("HWFixesWarning");
} }
return num_applied_fixes;
} }
void GameDatabase::initDatabase() void GameDatabase::initDatabase()

View File

@ -124,11 +124,11 @@ namespace GameDatabaseSchema
const std::string* findPatch(u32 crc) const; const std::string* findPatch(u32 crc) const;
const char* compatAsString() const; const char* compatAsString() const;
/// Applies Core game fixes to an existing config. Returns the number of applied fixes. /// Applies Core game fixes to an existing config.
u32 applyGameFixes(Pcsx2Config& config, bool applyAuto) const; void applyGameFixes(Pcsx2Config& config, bool applyAuto) const;
/// Applies GS hardware fixes to an existing config. Returns the number of applied fixes. /// Applies GS hardware fixes to an existing config.
u32 applyGSHardwareFixes(Pcsx2Config::GSOptions& config) const; void applyGSHardwareFixes(Pcsx2Config::GSOptions& config) const;
/// Returns true if the current config value for the specified hw fix id matches the value. /// Returns true if the current config value for the specified hw fix id matches the value.
static bool configMatchesHWFix(const Pcsx2Config::GSOptions& config, GSHWFixId id, int value); static bool configMatchesHWFix(const Pcsx2Config::GSOptions& config, GSHWFixId id, int value);

View File

@ -874,7 +874,7 @@ void Pcsx2Config::GSOptions::MaskUserHacks()
void Pcsx2Config::GSOptions::MaskUpscalingHacks() void Pcsx2Config::GSOptions::MaskUpscalingHacks()
{ {
if (UpscaleMultiplier > 1.0f && ManualUserHacks) if (UpscaleMultiplier > 1.0f)
return; return;
UserHacks_AlignSpriteX = false; UserHacks_AlignSpriteX = false;

View File

@ -165,7 +165,6 @@ static std::pair<u32, u32> s_elf_text_range;
static bool s_elf_executed = false; static bool s_elf_executed = false;
static std::string s_elf_override; static std::string s_elf_override;
static std::string s_input_profile_name; static std::string s_input_profile_name;
static u32 s_active_game_fixes = 0;
static u32 s_frame_advance_count = 0; static u32 s_frame_advance_count = 0;
static u32 s_mxcsr_saved; static u32 s_mxcsr_saved;
static bool s_fast_boot_requested = false; static bool s_fast_boot_requested = false;
@ -491,7 +490,6 @@ void VMManager::LoadCoreSettings(SettingsInterface* si)
void VMManager::ApplyGameFixes() void VMManager::ApplyGameFixes()
{ {
s_active_game_fixes = 0;
if (!HasBootedELF() && !GSDumpReplayer::IsReplayingDump()) if (!HasBootedELF() && !GSDumpReplayer::IsReplayingDump())
{ {
// Instant DMA needs to be on for this BIOS (font rendering is broken without it, possible cache issues). // Instant DMA needs to be on for this BIOS (font rendering is broken without it, possible cache issues).
@ -506,8 +504,12 @@ void VMManager::ApplyGameFixes()
if (!game) if (!game)
return; return;
s_active_game_fixes += game->applyGameFixes(EmuConfig, EmuConfig.EnableGameFixes); game->applyGameFixes(EmuConfig, EmuConfig.EnableGameFixes);
s_active_game_fixes += game->applyGSHardwareFixes(EmuConfig.GS); game->applyGSHardwareFixes(EmuConfig.GS);
// Re-remove upscaling fixes, make sure they don't apply at native res.
// We do this in LoadCoreSettings(), but game fixes get applied afterwards because of the unsafe warning.
EmuConfig.GS.MaskUpscalingHacks();
} }
void VMManager::ApplySettings() void VMManager::ApplySettings()
@ -1332,7 +1334,6 @@ void VMManager::Shutdown(bool save_resume_state)
UpdateDiscordPresence(Achievements::GetRichPresenceString()); UpdateDiscordPresence(Achievements::GetRichPresenceString());
Host::OnGameChanged(s_title, std::string(), std::string(), s_disc_serial, 0, 0); Host::OnGameChanged(s_title, std::string(), std::string(), s_disc_serial, 0, 0);
s_active_game_fixes = 0;
s_fast_boot_requested = false; s_fast_boot_requested = false;
UpdateGameSettingsLayer(); UpdateGameSettingsLayer();