diff --git a/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp b/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp index e8bd573c69..0b2024abd8 100644 --- a/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" +#include "cellSysutil.h" namespace vm { using namespace ps3; } @@ -20,6 +21,16 @@ enum CELL_PHOTO_EXPORT_UTIL_ERROR_INITIALIZE = 0x8002c20a, }; +struct CellPhotoExportSetParam +{ + vm::bptr photo_title; + vm::bptr game_title; + vm::bptr game_comment; + vm::bptr reserved; +}; + +using CellPhotoExportUtilFinishCallback = void(s32 result, vm::ptr userdata); + s32 cellPhotoInitialize() { UNIMPLEMENTED_FUNC(cellPhotoExport); @@ -38,39 +49,81 @@ s32 cellPhotoRegistFromFile() return CELL_OK; } -s32 cellPhotoExportInitialize() +error_code cellPhotoExportInitialize(u32 version, u32 container, vm::ptr funcFinish, vm::ptr userdata) { - UNIMPLEMENTED_FUNC(cellPhotoExport); + cellPhotoExport.todo("cellPhotoExportInitialize(version=0x%x, container=0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, container, funcFinish, userdata); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + funcFinish(ppu, CELL_OK, userdata); + return CELL_OK; + }); + return CELL_OK; } -s32 cellPhotoExportInitialize2() +error_code cellPhotoExportInitialize2(u32 version, vm::ptr funcFinish, vm::ptr userdata) { - UNIMPLEMENTED_FUNC(cellPhotoExport); + cellPhotoExport.todo("cellPhotoExportInitialize2(version=0x%x, funcFinish=*0x%x, userdata=*0x%x)", version, funcFinish, userdata); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + funcFinish(ppu, CELL_OK, userdata); + return CELL_OK; + }); + return CELL_OK; } -s32 cellPhotoExportFinalize() +error_code cellPhotoExportFinalize(vm::ptr funcFinish, vm::ptr userdata) { - UNIMPLEMENTED_FUNC(cellPhotoExport); + cellPhotoExport.todo("cellPhotoExportFinalize(funcFinish=*0x%x, userdata=*0x%x)", funcFinish, userdata); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + funcFinish(ppu, CELL_OK, userdata); + return CELL_OK; + }); + return CELL_OK; } -s32 cellPhotoExportFromFile() +error_code cellPhotoExportFromFile(vm::cptr srcHddDir, vm::cptr srcHddFile, vm::ptr param, vm::ptr funcFinish, vm::ptr userdata) { - UNIMPLEMENTED_FUNC(cellPhotoExport); + cellPhotoExport.todo("cellPhotoExportFromFile(srcHddDir=%s, srcHddFile=%s, param=*0x%x, funcFinish=*0x%x, userdata=*0x%x)", srcHddDir, srcHddFile, param, funcFinish, userdata); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + funcFinish(ppu, CELL_OK, userdata); + return CELL_OK; + }); + return CELL_OK; } -s32 cellPhotoExportFromFileWithCopy() +error_code cellPhotoExportFromFileWithCopy(vm::cptr srcHddDir, vm::cptr srcHddFile, vm::ptr param, vm::ptr funcFinish, vm::ptr userdata) { - UNIMPLEMENTED_FUNC(cellPhotoExport); + cellPhotoExport.todo("cellPhotoExportFromFileWithCopy(srcHddDir=%s, srcHddFile=%s, param=*0x%x, funcFinish=*0x%x, userdata=*0x%x)", srcHddDir, srcHddFile, param, funcFinish, userdata); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + funcFinish(ppu, CELL_OK, userdata); + return CELL_OK; + }); + return CELL_OK; } -s32 cellPhotoExportProgress() +error_code cellPhotoExportProgress(vm::ptr funcFinish, vm::ptr userdata) { - UNIMPLEMENTED_FUNC(cellPhotoExport); + cellPhotoExport.todo("cellPhotoExportProgress(funcFinish=*0x%x, userdata=*0x%x)", funcFinish, userdata); + + sysutil_register_cb([=](ppu_thread& ppu) -> s32 + { + funcFinish(ppu, 0xFFFF, userdata); // 0-0xFFFF where 0xFFFF = 100% + return CELL_OK; + }); + return CELL_OK; }