rpcsx/rpcs3/Emu/Cell/Modules/cellMusicExport.cpp

110 lines
3.4 KiB
C++
Raw Normal View History

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 22:45:50 +01:00
#include "cellSysutil.h"
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 cellMusicExport("cellMusicExport");
// Return Codes
enum
{
2014-04-04 15:25:38 +02:00
CELL_MUSIC_EXPORT_UTIL_ERROR_BUSY = 0x8002c601,
CELL_MUSIC_EXPORT_UTIL_ERROR_INTERNAL = 0x8002c602,
CELL_MUSIC_EXPORT_UTIL_ERROR_PARAM = 0x8002c603,
CELL_MUSIC_EXPORT_UTIL_ERROR_ACCESS_ERROR = 0x8002c604,
CELL_MUSIC_EXPORT_UTIL_ERROR_DB_INTERNAL = 0x8002c605,
CELL_MUSIC_EXPORT_UTIL_ERROR_DB_REGIST = 0x8002c606,
CELL_MUSIC_EXPORT_UTIL_ERROR_SET_META = 0x8002c607,
CELL_MUSIC_EXPORT_UTIL_ERROR_FLUSH_META = 0x8002c608,
CELL_MUSIC_EXPORT_UTIL_ERROR_MOVE = 0x8002c609,
CELL_MUSIC_EXPORT_UTIL_ERROR_INITIALIZE = 0x8002c60a,
};
2018-01-12 22:45:50 +01:00
struct CellMusicExportSetParam
{
2018-01-12 22:45:50 +01:00
vm::bptr<char> title;
vm::bptr<char> game_title;
vm::bptr<char> artist;
vm::bptr<char> genre;
vm::bptr<char> game_comment;
vm::bptr<void> reserved1;
vm::bptr<void> reserved2;
};
using CellMusicExportUtilFinishCallback = void(s32 result, vm::ptr<void> userdata);
error_code cellMusicExportInitialize(u32 version, u32 container, vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
{
cellMusicExport.todo("cellMusicExportInitialize(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;
}
2018-01-12 22:45:50 +01:00
error_code cellMusicExportInitialize2(u32 version, vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
{
2018-01-12 22:45:50 +01:00
cellMusicExport.todo("cellMusicExportInitialize2(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;
}
2018-01-12 22:45:50 +01:00
error_code cellMusicExportFinalize(vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
{
2018-01-12 22:45:50 +01:00
cellMusicExport.todo("cellMusicExportFinalize(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;
}
2018-01-12 22:45:50 +01:00
error_code cellMusicExportFromFile(vm::cptr<char> srcHddDir, vm::cptr<char> srcHddFile, vm::ptr<CellMusicExportSetParam> param, vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
{
2018-01-12 22:45:50 +01:00
cellMusicExport.todo("cellMusicExportFromFile(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;
}
2018-01-12 22:45:50 +01:00
error_code cellMusicExportProgress(vm::ptr<CellMusicExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
{
2018-01-12 22:45:50 +01:00
cellMusicExport.todo("cellMusicExportProgress(funcFinish=*0x%x, userdata=*0x%x)", funcFinish, userdata);
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
funcFinish(ppu, 0xFFFF, userdata);
return CELL_OK;
});
return CELL_OK;
}
2016-03-21 20:43:03 +01:00
DECLARE(ppu_module_manager::cellMusicExport)("cellMusicExportUtility", []()
{
2016-03-21 20:43:03 +01:00
REG_FUNC(cellMusicExportUtility, cellMusicExportInitialize);
REG_FUNC(cellMusicExportUtility, cellMusicExportInitialize2);
REG_FUNC(cellMusicExportUtility, cellMusicExportFinalize);
REG_FUNC(cellMusicExportUtility, cellMusicExportFromFile);
REG_FUNC(cellMusicExportUtility, cellMusicExportProgress);
});