fix settings

This commit is contained in:
german77
2024-01-13 12:35:14 -06:00
parent e2fe0c49b2
commit 9052a9b8ee
3 changed files with 18 additions and 55 deletions

View File

@ -305,6 +305,21 @@ ISystemSettingsServer::ISystemSettingsServer(Core::System& system_)
RegisterHandlers(functions); RegisterHandlers(functions);
SetupSettings(); SetupSettings();
Time::Clock::SteadyClockTimePoint timestamp{
.time_point = 1691079299,
.clock_source_id = Common::UUID::MakeRandom(),
};
EulaVersion eula_version{
.version = 65536,
.region_code = SystemRegionCode::Usa,
.clock_type = EulaVersionClockType::SteadyClock,
.posix_time = 4575657222473777152,
.timestamp = timestamp,
};
m_system_settings.eula_versions[0] = eula_version;
m_system_settings.eula_version_count = 1;
m_save_thread = m_save_thread =
std::jthread([this](std::stop_token stop_token) { StoreSettingsThreadFunc(stop_token); }); std::jthread([this](std::stop_token stop_token) { StoreSettingsThreadFunc(stop_token); });
} }
@ -528,16 +543,6 @@ void ISystemSettingsServer::SetLockScreenFlag(HLERequestContext& ctx) {
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
void ISystemSettingsServer::SetLockScreenFlag(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto lock_screen_flag{rp.Pop<bool>()};
LOG_INFO(Service_SET, "called, lock_screen_flag={}", lock_screen_flag);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void ISystemSettingsServer::GetAccountSettings(HLERequestContext& ctx) { void ISystemSettingsServer::GetAccountSettings(HLERequestContext& ctx) {
LOG_INFO(Service_SET, "called"); LOG_INFO(Service_SET, "called");
@ -1045,25 +1050,6 @@ void ISystemSettingsServer::SetNfcEnableFlag(HLERequestContext& ctx) {
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
void ISystemSettingsServer::GetNfcEnableFlag(HLERequestContext& ctx) {
const auto nfc_enable_flag = true;
LOG_INFO(Service_SET, "called, nfc_enable_flag={}", nfc_enable_flag);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push<u8>(nfc_enable_flag);
}
void ISystemSettingsServer::SetNfcEnableFlag(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto nfc_enable_flag{rp.Pop<bool>()};
LOG_INFO(Service_SET, "called, nfc_enable_flag={}", nfc_enable_flag);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void ISystemSettingsServer::GetSleepSettings(HLERequestContext& ctx) { void ISystemSettingsServer::GetSleepSettings(HLERequestContext& ctx) {
LOG_INFO(Service_SET, "called, flags={}, handheld_sleep_plan={}, console_sleep_plan={}", LOG_INFO(Service_SET, "called, flags={}, handheld_sleep_plan={}, console_sleep_plan={}",
m_system_settings.sleep_settings.flags.raw, m_system_settings.sleep_settings.flags.raw,
@ -1110,27 +1096,6 @@ void ISystemSettingsServer::SetWirelessLanEnableFlag(HLERequestContext& ctx) {
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
void ISystemSettingsServer::GetWirelessLanEnableFlag(HLERequestContext& ctx) {
const auto wireless_lan_enable_flag = false;
LOG_WARNING(Service_SET, "(STUBBED) called, wireless_lan_enable_flag={}",
wireless_lan_enable_flag);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(ResultSuccess);
rb.Push<u8>(wireless_lan_enable_flag);
}
void ISystemSettingsServer::SetWirelessLanEnableFlag(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto wireless_lan_enable_flag{rp.Pop<bool>()};
LOG_DEBUG(Service_SET, "(STUBBED) called, wireless_lan_enable_flag={}",
wireless_lan_enable_flag);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void ISystemSettingsServer::GetInitialLaunchSettings(HLERequestContext& ctx) { void ISystemSettingsServer::GetInitialLaunchSettings(HLERequestContext& ctx) {
LOG_INFO(Service_SET, "called, flags={}, timestamp={}", LOG_INFO(Service_SET, "called, flags={}, timestamp={}",
m_system_settings.initial_launch_settings_packed.flags.raw, m_system_settings.initial_launch_settings_packed.flags.raw,

View File

@ -87,8 +87,6 @@ private:
void SetExternalSteadyClockSourceId(HLERequestContext& ctx); void SetExternalSteadyClockSourceId(HLERequestContext& ctx);
void GetUserSystemClockContext(HLERequestContext& ctx); void GetUserSystemClockContext(HLERequestContext& ctx);
void SetUserSystemClockContext(HLERequestContext& ctx); void SetUserSystemClockContext(HLERequestContext& ctx);
void GetLockScreenFlag(HLERequestContext& ctx);
void SetLockScreenFlag(HLERequestContext& ctx);
void GetAccountSettings(HLERequestContext& ctx); void GetAccountSettings(HLERequestContext& ctx);
void SetAccountSettings(HLERequestContext& ctx); void SetAccountSettings(HLERequestContext& ctx);
void GetEulaVersions(HLERequestContext& ctx); void GetEulaVersions(HLERequestContext& ctx);

View File

@ -4221,7 +4221,7 @@ void GMainWindow::OnCabinet(Service::NFP::CabinetMode mode) {
} }
void GMainWindow::OnQlaunch() { void GMainWindow::OnQlaunch() {
constexpr u64 QlaunchId = static_cast<u64>(Service::AM::Applets::AppletProgramId::QLaunch); constexpr u64 QlaunchId = static_cast<u64>(Service::AM::AppletProgramId::QLaunch);
auto bis_system = system->GetFileSystemController().GetSystemNANDContents(); auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
if (!bis_system) { if (!bis_system) {
QMessageBox::warning(this, tr("No firmware available"), QMessageBox::warning(this, tr("No firmware available"),
@ -4236,11 +4236,11 @@ void GMainWindow::OnQlaunch() {
return; return;
} }
system->GetAppletManager().SetCurrentAppletId(Service::AM::Applets::AppletId::QLaunch); system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::QLaunch);
const auto filename = QString::fromStdString((mii_applet_nca->GetFullPath())); const auto filename = QString::fromStdString((mii_applet_nca->GetFullPath()));
UISettings::values.roms_path = QFileInfo(filename).path().toStdString(); UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
BootGame(filename, QlaunchId); BootGame(filename, LibraryAppletParameters(QlaunchId, Service::AM::AppletId::QLaunch));
} }
void GMainWindow::OnMiiEdit() { void GMainWindow::OnMiiEdit() {