mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-01 03:32:07 +00:00
Use g_fxo for cellRec
Rename rec_t -> rec_info
This commit is contained in:
parent
2740fafa64
commit
93d5c0a38e
@ -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;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user