mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Complex STOP 0x0 hack
This commit is contained in:
parent
07d49b1bd8
commit
8369cb2af6
2 changed files with 32 additions and 3 deletions
|
@ -140,7 +140,7 @@ public:
|
||||||
//0 - 10
|
//0 - 10
|
||||||
void STOP(spu_opcode_t op)
|
void STOP(spu_opcode_t op)
|
||||||
{
|
{
|
||||||
DisAsm("stop", op.opcode & 0x1fffff);
|
op.rb ? UNK(op) : DisAsm("stop", op.opcode & 0x3fff);
|
||||||
}
|
}
|
||||||
void LNOP(spu_opcode_t op)
|
void LNOP(spu_opcode_t op)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1061,8 +1061,37 @@ bool SPUThread::stop_and_signal(u32 code)
|
||||||
{
|
{
|
||||||
case 0x000:
|
case 0x000:
|
||||||
{
|
{
|
||||||
// Hack: execute as NOP
|
LOG_WARNING(SPU, "STOP 0x0");
|
||||||
return true;
|
|
||||||
|
// HACK: find an ILA instruction
|
||||||
|
for (u32 addr = pc; addr < 0x40000; addr += 4)
|
||||||
|
{
|
||||||
|
const u32 instr = _ref<u32>(addr);
|
||||||
|
|
||||||
|
if (instr >> 25 == 0x21)
|
||||||
|
{
|
||||||
|
pc = addr;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (instr > 0x1fffff)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// HACK: wait for executable code
|
||||||
|
while (!_ref<u32>(pc))
|
||||||
|
{
|
||||||
|
if (test(state & cpu_flag::stop))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread_ctrl::wait_for(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0x001:
|
case 0x001:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue