ulauncher ipc emu

This commit is contained in:
lizzie 2026-05-20 10:27:37 +00:00
parent 3f8d1b038f
commit ef027b629e
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/patch_manager.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/am/applet_data_broker.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) {
LOG_INFO(Service_AM, "called");
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();
}

View file

@ -512,14 +512,12 @@ MainWindow::MainWindow(bool has_broken_vulkan)
return;
}
QString game_path;
QString game_path{};
bool should_launch_qlaunch = false;
bool should_launch_hlaunch = false;
bool should_launch_hlaunch_uloader = false;
bool should_launch_umenu = false;
bool should_launch_ulaunch = false;
bool should_launch_setup = false;
bool has_gamepath = false;
bool is_fullscreen = false;
// Preserves drag/drop functionality
@ -553,7 +551,6 @@ MainWindow::MainWindow(bool has_broken_vulkan)
} else if (args[i] == QStringLiteral("-g") && i < args.size() - 1) {
// Launch game at path
game_path = args[++i];
has_gamepath = true;
} else if (args[i] == QStringLiteral("-input-profile") && i < args.size() - 1) {
auto& players = Settings::values.players.GetValue();
players[0].profile_name = args[++i].toStdString();
@ -564,20 +561,16 @@ MainWindow::MainWindow(bool has_broken_vulkan)
} else if (args[i] == QStringLiteral("-hlaunch-uloader")) {
should_launch_hlaunch_uloader = true;
} else if (args[i] == QStringLiteral("-ulaunch")) {
//should_launch_ulaunch = true;
should_launch_umenu = true;
} else if (args[i] == QStringLiteral("-umenu")) {
should_launch_umenu = true;
should_launch_ulaunch = true;
} else if (args[i] == QStringLiteral("-setup")) {
should_launch_setup = true;
} else {
game_path = args[i];
has_gamepath = true;
}
}
// 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);
}
@ -599,15 +592,11 @@ MainWindow::MainWindow(bool has_broken_vulkan)
params.launch_type = Service::AM::LaunchType::FrontendUlaunchInitiated;
BootGame(QString::fromStdString(path), params);
} 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);
auto const path = (sd_dir / "ulaunch" / "bin" / "uMenu" / "main").string();
auto const program_id = 0x010000000000FFFF;
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);
}
}