summaryrefslogtreecommitdiff
path: root/src/citron/main.cpp
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.orgq>2025-02-17 17:33:10 +1000
committerZephyron <zephyron@citron-emu.orgq>2025-02-17 17:33:10 +1000
commitc5e480e55ddc3183c48148daaa14c00ada855fee (patch)
tree36613554e13c7526fc106b59b80c49bb1c893392 /src/citron/main.cpp
parent1c9e17496b6f9f4b083c62aa25548617dd179a8b (diff)
feat: Add Home Menu launch support and system improvements
This commit adds support for launching the system Home Menu and implements several system-level improvements: - Add Home Menu launch functionality through new UI action - Implement shutdown/reboot sequence handlers in GlobalStateController - Add support for reserved region extra size in page tables - Enhance audio controller with output management - Expand parental control service capabilities - Add profile service improvements for user management Technical changes: - Add OnHomeMenu() handler to launch QLaunch system applet - Implement m_alias_region_extra_size tracking in page tables - Add new CreateProcessFlag for reserved region extra size - Expand audio controller interface with output management - Add self-controller methods to various services - Implement play timer and profile service improvements The changes primarily focus on system menu integration and core service improvements to better support system functionality.
Diffstat (limited to 'src/citron/main.cpp')
-rw-r--r--src/citron/main.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/citron/main.cpp b/src/citron/main.cpp
index c30395310..cb6cedd19 100644
--- a/src/citron/main.cpp
+++ b/src/citron/main.cpp
@@ -1584,6 +1584,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
@@ -1619,7 +1620,8 @@ void GMainWindow::UpdateMenuState() {
ui->action_Load_Cabinet_Restorer,
ui->action_Load_Cabinet_Formatter,
ui->action_Load_Mii_Edit,
- ui->action_Open_Controller_Menu};
+ ui->action_Open_Controller_Menu,
+ ui->action_Load_Home_Menu};
for (QAction* action : running_actions) {
action->setEnabled(emulation_running);
@@ -5324,3 +5326,40 @@ int main(int argc, char* argv[]) {
detached_tasks.WaitForAllTasks();
return result;
}
+
+void GMainWindow::OnHomeMenu() {
+ constexpr u64 QLaunchId = static_cast<u64>(Service::AM::AppletProgramId::QLaunch);
+
+ // Check if system NAND contents are available
+ auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
+ if (!bis_system) {
+ QMessageBox::warning(this, tr("System Error"),
+ tr("System NAND contents not found. Please verify your firmware installation."));
+ return;
+ }
+
+ // Try to get the QLaunch NCA
+ auto qlaunch_nca = bis_system->GetEntry(QLaunchId, FileSys::ContentRecordType::Program);
+ if (!qlaunch_nca) {
+ QMessageBox::warning(this, tr("System Error"),
+ tr("Home Menu applet not found. Please verify your firmware installation."));
+ return;
+ }
+
+ // Set up applet parameters
+ Service::AM::FrontendAppletParameters params{
+ .program_id = QLaunchId,
+ .applet_id = Service::AM::AppletId::QLaunch,
+ .applet_type = Service::AM::AppletType::SystemApplet
+ };
+
+ // Configure system for QLaunch
+ system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::QLaunch);
+
+ // Get path and launch
+ const auto nca_path = QString::fromStdString(qlaunch_nca->GetFullPath());
+ UISettings::values.roms_path = QFileInfo(nca_path).path().toStdString();
+
+ // Launch QLaunch with proper parameters
+ BootGame(nca_path, params);
+}