service: Add stubs for Qlaunch
This commit is contained in:
parent
f0df1e76e0
commit
7d9470c2d5
|
@ -96,9 +96,10 @@ public:
|
|||
{133, nullptr, "GetNintendoAccountVerificationUrlCache"}, // 9.0.0+
|
||||
{134, nullptr, "RefreshNintendoAccountVerificationUrlCache"}, // 9.0.0+
|
||||
{135, nullptr, "RefreshNintendoAccountVerificationUrlCacheAsyncIfSecondsElapsed"}, // 9.0.0+
|
||||
{140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+
|
||||
{140, &IManagerForSystemService::GetNetworkServiceLicenseCache, "GetNetworkServiceLicenseCache"}, // 5.0.0+
|
||||
{141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+
|
||||
{142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+
|
||||
{143, &IManagerForSystemService::Unknown143, "Unknown143"},
|
||||
{150, nullptr, "CreateAuthorizationRequest"},
|
||||
{160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"},
|
||||
{161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"},
|
||||
|
@ -114,6 +115,24 @@ private:
|
|||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetNetworkServiceLicenseCache(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_ACC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u64>(0);
|
||||
rb.Push<u64>(0);
|
||||
}
|
||||
|
||||
void Unknown143(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_ACC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u64>(0);
|
||||
rb.Push<u64>(0);
|
||||
}
|
||||
};
|
||||
|
||||
// 3.0.0+
|
||||
|
|
|
@ -223,6 +223,27 @@ void PushInShowSoftwareKeyboard(Core::System& system, AppletStorageChannel& chan
|
|||
channel.Push(std::make_shared<IStorage>(system, std::move(work_buffer)));
|
||||
}
|
||||
|
||||
void PushInShowMyPageData(Core::System& system, AppletStorageChannel& channel) {
|
||||
const CommonArguments arguments{
|
||||
.arguments_version = CommonArgumentVersion::Version3,
|
||||
.size = CommonArgumentSize::Version3,
|
||||
.library_version = 0,
|
||||
.theme_color = ThemeColor::BasicBlack,
|
||||
.play_startup_sound = true,
|
||||
.system_tick = system.CoreTiming().GetClockTicks(),
|
||||
};
|
||||
|
||||
std::vector<u8> argument_data(sizeof(arguments));
|
||||
std::vector<u8> settings_data{0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE,
|
||||
0x9E, 0xF8, 0xAF, 0xB1, 0xE8, 0x95, 0x90, 0x33, 0x6C,
|
||||
0x0B, 0x22, 0x70, 0x07, 0xF4, 0xBB, 0x00};
|
||||
settings_data.resize(0x10a8);
|
||||
std::memcpy(argument_data.data(), &arguments, sizeof(arguments));
|
||||
|
||||
channel.Push(std::make_shared<IStorage>(system, std::move(argument_data)));
|
||||
channel.Push(std::make_shared<IStorage>(system, std::move(settings_data)));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
AppletManager::AppletManager(Core::System& system) : m_system(system) {}
|
||||
|
@ -315,6 +336,9 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
|
|||
case AppletId::Controller:
|
||||
PushInShowController(m_system, InitializeFakeCallerApplet(m_system, applet));
|
||||
break;
|
||||
case AppletId::MyPage:
|
||||
PushInShowMyPageData(m_system, InitializeFakeCallerApplet(m_system, applet));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/am/cradle_firmware_updater.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
ICradleFirmwareUpdater::ICradleFirmwareUpdater(Core::System& system_)
|
||||
: ServiceFramework{system_, "ICradleFirmwareUpdater"}, service_context{system,
|
||||
"IHomeMenuFunctions"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "StartUpdate"},
|
||||
{1, &ICradleFirmwareUpdater::FinishUpdate, "FinishUpdate"},
|
||||
{2, &ICradleFirmwareUpdater::GetCradleDeviceInfo, "GetCradleDeviceInfo"},
|
||||
{3, &ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent, "GetCradleDeviceInfoChangeEvent"},
|
||||
{4, nullptr, "GetUpdateProgressInfo"},
|
||||
{5, nullptr, "GetLastInternalResult"},
|
||||
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
|
||||
cradle_device_info_event =
|
||||
service_context.CreateEvent("IHomeMenuFunctions:PopFromGeneralChannelEvent");
|
||||
}
|
||||
|
||||
ICradleFirmwareUpdater::~ICradleFirmwareUpdater() {
|
||||
service_context.CloseEvent(cradle_device_info_event);
|
||||
}
|
||||
|
||||
void ICradleFirmwareUpdater::FinishUpdate(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
void ICradleFirmwareUpdater::GetCradleDeviceInfo(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 5};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u64>(0);
|
||||
rb.Push<u32>(0);
|
||||
}
|
||||
|
||||
void ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(cradle_device_info_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
|
@ -0,0 +1,25 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class ICradleFirmwareUpdater final : public ServiceFramework<ICradleFirmwareUpdater> {
|
||||
public:
|
||||
explicit ICradleFirmwareUpdater(Core::System& system_);
|
||||
~ICradleFirmwareUpdater() override;
|
||||
|
||||
private:
|
||||
void FinishUpdate(HLERequestContext& ctx);
|
||||
void GetCradleDeviceInfo(HLERequestContext& ctx);
|
||||
void GetCradleDeviceInfoChangeEvent(HLERequestContext& ctx);
|
||||
|
||||
Kernel::KEvent* cradle_device_info_event;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
};
|
||||
|
||||
} // namespace Service::AM
|
|
@ -37,7 +37,12 @@ Result ARPManager::GetControlProperty(std::vector<u8>* out_control_property, u64
|
|||
|
||||
const auto iter = entries.find(title_id);
|
||||
if (iter == entries.end()) {
|
||||
return Glue::ResultProcessIdNotRegistered;
|
||||
if (entries.empty()) {
|
||||
return Glue::ResultProcessIdNotRegistered;
|
||||
}
|
||||
|
||||
*out_control_property = entries.begin()->second.control;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
*out_control_property = iter->second.control;
|
||||
|
|
|
@ -32,8 +32,8 @@ public:
|
|||
void GetTagInfo(HLERequestContext& ctx);
|
||||
void AttachActivateEvent(HLERequestContext& ctx);
|
||||
void AttachDeactivateEvent(HLERequestContext& ctx);
|
||||
void ReadMifare(HLERequestContext& ctx);
|
||||
void SetNfcEnabled(HLERequestContext& ctx);
|
||||
void ReadMifare(HLERequestContext& ctx);
|
||||
void WriteMifare(HLERequestContext& ctx);
|
||||
void SendCommandByPassThrough(HLERequestContext& ctx);
|
||||
|
||||
|
|
|
@ -419,6 +419,22 @@ void IGeneralService::GetCurrentNetworkProfile(HLERequestContext& ctx) {
|
|||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IGeneralService::EnumerateNetworkInterfaces(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(0);
|
||||
}
|
||||
|
||||
void IGeneralService::EnumerateNetworkProfiles(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(0);
|
||||
}
|
||||
|
||||
void IGeneralService::RemoveNetworkProfile(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
|
@ -506,16 +522,27 @@ void IGeneralService::GetCurrentIpConfigInfo(HLERequestContext& ctx) {
|
|||
rb.PushRaw<IpConfigInfo>(ip_config_info);
|
||||
}
|
||||
|
||||
void IGeneralService::SetWirelessCommunicationEnabled(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto is_enabled{rp.Pop<bool>()};
|
||||
LOG_DEBUG(Service_NIFM, "called, is_enabled={}", is_enabled);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IGeneralService::IsWirelessCommunicationEnabled(HLERequestContext& ctx) {
|
||||
LOG_WARNING(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<u8>(1);
|
||||
rb.Push<u8>(is_enabled);
|
||||
}
|
||||
|
||||
void IGeneralService::GetInternetConnectionStatus(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_NIFM, "(STUBBED) called");
|
||||
LOG_DEBUG(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
struct Output {
|
||||
u8 type{static_cast<u8>(NetworkInterfaceType::WiFi_Ieee80211)};
|
||||
|
@ -565,6 +592,21 @@ void IGeneralService::IsAnyForegroundRequestAccepted(HLERequestContext& ctx) {
|
|||
rb.Push<u8>(is_accepted);
|
||||
}
|
||||
|
||||
void IGeneralService::ConfirmSystemAvailability(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(false);
|
||||
}
|
||||
|
||||
void IGeneralService::GetCurrentAccessPoint(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_NIFM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
IGeneralService::IGeneralService(Core::System& system_)
|
||||
: ServiceFramework{system_, "IGeneralService"}, network{system_.GetRoomNetwork()} {
|
||||
// clang-format off
|
||||
|
@ -573,8 +615,8 @@ IGeneralService::IGeneralService(Core::System& system_)
|
|||
{2, &IGeneralService::CreateScanRequest, "CreateScanRequest"},
|
||||
{4, &IGeneralService::CreateRequest, "CreateRequest"},
|
||||
{5, &IGeneralService::GetCurrentNetworkProfile, "GetCurrentNetworkProfile"},
|
||||
{6, nullptr, "EnumerateNetworkInterfaces"},
|
||||
{7, nullptr, "EnumerateNetworkProfiles"},
|
||||
{6, &IGeneralService::EnumerateNetworkInterfaces, "EnumerateNetworkInterfaces"},
|
||||
{7, &IGeneralService::EnumerateNetworkProfiles, "EnumerateNetworkProfiles"},
|
||||
{8, nullptr, "GetNetworkProfile"},
|
||||
{9, nullptr, "SetNetworkProfile"},
|
||||
{10, &IGeneralService::RemoveNetworkProfile, "RemoveNetworkProfile"},
|
||||
|
@ -583,7 +625,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"},
|
||||
|
@ -600,10 +642,10 @@ IGeneralService::IGeneralService(Core::System& system_)
|
|||
{30, nullptr, "SetEthernetCommunicationEnabledForTest"},
|
||||
{31, nullptr, "GetTelemetorySystemEventReadableHandle"},
|
||||
{32, nullptr, "GetTelemetryInfo"},
|
||||
{33, nullptr, "ConfirmSystemAvailability"},
|
||||
{33, &IGeneralService::ConfirmSystemAvailability, "ConfirmSystemAvailability"},
|
||||
{34, nullptr, "SetBackgroundRequestEnabled"},
|
||||
{35, nullptr, "GetScanData"},
|
||||
{36, nullptr, "GetCurrentAccessPoint"},
|
||||
{36, &IGeneralService::GetCurrentAccessPoint, "GetCurrentAccessPoint"},
|
||||
{37, nullptr, "Shutdown"},
|
||||
{38, nullptr, "GetAllowedChannels"},
|
||||
{39, nullptr, "NotifyApplicationSuspended"},
|
||||
|
|
|
@ -27,15 +27,20 @@ private:
|
|||
void CreateScanRequest(HLERequestContext& ctx);
|
||||
void CreateRequest(HLERequestContext& ctx);
|
||||
void GetCurrentNetworkProfile(HLERequestContext& ctx);
|
||||
void EnumerateNetworkInterfaces(HLERequestContext& ctx);
|
||||
void EnumerateNetworkProfiles(HLERequestContext& ctx);
|
||||
void RemoveNetworkProfile(HLERequestContext& ctx);
|
||||
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);
|
||||
void IsAnyInternetRequestAccepted(HLERequestContext& ctx);
|
||||
void IsAnyForegroundRequestAccepted(HLERequestContext& ctx);
|
||||
void ConfirmSystemAvailability(HLERequestContext& ctx);
|
||||
void GetCurrentAccessPoint(HLERequestContext& ctx);
|
||||
|
||||
Network::RoomNetwork& network;
|
||||
};
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "core/file_sys/patch_manager.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/file_sys/submission_package.h"
|
||||
#include "core/hle/service/glue/glue_manager.h"
|
||||
#include "core/loader/loader.h"
|
||||
#include "yuzu/compatibility_list.h"
|
||||
#include "yuzu/game_list.h"
|
||||
|
@ -326,6 +327,21 @@ void GameListWorker::AddTitlesToGameList(GameListDir* parent_dir) {
|
|||
const auto control = cache.GetEntry(game.title_id, ContentRecordType::Control);
|
||||
if (control != nullptr) {
|
||||
GetMetadataFromControlNCA(patch, *control, icon, name);
|
||||
|
||||
std::vector<u8> nacp_data;
|
||||
FileSys::NACP nacp;
|
||||
if (loader->ReadControlData(nacp) == Loader::ResultStatus::Success) {
|
||||
nacp_data = nacp.GetRawBytes();
|
||||
} else {
|
||||
nacp_data.resize(sizeof(FileSys::RawNACP));
|
||||
}
|
||||
Service::Glue::ApplicationLaunchProperty launch{};
|
||||
launch.title_id = program_id;
|
||||
launch.version = patch.GetGameVersion().value_or(0);
|
||||
launch.base_game_storage_id = FileSys::StorageId::NandUser;
|
||||
launch.update_storage_id = FileSys::StorageId::NandSystem;
|
||||
|
||||
system.GetARPManager().Register(launch.title_id, launch, std::move(nacp_data));
|
||||
}
|
||||
|
||||
auto entry = MakeGameListEntry(file->GetFullPath(), name, file->GetSize(), icon, *loader,
|
||||
|
|
|
@ -1589,6 +1589,7 @@ void GMainWindow::ConnectMenuEvents() {
|
|||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartRestorer); });
|
||||
connect_menu(ui->action_Load_Cabinet_Formatter,
|
||||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartFormatter); });
|
||||
connect_menu(ui->action_Load_QLaunch, &GMainWindow::OnQlaunch);
|
||||
connect_menu(ui->action_Load_Mii_Edit, &GMainWindow::OnMiiEdit);
|
||||
connect_menu(ui->action_Open_Controller_Menu, &GMainWindow::OnOpenControllerMenu);
|
||||
connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot);
|
||||
|
@ -1626,6 +1627,7 @@ void GMainWindow::UpdateMenuState() {
|
|||
ui->action_Load_Cabinet_Restorer,
|
||||
ui->action_Load_Cabinet_Formatter,
|
||||
ui->action_Load_Mii_Edit,
|
||||
ui->action_Load_QLaunch,
|
||||
ui->action_Open_Controller_Menu};
|
||||
|
||||
for (QAction* action : running_actions) {
|
||||
|
@ -4434,6 +4436,29 @@ void GMainWindow::OnCabinet(Service::NFP::CabinetMode mode) {
|
|||
BootGame(filename, LibraryAppletParameters(CabinetId, Service::AM::AppletId::Cabinet));
|
||||
}
|
||||
|
||||
void GMainWindow::OnQlaunch() {
|
||||
constexpr u64 QlaunchId = static_cast<u64>(Service::AM::AppletProgramId::QLaunch);
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
if (!bis_system) {
|
||||
QMessageBox::warning(this, tr("No firmware available"),
|
||||
tr("Please install the firmware to use the Mii editor."));
|
||||
return;
|
||||
}
|
||||
|
||||
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."));
|
||||
return;
|
||||
}
|
||||
|
||||
system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::QLaunch);
|
||||
|
||||
const auto filename = QString::fromStdString((mii_applet_nca->GetFullPath()));
|
||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
||||
BootGame(filename, LibraryAppletParameters(QlaunchId, Service::AM::AppletId::QLaunch));
|
||||
}
|
||||
|
||||
void GMainWindow::OnMiiEdit() {
|
||||
constexpr u64 MiiEditId = static_cast<u64>(Service::AM::AppletProgramId::MiiEdit);
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
|
|
|
@ -396,6 +396,7 @@ private slots:
|
|||
void ResetWindowSize900();
|
||||
void ResetWindowSize1080();
|
||||
void OnAlbum();
|
||||
void OnQlaunch();
|
||||
void OnCabinet(Service::NFP::CabinetMode mode);
|
||||
void OnMiiEdit();
|
||||
void OnOpenControllerMenu();
|
||||
|
|
|
@ -169,6 +169,7 @@
|
|||
<addaction name="action_Install_Firmware"/>
|
||||
<addaction name="action_Verify_installed_contents"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Load_QLaunch"/>
|
||||
<addaction name="menu_cabinet_applet"/>
|
||||
<addaction name="action_Load_Album"/>
|
||||
<addaction name="action_Load_Mii_Edit"/>
|
||||
|
@ -412,6 +413,11 @@
|
|||
<string>&Format Amiibo</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Load_QLaunch">
|
||||
<property name="text">
|
||||
<string>Open &Home menu</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Load_Mii_Edit">
|
||||
<property name="text">
|
||||
<string>Open &Mii Editor</string>
|
||||
|
|
Loading…
Reference in New Issue