diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/loader/nso.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 57 | ||||
| -rw-r--r-- | src/yuzu/main.h | 3 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 11 | ||||
| -rw-r--r-- | src/yuzu/ui_settings.h | 1 |
6 files changed, 74 insertions, 2 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 7efa603a2..7e1953701 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -157,7 +157,7 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) { | |||
| 157 | 157 | ||
| 158 | // Load NSO modules | 158 | // Load NSO modules |
| 159 | VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; | 159 | VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; |
| 160 | for (const auto& module : {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3"}) { | 160 | for (const auto& module : {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4"}) { |
| 161 | const std::string path = filepath.substr(0, filepath.find_last_of("/\\")) + "/" + module; | 161 | const std::string path = filepath.substr(0, filepath.find_last_of("/\\")) + "/" + module; |
| 162 | const VAddr load_addr = next_load_addr; | 162 | const VAddr load_addr = next_load_addr; |
| 163 | next_load_addr = LoadNso(path, load_addr); | 163 | next_load_addr = LoadNso(path, load_addr); |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index ab6ba0ec9..923a7c53f 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -137,6 +137,7 @@ void Config::ReadValues() { | |||
| 137 | qt_config->endGroup(); | 137 | qt_config->endGroup(); |
| 138 | 138 | ||
| 139 | UISettings::values.single_window_mode = qt_config->value("singleWindowMode", true).toBool(); | 139 | UISettings::values.single_window_mode = qt_config->value("singleWindowMode", true).toBool(); |
| 140 | UISettings::values.fullscreen = qt_config->value("fullscreen", false).toBool(); | ||
| 140 | UISettings::values.display_titlebar = qt_config->value("displayTitleBars", true).toBool(); | 141 | UISettings::values.display_titlebar = qt_config->value("displayTitleBars", true).toBool(); |
| 141 | UISettings::values.show_filter_bar = qt_config->value("showFilterBar", true).toBool(); | 142 | UISettings::values.show_filter_bar = qt_config->value("showFilterBar", true).toBool(); |
| 142 | UISettings::values.show_status_bar = qt_config->value("showStatusBar", true).toBool(); | 143 | UISettings::values.show_status_bar = qt_config->value("showStatusBar", true).toBool(); |
| @@ -216,6 +217,7 @@ void Config::SaveValues() { | |||
| 216 | qt_config->endGroup(); | 217 | qt_config->endGroup(); |
| 217 | 218 | ||
| 218 | qt_config->setValue("singleWindowMode", UISettings::values.single_window_mode); | 219 | qt_config->setValue("singleWindowMode", UISettings::values.single_window_mode); |
| 220 | qt_config->setValue("fullscreen", UISettings::values.fullscreen); | ||
| 219 | qt_config->setValue("displayTitleBars", UISettings::values.display_titlebar); | 221 | qt_config->setValue("displayTitleBars", UISettings::values.display_titlebar); |
| 220 | qt_config->setValue("showFilterBar", UISettings::values.show_filter_bar); | 222 | qt_config->setValue("showFilterBar", UISettings::values.show_filter_bar); |
| 221 | qt_config->setValue("showStatusBar", UISettings::values.show_status_bar); | 223 | qt_config->setValue("showStatusBar", UISettings::values.show_status_bar); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f64e68268..51d7f9418 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -185,12 +185,24 @@ void GMainWindow::InitializeRecentFileMenuActions() { | |||
| 185 | void GMainWindow::InitializeHotkeys() { | 185 | void GMainWindow::InitializeHotkeys() { |
| 186 | RegisterHotkey("Main Window", "Load File", QKeySequence::Open); | 186 | RegisterHotkey("Main Window", "Load File", QKeySequence::Open); |
| 187 | RegisterHotkey("Main Window", "Start Emulation"); | 187 | RegisterHotkey("Main Window", "Start Emulation"); |
| 188 | RegisterHotkey( "Main Window", "Fullscreen", QKeySequence::FullScreen ); | ||
| 189 | RegisterHotkey( "Main Window", "Exit Fullscreen", QKeySequence::Cancel, Qt::ApplicationShortcut ); | ||
| 188 | LoadHotkeys(); | 190 | LoadHotkeys(); |
| 189 | 191 | ||
| 190 | connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, | 192 | connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, |
| 191 | SLOT(OnMenuLoadFile())); | 193 | SLOT(OnMenuLoadFile())); |
| 192 | connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, | 194 | connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, |
| 193 | SLOT(OnStartGame())); | 195 | SLOT(OnStartGame())); |
| 196 | connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, | ||
| 197 | ui.action_Fullscreen, &QAction::trigger); | ||
| 198 | connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, | ||
| 199 | ui.action_Fullscreen, &QAction::trigger); | ||
| 200 | connect(GetHotkey("Main Window", "Exit Fullscreen", this), &QShortcut::activated, this, [&] { | ||
| 201 | if (emulation_running) { | ||
| 202 | ui.action_Fullscreen->setChecked(false); | ||
| 203 | ToggleFullscreen(); | ||
| 204 | } | ||
| 205 | }); | ||
| 194 | } | 206 | } |
| 195 | 207 | ||
| 196 | void GMainWindow::SetDefaultUIGeometry() { | 208 | void GMainWindow::SetDefaultUIGeometry() { |
| @@ -219,6 +231,8 @@ void GMainWindow::RestoreUIState() { | |||
| 219 | ui.action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode); | 231 | ui.action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode); |
| 220 | ToggleWindowMode(); | 232 | ToggleWindowMode(); |
| 221 | 233 | ||
| 234 | ui.action_Fullscreen->setChecked(UISettings::values.fullscreen); | ||
| 235 | |||
| 222 | ui.action_Display_Dock_Widget_Headers->setChecked(UISettings::values.display_titlebar); | 236 | ui.action_Display_Dock_Widget_Headers->setChecked(UISettings::values.display_titlebar); |
| 223 | OnDisplayTitleBars(ui.action_Display_Dock_Widget_Headers->isChecked()); | 237 | OnDisplayTitleBars(ui.action_Display_Dock_Widget_Headers->isChecked()); |
| 224 | 238 | ||
| @@ -263,6 +277,10 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 263 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); | 277 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); |
| 264 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); | 278 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); |
| 265 | 279 | ||
| 280 | // Fullscreen | ||
| 281 | ui.action_Fullscreen->setShortcut(GetHotkey("Main Window", "Fullscreen", this)->key()); | ||
| 282 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); | ||
| 283 | |||
| 266 | // Help | 284 | // Help |
| 267 | connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnAbout); | 285 | connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnAbout); |
| 268 | } | 286 | } |
| @@ -402,6 +420,9 @@ void GMainWindow::BootGame(const QString& filename) { | |||
| 402 | render_window->setFocus(); | 420 | render_window->setFocus(); |
| 403 | 421 | ||
| 404 | emulation_running = true; | 422 | emulation_running = true; |
| 423 | if (ui.action_Fullscreen->isChecked()) { | ||
| 424 | ShowFullscreen(); | ||
| 425 | } | ||
| 405 | OnStartGame(); | 426 | OnStartGame(); |
| 406 | } | 427 | } |
| 407 | 428 | ||
| @@ -548,6 +569,41 @@ void GMainWindow::OnStopGame() { | |||
| 548 | ShutdownGame(); | 569 | ShutdownGame(); |
| 549 | } | 570 | } |
| 550 | 571 | ||
| 572 | void GMainWindow::ToggleFullscreen() { | ||
| 573 | if (!emulation_running) { | ||
| 574 | return; | ||
| 575 | } | ||
| 576 | if (ui.action_Fullscreen->isChecked()) { | ||
| 577 | ShowFullscreen(); | ||
| 578 | } else { | ||
| 579 | HideFullscreen(); | ||
| 580 | } | ||
| 581 | } | ||
| 582 | |||
| 583 | void GMainWindow::ShowFullscreen() { | ||
| 584 | if (ui.action_Single_Window_Mode->isChecked()) { | ||
| 585 | UISettings::values.geometry = saveGeometry(); | ||
| 586 | ui.menubar->hide(); | ||
| 587 | statusBar()->hide(); | ||
| 588 | showFullScreen(); | ||
| 589 | } else { | ||
| 590 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); | ||
| 591 | render_window->showFullScreen(); | ||
| 592 | } | ||
| 593 | } | ||
| 594 | |||
| 595 | void GMainWindow::HideFullscreen() { | ||
| 596 | if (ui.action_Single_Window_Mode->isChecked()) { | ||
| 597 | statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); | ||
| 598 | ui.menubar->show(); | ||
| 599 | showNormal(); | ||
| 600 | restoreGeometry(UISettings::values.geometry); | ||
| 601 | } else { | ||
| 602 | render_window->showNormal(); | ||
| 603 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); | ||
| 604 | } | ||
| 605 | } | ||
| 606 | |||
| 551 | void GMainWindow::ToggleWindowMode() { | 607 | void GMainWindow::ToggleWindowMode() { |
| 552 | if (ui.action_Single_Window_Mode->isChecked()) { | 608 | if (ui.action_Single_Window_Mode->isChecked()) { |
| 553 | // Render in the main window... | 609 | // Render in the main window... |
| @@ -700,6 +756,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) { | |||
| 700 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); | 756 | UISettings::values.microprofile_visible = microProfileDialog->isVisible(); |
| 701 | #endif | 757 | #endif |
| 702 | UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); | 758 | UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); |
| 759 | UISettings::values.fullscreen = ui.action_Fullscreen->isChecked(); | ||
| 703 | UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); | 760 | UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); |
| 704 | UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); | 761 | UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); |
| 705 | UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); | 762 | UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 3add882dd..4a0d912bb 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -127,6 +127,9 @@ private slots: | |||
| 127 | void OnAbout(); | 127 | void OnAbout(); |
| 128 | void OnToggleFilterBar(); | 128 | void OnToggleFilterBar(); |
| 129 | void OnDisplayTitleBars(bool); | 129 | void OnDisplayTitleBars(bool); |
| 130 | void ToggleFullscreen(); | ||
| 131 | void ShowFullscreen(); | ||
| 132 | void HideFullscreen(); | ||
| 130 | void ToggleWindowMode(); | 133 | void ToggleWindowMode(); |
| 131 | void OnCoreError(Core::System::ResultStatus, std::string); | 134 | void OnCoreError(Core::System::ResultStatus, std::string); |
| 132 | 135 | ||
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 721e769e8..0fcd93cc2 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -83,6 +83,7 @@ | |||
| 83 | <string>Debugging</string> | 83 | <string>Debugging</string> |
| 84 | </property> | 84 | </property> |
| 85 | </widget> | 85 | </widget> |
| 86 | <addaction name="action_Fullscreen"/> | ||
| 86 | <addaction name="action_Single_Window_Mode"/> | 87 | <addaction name="action_Single_Window_Mode"/> |
| 87 | <addaction name="action_Display_Dock_Widget_Headers"/> | 88 | <addaction name="action_Display_Dock_Widget_Headers"/> |
| 88 | <addaction name="action_Show_Filter_Bar"/> | 89 | <addaction name="action_Show_Filter_Bar"/> |
| @@ -189,6 +190,14 @@ | |||
| 189 | <string>Selects a folder to display in the game list</string> | 190 | <string>Selects a folder to display in the game list</string> |
| 190 | </property> | 191 | </property> |
| 191 | </action> | 192 | </action> |
| 192 | </widget> | 193 | <action name="action_Fullscreen"> |
| 194 | <property name="checkable"> | ||
| 195 | <bool>true</bool> | ||
| 196 | </property> | ||
| 197 | <property name="text"> | ||
| 198 | <string>Fullscreen</string> | ||
| 199 | </property> | ||
| 200 | </action> | ||
| 201 | </widget> | ||
| 193 | <resources/> | 202 | <resources/> |
| 194 | </ui> | 203 | </ui> |
diff --git a/src/yuzu/ui_settings.h b/src/yuzu/ui_settings.h index e965f0ba9..d093da641 100644 --- a/src/yuzu/ui_settings.h +++ b/src/yuzu/ui_settings.h | |||
| @@ -27,6 +27,7 @@ struct Values { | |||
| 27 | bool microprofile_visible; | 27 | bool microprofile_visible; |
| 28 | 28 | ||
| 29 | bool single_window_mode; | 29 | bool single_window_mode; |
| 30 | bool fullscreen; | ||
| 30 | bool display_titlebar; | 31 | bool display_titlebar; |
| 31 | bool show_filter_bar; | 32 | bool show_filter_bar; |
| 32 | bool show_status_bar; | 33 | bool show_status_bar; |