diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index 0d447dea1d..4248c35d74 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -37,7 +37,10 @@ s64 spursCreateLv2EventQueue(vm::ptr spurs, u32& queue_id, vm::ptrm.nSpus = nSpus; spurs->m.spuPriority = spuPriority; #ifdef PRX_DEBUG - assert(spu_image_import(spurs->m.spuImg, vm::read32(libsre_rtoc - (isSecond ? 0x7E94 : 0x7E98)), 1) == CELL_OK); + if (s32 res = spu_image_import(spurs->m.spuImg, vm::read32(libsre_rtoc - (isSecond ? 0x7E94 : 0x7E98)), 1)) + { + assert(!"spu_image_import() failed"); + } #else spurs->m.spuImg.addr = Memory.Alloc(0x40000, 4096); #endif @@ -492,8 +498,14 @@ s64 spursInit( } } - assert(lwmutex_create(spurs->m.mutex, SYS_SYNC_PRIORITY, SYS_SYNC_NOT_RECURSIVE, *(u64*)"_spuPrv") == CELL_OK); - assert(lwcond_create(spurs->m.cond, spurs->m.mutex, *(u64*)"_spuPrv") == CELL_OK); + if (s32 res = lwmutex_create(spurs->m.mutex, SYS_SYNC_PRIORITY, SYS_SYNC_NOT_RECURSIVE, *(u64*)"_spuPrv")) + { + assert(!"lwmutex_create() failed"); + } + if (s32 res = lwcond_create(spurs->m.cond, spurs->m.mutex, *(u64*)"_spuPrv")) + { + assert(!"lwcond_create() failed"); + } spurs->m.flags1 = (flags & SAF_EXIT_IF_NO_WORK ? SF1_EXIT_IF_NO_WORK : 0) | (isSecond ? SF1_IS_SECOND : 0); spurs->m.flagRecv.write_relaxed(0xff); @@ -504,14 +516,20 @@ s64 spursInit( spurs->m.ppuPriority = ppuPriority; u32 queue; - assert(spursCreateLv2EventQueue(spurs, queue, vm::ptr::make(spurs.addr() + 0xc9), 0x2a, *(u64*)"_spuPrv") == CELL_OK); + if (s32 res = spursCreateLv2EventQueue(spurs, queue, vm::ptr::make(spurs.addr() + 0xc9), 0x2a, *(u64*)"_spuPrv")) + { + assert(!"spursCreateLv2EventQueue() failed"); + } spurs->m.queue = queue; u32 port = event_port_create(0); assert(port && ~port); spurs->m.port = port; - assert(sys_event_port_connect_local(port, queue) == CELL_OK); + if (s32 res = sys_event_port_connect_local(port, queue)) + { + assert(!"sys_event_port_connect_local() failed"); + } name = std::string(prefix, prefixSize); @@ -536,10 +554,16 @@ s64 spursInit( if (spurs->m.flags1 & SF1_EXIT_IF_NO_WORK) { - assert(sys_lwmutex_lock(spurs->get_lwmutex(), 0) == CELL_OK); + if (s32 res = sys_lwmutex_lock(spurs->get_lwmutex(), 0)) + { + assert(!"sys_lwmutex_lock() failed"); + } if (spurs->m.xD66.read_relaxed()) { - assert(sys_lwmutex_unlock(spurs->get_lwmutex()) == CELL_OK); + if (s32 res = sys_lwmutex_unlock(spurs->get_lwmutex())) + { + assert(!"sys_lwmutex_unlock() failed"); + } return; } else while (true) @@ -590,28 +614,40 @@ s64 spursInit( spurs->m.xD65.exchange(1); if (spurs->m.xD64.read_relaxed() == 0) { - assert(sys_lwcond_wait(spurs->get_lwcond(), 0) == CELL_OK); + if (s32 res = sys_lwcond_wait(spurs->get_lwcond(), 0)) + { + assert(!"sys_lwcond_wait() failed"); + } } spurs->m.xD65.exchange(0); if (spurs->m.xD66.read_relaxed()) { - assert(sys_lwmutex_unlock(spurs->get_lwmutex()) == CELL_OK); + if (s32 res = sys_lwmutex_unlock(spurs->get_lwmutex())) + { + assert(!"sys_lwmutex_unlock() failed"); + } return; } } - assert(sys_lwmutex_unlock(spurs->get_lwmutex()) == CELL_OK); + if (s32 res = sys_lwmutex_unlock(spurs->get_lwmutex())) + { + assert(!"sys_lwmutex_unlock() failed"); + } } if (Emu.IsStopped()) continue; - assert(sys_spu_thread_group_start(spurs->m.spuTG) == CELL_OK); + if (s32 res = sys_spu_thread_group_start(spurs->m.spuTG)) + { + assert(!"sys_spu_thread_group_start() failed"); + } if (s32 res = sys_spu_thread_group_join(spurs->m.spuTG, vm::ptr::make(0), vm::ptr::make(0))) { if (res == CELL_ESTAT) { return; } - assert(res == CELL_OK); + assert(!"sys_spu_thread_group_join() failed"); } if (Emu.IsStopped()) continue; @@ -635,7 +671,10 @@ s64 spursInit( // enable exception event handler if (spurs->m.enableEH.compare_and_swap_test(be_t::make(0), be_t::make(1))) { - assert(sys_spu_thread_group_connect_event(spurs->m.spuTG, spurs->m.queue, SYS_SPU_THREAD_GROUP_EVENT_EXCEPTION) == CELL_OK); + if (s32 res = sys_spu_thread_group_connect_event(spurs->m.spuTG, spurs->m.queue, SYS_SPU_THREAD_GROUP_EVENT_EXCEPTION)) + { + assert(!"sys_spu_thread_group_connect_event() failed"); + } } spurs->m.unk22 = 0; @@ -997,7 +1036,10 @@ s64 spursAttachLv2EventQueue(vm::ptr spurs, u32 queue, vm::ptr po } s32 sdk_ver; - assert(process_get_sdk_version(process_getpid(), sdk_ver) == CELL_OK); + if (s32 res = process_get_sdk_version(process_getpid(), sdk_ver)) + { + assert(!"process_get_sdk_version() failed"); + } if (sdk_ver == -1) sdk_ver = 0x460000; u8 _port = 0x3f; @@ -1236,9 +1278,18 @@ s64 spursWakeUp(vm::ptr spurs) spurs->m.xD64.exchange(1); if (spurs->m.xD65.read_sync()) { - assert(sys_lwmutex_lock(spurs->get_lwmutex(), 0) == 0); - assert(sys_lwcond_signal(spurs->get_lwcond()) == 0); - assert(sys_lwmutex_unlock(spurs->get_lwmutex()) == 0); + if (s32 res = sys_lwmutex_lock(spurs->get_lwmutex(), 0)) + { + assert(!"sys_lwmutex_lock() failed"); + } + if (s32 res = sys_lwcond_signal(spurs->get_lwcond())) + { + assert(!"sys_lwcond_signal() failed"); + } + if (s32 res = sys_lwmutex_unlock(spurs->get_lwmutex())) + { + assert(!"sys_lwmutex_unlock() failed"); + } } return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index cf754b28a0..afac57e65e 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -1086,7 +1086,10 @@ s32 syncLFQueueGetPushPointer(vm::ptr queue, s32& pointer, u32 } } - assert(sys_event_queue_receive(queue->m_eq_id, vm::ptr::make(0), 0) == CELL_OK); + if (s32 res = sys_event_queue_receive(queue->m_eq_id, vm::ptr::make(0), 0)) + { + assert(!"sys_event_queue_receive() failed"); + } var1 = 1; } } @@ -1106,7 +1109,7 @@ s32 syncLFQueueGetPushPointer2(vm::ptr queue, s32& pointer, u32 { // TODO //pointer = 0; - assert(0); + assert(!"syncLFQueueGetPushPointer2()"); return CELL_OK; } @@ -1268,7 +1271,7 @@ s32 syncLFQueueCompletePushPointer2(vm::ptr queue, s32 pointer, { // TODO //if (fpSendSignal) return fpSendSignal(0, 0); - assert(0); + assert(!"syncLFQueueCompletePushPointer2()"); return CELL_OK; } @@ -1465,7 +1468,10 @@ s32 syncLFQueueGetPopPointer(vm::ptr queue, s32& pointer, u32 i } } - assert(sys_event_queue_receive(queue->m_eq_id, vm::ptr::make(0), 0) == CELL_OK); + if (s32 res = sys_event_queue_receive(queue->m_eq_id, vm::ptr::make(0), 0)) + { + assert(!"sys_event_queue_receive() failed"); + } var1 = 1; } } @@ -1485,7 +1491,7 @@ s32 syncLFQueueGetPopPointer2(vm::ptr queue, s32& pointer, u32 { // TODO //pointer = 0; - assert(0); + assert(!"syncLFQueueGetPopPointer2()"); return CELL_OK; } @@ -1647,7 +1653,7 @@ s32 syncLFQueueCompletePopPointer2(vm::ptr queue, s32 pointer, { // TODO //if (fpSendSignal) fpSendSignal(0, 0); - assert(0); + assert(!"syncLFQueueCompletePopPointer2()"); return CELL_OK; } @@ -1906,7 +1912,7 @@ s32 syncLFQueueAttachLv2EventQueue(vm::ptr spus, u32 num, vm::ptr spus, u32 num, vm::ptr _sys_strcat(vm::ptr dest, vm::ptr source) { sysPrxForUser->Log("_sys_strcat(dest_addr=0x%x, source_addr=0x%x)", dest.addr(), source.addr()); - assert(strcat(dest.get_ptr(), source.get_ptr()) == dest.get_ptr()); + if (strcat(dest.get_ptr(), source.get_ptr()) != dest.get_ptr()) + { + assert(!"strcat(): unexpected result"); + } return dest; } @@ -213,7 +216,10 @@ vm::ptr _sys_strncat(vm::ptr dest, vm::ptr source, u32 l { sysPrxForUser->Log("_sys_strncat(dest_addr=0x%x, source_addr=0x%x, len=%d)", dest.addr(), source.addr(), len); - assert(strncat(dest.get_ptr(), source.get_ptr(), len) == dest.get_ptr()); + if (strncat(dest.get_ptr(), source.get_ptr(), len) != dest.get_ptr()) + { + assert(!"strncat(): unexpected result"); + } return dest; } @@ -221,7 +227,10 @@ vm::ptr _sys_strcpy(vm::ptr dest, vm::ptr source) { sysPrxForUser->Log("_sys_strcpy(dest_addr=0x%x, source_addr=0x%x)", dest.addr(), source.addr()); - assert(strcpy(dest.get_ptr(), source.get_ptr()) == dest.get_ptr()); + if (strcpy(dest.get_ptr(), source.get_ptr()) != dest.get_ptr()) + { + assert(!"strcpy(): unexpected result"); + } return dest; } @@ -234,7 +243,10 @@ vm::ptr _sys_strncpy(vm::ptr dest, vm::ptr source, u32 l return vm::ptr::make(0); } - assert(strncpy(dest.get_ptr(), source.get_ptr(), len) == dest.get_ptr()); + if (strncpy(dest.get_ptr(), source.get_ptr(), len) != dest.get_ptr()) + { + assert(!"strncpy(): unexpected result"); + } return dest; }