Savestates: Fix restart when suspend mode is off

Add a new menu button for explicit exit (mostly for debug purposes)
This commit is contained in:
Eladash 2024-01-20 21:25:10 +02:00 committed by Elad.Ash
parent 01ee119c59
commit f19744ae88
4 changed files with 34 additions and 4 deletions

View file

@ -57,6 +57,7 @@
#include "Emu/vfs_config.h"
#include "Emu/System.h"
#include "Emu/system_utils.hpp"
#include "Emu/system_config.h"
#include "Crypto/unpkg.h"
#include "Crypto/unself.h"
@ -2395,6 +2396,21 @@ void main_window::CreateConnects()
connect(ui->actionCreate_Savestate, &QAction::triggered, this, []()
{
gui_log.notice("User triggered savestate creation from utilities.");
if (!g_cfg.savestate.suspend_emu)
{
Emu.after_kill_callback = []()
{
Emu.Restart();
};
}
Emu.Kill(false, true);
});
connect(ui->actionCreate_Savestate_And_Exit, &QAction::triggered, this, []()
{
gui_log.notice("User triggered savestate creation and emulation stop from utilities.");
Emu.Kill(false, true);
});