diff --git a/src/core/hle/api_version.h b/src/core/hle/api_version.h index 53822c221..bd15606e1 100644 --- a/src/core/hle/api_version.h +++ b/src/core/hle/api_version.h @@ -11,7 +11,7 @@ namespace HLE::ApiVersion { // Horizon OS version constants. -constexpr u8 HOS_VERSION_MAJOR = 16; +constexpr u8 HOS_VERSION_MAJOR = 12; constexpr u8 HOS_VERSION_MINOR = 1; constexpr u8 HOS_VERSION_MICRO = 0; @@ -22,8 +22,8 @@ constexpr u8 SDK_REVISION_MINOR = 0; constexpr char PLATFORM_STRING[] = "NX"; constexpr char VERSION_HASH[] = "76b10c2dab7d3aa73fc162f8dff1655e6a21caf4"; -constexpr char DISPLAY_VERSION[] = "16.1.0"; -constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 16.1.0-1.0"; +constexpr char DISPLAY_VERSION[] = "12.1.0"; +constexpr char DISPLAY_TITLE[] = "NintendoSDK Firmware for NX 12.1.0-1.0"; // Atmosphere version constants. diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 38cdd57ad..e4a6864cf 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -93,7 +93,7 @@ public: {31, nullptr, "EnableMcMode"}, {32, nullptr, "EnableLlrScan"}, {33, nullptr, "DisableLlrScan"}, - {34, nullptr, "EnableRadio"}, + {34, &BtDrv::EnableRadio, "EnableRadio"}, {35, nullptr, "SetVisibility"}, {36, nullptr, "EnableTbfcScan"}, {37, nullptr, "RegisterHidReportEvent"}, @@ -195,6 +195,12 @@ public: RegisterHandlers(functions); } + + private: + void EnableRadio(HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index 8bf65d560..aabddb18c 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp @@ -154,8 +154,8 @@ public: {11, nullptr, "RemoveDeviceInfo"}, {12, nullptr, "IncreaseDeviceInfoOrder"}, {13, nullptr, "LlrNotify"}, - {14, nullptr, "EnableRadio"}, - {15, nullptr, "DisableRadio"}, + {14, &BTM::EnableRadio, "EnableRadio"}, + {15, &BTM::DisableRadio, "DisableRadio"}, {16, nullptr, "HidDisconnect"}, {17, nullptr, "HidSetRetransmissionMode"}, {18, nullptr, "AcquireAwakeReqEvent"}, @@ -230,6 +230,17 @@ public: RegisterHandlers(functions); } + +private: + void EnableRadio(HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } + + void DisableRadio(HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } }; class BTM_DBG final : public ServiceFramework { @@ -268,8 +279,8 @@ public: {1, &IBtmSystemCore::CancelGamepadPairing, "CancelGamepadPairing"}, {2, nullptr, "ClearGamepadPairingDatabase"}, {3, nullptr, "GetPairedGamepadCount"}, - {4, nullptr, "EnableRadio"}, - {5, nullptr, "DisableRadio"}, + {4, &IBtmSystemCore::EnableRadio, "EnableRadio"}, + {5, &IBtmSystemCore::DisableRadio, "DisableRadio"}, {6, &IBtmSystemCore::IsRadioEnabled, "IsRadioEnabled"}, {7, &IBtmSystemCore::AcquireRadioEvent, "AcquireRadioEvent"}, {8, nullptr, "AcquireGamepadPairingEvent"}, @@ -278,7 +289,7 @@ public: {11, nullptr, "StopAudioDeviceDiscovery"}, {12, nullptr, "IsDiscoveryingAudioDevice"}, {13, nullptr, "GetDiscoveredAudioDevice"}, - {14, nullptr, "AcquireAudioDeviceConnectionEvent"}, + {14, &IBtmSystemCore::AcquireAudioDeviceConnectionEvent, "AcquireAudioDeviceConnectionEvent"}, {15, nullptr, "ConnectAudioDevice"}, {16, nullptr, "IsConnectingAudioDevice"}, {17, &IBtmSystemCore::GetConnectedAudioDevices, "GetConnectedAudioDevices"}, @@ -293,9 +304,20 @@ public: RegisterHandlers(functions); radio_event = service_context.CreateEvent("IBtmSystemCore::RadioEvent"); + audio_device_connection_event = service_context.CreateEvent("IBtmSystemCore::AudioDeviceConnectionEvent"); } private: + void EnableRadio(HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } + + void DisableRadio(HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } + void IsRadioEnabled(HLERequestContext& ctx) { LOG_DEBUG(Service_BTM, "(STUBBED) called"); // Spams a lot when controller applet is running @@ -351,7 +373,17 @@ private: rb.PushCopyObjects(radio_event->GetReadableEvent()); } + void AcquireAudioDeviceConnectionEvent(HLERequestContext& ctx) { + LOG_ERROR(Service_BTM, "called"); + + IPC::ResponseBuilder rb{ctx, 3, 1}; + rb.Push(ResultSuccess); + rb.Push(true); + rb.PushCopyObjects(audio_device_connection_event->GetReadableEvent()); + } + Kernel::KEvent* radio_event; + Kernel::KEvent* audio_device_connection_event; KernelHelpers::ServiceContext service_context; }; diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index 30ae989b9..9d4808dbe 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp @@ -57,7 +57,7 @@ public: {1, &NfcInterface::Finalize, "FinalizeOld"}, {2, &NfcInterface::GetState, "GetStateOld"}, {3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"}, - {100, nullptr, "SetNfcEnabledOld"}, + {100, &NfcInterface::SetNfcEnabled, "SetNfcEnabledOld"}, {400, &NfcInterface::Initialize, "Initialize"}, {401, &NfcInterface::Finalize, "Finalize"}, {402, &NfcInterface::GetState, "GetState"}, @@ -71,7 +71,7 @@ public: {410, &NfcInterface::GetTagInfo, "GetTagInfo"}, {411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"}, {412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"}, - {500, nullptr, "SetNfcEnabled"}, + {500, &NfcInterface::SetNfcEnabled, "SetNfcEnabled"}, {510, nullptr, "OutputTestWave"}, {1000, &NfcInterface::ReadMifare, "ReadMifare"}, {1001, &NfcInterface::WriteMifare, "WriteMifare"}, diff --git a/src/core/hle/service/nfc/nfc_interface.cpp b/src/core/hle/service/nfc/nfc_interface.cpp index 3e2c7deab..5263dc05c 100644 --- a/src/core/hle/service/nfc/nfc_interface.cpp +++ b/src/core/hle/service/nfc/nfc_interface.cpp @@ -65,12 +65,9 @@ void NfcInterface::GetState(HLERequestContext& ctx) { void NfcInterface::IsNfcEnabled(HLERequestContext& ctx) { LOG_DEBUG(Service_NFC, "called"); - // TODO: This calls nn::settings::detail::GetNfcEnableFlag - const bool is_enabled = true; - IPC::ResponseBuilder rb{ctx, 3}; rb.Push(ResultSuccess); - rb.Push(is_enabled); + rb.Push(true); } void NfcInterface::ListDevices(HLERequestContext& ctx) { @@ -212,6 +209,15 @@ void NfcInterface::AttachDeactivateEvent(HLERequestContext& ctx) { rb.PushCopyObjects(out_event); } +void NfcInterface::SetNfcEnabled(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto is_enabled{rp.Pop()}; + LOG_DEBUG(Service_NFC, "called, is_enabled={}", is_enabled); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + void NfcInterface::ReadMifare(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto device_handle{rp.Pop()}; diff --git a/src/core/hle/service/nfc/nfc_interface.h b/src/core/hle/service/nfc/nfc_interface.h index 08be174d8..3be41cd46 100644 --- a/src/core/hle/service/nfc/nfc_interface.h +++ b/src/core/hle/service/nfc/nfc_interface.h @@ -28,6 +28,7 @@ public: void GetTagInfo(HLERequestContext& ctx); void AttachActivateEvent(HLERequestContext& ctx); void AttachDeactivateEvent(HLERequestContext& ctx); + void SetNfcEnabled(HLERequestContext& ctx); void ReadMifare(HLERequestContext& ctx); void WriteMifare(HLERequestContext& ctx); void SendCommandByPassThrough(HLERequestContext& ctx); diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 55bc2fe89..10eb43a06 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -506,12 +506,23 @@ void IGeneralService::GetCurrentIpConfigInfo(HLERequestContext& ctx) { rb.PushRaw(ip_config_info); } +void IGeneralService::SetWirelessCommunicationEnabled(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto is_enabled{rp.Pop()}; + LOG_DEBUG(Service_NIFM, "called, is_enabled={}", is_enabled); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + void IGeneralService::IsWirelessCommunicationEnabled(HLERequestContext& ctx) { - LOG_DEBUG(Service_NIFM, "(STUBBED) called"); + const auto is_enabled = false; + + LOG_DEBUG(Service_NIFM, "called, is_enabled={}", is_enabled); IPC::ResponseBuilder rb{ctx, 3}; rb.Push(ResultSuccess); - rb.Push(1); + rb.Push(is_enabled); } void IGeneralService::GetInternetConnectionStatus(HLERequestContext& ctx) { @@ -583,7 +594,7 @@ IGeneralService::IGeneralService(Core::System& system_) {13, nullptr, "GetCurrentAccessPointOld"}, {14, &IGeneralService::CreateTemporaryNetworkProfile, "CreateTemporaryNetworkProfile"}, {15, &IGeneralService::GetCurrentIpConfigInfo, "GetCurrentIpConfigInfo"}, - {16, nullptr, "SetWirelessCommunicationEnabled"}, + {16, &IGeneralService::SetWirelessCommunicationEnabled, "SetWirelessCommunicationEnabled"}, {17, &IGeneralService::IsWirelessCommunicationEnabled, "IsWirelessCommunicationEnabled"}, {18, &IGeneralService::GetInternetConnectionStatus, "GetInternetConnectionStatus"}, {19, nullptr, "SetEthernetCommunicationEnabled"}, diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index b74b66438..aa7ea4192 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h @@ -31,6 +31,7 @@ private: void GetCurrentIpAddress(HLERequestContext& ctx); void CreateTemporaryNetworkProfile(HLERequestContext& ctx); void GetCurrentIpConfigInfo(HLERequestContext& ctx); + void SetWirelessCommunicationEnabled(HLERequestContext& ctx); void IsWirelessCommunicationEnabled(HLERequestContext& ctx); void GetInternetConnectionStatus(HLERequestContext& ctx); void IsEthernetCommunicationEnabled(HLERequestContext& ctx); diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 726a36e98..9226c0c26 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp @@ -206,6 +206,7 @@ public: {1122, nullptr, "RepairIssue2"}, {1123, nullptr, "RepairIssue3"}, {1124, nullptr, "Unknown1124"}, + {10000, &IOlscServiceForSystemService::Unknown10000, "Unknown10000"}, }; // clang-format on @@ -220,6 +221,14 @@ private: rb.Push(ResultSuccess); rb.PushIpcInterface(system); } + + void Unknown10000(HLERequestContext& ctx) { + LOG_INFO(Service_OLSC, "called"); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface(system); + } }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp index 7ef4a0ded..c0b8ad74e 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp @@ -528,6 +528,16 @@ void ISystemSettingsServer::SetLockScreenFlag(HLERequestContext& ctx) { rb.Push(ResultSuccess); } +void ISystemSettingsServer::SetLockScreenFlag(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto lock_screen_flag{rp.Pop()}; + + LOG_INFO(Service_SET, "called, lock_screen_flag={}", lock_screen_flag); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + void ISystemSettingsServer::GetAccountSettings(HLERequestContext& ctx) { LOG_INFO(Service_SET, "called"); @@ -1035,6 +1045,25 @@ void ISystemSettingsServer::SetNfcEnableFlag(HLERequestContext& ctx) { 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(nfc_enable_flag); +} + +void ISystemSettingsServer::SetNfcEnableFlag(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto nfc_enable_flag{rp.Pop()}; + + LOG_INFO(Service_SET, "called, nfc_enable_flag={}", nfc_enable_flag); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} void ISystemSettingsServer::GetSleepSettings(HLERequestContext& ctx) { LOG_INFO(Service_SET, "called, flags={}, handheld_sleep_plan={}, console_sleep_plan={}", m_system_settings.sleep_settings.flags.raw, @@ -1081,6 +1110,27 @@ void ISystemSettingsServer::SetWirelessLanEnableFlag(HLERequestContext& ctx) { 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(wireless_lan_enable_flag); +} + +void ISystemSettingsServer::SetWirelessLanEnableFlag(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto wireless_lan_enable_flag{rp.Pop()}; + + 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) { LOG_INFO(Service_SET, "called, flags={}, timestamp={}", m_system_settings.initial_launch_settings_packed.flags.raw, diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h index 0e22e88df..9e71fa5fd 100644 --- a/src/core/hle/service/set/system_settings_server.h +++ b/src/core/hle/service/set/system_settings_server.h @@ -88,6 +88,7 @@ private: void GetUserSystemClockContext(HLERequestContext& ctx); void SetUserSystemClockContext(HLERequestContext& ctx); void GetLockScreenFlag(HLERequestContext& ctx); + void SetLockScreenFlag(HLERequestContext& ctx); void GetAccountSettings(HLERequestContext& ctx); void SetAccountSettings(HLERequestContext& ctx); void GetEulaVersions(HLERequestContext& ctx); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c509b002a..7d4542220 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -4221,7 +4221,7 @@ void GMainWindow::OnCabinet(Service::NFP::CabinetMode mode) { } void GMainWindow::OnQlaunch() { - constexpr u64 MiiEditId = 0x0100000000001000ull; + constexpr u64 QlaunchId = static_cast(Service::AM::Applets::AppletProgramId::QLaunch); auto bis_system = system->GetFileSystemController().GetSystemNANDContents(); if (!bis_system) { QMessageBox::warning(this, tr("No firmware available"), @@ -4229,7 +4229,7 @@ void GMainWindow::OnQlaunch() { return; } - auto mii_applet_nca = bis_system->GetEntry(MiiEditId, FileSys::ContentRecordType::Program); + auto mii_applet_nca = bis_system->GetEntry(QlaunchId, FileSys::ContentRecordType::Program); if (!mii_applet_nca) { QMessageBox::warning(this, tr("Mii Edit Applet"), tr("Mii editor is not available. Please reinstall firmware.")); @@ -4239,8 +4239,8 @@ void GMainWindow::OnQlaunch() { system->GetAppletManager().SetCurrentAppletId(Service::AM::Applets::AppletId::QLaunch); const auto filename = QString::fromStdString((mii_applet_nca->GetFullPath())); - UISettings::values.roms_path = QFileInfo(filename).path(); - BootGame(filename); + UISettings::values.roms_path = QFileInfo(filename).path().toStdString(); + BootGame(filename, QlaunchId); } void GMainWindow::OnMiiEdit() {