diff options
Diffstat (limited to 'src/yuzu')
| -rw-r--r-- | src/yuzu/applets/web_browser.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/compatdb.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 7 | ||||
| -rw-r--r-- | src/yuzu/debugger/wait_tree.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/debugger/wait_tree.h | 3 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 20 | 
9 files changed, 50 insertions, 14 deletions
| diff --git a/src/yuzu/applets/web_browser.cpp b/src/yuzu/applets/web_browser.cpp index 6a9138d53..979b9ec14 100644 --- a/src/yuzu/applets/web_browser.cpp +++ b/src/yuzu/applets/web_browser.cpp @@ -56,6 +56,8 @@ constexpr char NX_SHIM_INJECT_SCRIPT[] = R"(      window.nx.endApplet = function() {          applet_done = true;      }; + +    window.onkeypress = function(e) { if (e.keyCode === 13) { applet_done = true; } };  )";  QString GetNXShimInjectionScript() { diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 73b04b749..3b070bfbb 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -20,10 +20,7 @@  EmuThread::EmuThread(GRenderWindow* render_window) : render_window(render_window) {}  void EmuThread::run() { -    if (!Settings::values.use_multi_core) { -        // Single core mode must acquire OpenGL context for entire emulation session -        render_window->MakeCurrent(); -    } +    render_window->MakeCurrent();      MicroProfileOnThreadCreate("EmuThread"); @@ -38,6 +35,11 @@ void EmuThread::run() {      emit LoadProgress(VideoCore::LoadCallbackStage::Complete, 0, 0); +    if (Settings::values.use_asynchronous_gpu_emulation) { +        // Release OpenGL context for the GPU thread +        render_window->DoneCurrent(); +    } +      // holds whether the cpu was running during the last iteration,      // so that the DebugModeLeft signal can be emitted before the      // next execution step diff --git a/src/yuzu/compatdb.cpp b/src/yuzu/compatdb.cpp index 5f0896f84..c8b0a5ec0 100644 --- a/src/yuzu/compatdb.cpp +++ b/src/yuzu/compatdb.cpp @@ -53,15 +53,15 @@ void CompatDB::Submit() {      case CompatDBPage::Final:          back();          LOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId()); -        Core::Telemetry().AddField(Telemetry::FieldType::UserFeedback, "Compatibility", -                                   compatibility->checkedId()); +        Core::System::GetInstance().TelemetrySession().AddField( +            Telemetry::FieldType::UserFeedback, "Compatibility", compatibility->checkedId());          button(NextButton)->setEnabled(false);          button(NextButton)->setText(tr("Submitting"));          button(QWizard::CancelButton)->setVisible(false);          testcase_watcher.setFuture(QtConcurrent::run( -            [this]() { return Core::System::GetInstance().TelemetrySession().SubmitTestcase(); })); +            [] { return Core::System::GetInstance().TelemetrySession().SubmitTestcase(); }));          break;      default:          LOG_ERROR(Frontend, "Unexpected page: {}", currentId()); diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index e9546dadf..74dc6bb28 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -374,6 +374,8 @@ void Config::ReadValues() {          qt_config->value("use_disk_shader_cache", false).toBool();      Settings::values.use_accurate_gpu_emulation =          qt_config->value("use_accurate_gpu_emulation", false).toBool(); +    Settings::values.use_asynchronous_gpu_emulation = +        qt_config->value("use_asynchronous_gpu_emulation", false).toBool();      Settings::values.bg_red = qt_config->value("bg_red", 0.0).toFloat();      Settings::values.bg_green = qt_config->value("bg_green", 0.0).toFloat(); @@ -633,6 +635,8 @@ void Config::SaveValues() {      qt_config->setValue("frame_limit", Settings::values.frame_limit);      qt_config->setValue("use_disk_shader_cache", Settings::values.use_disk_shader_cache);      qt_config->setValue("use_accurate_gpu_emulation", Settings::values.use_accurate_gpu_emulation); +    qt_config->setValue("use_asynchronous_gpu_emulation", +                        Settings::values.use_asynchronous_gpu_emulation);      // Cast to double because Qt's written float values are not human-readable      qt_config->setValue("bg_red", (double)Settings::values.bg_red); diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 0f5dd534b..dd1d67488 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -75,6 +75,8 @@ void ConfigureGraphics::setConfiguration() {      ui->frame_limit->setValue(Settings::values.frame_limit);      ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache);      ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); +    ui->use_asynchronous_gpu_emulation->setEnabled(!Core::System::GetInstance().IsPoweredOn()); +    ui->use_asynchronous_gpu_emulation->setChecked(Settings::values.use_asynchronous_gpu_emulation);      UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green,                                                   Settings::values.bg_blue));  } @@ -86,6 +88,8 @@ void ConfigureGraphics::applyConfiguration() {      Settings::values.frame_limit = ui->frame_limit->value();      Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked();      Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); +    Settings::values.use_asynchronous_gpu_emulation = +        ui->use_asynchronous_gpu_emulation->isChecked();      Settings::values.bg_red = static_cast<float>(bg_color.redF());      Settings::values.bg_green = static_cast<float>(bg_color.greenF());      Settings::values.bg_blue = static_cast<float>(bg_color.blueF()); diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 824f5810a..c6767e0ca 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui @@ -64,6 +64,13 @@           </widget>          </item>          <item> +         <widget class="QCheckBox" name="use_asynchronous_gpu_emulation"> +          <property name="text"> +           <string>Use asynchronous GPU emulation</string> +          </property> +         </widget> +        </item> +        <item>           <layout class="QHBoxLayout" name="horizontalLayout">            <item>             <widget class="QLabel" name="label"> diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index f50225d5f..06ad74ffe 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp @@ -81,9 +81,8 @@ QString WaitTreeText::GetText() const {      return text;  } -WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address) : mutex_address(mutex_address) { -    const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); - +WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTable& handle_table) +    : mutex_address(mutex_address) {      mutex_value = Memory::Read32(mutex_address);      owner_handle = static_cast<Kernel::Handle>(mutex_value & Kernel::Mutex::MutexOwnerMask);      owner = handle_table.Get<Kernel::Thread>(owner_handle); @@ -316,7 +315,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {      const VAddr mutex_wait_address = thread.GetMutexWaitAddress();      if (mutex_wait_address != 0) { -        list.push_back(std::make_unique<WaitTreeMutexInfo>(mutex_wait_address)); +        const auto& handle_table = thread.GetOwnerProcess()->GetHandleTable(); +        list.push_back(std::make_unique<WaitTreeMutexInfo>(mutex_wait_address, handle_table));      } else {          list.push_back(std::make_unique<WaitTreeText>(tr("not waiting for mutex")));      } diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h index 365c3dbfe..62886609d 100644 --- a/src/yuzu/debugger/wait_tree.h +++ b/src/yuzu/debugger/wait_tree.h @@ -17,6 +17,7 @@  class EmuThread;  namespace Kernel { +class HandleTable;  class ReadableEvent;  class WaitObject;  class Thread; @@ -72,7 +73,7 @@ public:  class WaitTreeMutexInfo : public WaitTreeExpandableItem {      Q_OBJECT  public: -    explicit WaitTreeMutexInfo(VAddr mutex_address); +    explicit WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTable& handle_table);      ~WaitTreeMutexInfo() override;      QString GetText() const override; diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1d460c189..41ba3c4c6 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -11,6 +11,7 @@  #include "applets/profile_select.h"  #include "applets/software_keyboard.h"  #include "applets/web_browser.h" +#include "configuration/configure_input.h"  #include "configuration/configure_per_general.h"  #include "core/file_sys/vfs.h"  #include "core/file_sys/vfs_real.h" @@ -339,6 +340,11 @@ void GMainWindow::WebBrowserOpenPage(std::string_view filename, std::string_view                  .arg(QString::fromStdString(std::to_string(key_code))));      }; +    QMessageBox::information( +        this, tr("Exit"), +        tr("To exit the web application, use the game provided controls to select exit, select the " +           "'Exit Web Applet' option in the menu bar, or press the 'Enter' key.")); +      bool running_exit_check = false;      while (!finished) {          QApplication::processEvents(); @@ -522,6 +528,7 @@ void GMainWindow::InitializeHotkeys() {                                     Qt::ApplicationShortcut);      hotkey_registry.RegisterHotkey("Main Window", "Capture Screenshot",                                     QKeySequence(QKeySequence::Print)); +    hotkey_registry.RegisterHotkey("Main Window", "Change Docked Mode", QKeySequence(Qt::Key_F10));      hotkey_registry.LoadHotkeys(); @@ -561,7 +568,10 @@ void GMainWindow::InitializeHotkeys() {                  Settings::values.use_frame_limit = !Settings::values.use_frame_limit;                  UpdateStatusBar();              }); -    constexpr u16 SPEED_LIMIT_STEP = 5; +    // TODO: Remove this comment/static whenever the next major release of +    // MSVC occurs and we make it a requirement (see: +    // https://developercommunity.visualstudio.com/content/problem/93922/constexprs-are-trying-to-be-captured-in-lambda-fun.html) +    static constexpr u16 SPEED_LIMIT_STEP = 5;      connect(hotkey_registry.GetHotkey("Main Window", "Increase Speed Limit", this),              &QShortcut::activated, this, [&] {                  if (Settings::values.frame_limit < 9999 - SPEED_LIMIT_STEP) { @@ -588,6 +598,12 @@ void GMainWindow::InitializeHotkeys() {                      OnCaptureScreenshot();                  }              }); +    connect(hotkey_registry.GetHotkey("Main Window", "Change Docked Mode", this), +            &QShortcut::activated, this, [&] { +                Settings::values.use_docked_mode = !Settings::values.use_docked_mode; +                OnDockedModeChanged(!Settings::values.use_docked_mode, +                                    Settings::values.use_docked_mode); +            });  }  void GMainWindow::SetDefaultUIGeometry() { @@ -846,7 +862,7 @@ bool GMainWindow::LoadROM(const QString& filename) {      }      game_path = filename; -    Core::Telemetry().AddField(Telemetry::FieldType::App, "Frontend", "Qt"); +    system.TelemetrySession().AddField(Telemetry::FieldType::App, "Frontend", "Qt");      return true;  } | 
