Fixed RSXThread::ReadIO32 exception

This commit is contained in:
DHrpcs3 2014-12-02 02:51:42 +02:00
parent a725676346
commit d82f0b62a5

View File

@ -1170,6 +1170,21 @@ s32 cellGcmCallback(vm::ptr<CellGcmContextData> context, u32 count)
{
cellGcmSys->Log("cellGcmCallback(context_addr=0x%x, count=0x%x)", context.addr(), count);
GSLockCurrent gslock(GS_LOCK_WAIT_FLUSH);
if (0)
{
auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
be_t<u32> res = be_t<u32>::make(context->current - context->begin - ctrl.put.read_relaxed());
memmove(vm::get_ptr<void>(context->begin), vm::get_ptr<void>(context->current - res), res);
context->current = context->begin + res;
ctrl.put.write_relaxed(res);
ctrl.get.write_relaxed(be_t<u32>::make(0));
return CELL_OK;
}
//auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
// preparations for changing the place (for optimized FIFO mode)
@ -1180,13 +1195,16 @@ s32 cellGcmCallback(vm::ptr<CellGcmContextData> context, u32 count)
//cmd[3] = 0; // some incrementing by module value
//context->current += 0x10;
if (0)
if (1)
{
const u32 address = context->begin;
const u32 upper = offsetTable.ioAddress[address >> 20]; // 12 bits
assert(upper != 0xFFFF);
const u32 offset = (upper << 20) | (address & 0xFFFFF);
vm::write32(context->current, CELL_GCM_METHOD_FLAG_JUMP | offset); // set JUMP cmd
auto& ctrl = vm::get_ref<CellGcmControl>(gcm_info.control_addr);
ctrl.put.write_relaxed(be_t<u32>::make(offset));
}
else
{