core: Set game config title ID to zero if game has no title ID
This commit is contained in:
@@ -137,9 +137,11 @@ struct System::Impl {
|
||||
virtual_filesystem = std::make_shared<FileSys::RealVfsFilesystem>();
|
||||
|
||||
// Force update title ID for per game settings in case any services use them
|
||||
u64 title_id;
|
||||
u64 title_id = 0;
|
||||
if (app_loader->ReadProgramId(title_id) == Loader::ResultStatus::Success)
|
||||
Settings::values.SetCurrentTitleID(title_id);
|
||||
else
|
||||
Settings::values.SetCurrentTitleID(Settings::DEFAULT_PER_GAME);
|
||||
|
||||
// Write config to log
|
||||
Settings::values->LogSettings();
|
||||
|
||||
@@ -504,7 +504,7 @@ bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const
|
||||
return false;
|
||||
}
|
||||
// Handheld should not be supported in docked mode
|
||||
if (Settings::values.use_docked_mode) {
|
||||
if (Settings::values->use_docked_mode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ Controller_NPad::NPadControllerType Controller_NPad::DecideBestController(
|
||||
if (IsControllerSupported(priority)) {
|
||||
return priority;
|
||||
}
|
||||
const auto is_docked = Settings::values.use_docked_mode;
|
||||
const auto is_docked = Settings::values->use_docked_mode;
|
||||
if (is_docked && priority == NPadControllerType::Handheld) {
|
||||
priority = NPadControllerType::JoyDual;
|
||||
if (IsControllerSupported(priority)) {
|
||||
|
||||
@@ -74,7 +74,7 @@ double PerfStats::GetLastFrameTimeScale() {
|
||||
}
|
||||
|
||||
void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) {
|
||||
if (!Settings::values.use_frame_limit) {
|
||||
if (!Settings::values->use_frame_limit) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -668,9 +668,3 @@ PerGameValuesChange Config::GetPerGameSettingsDelta(u64 title_id) const {
|
||||
void Config::SetPerGameSettingsDelta(u64 title_id, PerGameValuesChange change) {
|
||||
update_values_delta.insert_or_assign(title_id, change);
|
||||
}
|
||||
|
||||
Config::~Config() {
|
||||
Save();
|
||||
|
||||
delete qt_config;
|
||||
}
|
||||
|
||||
@@ -64,19 +64,16 @@ public:
|
||||
private:
|
||||
void ReadValues();
|
||||
void SaveValues();
|
||||
std::map<u64, Settings::PerGameValues> update_values;
|
||||
std::map<u64, PerGameValuesChange> update_values_delta;
|
||||
|
||||
void ReadPerGameSettings(Settings::PerGameValues& values) const;
|
||||
void ReadPerGameSettingsDelta(PerGameValuesChange& values) const;
|
||||
void SavePerGameSettings(const Settings::PerGameValues& values);
|
||||
void SavePerGameSettingsDelta(const PerGameValuesChange& values);
|
||||
void ReadValues();
|
||||
void SaveValues();
|
||||
|
||||
bool UpdateCurrentGame(u64 title_id, Settings::PerGameValues& values);
|
||||
|
||||
|
||||
std::unique_ptr<QSettings> qt_config;
|
||||
std::string qt_config_loc;
|
||||
std::map<u64, Settings::PerGameValues> update_values;
|
||||
std::map<u64, PerGameValuesChange> update_values_delta;
|
||||
};
|
||||
|
||||
@@ -75,7 +75,8 @@ QString FormatPatchNameVersions(const FileSys::PatchManager& patch_manager,
|
||||
const QString type = QString::fromStdString(kv.first);
|
||||
|
||||
if (kv.second.empty()) {
|
||||
out.append(QStringLiteral(patch_disabled ? "<s>%1</s><br>" : "%1<br>").arg(type));
|
||||
out.append((patch_disabled ? QStringLiteral("<s>%1</s><br>") : QStringLiteral("%1<br>"))
|
||||
.arg(type));
|
||||
} else {
|
||||
auto ver = kv.second;
|
||||
|
||||
@@ -84,7 +85,9 @@ QString FormatPatchNameVersions(const FileSys::PatchManager& patch_manager,
|
||||
ver = Loader::GetFileTypeString(loader.GetFileType());
|
||||
}
|
||||
|
||||
out.append(QStringLiteral(patch_disabled ? "<s>%1 (%2)</s><br>" : "%1 (%2)<br>").arg(type, QString::fromStdString(ver)));
|
||||
out.append((patch_disabled ? QStringLiteral("<s>%1 (%2)</s><br>")
|
||||
: QStringLiteral("%1 (%2)<br>"))
|
||||
.arg(type, QString::fromStdString(ver)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user