diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index 4d179b74e3..1593ca760a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -459,6 +459,7 @@ error_code sys_rsx_context_attribute(s32 context_id, u32 package_id, u64 a3, u64 case 0xFED: // hack: vblank command // todo: this is wrong and should be 'second' vblank handler and freq, but since currently everything is reported as being 59.94, this should be fine + vm::_ref(render->ctxt_addr + 0x30) = 1; driverInfo.head[a3].vBlankCount++; driverInfo.head[a3].lastSecondVTime = rsxTimeStamp(); sys_event_port_send(m_sysrsx->rsx_event_port, 0, (1 << 1), 0); diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 0bb74c9f14..cc49c4ded7 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -59,19 +59,23 @@ namespace rsx rsx->ctrl->ref.exchange(arg); } - void semaphore_acquire(thread* rsx, u32 _reg, u32 arg) + void semaphore_acquire(thread* rsx, u32 /*_reg*/, u32 arg) { rsx->sync_point_request = true; const u32 addr = get_address(method_registers.semaphore_offset_406e(), method_registers.semaphore_context_dma_406e()); - if (vm::read32(addr) == arg) return; + +#ifdef IS_LE_MACHINE + arg = se_storage::swap(arg); + const auto& sema = vm::_ref>(addr); +#else + const auto& sema = vm::_ref(addr); +#endif + // TODO: Remove vblank semaphore hack + if (sema == arg || addr == rsx->ctxt_addr + 0x30) return; u64 start = get_system_time(); - while (vm::read32(addr) != arg) + while (sema != arg) { - // todo: LLE: why does this one keep hanging? is it vsh system semaphore? whats actually pushing this to the command buffer?! - if (addr == get_current_renderer()->ctxt_addr + 0x30) - return; - if (Emu.IsStopped()) return;