diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index d537bdf92d..6802796d3a 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -496,8 +496,8 @@ void GLFragmentDecompilerThread::Task() case RSX_FP_OPCODE_BEM: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: BEM"); break; case RSX_FP_OPCODE_TEX: SetDst("texture($t, $0.xy)"); break; case RSX_FP_OPCODE_TEXBEM: SetDst("texture($t, $0.xy, $1.x)"); break; - case RSX_FP_OPCODE_TXP: SetDst("textureProj($t, $0.xy, $1.x)"); break; //TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478) and The Simpsons Arcade Game (NPUB30563)) - case RSX_FP_OPCODE_TXPBEM: SetDst("textureProj($t, $0.xy, $1.x)"); break; + case RSX_FP_OPCODE_TXP: SetDst("textureProj($t, $0.xyz, $1.x)"); break; //TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478) and The Simpsons Arcade Game (NPUB30563)) + case RSX_FP_OPCODE_TXPBEM: SetDst("textureProj($t, $0.xyz, $1.x)"); break; case RSX_FP_OPCODE_TXD: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXD"); break; case RSX_FP_OPCODE_TXB: SetDst("texture($t, $0.xy, $1.x)"); break; case RSX_FP_OPCODE_TXL: SetDst("textureLod($t, $0.xy, $1.x)"); break; diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index 5b730555a5..f6c825aa51 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -536,7 +536,7 @@ void GLVertexDecompilerThread::Task() switch (d1.sca_opcode) { case 0x08: //BRA - LOG_WARNING(RSX, "BRA found. Please report to RPCS3 team."); + LOG_ERROR(RSX, "BRA found. Please report to RPCS3 team."); is_has_BRA = true; m_jump_lvls.clear(); d3.HEX = m_data[++i]; diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index e8936c16a8..1639eceeed 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -1,7 +1,6 @@ #include "stdafx.h" #include "ModuleManager.h" -extern Module sys_fs; extern Module cellAdec; extern Module cellAtrac; extern Module cellAudio; @@ -16,19 +15,19 @@ extern Module cellGcmSys; extern Module cellGem; extern Module cellGifDec; extern Module cellJpgDec; -extern Module sys_io; extern Module cellL10n; extern Module cellMic; -extern Module sys_io; extern Module cellSysutil; extern Module cellNetCtl; extern Module cellOvis; -extern Module sys_io; extern Module cellPamf; extern Module cellPngDec; extern Module cellResc; extern Module cellRtc; +extern Module cellRudp; extern Module cellSail; +extern Module cellScreenshot; +extern Module cellSearch; extern Module cellSysutil; extern Module cellSpurs; extern Module cellSpursJq; @@ -38,8 +37,10 @@ extern Module cellSync2; extern Module cellSysmodule; extern Module cellSysutil; extern Module cellSysutilAp; +extern Module cellUsbd; extern Module cellUserInfo; extern Module cellVdec; +extern Module cellVoice; extern Module cellVpost; extern Module libmixer; extern Module sceNp; @@ -48,6 +49,7 @@ extern Module sceNpCommerce2; extern Module sceNpSns; extern Module sceNpTrophy; extern Module sceNpTus; +extern Module sys_fs; extern Module sys_io; extern Module sys_net; extern Module sysPrxForUser; @@ -88,7 +90,7 @@ static const g_module_list[] = { 0x0019, "cellFont", &cellFont }, { 0x001a, "cellFontFT", &cellFontFT }, { 0x001b, "cellFreetype", nullptr }, - { 0x001c, "cellUsbd", nullptr }, + { 0x001c, "cellUsbd", &cellUsbd }, { 0x001d, "cellSail", &cellSail }, { 0x001e, "cellL10n", &cellL10n }, { 0x001f, "cellResc", &cellResc }, @@ -126,12 +128,12 @@ static const g_module_list[] = { 0x0043, "cellFiber", &cellFiber }, { 0x0044, "sceNpCommerce2", &sceNpCommerce2 }, { 0x0045, "sceNpTus", &sceNpTus }, - { 0x0046, "cellVoice", nullptr }, + { 0x0046, "cellVoice", &cellVoice }, { 0x0047, "cellAdecCelp8", nullptr }, { 0x0048, "cellCelp8Enc", nullptr }, { 0x0049, "cellLicenseArea", nullptr }, { 0x004a, "cellMusic2", nullptr }, - { 0x004e, "cellScreenshot", nullptr }, + { 0x004e, "cellScreenShotUtility", &cellScreenshot }, { 0x004f, "cellMusicDecode", nullptr }, { 0x0050, "cellSpursJq", &cellSpursJq }, { 0x0052, "cellPngEnc", nullptr }, @@ -154,7 +156,7 @@ static const g_module_list[] = { 0xf02b, "cellPhotoImport", nullptr }, { 0xf02c, "cellMusicExport", nullptr }, { 0xf02e, "cellPhotoDecode", nullptr }, - { 0xf02f, "cellSearch", nullptr }, + { 0xf02f, "cellSearch", &cellSearch }, { 0xf030, "cellAvchat2", nullptr }, { 0xf034, "cellSailRec", nullptr }, { 0xf035, "sceNpTrophy", &sceNpTrophy }, diff --git a/rpcs3/Emu/SysCalls/Modules/cellPad.cpp b/rpcs3/Emu/SysCalls/Modules/cellPad.cpp index 20b5c61a28..7b09ba37d7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPad.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPad.cpp @@ -8,30 +8,46 @@ extern Module sys_io; -int cellPadInit(u32 max_connect) +s32 cellPadInit(u32 max_connect) { sys_io.Warning("cellPadInit(max_connect=%d)", max_connect); - if(Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_ALREADY_INITIALIZED; - if (max_connect > CELL_PAD_MAX_PORT_NUM) return CELL_PAD_ERROR_INVALID_PARAMETER; + + if (Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_ALREADY_INITIALIZED; + + if (max_connect > CELL_PAD_MAX_PORT_NUM) + return CELL_PAD_ERROR_INVALID_PARAMETER; + Emu.GetPadManager().Init(max_connect); + return CELL_OK; } -int cellPadEnd() +s32 cellPadEnd() { sys_io.Log("cellPadEnd()"); - if(!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + Emu.GetPadManager().Close(); + return CELL_OK; } -int cellPadClearBuf(u32 port_no) +s32 cellPadClearBuf(u32 port_no) { sys_io.Log("cellPadClearBuf(port_no=%d)", port_no); - if(!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; //Set 'm_buffer_cleared' to force a resend of everything //might as well also reset everything in our pad 'buffer' to nothing as well @@ -54,7 +70,7 @@ int cellPadClearBuf(u32 port_no) return CELL_OK; } -int cellPadPeriphGetInfo(vm::ptr info) +s32 cellPadPeriphGetInfo(vm::ptr info) { sys_io.Warning("cellPadPeriphGetInfo(info_addr=0x%x)", info.addr()); @@ -67,26 +83,23 @@ int cellPadPeriphGetInfo(vm::ptr info) return CELL_OK; } -int cellPadGetData(u32 port_no, vm::ptr data) +s32 cellPadGetData(u32 port_no, vm::ptr data) { sys_io.Log("cellPadGetData(port_no=%d, data_addr=0x%x)", port_no, data.addr()); std::vector& pads = Emu.GetPadManager().GetPads(); - if (!Emu.GetPadManager().IsInited()) { + if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; - } const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) { + if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - } //We have a choice here of NO_DEVICE or READ_FAILED...lets try no device for now - if (port_no >= rinfo.now_connect) { + if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; - } Pad& pad = pads[port_no]; @@ -249,33 +262,46 @@ int cellPadGetData(u32 port_no, vm::ptr data) return CELL_OK; } -int cellPadGetDataExtra(u32 port_no, u32 device_type_addr, u32 data_addr) +s32 cellPadGetDataExtra(u32 port_no, u32 device_type_addr, u32 data_addr) { sys_io.Log("cellPadGetDataExtra(port_no=%d, device_type_addr=0x%x, device_type_addr=0x%x)", port_no, device_type_addr, data_addr); - if(!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; return CELL_OK; } -int cellPadSetActDirect(u32 port_no, u32 param_addr) +s32 cellPadSetActDirect(u32 port_no, u32 param_addr) { sys_io.Log("cellPadSetActDirect(port_no=%d, param_addr=0x%x)", port_no, param_addr); - if(!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; return CELL_OK; } -int cellPadGetInfo(vm::ptr info) +s32 cellPadGetInfo(vm::ptr info) { sys_io.Log("cellPadGetInfo(info_addr=0x%x)", info.addr()); - if(!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); info->max_connect = rinfo.max_connect; @@ -285,9 +311,9 @@ int cellPadGetInfo(vm::ptr info) //Can't have this as const, we need to reset Assign Changes Flag here std::vector& pads = Emu.GetPadManager().GetPads(); - for(u32 i=0; i= pads.size()) + if (i >= pads.size()) break; info->status[i] = pads[i].m_port_status; @@ -299,11 +325,12 @@ int cellPadGetInfo(vm::ptr info) return CELL_OK; } -int cellPadGetInfo2(vm::ptr info) +s32 cellPadGetInfo2(vm::ptr info) { sys_io.Log("cellPadGetInfo2(info_addr=0x%x)", info.addr()); - if(!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); info->max_connect = rinfo.max_connect; @@ -312,9 +339,9 @@ int cellPadGetInfo2(vm::ptr info) std::vector& pads = Emu.GetPadManager().GetPads(); - for(u32 i=0; i= pads.size()) + if (i >= pads.size()) break; info->port_status[i] = pads[i].m_port_status; @@ -327,14 +354,19 @@ int cellPadGetInfo2(vm::ptr info) return CELL_OK; } -int cellPadGetCapabilityInfo(u32 port_no, vm::ptr info) +s32 cellPadGetCapabilityInfo(u32 port_no, vm::ptr info) { sys_io.Log("cellPadGetCapabilityInfo(port_no=%d, data_addr:=0x%x)", port_no, info.addr()); - if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; const std::vector& pads = Emu.GetPadManager().GetPads(); @@ -344,13 +376,19 @@ int cellPadGetCapabilityInfo(u32 port_no, vm::ptr info) return CELL_OK; } -int cellPadSetPortSetting(u32 port_no, u32 port_setting) +s32 cellPadSetPortSetting(u32 port_no, u32 port_setting) { sys_io.Log("cellPadSetPortSetting(port_no=%d, port_setting=0x%x)", port_no, port_setting); - if(!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; std::vector& pads = Emu.GetPadManager().GetPads(); pads[port_no].m_port_setting = port_setting; @@ -358,40 +396,59 @@ int cellPadSetPortSetting(u32 port_no, u32 port_setting) return CELL_OK; } -int cellPadInfoPressMode(u32 port_no) +s32 cellPadInfoPressMode(u32 port_no) { sys_io.Log("cellPadInfoPressMode(port_no=%d)", port_no); - if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; const std::vector& pads = Emu.GetPadManager().GetPads(); return (pads[port_no].m_device_capability & CELL_PAD_CAPABILITY_PRESS_MODE) > 0; } -int cellPadInfoSensorMode(u32 port_no) +s32 cellPadInfoSensorMode(u32 port_no) { sys_io.Log("cellPadInfoSensorMode(port_no=%d)", port_no); - if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; const std::vector& pads = Emu.GetPadManager().GetPads(); return (pads[port_no].m_device_capability & CELL_PAD_CAPABILITY_SENSOR_MODE) > 0; } -int cellPadSetPressMode(u32 port_no, u32 mode) +s32 cellPadSetPressMode(u32 port_no, u32 mode) { sys_io.Log("cellPadSetPressMode(port_no=%d, mode=%d)", port_no, mode); - if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; - if (mode != 0 && mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + if (mode != 0 && mode != 1) + return CELL_PAD_ERROR_INVALID_PARAMETER; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; std::vector& pads = Emu.GetPadManager().GetPads(); @@ -403,14 +460,21 @@ int cellPadSetPressMode(u32 port_no, u32 mode) return CELL_OK; } -int cellPadSetSensorMode(u32 port_no, u32 mode) +s32 cellPadSetSensorMode(u32 port_no, u32 mode) { sys_io.Log("cellPadSetSensorMode(port_no=%d, mode=%d)", port_no, mode); - if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED; - if (mode != 0 && mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER; + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + if (mode != 0 && mode != 1) + return CELL_PAD_ERROR_INVALID_PARAMETER; + const PadInfo& rinfo = Emu.GetPadManager().GetInfo(); - if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER; - if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE; + + if (port_no >= rinfo.max_connect) + return CELL_PAD_ERROR_INVALID_PARAMETER; + if (port_no >= rinfo.now_connect) + return CELL_PAD_ERROR_NO_DEVICE; std::vector& pads = Emu.GetPadManager().GetPads(); @@ -422,6 +486,46 @@ int cellPadSetSensorMode(u32 port_no, u32 mode) return CELL_OK; } +s32 cellPadLddRegisterController() +{ + sys_io.Todo("cellPadLddRegisterController()"); + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + + return CELL_OK; +} + +s32 cellPadLddDataInsert(s32 handle, vm::ptr data) +{ + sys_io.Todo("cellPadLddDataInsert(handle=%d, data_addr=0x%x)", handle, data.addr()); + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + + return CELL_OK; +} + +s32 cellPadLddGetPortNo(s32 handle) +{ + sys_io.Todo("cellPadLddGetPortNo(handle=%d)", handle); + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + + return CELL_OK; +} + +s32 cellPadLddUnregisterController(s32 handle) +{ + sys_io.Todo("cellPadLddUnregisterController(handle=%d)", handle); + + if (!Emu.GetPadManager().IsInited()) + return CELL_PAD_ERROR_UNINITIALIZED; + + return CELL_OK; +} + void cellPad_init() { REG_FUNC(sys_io, cellPadInit); @@ -439,4 +543,8 @@ void cellPad_init() REG_FUNC(sys_io, cellPadSetPressMode); REG_FUNC(sys_io, cellPadSetSensorMode); REG_FUNC(sys_io, cellPadGetCapabilityInfo); + REG_FUNC(sys_io, cellPadLddRegisterController); + REG_FUNC(sys_io, cellPadLddDataInsert); + REG_FUNC(sys_io, cellPadLddGetPortNo); + REG_FUNC(sys_io, cellPadLddUnregisterController); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp index 1a3051f881..9b825d1391 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp @@ -1,8 +1,9 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/System.h" +#include "Emu/SysCalls/Modules.h" -void cellRudp_init(); -Module cellRudp(0x0057, cellRudp_init); +extern Module cellRudp; // Return Codes enum @@ -48,175 +49,175 @@ enum CELL_RUDP_ERROR_KEEP_ALIVE_FAILURE = 0x80770026, }; -int cellRudpInit() +s32 cellRudpInit() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpEnd() +s32 cellRudpEnd() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpEnableInternalIOThread() +s32 cellRudpEnableInternalIOThread() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpSetEventHandler() +s32 cellRudpSetEventHandler() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpSetMaxSegmentSize() +s32 cellRudpSetMaxSegmentSize() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetMaxSegmentSize() +s32 cellRudpGetMaxSegmentSize() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpCreateContext() +s32 cellRudpCreateContext() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpSetOption() +s32 cellRudpSetOption() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetOption() +s32 cellRudpGetOption() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetContextStatus() +s32 cellRudpGetContextStatus() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetStatus() +s32 cellRudpGetStatus() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetLocalInfo() +s32 cellRudpGetLocalInfo() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetRemoteInfo() +s32 cellRudpGetRemoteInfo() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpBind() +s32 cellRudpBind() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpInitiate() +s32 cellRudpInitiate() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpActivate() +s32 cellRudpActivate() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpTerminate() +s32 cellRudpTerminate() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpRead() +s32 cellRudpRead() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpWrite() +s32 cellRudpWrite() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetSizeReadable() +s32 cellRudpGetSizeReadable() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpGetSizeWritable() +s32 cellRudpGetSizeWritable() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpFlush() +s32 cellRudpFlush() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpPollCreate() +s32 cellRudpPollCreate() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpPollDestroy() +s32 cellRudpPollDestroy() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpPollControl() +s32 cellRudpPollControl() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpPollWait() +s32 cellRudpPollWait() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpNetReceived() +s32 cellRudpNetReceived() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -int cellRudpProcessEvents() +s32 cellRudpProcessEvents() { UNIMPLEMENTED_FUNC(cellRudp); return CELL_OK; } -void cellRudp_init() +Module cellRudp("cellRudp", []() { REG_FUNC(cellRudp, cellRudpInit); REG_FUNC(cellRudp, cellRudpEnd); @@ -249,9 +250,8 @@ void cellRudp_init() REG_FUNC(cellRudp, cellRudpPollDestroy); REG_FUNC(cellRudp, cellRudpPollControl); REG_FUNC(cellRudp, cellRudpPollWait); - //cellRudp.AddFunc(, cellRudpPollCancel); + //REG_FUNC(cellRudp, cellRudpPollCancel); REG_FUNC(cellRudp, cellRudpNetReceived); REG_FUNC(cellRudp, cellRudpProcessEvents); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp index 7c45075861..db244d22f2 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp @@ -868,74 +868,77 @@ s32 cellSaveDataListAutoLoad( u32 container, vm::ptr userdata) { - cellSysutil.Todo("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)", + cellSysutil.Warning("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)", version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr()); - //vm::var result; - //vm::var listGet; - //vm::var fixedSet; - //vm::var statGet; - //vm::var statSet; + vm::var result; + vm::var listGet; + vm::var fixedSet; + vm::var statGet; + vm::var statSet; - //std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user - //vfsDir dir(saveBaseDir); + std::string saveBaseDir = "/dev_hdd0/home/00000001/savedata/"; // TODO: Get the path of the current user + vfsDir dir(saveBaseDir); - //if (!dir.IsOpened()) - // return CELL_SAVEDATA_ERROR_INTERNAL; + if (!dir.IsOpened()) + return CELL_SAVEDATA_ERROR_INTERNAL; - //std::string dirNamePrefix = setList->dirNamePrefix.get_ptr(); - //std::vector saveEntries; + std::string dirNamePrefix = setList->dirNamePrefix.get_ptr(); + std::vector saveEntries; - //for (const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read()) - //{ - // if (entry->flags & DirEntry_TypeDir && entry->name.substr(0, dirNamePrefix.size()) == dirNamePrefix) - // { - // // Count the amount of matches and the amount of listed directories - // listGet->dirListNum++; - // if (listGet->dirListNum > setBuf->dirListMax) - // continue; - // listGet->dirNum++; + for (const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read()) + { + if (entry->flags & DirEntry_TypeDir && entry->name.substr(0, dirNamePrefix.size()) == dirNamePrefix) + { + // Count the amount of matches and the amount of listed directories + listGet->dirListNum++; + if (listGet->dirListNum > setBuf->dirListMax) + continue; + listGet->dirNum++; - // std::string saveDir = saveBaseDir + entry->name; - // addSaveDataEntry(saveEntries, saveDir); - // } - //} + std::string saveDir = saveBaseDir + entry->name; + addSaveDataEntry(saveEntries, saveDir); + } + } - //// Sort the entries and fill the listGet->dirList array - //std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder)); - //listGet->dirList = vm::bptr::make(setBuf->buf.addr()); - //auto dirList = vm::get_ptr(listGet->dirList.addr()); + // Sort the entries and fill the listGet->dirList array + std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder)); + listGet->dirList = vm::bptr::make(setBuf->buf.addr()); + auto dirList = vm::get_ptr(listGet->dirList.addr()); - //for (u32 i = 0; idirList[i].reserved)); + } - //funcFixed(result, listGet, fixedSet); + funcFixed(result, listGet, fixedSet); - //if (result->result < 0) { - // cellSysutil.Error("cellSaveDataListAutoLoad: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message. - // return CELL_SAVEDATA_ERROR_CBRESULT; - //} + if (result->result < 0) { + cellSysutil.Error("cellSaveDataListAutoLoad: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message. + return CELL_SAVEDATA_ERROR_CBRESULT; + } - //setSaveDataFixed(saveEntries, fixedSet); - //getSaveDataStat(saveEntries[0], statGet); // There should be only one element in this list - //// TODO: Display the Yes|No dialog here - //result->userdata = userdata; + setSaveDataFixed(saveEntries, fixedSet); + getSaveDataStat(saveEntries[0], statGet); // There should be only one element in this list + // TODO: Display the Yes|No dialog here + result->userdata = userdata; - //funcStat(result, statGet, statSet); - //Memory.Free(statGet->fileList.addr()); - //if (result->result < 0) { - // cellSysutil.Error("cellSaveDataFixedLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message. - // return CELL_SAVEDATA_ERROR_CBRESULT; - //} - ///*if (statSet->setParam) - //// TODO: Write PARAM.SFO file - //*/ + funcStat(result, statGet, statSet); + Memory.Free(statGet->fileList.addr()); + + if (result->result < 0) { + cellSysutil.Error("cellSaveDataFixedLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message. + return CELL_SAVEDATA_ERROR_CBRESULT; + } + + /*if (statSet->setParam) + // TODO: Write PARAM.SFO file + */ + + // Enter the loop where the save files are read/created/deleted. + s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName); - //// Enter the loop where the save files are read/created/deleted. - //s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp index 3de06f9d20..f62c866416 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp @@ -1,58 +1,38 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/System.h" +#include "Emu/SysCalls/Modules.h" -void cellScreenshot_init(); -Module cellScreenshot(0x004e, cellScreenshot_init); +extern Module cellScreenshot; -// Return Codes -enum -{ - CELL_SCREENSHOT_OK = 0x0, - CELL_SCREENSHOT_ERROR_INTERNAL = 0x8002d101, - CELL_SCREENSHOT_ERROR_PARAM = 0x8002d102, - CELL_SCREENSHOT_ERROR_DECODE = 0x8002d103, - CELL_SCREENSHOT_ERROR_NOSPACE = 0x8002d104, - CELL_SCREENSHOT_ERROR_UNSUPPORTED_COLOR_FORMAT = 0x8002d105, -}; - -// Datatypes -struct CellScreenShotSetParam -{ - const char *photo_title; - const char *game_title; - const char *game_comment; -}; - -// Functions -int cellScreenShotSetParameter() //const CellScreenShotSetParam *param +s32 cellScreenShotSetParameter() //const CellScreenShotSetParam *param { UNIMPLEMENTED_FUNC(cellScreenshot); return CELL_OK; } -int cellScreenShotSetOverlayImage() //const char *srcDir, const char *srcFile, s32 offset_x, s32 offset_y +s32 cellScreenShotSetOverlayImage() //const char *srcDir, const char *srcFile, s32 offset_x, s32 offset_y { UNIMPLEMENTED_FUNC(cellScreenshot); return CELL_OK; } -int cellScreenShotEnable() +s32 cellScreenShotEnable() { UNIMPLEMENTED_FUNC(cellScreenshot); return CELL_OK; } -int cellScreenShotDisable() +s32 cellScreenShotDisable() { UNIMPLEMENTED_FUNC(cellScreenshot); return CELL_OK; } -void cellScreenshot_init() +Module cellScreenshot("cellScreenshot", []() { REG_FUNC(cellScreenshot, cellScreenShotSetParameter); REG_FUNC(cellScreenshot, cellScreenShotSetOverlayImage); REG_FUNC(cellScreenshot, cellScreenShotEnable); REG_FUNC(cellScreenshot, cellScreenShotDisable); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.h b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.h new file mode 100644 index 0000000000..75045278d7 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.h @@ -0,0 +1,17 @@ +// Return Codes +enum +{ + CELL_SCREENSHOT_OK = 0x0, + CELL_SCREENSHOT_ERROR_INTERNAL = 0x8002d101, + CELL_SCREENSHOT_ERROR_PARAM = 0x8002d102, + CELL_SCREENSHOT_ERROR_DECODE = 0x8002d103, + CELL_SCREENSHOT_ERROR_NOSPACE = 0x8002d104, + CELL_SCREENSHOT_ERROR_UNSUPPORTED_COLOR_FORMAT = 0x8002d105, +}; + +struct CellScreenShotSetParam +{ + const char *photo_title; + const char *game_title; + const char *game_comment; +}; \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp index 56cca5ec4f..e9978c0979 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp @@ -1,8 +1,9 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/System.h" +#include "Emu/SysCalls/Modules.h" -void cellSearch_init(); -Module cellSearch(0xf02f, cellSearch_init); +extern Module cellSearch; // Error Codes enum @@ -30,127 +31,127 @@ enum CELL_SEARCH_ERROR_GENERIC = 0x8002C8FF, }; -int cellSearchInitialize() +s32 cellSearchInitialize() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchFinalize() +s32 cellSearchFinalize() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchStartListSearch() +s32 cellSearchStartListSearch() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchStartContentSearchInList() +s32 cellSearchStartContentSearchInList() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchStartContentSearch() +s32 cellSearchStartContentSearch() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchStartSceneSearchInVideo() +s32 cellSearchStartSceneSearchInVideo() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchStartSceneSearch() +s32 cellSearchStartSceneSearch() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetContentInfoByOffset() +s32 cellSearchGetContentInfoByOffset() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetContentInfoByContentId() +s32 cellSearchGetContentInfoByContentId() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetOffsetByContentId() +s32 cellSearchGetOffsetByContentId() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetContentIdByOffset() +s32 cellSearchGetContentIdByOffset() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetContentInfoGameComment() +s32 cellSearchGetContentInfoGameComment() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetMusicSelectionContext() +s32 cellSearchGetMusicSelectionContext() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetMusicSelectionContextOfSingleTrack() +s32 cellSearchGetMusicSelectionContextOfSingleTrack() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetContentInfoPath() +s32 cellSearchGetContentInfoPath() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetContentInfoPathMovieThumb() +s32 cellSearchGetContentInfoPathMovieThumb() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchPrepareFile() +s32 cellSearchPrepareFile() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchGetContentInfoDeveloperData() +s32 cellSearchGetContentInfoDeveloperData() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchCancel() +s32 cellSearchCancel() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -int cellSearchEnd() +s32 cellSearchEnd() { UNIMPLEMENTED_FUNC(cellSearch); return CELL_OK; } -void cellSearch_init() +Module cellSearch("cellSearch", []() { REG_FUNC(cellSearch, cellSearchInitialize); REG_FUNC(cellSearch, cellSearchFinalize); @@ -172,5 +173,4 @@ void cellSearch_init() REG_FUNC(cellSearch, cellSearchGetContentInfoDeveloperData); REG_FUNC(cellSearch, cellSearchCancel); REG_FUNC(cellSearch, cellSearchEnd); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp index 65648a1f17..0e81263b83 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp @@ -1,177 +1,157 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/System.h" +#include "Emu/SysCalls/Modules.h" -void cellUsbd_init(); -Module cellUsbd(0x001c, cellUsbd_init); +#include "cellUsbd.h" -// Return Codes -enum -{ - CELL_USBD_ERROR_NOT_INITIALIZED = 0x80110001, - CELL_USBD_ERROR_ALREADY_INITIALIZED = 0x80110002, - CELL_USBD_ERROR_NO_MEMORY = 0x80110003, - CELL_USBD_ERROR_INVALID_PARAM = 0x80110004, - CELL_USBD_ERROR_INVALID_TRANSFER_TYPE = 0x80110005, - CELL_USBD_ERROR_LDD_ALREADY_REGISTERED = 0x80110006, - CELL_USBD_ERROR_LDD_NOT_ALLOCATED = 0x80110007, - CELL_USBD_ERROR_LDD_NOT_RELEASED = 0x80110008, - CELL_USBD_ERROR_LDD_NOT_FOUND = 0x80110009, - CELL_USBD_ERROR_DEVICE_NOT_FOUND = 0x8011000a, - CELL_USBD_ERROR_PIPE_NOT_ALLOCATED = 0x8011000b, - CELL_USBD_ERROR_PIPE_NOT_RELEASED = 0x8011000c, - CELL_USBD_ERROR_PIPE_NOT_FOUND = 0x8011000d, - CELL_USBD_ERROR_IOREQ_NOT_ALLOCATED = 0x8011000e, - CELL_USBD_ERROR_IOREQ_NOT_RELEASED = 0x8011000f, - CELL_USBD_ERROR_IOREQ_NOT_FOUND = 0x80110010, - CELL_USBD_ERROR_CANNOT_GET_DESCRIPTOR = 0x80110011, - CELL_USBD_ERROR_FATAL = 0x801100ff, -}; +extern Module cellUsbd; -int cellUsbdInit() +s32 cellUsbdInit() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdEnd() +s32 cellUsbdEnd() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdSetThreadPriority() +s32 cellUsbdSetThreadPriority() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdSetThreadPriority2() +s32 cellUsbdSetThreadPriority2() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdGetThreadPriority() +s32 cellUsbdGetThreadPriority() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdRegisterLdd() +s32 cellUsbdRegisterLdd() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdRegisterExtraLdd() +s32 cellUsbdRegisterExtraLdd() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdRegisterExtraLdd2() +s32 cellUsbdRegisterExtraLdd2() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdUnregisterLdd() +s32 cellUsbdUnregisterLdd() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdUnregisterExtraLdd() +s32 cellUsbdUnregisterExtraLdd() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdOpenPipe() +s32 cellUsbdOpenPipe() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdClosePipe() +s32 cellUsbdClosePipe() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdControlTransfer() +s32 cellUsbdControlTransfer() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdBulkTransfer() +s32 cellUsbdBulkTransfer() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdInterruptTransfer() +s32 cellUsbdInterruptTransfer() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdIsochronousTransfer() +s32 cellUsbdIsochronousTransfer() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdHSIsochronousTransfer() +s32 cellUsbdHSIsochronousTransfer() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdScanStaticDescriptor() +s32 cellUsbdScanStaticDescriptor() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdGetDeviceSpeed() +s32 cellUsbdGetDeviceSpeed() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdGetDeviceLocation() +s32 cellUsbdGetDeviceLocation() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdSetPrivateData() +s32 cellUsbdSetPrivateData() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdGetPrivateData() +s32 cellUsbdGetPrivateData() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdAllocateMemory() +s32 cellUsbdAllocateMemory() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -int cellUsbdFreeMemory() +s32 cellUsbdFreeMemory() { UNIMPLEMENTED_FUNC(cellUsbd); return CELL_OK; } -void cellUsbd_init() +Module cellUsbd("cellUsbd", []() { REG_FUNC(cellUsbd, cellUsbdInit); REG_FUNC(cellUsbd, cellUsbdEnd); @@ -204,5 +184,4 @@ void cellUsbd_init() REG_FUNC(cellUsbd, cellUsbdAllocateMemory); REG_FUNC(cellUsbd, cellUsbdFreeMemory); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbd.h b/rpcs3/Emu/SysCalls/Modules/cellUsbd.h new file mode 100644 index 0000000000..6259bd9978 --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellUsbd.h @@ -0,0 +1,39 @@ +// Return Codes +enum +{ + CELL_USBD_ERROR_NOT_INITIALIZED = 0x80110001, + CELL_USBD_ERROR_ALREADY_INITIALIZED = 0x80110002, + CELL_USBD_ERROR_NO_MEMORY = 0x80110003, + CELL_USBD_ERROR_INVALID_PARAM = 0x80110004, + CELL_USBD_ERROR_INVALID_TRANSFER_TYPE = 0x80110005, + CELL_USBD_ERROR_LDD_ALREADY_REGISTERED = 0x80110006, + CELL_USBD_ERROR_LDD_NOT_ALLOCATED = 0x80110007, + CELL_USBD_ERROR_LDD_NOT_RELEASED = 0x80110008, + CELL_USBD_ERROR_LDD_NOT_FOUND = 0x80110009, + CELL_USBD_ERROR_DEVICE_NOT_FOUND = 0x8011000a, + CELL_USBD_ERROR_PIPE_NOT_ALLOCATED = 0x8011000b, + CELL_USBD_ERROR_PIPE_NOT_RELEASED = 0x8011000c, + CELL_USBD_ERROR_PIPE_NOT_FOUND = 0x8011000d, + CELL_USBD_ERROR_IOREQ_NOT_ALLOCATED = 0x8011000e, + CELL_USBD_ERROR_IOREQ_NOT_RELEASED = 0x8011000f, + CELL_USBD_ERROR_IOREQ_NOT_FOUND = 0x80110010, + CELL_USBD_ERROR_CANNOT_GET_DESCRIPTOR = 0x80110011, + CELL_USBD_ERROR_FATAL = 0x801100ff, +}; + +// TCC (Transfer Completion Codes) +enum +{ + HC_CC_NOERR = 0x0, + EHCI_CC_MISSMF = 0x10, + EHCI_CC_XACT = 0x20, + EHCI_CC_BABBLE = 0x30, + EHCI_CC_DATABUF = 0x40, + EHCI_CC_HALTED = 0x50, + + USBD_HC_CC_NOERR = 0x0, + USBD_HC_CC_MISSMF = 0x1, + USBD_HC_CC_XACT = 0x2, + USBD_HC_CC_BABBLE = 0x4, + USBD_HC_CC_DATABUF = 0x8, +}; \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp index 6268fc3357..e9ed1f9da1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp @@ -1,8 +1,9 @@ #include "stdafx.h" -#if 0 +#include "Emu/Memory/Memory.h" +#include "Emu/System.h" +#include "Emu/SysCalls/Modules.h" -void cellVoice_init(); -Module cellVoice(0x0046, cellVoice_init); +extern Module cellVoice; // Error Codes enum @@ -27,211 +28,211 @@ enum CELL_VOICE_ERROR_TOPOLOGY = 0x80310807, }; -int cellVoiceConnectIPortToOPort() +s32 cellVoiceConnectIPortToOPort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceCreateNotifyEventQueue() +s32 cellVoiceCreateNotifyEventQueue() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceCreatePort() +s32 cellVoiceCreatePort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceDeletePort() +s32 cellVoiceDeletePort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceDisconnectIPortFromOPort() +s32 cellVoiceDisconnectIPortFromOPort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceEnd() +s32 cellVoiceEnd() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceGetBitRate() +s32 cellVoiceGetBitRate() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceGetMuteFlag() +s32 cellVoiceGetMuteFlag() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceGetPortAttr() +s32 cellVoiceGetPortAttr() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceGetPortInfo() +s32 cellVoiceGetPortInfo() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceGetSignalState() +s32 cellVoiceGetSignalState() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceGetVolume() +s32 cellVoiceGetVolume() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceInit() +s32 cellVoiceInit() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceInitEx() +s32 cellVoiceInitEx() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoicePausePort() +s32 cellVoicePausePort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoicePausePortAll() +s32 cellVoicePausePortAll() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceRemoveNotifyEventQueue() +s32 cellVoiceRemoveNotifyEventQueue() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceResetPort() +s32 cellVoiceResetPort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceResumePort() +s32 cellVoiceResumePort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceResumePortAll() +s32 cellVoiceResumePortAll() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceSetBitRate() +s32 cellVoiceSetBitRate() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceSetMuteFlag() +s32 cellVoiceSetMuteFlag() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceSetMuteFlagAll() +s32 cellVoiceSetMuteFlagAll() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceSetNotifyEventQueue() +s32 cellVoiceSetNotifyEventQueue() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceSetPortAttr() +s32 cellVoiceSetPortAttr() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceSetVolume() +s32 cellVoiceSetVolume() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceStart() +s32 cellVoiceStart() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceStartEx() +s32 cellVoiceStartEx() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceStop() +s32 cellVoiceStop() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceUpdatePort() +s32 cellVoiceUpdatePort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceWriteToIPort() +s32 cellVoiceWriteToIPort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceWriteToIPortEx() +s32 cellVoiceWriteToIPortEx() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceReadFromOPort() +s32 cellVoiceReadFromOPort() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -int cellVoiceDebugTopology() +s32 cellVoiceDebugTopology() { UNIMPLEMENTED_FUNC(cellVoice); return CELL_OK; } -void cellVoice_init() +Module cellVoice("cellVoice", []() { REG_FUNC(cellVoice, cellVoiceConnectIPortToOPort); REG_FUNC(cellVoice, cellVoiceCreateNotifyEventQueue); @@ -267,5 +268,4 @@ void cellVoice_init() REG_FUNC(cellVoice, cellVoiceWriteToIPortEx); REG_FUNC(cellVoice, cellVoiceReadFromOPort); REG_FUNC(cellVoice, cellVoiceDebugTopology); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/lv2/cellFs.cpp b/rpcs3/Emu/SysCalls/lv2/cellFs.cpp index 9768101a37..6695207b54 100644 --- a/rpcs3/Emu/SysCalls/lv2/cellFs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/cellFs.cpp @@ -1029,6 +1029,24 @@ s32 cellFsReadWithOffset(PPUThread& CPU, u32 fd, u64 offset, vm::ptr buf, return CELL_OK; } +s32 cellFsSetDefaultContainer(u32 id, u32 total_limit) +{ + sys_fs.Todo("cellFsSetDefaultContainer(id=%d, total_limit=%d)", id, total_limit); + + return CELL_OK; +} + +s32 cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 page_type) +{ + sys_fs.Todo("cellFsSetIoBufferFromDefaultContainer(fd=%d, buffer_size=%d, page_type=%d)", fd, buffer_size, page_type); + + std::shared_ptr file; + if (!sys_fs.CheckId(fd, file)) + return CELL_ESRCH; + + return CELL_OK; +} + Module sys_fs("sys_fs", []() { g_FsAioReadID = 0; @@ -1076,4 +1094,6 @@ Module sys_fs("sys_fs", []() REG_FUNC(sys_fs, cellFsStReadPutCurrentAddr); REG_FUNC(sys_fs, cellFsStReadWait); REG_FUNC(sys_fs, cellFsStReadWaitCallback); + REG_FUNC(sys_fs, cellFsSetDefaultContainer); + REG_FUNC(sys_fs, cellFsSetIoBufferFromDefaultContainer); }); diff --git a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp index c524e17515..18d41494f4 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp @@ -61,7 +61,8 @@ s32 sys_ppu_thread_join(u64 thread_id, vm::ptr vptr) sys_ppu_thread.Warning("sys_ppu_thread_join(thread_id=%lld, vptr_addr=0x%x)", thread_id, vptr.addr()); std::shared_ptr thr = Emu.GetCPU().GetThread(thread_id); - if(!thr) return CELL_ESRCH; + if (!thr) return + CELL_ESRCH; while (thr->IsAlive()) { @@ -83,9 +84,10 @@ s32 sys_ppu_thread_detach(u64 thread_id) sys_ppu_thread.Todo("sys_ppu_thread_detach(thread_id=%lld)", thread_id); std::shared_ptr thr = Emu.GetCPU().GetThread(thread_id); - if(!thr) return CELL_ESRCH; + if (!thr) + return CELL_ESRCH; - if(!thr->IsJoinable()) + if (!thr->IsJoinable()) return CELL_EINVAL; thr->SetJoinable(false); @@ -104,7 +106,8 @@ s32 sys_ppu_thread_set_priority(u64 thread_id, s32 prio) sys_ppu_thread.Log("sys_ppu_thread_set_priority(thread_id=%lld, prio=%d)", thread_id, prio); std::shared_ptr thr = Emu.GetCPU().GetThread(thread_id); - if(!thr) return CELL_ESRCH; + if (!thr) + return CELL_ESRCH; thr->SetPrio(prio); @@ -138,7 +141,8 @@ s32 sys_ppu_thread_stop(u64 thread_id) sys_ppu_thread.Warning("sys_ppu_thread_stop(thread_id=%lld)", thread_id); std::shared_ptr thr = Emu.GetCPU().GetThread(thread_id); - if(!thr) return CELL_ESRCH; + if (!thr) + return CELL_ESRCH; thr->Stop(); @@ -150,7 +154,8 @@ s32 sys_ppu_thread_restart(u64 thread_id) sys_ppu_thread.Warning("sys_ppu_thread_restart(thread_id=%lld)", thread_id); std::shared_ptr thr = Emu.GetCPU().GetThread(thread_id); - if(!thr) return CELL_ESRCH; + if (!thr) + return CELL_ESRCH; thr->Stop(); thr->Run(); @@ -169,8 +174,8 @@ PPUThread* ppu_thread_create(u32 entry, u64 arg, s32 prio, u32 stacksize, bool i // If not times of smallest allocation unit, round it up to the nearest one. // And regard zero as a same condition. sys_ppu_thread.Warning("sys_ppu_thread_create: stacksize increased from 0x%x to 0x%x.", - stacksize, 4096 * ((u32)(stacksize / 4096) + 1)); - stacksize = 4096 * ((u32)(stacksize / 4096) + 1); + stacksize, SYS_PPU_THREAD_STACK_MIN * ((u32)(stacksize / SYS_PPU_THREAD_STACK_MIN) + 1)); + stacksize = SYS_PPU_THREAD_STACK_MIN * ((u32)(stacksize / SYS_PPU_THREAD_STACK_MIN) + 1); } u32 id = new_thread.GetId(); @@ -256,9 +261,8 @@ s32 sys_ppu_thread_rename(u64 thread_id, vm::ptr name) sys_ppu_thread.Log("sys_ppu_thread_rename(thread_id=%d, name_addr=0x%x('%s'))", thread_id, name.addr(), name.get_ptr()); std::shared_ptr thr = Emu.GetCPU().GetThread(thread_id); - if (!thr) { + if (!thr) return CELL_ESRCH; - } thr->SetThreadName(name.get_ptr()); return CELL_OK; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h index eb3e343b97..3bd901338c 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h @@ -14,6 +14,11 @@ enum ppu_thread_flags : u64 SYS_PPU_THREAD_CREATE_INTERRUPT = 0x2, }; +enum stackSize +{ + SYS_PPU_THREAD_STACK_MIN = 0x4000, +}; + // Aux PPUThread* ppu_thread_create(u32 entry, u64 arg, s32 prio, u32 stacksize, bool is_joinable, bool is_interrupt, const std::string& name, std::function task = nullptr); diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index eb0c24f4e0..0e0cac5072 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -488,6 +488,7 @@ + @@ -495,6 +496,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 90c6dd6572..c59f0c4c5a 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -167,6 +167,9 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -206,9 +209,18 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -233,12 +245,18 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -404,9 +422,6 @@ Emu\SysCalls\currently_unused - - Emu\SysCalls\Modules - Emu\SysCalls\currently_unused @@ -443,33 +458,18 @@ Emu\SysCalls\currently_unused - - Emu\SysCalls\currently_unused - Emu\SysCalls\currently_unused - - Emu\SysCalls\currently_unused - - - Emu\SysCalls\currently_unused - Emu\SysCalls\currently_unused Emu\SysCalls\currently_unused - - Emu\SysCalls\currently_unused - Emu\SysCalls\currently_unused - - Emu\SysCalls\currently_unused - Emu\SysCalls\currently_unused @@ -587,6 +587,9 @@ Emu\GPU\RSX + + Emu\GPU\RSX + Emu\SysCalls\lv2 @@ -854,9 +857,6 @@ Emu\CPU\ARMv7\Objects - - Emu\GPU\RSX - @@ -1366,6 +1366,9 @@ Emu\GPU\RSX + + Emu\GPU\RSX + Emu\GPU\RSX @@ -1522,8 +1525,11 @@ Emu\CPU\ARMv7\Objects - - Emu\GPU\RSX + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules \ No newline at end of file