diff options
| -rw-r--r-- | CMakeLists.txt | 12 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -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 | 
8 files changed, 81 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d60d1a5bf..3da8465b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,10 +7,10 @@ include(DownloadExternals)  project(yuzu)  option(ENABLE_SDL2 "Enable the SDL2 frontend" ON) -option(CITRA_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF) +option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF)  option(ENABLE_QT "Enable the Qt frontend" ON) -option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) +option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" OFF)  option(YUZU_USE_BUNDLED_UNICORN "Download bundled Unicorn binaries" OFF) @@ -174,12 +174,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)  find_package(Threads REQUIRED)  if (ENABLE_SDL2) -    if (CITRA_USE_BUNDLED_SDL2) +    if (YUZU_USE_BUNDLED_SDL2)          # Detect toolchain and platform          if (MSVC14 AND ARCHITECTURE_x86_64)              set(SDL2_VER "SDL2-2.0.5")          else() -            message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable CITRA_USE_BUNDLED_SDL2 and provide your own.") +            message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable YUZU_USE_BUNDLED_SDL2 and provide your own.")          endif()          if (DEFINED SDL2_VER) @@ -235,11 +235,11 @@ if (UNICORN_FOUND)  endif()  if (ENABLE_QT) -    if (CITRA_USE_BUNDLED_QT) +    if (YUZU_USE_BUNDLED_QT)          if (MSVC14 AND ARCHITECTURE_x86_64)              set(QT_VER qt-5.7-msvc2015_64)          else() -            message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable CITRA_USE_BUNDLED_QT and provide your own.") +            message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own.")          endif()          if (DEFINED QT_VER) @@ -12,7 +12,7 @@ yuzu is licensed under the GPLv2 (or any later version). Refer to the license.tx  Check out our [website](https://yuzu-emu.org/)! -For development discussion, please join us on [Discord](https://discord.gg/VXqngT3). +For development discussion, please join us on [Discord](https://discord.gg/XQV6dn9).  ### Development 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) {      // Load NSO modules      VAddr next_load_addr{Memory::PROCESS_IMAGE_VADDR}; -    for (const auto& module : {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3"}) { +    for (const auto& module : {"rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", "subsdk3", "subsdk4"}) {          const std::string path = filepath.substr(0, filepath.find_last_of("/\\")) + "/" + module;          const VAddr load_addr = next_load_addr;          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() {      qt_config->endGroup();      UISettings::values.single_window_mode = qt_config->value("singleWindowMode", true).toBool(); +    UISettings::values.fullscreen = qt_config->value("fullscreen", false).toBool();      UISettings::values.display_titlebar = qt_config->value("displayTitleBars", true).toBool();      UISettings::values.show_filter_bar = qt_config->value("showFilterBar", true).toBool();      UISettings::values.show_status_bar = qt_config->value("showStatusBar", true).toBool(); @@ -216,6 +217,7 @@ void Config::SaveValues() {      qt_config->endGroup();      qt_config->setValue("singleWindowMode", UISettings::values.single_window_mode); +    qt_config->setValue("fullscreen", UISettings::values.fullscreen);      qt_config->setValue("displayTitleBars", UISettings::values.display_titlebar);      qt_config->setValue("showFilterBar", UISettings::values.show_filter_bar);      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() {  void GMainWindow::InitializeHotkeys() {      RegisterHotkey("Main Window", "Load File", QKeySequence::Open);      RegisterHotkey("Main Window", "Start Emulation"); +    RegisterHotkey( "Main Window", "Fullscreen", QKeySequence::FullScreen ); +    RegisterHotkey( "Main Window", "Exit Fullscreen", QKeySequence::Cancel, Qt::ApplicationShortcut );      LoadHotkeys();      connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this,              SLOT(OnMenuLoadFile()));      connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this,              SLOT(OnStartGame())); +    connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated, +             ui.action_Fullscreen, &QAction::trigger); +    connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously, +             ui.action_Fullscreen, &QAction::trigger); +    connect(GetHotkey("Main Window", "Exit Fullscreen", this), &QShortcut::activated, this, [&] { +        if (emulation_running) { +            ui.action_Fullscreen->setChecked(false); +            ToggleFullscreen(); +        } +    });  }  void GMainWindow::SetDefaultUIGeometry() { @@ -219,6 +231,8 @@ void GMainWindow::RestoreUIState() {      ui.action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode);      ToggleWindowMode(); +    ui.action_Fullscreen->setChecked(UISettings::values.fullscreen); +      ui.action_Display_Dock_Widget_Headers->setChecked(UISettings::values.display_titlebar);      OnDisplayTitleBars(ui.action_Display_Dock_Widget_Headers->isChecked()); @@ -263,6 +277,10 @@ void GMainWindow::ConnectMenuEvents() {      connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar);      connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); +    // Fullscreen +    ui.action_Fullscreen->setShortcut(GetHotkey("Main Window", "Fullscreen", this)->key()); +    connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); +      // Help      connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnAbout);  } @@ -402,6 +420,9 @@ void GMainWindow::BootGame(const QString& filename) {      render_window->setFocus();      emulation_running = true; +    if (ui.action_Fullscreen->isChecked()) { +        ShowFullscreen(); +    }      OnStartGame();  } @@ -548,6 +569,41 @@ void GMainWindow::OnStopGame() {      ShutdownGame();  } +void GMainWindow::ToggleFullscreen() { +    if (!emulation_running) { +        return; +    } +    if (ui.action_Fullscreen->isChecked()) { +        ShowFullscreen(); +    } else { +        HideFullscreen(); +    } +} + +void GMainWindow::ShowFullscreen() { +    if (ui.action_Single_Window_Mode->isChecked()) { +        UISettings::values.geometry = saveGeometry(); +        ui.menubar->hide(); +        statusBar()->hide(); +        showFullScreen(); +    } else { +        UISettings::values.renderwindow_geometry = render_window->saveGeometry(); +        render_window->showFullScreen(); +    } +} + +void GMainWindow::HideFullscreen() { +    if (ui.action_Single_Window_Mode->isChecked()) { +        statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); +        ui.menubar->show(); +        showNormal(); +        restoreGeometry(UISettings::values.geometry); +    } else { +        render_window->showNormal(); +        render_window->restoreGeometry(UISettings::values.renderwindow_geometry); +    } +} +  void GMainWindow::ToggleWindowMode() {      if (ui.action_Single_Window_Mode->isChecked()) {          // Render in the main window... @@ -700,6 +756,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) {      UISettings::values.microprofile_visible = microProfileDialog->isVisible();  #endif      UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); +    UISettings::values.fullscreen = ui.action_Fullscreen->isChecked();      UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked();      UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked();      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:      void OnAbout();      void OnToggleFilterBar();      void OnDisplayTitleBars(bool); +    void ToggleFullscreen(); +    void ShowFullscreen(); +    void HideFullscreen();      void ToggleWindowMode();      void OnCoreError(Core::System::ResultStatus, std::string); 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 @@        <string>Debugging</string>       </property>      </widget> +    <addaction name="action_Fullscreen"/>      <addaction name="action_Single_Window_Mode"/>      <addaction name="action_Display_Dock_Widget_Headers"/>      <addaction name="action_Show_Filter_Bar"/> @@ -189,6 +190,14 @@      <string>Selects a folder to display in the game list</string>     </property>    </action> - </widget> +  <action name="action_Fullscreen"> +   <property name="checkable"> +    <bool>true</bool> +   </property> +   <property name="text"> +    <string>Fullscreen</string> +   </property> +  </action> +  </widget>   <resources/>  </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 {      bool microprofile_visible;      bool single_window_mode; +    bool fullscreen;      bool display_titlebar;      bool show_filter_bar;      bool show_status_bar;  | 
