diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index 72be0defa3..6e4e8bcd48 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -29,6 +29,8 @@ extern Module cellPngDec; extern Module cellResc; extern Module cellRtc; extern Module cellSail; +extern Module cellScreenshot; +extern Module cellSearch; extern Module cellSysutil; extern Module cellSpurs; extern Module cellSpursJq; @@ -38,6 +40,7 @@ extern Module cellSync2; extern Module cellSysmodule; extern Module cellSysutil; extern Module cellSysutilAp; +extern Module cellUsbd; extern Module cellUserInfo; extern Module cellVdec; extern Module cellVpost; @@ -88,7 +91,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 }, @@ -131,7 +134,7 @@ static const g_module_list[] = { 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 +157,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 88b6b2505f..91aab2d96b 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() { sys_io.AddFunc(0x1cf98800, cellPadInit); @@ -439,4 +543,8 @@ void cellPad_init() sys_io.AddFunc(0xf83f8182, cellPadSetPressMode); sys_io.AddFunc(0xbe5be3ba, cellPadSetSensorMode); sys_io.AddFunc(0xdbf4c59c, cellPadGetCapabilityInfo); + sys_io.AddFunc(0x20a97ba2, cellPadLddRegisterController); + sys_io.AddFunc(0xbafd6409, cellPadLddDataInsert); + sys_io.AddFunc(0x8b8231e5, cellPadLddGetPortNo); + sys_io.AddFunc(0xe442faa8, cellPadLddUnregisterController); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp index 14959e3d0b..52df2aa113 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", []() { cellScreenshot.AddFunc(0xd3ad63e4, cellScreenShotSetParameter); cellScreenshot.AddFunc(0x7a9c2243, cellScreenShotSetOverlayImage); cellScreenshot.AddFunc(0x9e33ab8f, cellScreenShotEnable); cellScreenshot.AddFunc(0xfc6f4e74, 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 d56f44ce2a..7f9b8e9abe 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", []() { cellSearch.AddFunc(0xc81ccf8a, cellSearchInitialize); cellSearch.AddFunc(0xbfab7616, cellSearchFinalize); @@ -172,5 +173,4 @@ void cellSearch_init() cellSearch.AddFunc(0x35cda406, cellSearchGetContentInfoDeveloperData); cellSearch.AddFunc(0x8fe376a6, cellSearchCancel); cellSearch.AddFunc(0x774033d6, cellSearchEnd); -} -#endif +}); diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp index 07759a9cb4..dee4f647b9 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", []() { cellUsbd.AddFunc(0xd0e766fe, cellUsbdInit); cellUsbd.AddFunc(0x35f22ac3, cellUsbdEnd); @@ -204,5 +184,4 @@ void cellUsbd_init() cellUsbd.AddFunc(0x074dbb39, cellUsbdAllocateMemory); cellUsbd.AddFunc(0x4e456e81, 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/lv2/cellFs.cpp b/rpcs3/Emu/SysCalls/lv2/cellFs.cpp index ddf9448482..6363355a76 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", []() sys_fs.AddFunc(0x81f33783, cellFsStReadPutCurrentAddr); sys_fs.AddFunc(0x8f71c5b2, cellFsStReadWait); sys_fs.AddFunc(0x866f6aec, cellFsStReadWaitCallback); + sys_fs.AddFunc(0x02671310, cellFsSetDefaultContainer); + sys_fs.AddFunc(0x75f16dc5, cellFsSetIoBufferFromDefaultContainer); }); diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 56bc415e11..d60ea9a10a 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -487,6 +487,7 @@ + @@ -494,6 +495,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 49c65e3094..8a8751b80e 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -212,6 +212,12 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -236,6 +242,9 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -452,21 +461,12 @@ 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 @@ -1525,5 +1525,11 @@ Emu\CPU\ARMv7\Objects + + Emu\SysCalls\Modules + + + Emu\SysCalls\Modules + \ No newline at end of file