diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp index cae56b62f44c..63807c0771a5 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp @@ -57,7 +57,7 @@ extern void sysutil_register_cb(std::function&& cb) extern void sysutil_send_system_cmd(u64 status, u64 param) { - if (auto& cbm = g_fxo->get(); g_fxo->is_init() && !Emu.IsStopped()) + if (auto& cbm = g_fxo->get(); g_fxo->is_init()) { for (sysutil_cb_manager::registered_cb cb : cbm.callbacks) { diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 16f2fd301f72..3fc0fa43ebfd 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1372,6 +1372,7 @@ void main_window::OnEmuStop() #endif } ui->actionManage_Users->setEnabled(true); + m_sys_menu_opened = false; // Refresh game list in order to update time played if (m_game_list_frame) @@ -1781,15 +1782,19 @@ void main_window::CreateConnects() connect(ui->sysStopAct, &QAction::triggered, [this]() { Emu.Stop(); }); connect(ui->sysRebootAct, &QAction::triggered, [this]() { Emu.Restart(); }); - connect(ui->sysSendOpenMenuAct, &QAction::triggered, [this]() + connect(ui->sysSendOpenMenuAct, &QAction::triggered, this, [this]() { + if (Emu.IsStopped()) return; + sysutil_send_system_cmd(m_sys_menu_opened ? 0x0132 /* CELL_SYSUTIL_SYSTEM_MENU_CLOSE */ : 0x0131 /* CELL_SYSUTIL_SYSTEM_MENU_OPEN */, 0); - m_sys_menu_opened = !m_sys_menu_opened; + m_sys_menu_opened ^= true; ui->sysSendOpenMenuAct->setText(tr("Send &%0 system menu cmd").arg(m_sys_menu_opened ? tr("close") : tr("open"))); }); - connect(ui->sysSendExitAct, &QAction::triggered, [this]() + connect(ui->sysSendExitAct, &QAction::triggered, this, []() { + if (Emu.IsStopped()) return; + sysutil_send_system_cmd(0x0101 /* CELL_SYSUTIL_REQUEST_EXITGAME */, 0); });