SPURS fixed

This commit is contained in:
Nekotekina 2015-04-13 20:39:38 +03:00
parent 16fe7919a0
commit 4d85a49666
4 changed files with 11 additions and 9 deletions

View File

@ -237,14 +237,14 @@ void SPUThread::FastCall(u32 ls_addr)
m_status = Running;
PC = ls_addr;
GPR[0]._u32[3] = 0x0;
m_custom_task.swap(m_custom_task);
m_custom_task.swap(old_task);
SPUThread::Task();
PC = old_PC;
GPR[0]._u32[3] = old_LR;
GPR[1]._u32[3] = old_stack;
m_custom_task.swap(m_custom_task);
m_custom_task.swap(old_task);
}
void SPUThread::FastStop()

View File

@ -150,11 +150,12 @@ s32 spursInit(
name += "CellSpursKernel0";
for (s32 num = 0; num < nSpus; num++, name[name.size() - 1]++)
{
const u32 id = spu_thread_initialize(spurs->m.spuTG, num, vm::ptr<sys_spu_image>::make(spurs.addr() + offsetof(CellSpurs, m.spuImg)), name, SYS_SPU_THREAD_OPTION_DEC_SYNC_TB_ENABLE, (u64)num << 32, spurs.addr(), 0, 0);
static_cast<SPUThread&>(*Emu.GetCPU().GetThread(id).get()).RegisterHleFunction(spurs->m.spuImg.entry_point, spursKernelEntry);
spurs->m.spus[num] = id;
spurs->m.spus[num] = spu_thread_initialize(spurs->m.spuTG, num, vm::ptr<sys_spu_image>::make(spurs.addr() + offsetof(CellSpurs, m.spuImg)),
name, SYS_SPU_THREAD_OPTION_DEC_SYNC_TB_ENABLE, (u64)num << 32, spurs.addr(), 0, 0, [spurs](SPUThread& SPU)
{
SPU.RegisterHleFunction(spurs->m.spuImg.entry_point, spursKernelEntry);
SPU.FastCall(spurs->m.spuImg.entry_point);
});
}
if (flags & SAF_SPU_PRINTF_ENABLED)

View File

@ -108,7 +108,7 @@ s32 sys_cond_signal_all(u32 cond_id)
return CELL_ESRCH;
}
if (const u32 count = cond->waiters.size())
if (const u32 count = vm::cast(cond->waiters.size()))
{
cond->signaled += count;
cond->waiters.clear();

View File

@ -17,6 +17,7 @@ void lwcond_create(sys_lwcond_t& lwcond, sys_lwmutex_t& lwmutex, u64 name)
{
std::shared_ptr<lwcond_t> cond(new lwcond_t(name));
lwcond.lwmutex.set(vm::get_addr(&lwmutex));
lwcond.lwcond_queue = Emu.GetIdManager().GetNewID(cond, TYPE_LWCOND);
}
@ -134,7 +135,7 @@ s32 _sys_lwcond_signal_all(u32 lwcond_id, u32 lwmutex_id, u32 mode)
sys_lwcond.Error("_sys_lwcond_signal_all(%d): invalid mode (%d)", lwcond_id, mode);
}
const u32 count = cond->waiters.size();
const u32 count = vm::cast(cond->waiters.size());
if (count)
{