mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
Fixup emulation stopping
This commit is contained in:
parent
8588b2b11a
commit
750359d780
2 changed files with 13 additions and 8 deletions
|
@ -3377,11 +3377,12 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value)
|
||||||
|
|
||||||
data += 0;
|
data += 0;
|
||||||
auto range_lock = vm::alloc_range_lock();
|
auto range_lock = vm::alloc_range_lock();
|
||||||
|
bool success = false;
|
||||||
{
|
{
|
||||||
rsx::reservation_lock rsx_lock(addr, 128);
|
rsx::reservation_lock rsx_lock(addr, 128);
|
||||||
|
|
||||||
auto& super_data = *vm::get_super_ptr<spu_rdata_t>(addr);
|
auto& super_data = *vm::get_super_ptr<spu_rdata_t>(addr);
|
||||||
const bool success = [&]()
|
success = [&]()
|
||||||
{
|
{
|
||||||
// Full lock (heavyweight)
|
// Full lock (heavyweight)
|
||||||
// TODO: vm::check_addr
|
// TODO: vm::check_addr
|
||||||
|
|
|
@ -2736,6 +2736,17 @@ void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savesta
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!savestate && m_emu_state_close_pending)
|
||||||
|
{
|
||||||
|
while (!async_op && m_state != system_state::stopped)
|
||||||
|
{
|
||||||
|
process_qt_events();
|
||||||
|
std::this_thread::sleep_for(16ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (old_state == system_state::paused)
|
if (old_state == system_state::paused)
|
||||||
{
|
{
|
||||||
Resume();
|
Resume();
|
||||||
|
@ -2759,11 +2770,6 @@ void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savesta
|
||||||
|
|
||||||
auto perform_kill = [read_counter, allow_autoexit, this, info = GetEmulationIdentifier()]()
|
auto perform_kill = [read_counter, allow_autoexit, this, info = GetEmulationIdentifier()]()
|
||||||
{
|
{
|
||||||
if (m_emu_state_close_pending.exchange(true))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool read_sysutil_signal = false;
|
bool read_sysutil_signal = false;
|
||||||
|
|
||||||
for (u32 i = 100; i < 140; i++)
|
for (u32 i = 100; i < 140; i++)
|
||||||
|
@ -2786,7 +2792,6 @@ void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savesta
|
||||||
|
|
||||||
if (static_cast<u64>(info) != m_stop_ctr)
|
if (static_cast<u64>(info) != m_stop_ctr)
|
||||||
{
|
{
|
||||||
m_emu_state_close_pending = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2794,7 +2799,6 @@ void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savesta
|
||||||
// An inevitable attempt to terminate the *current* emulation course will be issued after 7s
|
// An inevitable attempt to terminate the *current* emulation course will be issued after 7s
|
||||||
CallFromMainThread([allow_autoexit, this]()
|
CallFromMainThread([allow_autoexit, this]()
|
||||||
{
|
{
|
||||||
m_emu_state_close_pending = false;
|
|
||||||
Kill(allow_autoexit);
|
Kill(allow_autoexit);
|
||||||
}, info);
|
}, info);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue