diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 40c5b2ccbd..3d1ef5050b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -1170,6 +1170,21 @@ s32 cellGcmCallback(vm::ptr 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(gcm_info.control_addr); + be_t res = be_t::make(context->current - context->begin - ctrl.put.read_relaxed()); + memmove(vm::get_ptr(context->begin), vm::get_ptr(context->current - res), res); + + context->current = context->begin + res; + ctrl.put.write_relaxed(res); + ctrl.get.write_relaxed(be_t::make(0)); + + return CELL_OK; + } + //auto& ctrl = vm::get_ref(gcm_info.control_addr); // preparations for changing the place (for optimized FIFO mode) @@ -1180,13 +1195,16 @@ s32 cellGcmCallback(vm::ptr 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(gcm_info.control_addr); + ctrl.put.write_relaxed(be_t::make(offset)); } else {