mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 02:59:49 +01:00
Merge pull request #20962 from hrydgard/more-misc-code-cleanup
More misc code cleanup, fix setting softgpu in game-specific settings
This commit is contained in:
7 files changed
+25
-29
No files matched your search
+3
-7
@@ -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;
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
@@ -652,7 +653,7 @@ public:
|
||||
}
|
||||
|
||||
bool LoadAppendedConfig();
|
||||
void SetAppendedConfigIni(const Path &path);
|
||||
void SetAppendedConfigIni(const Path &path) { appendedConfigFileName_ = path; }
|
||||
void UpdateAfterSettingAutoFrameSkip();
|
||||
void NotifyUpdatedCpuCore();
|
||||
|
||||
|
||||
+4
-4
@@ -235,6 +235,10 @@ template <bool leave, bool convert_code, typename T>
|
||||
[[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<T>::value) {
|
||||
// We reinterpret as the bits for now, so we can have a common helper.
|
||||
|
||||
@@ -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());
|
||||
|
||||
+10
-6
@@ -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;
|
||||
}
|
||||
|
||||
+6
-9
@@ -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];
|
||||
|
||||
|
||||
@@ -566,5 +566,4 @@ private:
|
||||
void DoExecuteCall(u32 target);
|
||||
void PopDLQueue();
|
||||
void CheckDrawSync();
|
||||
int GetNextListIndex();
|
||||
};
|
||||
Reference in new issue
Block a user