diff --git a/rpcs3/Emu/Cell/Modules/cellSearch.cpp b/rpcs3/Emu/Cell/Modules/cellSearch.cpp index 799f95fa91..5316eee164 100644 --- a/rpcs3/Emu/Cell/Modules/cellSearch.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSearch.cpp @@ -3,6 +3,7 @@ #include "Emu/Cell/PPUModule.h" #include "cellSearch.h" +#include "cellSysutil.h" logs::channel cellSearch("cellSearch"); @@ -13,7 +14,11 @@ s32 cellSearchInitialize(ppu_thread& ppu, CellSearchMode mode, u32 container, vm // TODO: Store the arguments somewhere so we can use them later. //inform callback that search is alive - func(ppu, CELL_SEARCH_EVENT_INITIALIZE_RESULT, CELL_OK, vm::null, userData); + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + func(ppu, CELL_SEARCH_EVENT_INITIALIZE_RESULT, CELL_OK, vm::null, userData); + return CELL_OK; + }); return CELL_OK; } diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp index 7292507e65..0bd4e042b4 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -296,7 +296,7 @@ error_code sys_spu_thread_group_create(vm::ptr id, u32 num, s32 prio, vm::p // TODO: max num value should be affected by sys_spu_initialize() settings - if (!num || num > 6 || ((prio < 16 || prio > 255) && attr->type != SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT)) + if (attr->nsize > 0x80 || !num || num > 6 || ((prio < 16 || prio > 255) && attr->type != SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT)) { return CELL_EINVAL; } @@ -306,7 +306,7 @@ error_code sys_spu_thread_group_create(vm::ptr id, u32 num, s32 prio, vm::p sys_spu.todo("Unsupported SPU Thread Group type (0x%x)", attr->type); } - *id = idm::make(std::string(attr->name.get_ptr(), attr->nsize - 1), num, prio, attr->type, attr->ct); + *id = idm::make(std::string(attr->name.get_ptr(), std::max(attr->nsize, 1) - 1), num, prio, attr->type, attr->ct); return CELL_OK; }