cpu_thread::test_state added

lv2_obj::sleep adjustment
synchronization fixes
This commit is contained in:
Nekotekina 2017-02-22 13:10:55 +03:00
parent 4b6f8d2f62
commit 9000407a77
36 changed files with 421 additions and 302 deletions

View file

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "Utilities/Config.h"
#include "Utilities/lockless.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
@ -1060,18 +1061,8 @@ bool SPUThread::stop_and_signal(u32 code)
{
case 0x000:
{
// Hack: wait for an instruction become available
while (vm::ps3::read32(offset + pc) == 0)
{
if (test(state) && check_state())
{
return false;
}
thread_ctrl::wait_for(1000);
}
return false;
// Hack: execute as NOP
return true;
}
case 0x001:
@ -1086,23 +1077,6 @@ bool SPUThread::stop_and_signal(u32 code)
return true;
}
case 0x003:
{
const auto found = m_addr_to_hle_function_map.find(pc);
if (found == m_addr_to_hle_function_map.end())
{
fmt::throw_exception("HLE function not registered (PC=0x%05x)" HERE, pc);
}
if (const auto return_to_caller = found->second(*this))
{
pc = (gpr[0]._u32[3] & 0x3fffc) - 4;
}
return true;
}
case 0x110:
{
/* ===== sys_spu_thread_receive_event ===== */