2014-07-12 09:46:14 +02:00
|
|
|
#include "stdafx.h"
|
2016-03-21 20:43:03 +01:00
|
|
|
#include "Emu/Cell/PPUModule.h"
|
2018-01-12 23:45:55 +01:00
|
|
|
#include "cellSysutil.h"
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2018-02-09 15:49:37 +01:00
|
|
|
|
2017-05-15 13:58:32 +02:00
|
|
|
|
2017-05-13 20:30:37 +02:00
|
|
|
logs::channel cellPhotoExport("cellPhotoExport");
|
2013-09-28 04:36:57 +02:00
|
|
|
|
|
|
|
|
// Return Codes
|
|
|
|
|
enum
|
|
|
|
|
{
|
2014-04-04 15:25:38 +02:00
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_BUSY = 0x8002c201,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_INTERNAL = 0x8002c202,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_PARAM = 0x8002c203,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_ACCESS_ERROR = 0x8002c204,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_DB_INTERNAL = 0x8002c205,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_DB_REGIST = 0x8002c206,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_SET_META = 0x8002c207,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_FLUSH_META = 0x8002c208,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_MOVE = 0x8002c209,
|
|
|
|
|
CELL_PHOTO_EXPORT_UTIL_ERROR_INITIALIZE = 0x8002c20a,
|
2013-09-28 04:36:57 +02:00
|
|
|
};
|
|
|
|
|
|
2018-01-12 23:45:55 +01:00
|
|
|
struct CellPhotoExportSetParam
|
|
|
|
|
{
|
|
|
|
|
vm::bptr<char> photo_title;
|
|
|
|
|
vm::bptr<char> game_title;
|
|
|
|
|
vm::bptr<char> game_comment;
|
|
|
|
|
vm::bptr<void> reserved;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using CellPhotoExportUtilFinishCallback = void(s32 result, vm::ptr<void> userdata);
|
|
|
|
|
|
2015-07-30 03:43:03 +02:00
|
|
|
s32 cellPhotoInitialize()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellPhotoExport);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-30 03:43:03 +02:00
|
|
|
s32 cellPhotoFinalize()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellPhotoExport);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-30 03:43:03 +02:00
|
|
|
s32 cellPhotoRegistFromFile()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellPhotoExport);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 23:45:55 +01:00
|
|
|
error_code cellPhotoExportInitialize(u32 version, u32 container, vm::ptr<CellPhotoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2018-01-12 23:45:55 +01:00
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 23:45:55 +01:00
|
|
|
error_code cellPhotoExportInitialize2(u32 version, vm::ptr<CellPhotoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2018-01-12 23:45:55 +01:00
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 23:45:55 +01:00
|
|
|
error_code cellPhotoExportFinalize(vm::ptr<CellPhotoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2018-01-12 23:45:55 +01:00
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
|
2015-07-30 03:43:03 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 23:45:55 +01:00
|
|
|
error_code cellPhotoExportFromFile(vm::cptr<char> srcHddDir, vm::cptr<char> srcHddFile, vm::ptr<CellPhotoExportSetParam> param, vm::ptr<CellPhotoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
2015-07-30 03:43:03 +02:00
|
|
|
{
|
2018-01-12 23:45:55 +01:00
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
|
2015-07-30 03:43:03 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 23:45:55 +01:00
|
|
|
error_code cellPhotoExportFromFileWithCopy(vm::cptr<char> srcHddDir, vm::cptr<char> srcHddFile, vm::ptr<CellPhotoExportSetParam> param, vm::ptr<CellPhotoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
2015-07-30 03:43:03 +02:00
|
|
|
{
|
2018-01-12 23:45:55 +01:00
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
|
2015-07-30 03:43:03 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 23:45:55 +01:00
|
|
|
error_code cellPhotoExportProgress(vm::ptr<CellPhotoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
|
2015-07-30 03:43:03 +02:00
|
|
|
{
|
2018-01-12 23:45:55 +01:00
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
|
2015-07-30 03:43:03 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-21 20:43:03 +01:00
|
|
|
DECLARE(ppu_module_manager::cellPhotoExport)("cellPhotoUtility", []()
|
2015-07-30 03:43:03 +02:00
|
|
|
{
|
2016-03-21 20:43:03 +01:00
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoInitialize);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoFinalize);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoRegistFromFile);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoExportInitialize);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoExportInitialize2);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoExportFinalize);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoExportFromFile);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoExportFromFileWithCopy);
|
|
|
|
|
REG_FUNC(cellPhotoUtility, cellPhotoExportProgress);
|
2015-07-30 03:43:03 +02:00
|
|
|
});
|