diff --git a/Core/Config.cpp b/Core/Config.cpp index ce3ef21856..ab42a9ead1 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1149,10 +1149,6 @@ bool Config::LoadAppendedConfig() { return true; } -void Config::SetAppendedConfigIni(const Path &path) { - appendedConfigFileName_ = path; -} - void Config::UpdateAfterSettingAutoFrameSkip() { if (bAutoFrameSkip && iFrameSkip == 0) { iFrameSkip = 1; @@ -1848,11 +1844,11 @@ bool PlayTimeTracker::GetPlayedTimeString(const std::string &gameId, std::string } int totalSeconds = iter->second.totalTimePlayed; - int seconds = totalSeconds % 60; + const int seconds = totalSeconds % 60; totalSeconds /= 60; - int minutes = totalSeconds % 60; + const int minutes = totalSeconds % 60; totalSeconds /= 60; - int hours = totalSeconds; + const int hours = totalSeconds; *str = ApplySafeSubstitutions(ga->T("Time Played: %1h %2m %3s"), hours, minutes, seconds); return true; diff --git a/Core/Config.h b/Core/Config.h index 69dbfd0d43..ad3442f75e 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include @@ -652,7 +653,7 @@ public: } bool LoadAppendedConfig(); - void SetAppendedConfigIni(const Path &path); + void SetAppendedConfigIni(const Path &path) { appendedConfigFileName_ = path; } void UpdateAfterSettingAutoFrameSkip(); void NotifyUpdatedCpuCore(); diff --git a/Core/HLE/HLE.h b/Core/HLE/HLE.h index 2a71089264..3c18ff2e47 100644 --- a/Core/HLE/HLE.h +++ b/Core/HLE/HLE.h @@ -235,6 +235,10 @@ template [[nodiscard]] NO_INLINE T hleDoLog(Log t, LogLevel level, T res, const char *file, int line, const char *reportTag) { + if (convert_code && (int)res >= 0) { + level = LogLevel::LDEBUG; + } + if (((int)level > MAX_LOGLEVEL || !GenericLogEnabled(t, level)) && !reportTag) { if (leave) { hleLeave(); @@ -242,10 +246,6 @@ T hleDoLog(Log t, LogLevel level, T res, const char *file, int line, const char return res; } - if (convert_code && (int)res >= 0) { - level = LogLevel::LDEBUG; - } - u64 fmtRes = res; if (std::is_floating_point::value) { // We reinterpret as the bits for now, so we can have a common helper. diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index aa1e9f6b74..83e2c35fee 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -261,7 +261,6 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) { return false; } - //in case we didn't go through EmuScreen::boot g_Config.loadGameConfig(id, g_paramSFO.GetValueString("TITLE")); System_PostUIMessage(UIMessage::CONFIG_LOADED); INFO_LOG(Log::Loader, "Loading %s...", bootpath.c_str()); diff --git a/Core/System.cpp b/Core/System.cpp index 35d8604b01..78f1fc0959 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -360,11 +360,6 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin g_CoreParameter.compat.Load(g_paramSFO.GetDiscID()); ShowCompatWarnings(g_CoreParameter.compat); - // Compat settings can override the software renderer, take care of that here. - if (g_Config.bSoftwareRendering || PSP_CoreParameter().compat.flags().ForceSoftwareRenderer) { - g_CoreParameter.gpuCore = GPUCORE_SOFTWARE; - } - // This must be before Memory::Init because plugins can override the memory size. if (type != IdentifiedFileType::PPSSPP_GE_DUMP) { HLEPlugins::Init(); @@ -421,7 +416,9 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin g_CoreParameter.mountIsoLoader = ConstructFileLoader(g_CoreParameter.mountIso); } - // TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly + // Game-specific settings are load from for example Load_PSP_ISO (which calls g_Config.loadGameConfig). + // We can't do things that depend on these before the below switch. So for example, the adjustment of the GPU core + // to software has now been moved below it. // If they shut down early, we'll catch it when load completes. // Note: this may return before init is complete, which is checked if CPU_IsReady(). @@ -482,6 +479,13 @@ static bool CPU_Init(FileLoader *fileLoader, IdentifiedFileType type, std::strin g_recentFiles.Add(g_CoreParameter.fileToStart.ToString()); } + // Update things that depend on game-specific config here. + + // Compat settings can override the software renderer, take care of that here. + if (g_Config.bSoftwareRendering || g_CoreParameter.compat.flags().ForceSoftwareRenderer) { + g_CoreParameter.gpuCore = GPUCORE_SOFTWARE; + } + InstallExceptionHandler(&Memory::HandleFault); return true; } diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 93e80a4c86..f37275641c 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -725,15 +725,6 @@ inline void GPUCommon::UpdateState(GPURunState state) { downcount = 0; } -int GPUCommon::GetNextListIndex() { - auto iter = dlQueue.begin(); - if (iter != dlQueue.end()) { - return *iter; - } else { - return -1; - } -} - // This is now called when coreState == CORE_RUNNING_GE, in addition to from the various sceGe commands. DLResult GPUCommon::ProcessDLQueue() { if (!resumingFromDebugBreak_) { @@ -749,6 +740,12 @@ DLResult GPUCommon::ProcessDLQueue() { TimeCollector collectStat(&gpuStats.msProcessingDisplayLists, coreCollectDebugStats); + auto GetNextListIndex = [&]() -> int { + if (dlQueue.empty()) + return -1; + return dlQueue.front(); + }; + for (int listIndex = GetNextListIndex(); listIndex != -1; listIndex = GetNextListIndex()) { DisplayList &list = dls[listIndex]; diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 15bdf63d89..c75faaf4a1 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -566,5 +566,4 @@ private: void DoExecuteCall(u32 target); void PopDLQueue(); void CheckDrawSync(); - int GetNextListIndex(); };