core: Track system exit lock status

Used to determine if yuzu should confirm before pausing or stopping a game.
This commit is contained in:
Zach Hilman 2019-07-06 13:08:33 -04:00
parent a1b8e5d09a
commit bbc1437188
2 changed files with 15 additions and 0 deletions

View File

@ -163,6 +163,7 @@ struct System::Impl {
gpu_core = VideoCore::CreateGPU(system); gpu_core = VideoCore::CreateGPU(system);
is_powered_on = true; is_powered_on = true;
exit_lock = false;
LOG_DEBUG(Core, "Initialized OK"); LOG_DEBUG(Core, "Initialized OK");
@ -244,6 +245,7 @@ struct System::Impl {
perf_stats->GetMeanFrametime()); perf_stats->GetMeanFrametime());
is_powered_on = false; is_powered_on = false;
exit_lock = false;
// Shutdown emulation session // Shutdown emulation session
renderer.reset(); renderer.reset();
@ -328,6 +330,7 @@ struct System::Impl {
std::unique_ptr<Core::Hardware::InterruptManager> interrupt_manager; std::unique_ptr<Core::Hardware::InterruptManager> interrupt_manager;
CpuCoreManager cpu_core_manager; CpuCoreManager cpu_core_manager;
bool is_powered_on = false; bool is_powered_on = false;
bool exit_lock = false;
std::unique_ptr<FileSys::CheatEngine> cheat_engine; std::unique_ptr<FileSys::CheatEngine> cheat_engine;
std::unique_ptr<Tools::Freezer> memory_freezer; std::unique_ptr<Tools::Freezer> memory_freezer;
@ -624,6 +627,14 @@ const Service::APM::Controller& System::GetAPMController() const {
return impl->apm_controller; return impl->apm_controller;
} }
void System::SetExitLock(bool locked) {
impl->exit_lock = locked;
}
bool System::GetExitLock() const {
return impl->exit_lock;
}
System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) {
return impl->Init(*this, emu_window); return impl->Init(*this, emu_window);
} }

View File

@ -322,6 +322,10 @@ public:
const Service::APM::Controller& GetAPMController() const; const Service::APM::Controller& GetAPMController() const;
void SetExitLock(bool locked);
bool GetExitLock() const;
private: private:
System(); System();