diff options
| author | darktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion> | 2024-04-05 01:58:29 +0200 |
|---|---|---|
| committer | Briar <205427297+icybriarr@users.noreply.github.com> | 2025-04-04 03:40:45 +0200 |
| commit | 76a55dc00366778181d56d7e7d96956d92fcf28e (patch) | |
| tree | 7be111b619a6fc8e6faf6914800b2675d45d0247 /src/yuzu/main.cpp | |
| parent | c4fb749028bb838902450a998482999eed523ce1 (diff) | |
Implement option to start QLaunch from Tools menu
Diffstat (limited to 'src/yuzu/main.cpp')
| -rw-r--r-- | src/yuzu/main.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 56d8803bb8..7e1ec122a7 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1591,6 +1591,7 @@ void GMainWindow::ConnectMenuEvents() { [this]() { OnCabinet(Service::NFP::CabinetMode::StartFormatter); }); connect_menu(ui->action_Load_Mii_Edit, &GMainWindow::OnMiiEdit); connect_menu(ui->action_Open_Controller_Menu, &GMainWindow::OnOpenControllerMenu); + connect_menu(ui->action_Load_Home_Menu, &GMainWindow::OnHomeMenu); connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot); // TAS @@ -4480,6 +4481,29 @@ void GMainWindow::OnOpenControllerMenu() { LibraryAppletParameters(ControllerAppletId, Service::AM::AppletId::Controller)); } +void GMainWindow::OnHomeMenu() { + 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 Home Menu.")); + return; + } + + auto qlaunch_applet_nca = bis_system->GetEntry(QLaunchId, FileSys::ContentRecordType::Program); + if (!qlaunch_applet_nca) { + QMessageBox::warning(this, tr("Home Menu Applet"), + tr("Home Menu is not available. Please reinstall firmware.")); + return; + } + + system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::QLaunch); + + const auto filename = QString::fromStdString((qlaunch_applet_nca->GetFullPath())); + UISettings::values.roms_path = QFileInfo(filename).path().toStdString(); + BootGame(filename, LibraryAppletParameters(QLaunchId, Service::AM::AppletId::QLaunch)); +} + void GMainWindow::OnCaptureScreenshot() { if (emu_thread == nullptr || !emu_thread->IsRunning()) { return; |
