Use g_fxo for cellRec

Rename rec_t -> rec_info
This commit is contained in:
Nekotekina 2019-08-21 22:39:21 +03:00
parent 2740fafa64
commit 93d5c0a38e
1 changed files with 8 additions and 7 deletions

View File

@ -3,8 +3,6 @@
#include "Emu/IdManager.h"
#include "cellSysutil.h"
LOG_CHANNEL(cellRec);
enum
@ -58,7 +56,7 @@ struct CellRecParam
using CellRecCallback = void(s32 recStatus, s32 recError, vm::ptr<void> userdata);
struct rec_t
struct rec_info
{
vm::ptr<CellRecCallback> cb;
vm::ptr<void> cbUserData;
@ -68,7 +66,7 @@ error_code cellRecOpen(vm::cptr<char> pDirName, vm::cptr<char> pFileName, vm::cp
{
cellRec.todo("cellRecOpen(pDirName=%s, pFileName=%s, pParam=*0x%x, container=0x%x, cb=*0x%x, cbUserData=*0x%x)", pDirName, pFileName, pParam, container, cb, cbUserData);
const auto rec = fxm::make_always<rec_t>();
const auto rec = g_fxo->get<rec_info>();
rec->cb = cb;
rec->cbUserData = cbUserData;
@ -85,9 +83,10 @@ error_code cellRecClose(s32 isDiscard)
{
cellRec.todo("cellRecClose(isDiscard=0x%x)", isDiscard);
const auto rec = g_fxo->get<rec_info>();
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
const auto rec = fxm::get_always<rec_t>();
rec->cb(ppu, CELL_REC_STATUS_CLOSE, CELL_OK, rec->cbUserData);
return CELL_OK;
});
@ -104,9 +103,10 @@ error_code cellRecStop()
{
cellRec.todo("cellRecStop()");
const auto rec = g_fxo->get<rec_info>();
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
const auto rec = fxm::get_always<rec_t>();
rec->cb(ppu, CELL_REC_STATUS_STOP, CELL_OK, rec->cbUserData);
return CELL_OK;
});
@ -118,9 +118,10 @@ error_code cellRecStart()
{
cellRec.todo("cellRecStart()");
const auto rec = g_fxo->get<rec_info>();
sysutil_register_cb([=](ppu_thread& ppu) -> s32
{
const auto rec = fxm::get_always<rec_t>();
rec->cb(ppu, CELL_REC_STATUS_START, CELL_OK, rec->cbUserData);
return CELL_OK;
});