#include "stdafx.h" #include "Emu/Cell/PPUModule.h" #include "cellSysutil.h" LOG_CHANNEL(cellVideoExport); struct CellVideoExportSetParam { vm::bptr title; vm::bptr game_title; vm::bptr game_comment; be_t editable; vm::bptr reserved2; }; using CellVideoExportUtilFinishCallback = void(s32 result, vm::ptr userdata); error_code cellVideoExportProgress(vm::ptr funcFinish, vm::ptr userdata) { 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; } error_code cellVideoExportInitialize2(u32 version, vm::ptr funcFinish, vm::ptr userdata) { 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; } error_code cellVideoExportInitialize(u32 version, u32 container, vm::ptr funcFinish, vm::ptr userdata) { 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; } error_code cellVideoExportFromFileWithCopy(vm::cptr srcHddDir, vm::cptr srcHddFile, vm::ptr param, vm::ptr funcFinish, vm::ptr userdata) { 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; } error_code cellVideoExportFromFile(vm::cptr srcHddDir, vm::cptr srcHddFile, vm::ptr param, vm::ptr funcFinish, vm::ptr userdata) { 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; } error_code cellVideoExportFinalize(vm::ptr funcFinish, vm::ptr userdata) { 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; } 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); });