diff options
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r-- | src/yuzu/bootmanager.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 2e0ade815..40fd47406 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -36,12 +36,13 @@ #include "input_common/keyboard.h" #include "input_common/main.h" #include "input_common/mouse/mouse_input.h" +#include "input_common/tas/tas_input.h" #include "video_core/renderer_base.h" #include "video_core/video_core.h" #include "yuzu/bootmanager.h" #include "yuzu/main.h" -EmuThread::EmuThread() = default; +EmuThread::EmuThread(Core::System& system_) : system{system_} {} EmuThread::~EmuThread() = default; @@ -50,7 +51,6 @@ void EmuThread::run() { MicroProfileOnThreadCreate(name.c_str()); Common::SetCurrentThreadName(name.c_str()); - auto& system = Core::System::GetInstance(); auto& gpu = system.GPU(); auto stop_token = stop_source.get_token(); @@ -86,15 +86,15 @@ void EmuThread::run() { } running_guard = true; - Core::System::ResultStatus result = system.Run(); - if (result != Core::System::ResultStatus::Success) { + Core::SystemResultStatus result = system.Run(); + if (result != Core::SystemResultStatus::Success) { running_guard = false; this->SetRunning(false); emit ErrorThrown(result, system.GetStatusDetails()); } running_wait.Wait(); result = system.Pause(); - if (result != Core::System::ResultStatus::Success) { + if (result != Core::SystemResultStatus::Success) { running_guard = false; this->SetRunning(false); emit ErrorThrown(result, system.GetStatusDetails()); @@ -284,8 +284,10 @@ static Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* } GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, - std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_) - : QWidget(parent), emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)} { + std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_, + Core::System& system_) + : QWidget(parent), + emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, system{system_} { setWindowTitle(QStringLiteral("yuzu %1 | %2-%3") .arg(QString::fromUtf8(Common::g_build_name), QString::fromUtf8(Common::g_scm_branch), @@ -301,17 +303,23 @@ GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, connect(this, &GRenderWindow::FirstFrameDisplayed, parent, &GMainWindow::OnLoadComplete); connect(this, &GRenderWindow::ExecuteProgramSignal, parent, &GMainWindow::OnExecuteProgram, Qt::QueuedConnection); + connect(this, &GRenderWindow::ExitSignal, parent, &GMainWindow::OnExit, Qt::QueuedConnection); } void GRenderWindow::ExecuteProgram(std::size_t program_index) { emit ExecuteProgramSignal(program_index); } +void GRenderWindow::Exit() { + emit ExitSignal(); +} + GRenderWindow::~GRenderWindow() { input_subsystem->Shutdown(); } void GRenderWindow::OnFrameDisplayed() { + input_subsystem->GetTas()->UpdateThread(); if (!first_frame) { first_frame = true; emit FirstFrameDisplayed(); @@ -622,8 +630,7 @@ void GRenderWindow::ReleaseRenderTarget() { } void GRenderWindow::CaptureScreenshot(u32 res_scale, const QString& screenshot_path) { - auto& renderer = Core::System::GetInstance().Renderer(); - + VideoCore::RendererBase& renderer = system.Renderer(); if (res_scale == 0) { res_scale = VideoCore::GetResolutionScaleFactor(renderer); } |