Added Signals; more runtime fixes

This commit is contained in:
Hamish Milne 2020-01-12 00:24:44 +00:00 committed by zhupengfei
parent e4f05884c3
commit 8abc5525be
17 changed files with 118 additions and 56 deletions

View file

@ -1504,19 +1504,12 @@ void GMainWindow::OnCheats() {
}
void GMainWindow::OnSave() {
Core::System& system{Core::System::GetInstance()};
auto fs = std::ofstream("save0.citrasave");
emu_thread->SetRunning(false);
Core::System::GetInstance().Save(fs);
emu_thread->SetRunning(true);
Core::System::GetInstance().SendSignal(Core::System::Signal::Save);
}
void GMainWindow::OnLoad() {
if (QFileInfo("save0.citrasave").exists()) {
auto fs = std::ifstream("save0.citrasave");
emu_thread->SetRunning(false);
Core::System::GetInstance().Load(fs);
emu_thread->SetRunning(true);
Core::System::GetInstance().SendSignal(Core::System::Signal::Load);
}
}