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

109 lines
3.4 KiB
C++
Raw Normal View History

2016-03-21 20:43:03 +01:00
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
2018-01-18 20:15:18 +01:00
#include "cellSysutil.h"
2018-02-09 15:49:37 +01:00
2018-01-18 20:15:18 +01:00
LOG_CHANNEL(cellVideoExport);
2016-03-21 20:43:03 +01:00
2018-01-18 20:15:18 +01:00
struct CellVideoExportSetParam
{
vm::bptr<char> title;
vm::bptr<char> game_title;
vm::bptr<char> game_comment;
be_t<s32> editable;
vm::bptr<void> reserved2;
};
using CellVideoExportUtilFinishCallback = void(s32 result, vm::ptr<void> userdata);
error_code cellVideoExportProgress(vm::ptr<CellVideoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
2016-03-21 20:43:03 +01:00
{
2018-01-18 20:15:18 +01:00
cellVideoExport.todo("cellVideoExportProgress(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;
2016-03-21 20:43:03 +01:00
}
2018-01-18 20:15:18 +01:00
error_code cellVideoExportInitialize2(u32 version, vm::ptr<CellVideoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
2016-03-21 20:43:03 +01:00
{
2018-01-18 20:15:18 +01:00
cellVideoExport.todo("cellVideoExportInitialize2(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;
2016-03-21 20:43:03 +01:00
}
2018-01-18 20:15:18 +01:00
error_code cellVideoExportInitialize(u32 version, u32 container, vm::ptr<CellVideoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
2016-03-21 20:43:03 +01:00
{
2018-01-18 20:15:18 +01:00
cellVideoExport.todo("cellVideoExportInitialize(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;
2016-03-21 20:43:03 +01:00
}
2018-01-18 20:15:18 +01:00
error_code cellVideoExportFromFileWithCopy(vm::cptr<char> srcHddDir, vm::cptr<char> srcHddFile, vm::ptr<CellVideoExportSetParam> param, vm::ptr<CellVideoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
2016-03-21 20:43:03 +01:00
{
2018-01-18 20:15:18 +01:00
cellVideoExport.todo("cellVideoExportFromFileWithCopy(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;
2016-03-21 20:43:03 +01:00
}
2018-01-18 20:15:18 +01:00
error_code cellVideoExportFromFile(vm::cptr<char> srcHddDir, vm::cptr<char> srcHddFile, vm::ptr<CellVideoExportSetParam> param, vm::ptr<CellVideoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
2016-03-21 20:43:03 +01:00
{
2018-01-18 20:15:18 +01:00
cellVideoExport.todo("cellVideoExportFromFile(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;
2016-03-21 20:43:03 +01:00
}
2018-01-18 20:15:18 +01:00
error_code cellVideoExportFinalize(vm::ptr<CellVideoExportUtilFinishCallback> funcFinish, vm::ptr<void> userdata)
2016-03-21 20:43:03 +01:00
{
2018-01-18 20:15:18 +01:00
cellVideoExport.todo("cellVideoExportFinalize(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;
2016-03-21 20:43:03 +01:00
}
DECLARE(ppu_module_manager::cellVideoExport)("cellVideoExportUtility", []()
{
REG_FUNC(cellVideoExportUtility, cellVideoExportProgress);
REG_FUNC(cellVideoExportUtility, cellVideoExportInitialize2);
REG_FUNC(cellVideoExportUtility, cellVideoExportInitialize);
REG_FUNC(cellVideoExportUtility, cellVideoExportFromFileWithCopy);
REG_FUNC(cellVideoExportUtility, cellVideoExportFromFile);
REG_FUNC(cellVideoExportUtility, cellVideoExportFinalize);
});