ulauncher ipc emu

This commit is contained in:
lizzie 2026-05-20 10:27:37 +00:00
parent 272a71d27d
commit 20f1a2ef02
2 changed files with 21 additions and 15 deletions

View file

@ -8,6 +8,7 @@
#include "core/file_sys/control_metadata.h" #include "core/file_sys/control_metadata.h"
#include "core/file_sys/patch_manager.h" #include "core/file_sys/patch_manager.h"
#include "core/file_sys/registered_cache.h" #include "core/file_sys/registered_cache.h"
#include "core/hle/result.h"
#include "core/hle/service/acc/profile_manager.h" #include "core/hle/service/acc/profile_manager.h"
#include "core/hle/service/am/applet_data_broker.h" #include "core/hle/service/am/applet_data_broker.h"
#include "core/hle/service/am/applet_manager.h" #include "core/hle/service/am/applet_manager.h"
@ -99,6 +100,22 @@ Result ILibraryAppletSelfAccessor::PopInData(Out<SharedPointer<IStorage>> out_st
Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer<IStorage> storage) { Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer<IStorage> storage) {
LOG_INFO(Service_AM, "called"); LOG_INFO(Service_AM, "called");
m_broker->GetOutData().Push(storage); m_broker->GetOutData().Push(storage);
if (m_applet->applet_id == AppletId::UlauncherUmenu) {
LOG_WARNING(Service_AM, "emulating uLauncher IPC");
std::shared_ptr<IStorage> tmp_storage;
m_broker->GetOutData().Pop(&tmp_storage);
std::vector<u8> result_data(0x8000);
struct CommandCommonHeader {
u32 magic;
u32 val;
} cmd;
cmd.magic = 0x21494D53;
cmd.val = u32(ResultSuccess.raw);
std::memcpy(result_data.data(), &cmd, sizeof(cmd));
m_broker->GetInData().Push(std::make_shared<IStorage>(system, std::move(result_data)));
}
R_SUCCEED(); R_SUCCEED();
} }

View file

@ -512,14 +512,12 @@ MainWindow::MainWindow(bool has_broken_vulkan)
return; return;
} }
QString game_path; QString game_path{};
bool should_launch_qlaunch = false; bool should_launch_qlaunch = false;
bool should_launch_hlaunch = false; bool should_launch_hlaunch = false;
bool should_launch_hlaunch_uloader = false; bool should_launch_hlaunch_uloader = false;
bool should_launch_umenu = false;
bool should_launch_ulaunch = false; bool should_launch_ulaunch = false;
bool should_launch_setup = false; bool should_launch_setup = false;
bool has_gamepath = false;
bool is_fullscreen = false; bool is_fullscreen = false;
// Preserves drag/drop functionality // Preserves drag/drop functionality
@ -553,7 +551,6 @@ MainWindow::MainWindow(bool has_broken_vulkan)
} else if (args[i] == QStringLiteral("-g") && i < args.size() - 1) { } else if (args[i] == QStringLiteral("-g") && i < args.size() - 1) {
// Launch game at path // Launch game at path
game_path = args[++i]; game_path = args[++i];
has_gamepath = true;
} else if (args[i] == QStringLiteral("-input-profile") && i < args.size() - 1) { } else if (args[i] == QStringLiteral("-input-profile") && i < args.size() - 1) {
auto& players = Settings::values.players.GetValue(); auto& players = Settings::values.players.GetValue();
players[0].profile_name = args[++i].toStdString(); players[0].profile_name = args[++i].toStdString();
@ -564,20 +561,16 @@ MainWindow::MainWindow(bool has_broken_vulkan)
} else if (args[i] == QStringLiteral("-hlaunch-uloader")) { } else if (args[i] == QStringLiteral("-hlaunch-uloader")) {
should_launch_hlaunch_uloader = true; should_launch_hlaunch_uloader = true;
} else if (args[i] == QStringLiteral("-ulaunch")) { } else if (args[i] == QStringLiteral("-ulaunch")) {
//should_launch_ulaunch = true; should_launch_ulaunch = true;
should_launch_umenu = true;
} else if (args[i] == QStringLiteral("-umenu")) {
should_launch_umenu = true;
} else if (args[i] == QStringLiteral("-setup")) { } else if (args[i] == QStringLiteral("-setup")) {
should_launch_setup = true; should_launch_setup = true;
} else { } else {
game_path = args[i]; game_path = args[i];
has_gamepath = true;
} }
} }
// Override fullscreen setting if gamepath or argument is provided // Override fullscreen setting if gamepath or argument is provided
if (has_gamepath || is_fullscreen) { if (!game_path.isEmpty() || is_fullscreen) {
ui->action_Fullscreen->setChecked(is_fullscreen); ui->action_Fullscreen->setChecked(is_fullscreen);
} }
@ -599,15 +592,11 @@ MainWindow::MainWindow(bool has_broken_vulkan)
params.launch_type = Service::AM::LaunchType::FrontendUlaunchInitiated; params.launch_type = Service::AM::LaunchType::FrontendUlaunchInitiated;
BootGame(QString::fromStdString(path), params); BootGame(QString::fromStdString(path), params);
} else if (should_launch_ulaunch) { } else if (should_launch_ulaunch) {
std::filesystem::path const sd_dir = Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir);
auto const path = (sd_dir / "ulaunch" / "bin" / "uSystem" / "exefs.nsp").string();
BootGame(QString::fromStdString(path), ApplicationAppletParameters());
} else if (should_launch_umenu) {
std::filesystem::path const sd_dir = Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir); std::filesystem::path const sd_dir = Common::FS::GetEdenPathString(Common::FS::EdenPath::SDMCDir);
auto const path = (sd_dir / "ulaunch" / "bin" / "uMenu" / "main").string(); auto const path = (sd_dir / "ulaunch" / "bin" / "uMenu" / "main").string();
auto const program_id = 0x010000000000FFFF; auto const program_id = 0x010000000000FFFF;
auto params = LibraryAppletParameters(program_id, Service::AM::AppletId::UlauncherUmenu); auto params = LibraryAppletParameters(program_id, Service::AM::AppletId::UlauncherUmenu);
params.launch_type = Service::AM::LaunchType::FrontendUmenuInitiated; params.launch_type = Service::AM::LaunchType::FrontendInitiated;
BootGame(QString::fromStdString(path), params); BootGame(QString::fromStdString(path), params);
} }
} }