rpcsx/ps3fw/cellStorage.cpp

71 lines
2.5 KiB
C++
Raw Normal View History

2020-12-05 13:08:24 +01:00
#include "stdafx.h"
2016-03-21 20:43:03 +01:00
#include "Emu/Cell/PPUModule.h"
2018-02-26 22:54:47 +01:00
#include "cellSysutil.h"
#include "cellStorage.h"
2018-02-09 15:49:37 +01:00
LOG_CHANNEL(cellSysutil);
template <>
void fmt_class_string<CellStorageError>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(CELL_STORAGEDATA_ERROR_ACCESS_ERROR);
STR_CASE(CELL_STORAGEDATA_ERROR_INTERNAL);
STR_CASE(CELL_STORAGEDATA_ERROR_PARAM);
STR_CASE(CELL_STORAGEDATA_ERROR_FAILURE);
STR_CASE(CELL_STORAGEDATA_ERROR_BUSY);
}
return unknown;
});
}
error_code cellStorageDataImportMove(u32 version, vm::ptr<char> srcMediaFile, vm::ptr<char> dstHddDir, vm::ptr<CellStorageDataSetParam> param, vm::ptr<CellStorageDataFinishCallback> funcFinish, u32 container, vm::ptr<void> userdata)
{
cellSysutil.todo("cellStorageDataImportMove(version=0x%x, srcMediaFile=%s, dstHddDir=%s, param=*0x%x, funcFinish=*0x%x, container=0x%x, userdata=*0x%x)", version, srcMediaFile, dstHddDir, param, funcFinish, container, userdata);
2018-02-26 22:54:47 +01:00
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
funcFinish(ppu, CELL_OK, userdata);
return CELL_OK;
});
2018-02-26 22:54:47 +01:00
return CELL_OK;
}
error_code cellStorageDataImport(u32 version, vm::ptr<char> srcMediaFile, vm::ptr<char> dstHddDir, vm::ptr<CellStorageDataSetParam> param, vm::ptr<CellStorageDataFinishCallback> funcFinish, u32 container, vm::ptr<void> userdata)
{
cellSysutil.todo("cellStorageDataImport(version=0x%x, srcMediaFile=%s, dstHddDir=%s, param=*0x%x, funcFinish=*0x%x, container=0x%x, userdata=*0x%x)", version, srcMediaFile, dstHddDir, param, funcFinish, container, userdata);
2018-02-26 22:54:47 +01:00
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
funcFinish(ppu, CELL_OK, userdata);
return CELL_OK;
});
2018-02-26 22:54:47 +01:00
return CELL_OK;
}
error_code cellStorageDataExport(u32 version, vm::ptr<char> srcHddFile, vm::ptr<char> dstMediaDir, vm::ptr<CellStorageDataSetParam> param, vm::ptr<CellStorageDataFinishCallback> funcFinish, u32 container, vm::ptr<void> userdata)
{
cellSysutil.todo("cellStorageDataExport(version=0x%x, srcHddFile=%s, dstMediaDir=%s, param=*0x%x, funcFinish=*0x%x, container=0x%x, userdata=*0x%x)", version, srcHddFile, dstMediaDir, param, funcFinish, container, userdata);
2018-02-26 22:54:47 +01:00
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
funcFinish(ppu, CELL_OK, userdata);
return CELL_OK;
});
2018-02-26 22:54:47 +01:00
return CELL_OK;
}
void cellSysutil_Storage_init()
{
REG_FUNC(cellSysutil, cellStorageDataImportMove);
REG_FUNC(cellSysutil, cellStorageDataImport);
REG_FUNC(cellSysutil, cellStorageDataExport);
}