1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-24 03:32:50 +01:00

cellDmuxPamf: add module + stubs

This commit is contained in:
capriots 2024-11-23 13:46:15 +01:00 committed by Elad
parent 8778e69f9d
commit e7fd4224ad
9 changed files with 255 additions and 11 deletions

View File

@ -252,6 +252,7 @@ target_sources(rpcs3_emu PRIVATE
Cell/Modules/cellCrossController.cpp
Cell/Modules/cellDaisy.cpp
Cell/Modules/cellDmux.cpp
Cell/Modules/cellDmuxPamf.cpp
Cell/Modules/cellDtcpIpUtility.cpp
Cell/Modules/cellFiber.cpp
Cell/Modules/cellFont.cpp

View File

@ -1175,7 +1175,7 @@ error_code cellDmuxEnableEs(u32 handle, vm::cptr<CellCodecEsFilterId> esFilterId
const auto es = idm::make_ptr<ElementaryStream>(dmux.get(), esResourceInfo->memAddr, esResourceInfo->memSize,
esFilterId->filterIdMajor, esFilterId->filterIdMinor, esFilterId->supplementalInfo1, esFilterId->supplementalInfo2,
esCb->cbEsMsgFunc, esCb->cbArg, esSpecificInfo);
esCb->cbFunc, esCb->cbArg, esSpecificInfo);
*esHandle = es->id;
@ -1359,8 +1359,6 @@ error_code cellDmuxFlushEs(u32 esHandle)
DECLARE(ppu_module_manager::cellDmux)("cellDmux", []()
{
static ppu_static_module cellDmuxPamf("cellDmuxPamf");
REG_FUNC(cellDmux, cellDmuxQueryAttr);
REG_FUNC(cellDmux, cellDmuxQueryAttr2);
REG_FUNC(cellDmux, cellDmuxOpen);

View File

@ -195,6 +195,13 @@ struct CellDmuxResourceEx
be_t<u32> maxContention;
};
struct CellDmuxResourceSpurs
{
vm::bptr<void> spurs; // CellSpurs*
be_t<u64, 1> priority;
be_t<u32> maxContention;
};
/*
struct CellDmuxResource2Ex
{
@ -221,20 +228,20 @@ struct CellDmuxResource2
using CellDmuxCbMsg = u32(u32 demuxerHandle, vm::ptr<CellDmuxMsg> demuxerMsg, u32 cbArg);
struct CellDmuxCb
{
vm::bptr<CellDmuxCbMsg> cbMsgFunc;
be_t<u32> cbArg;
};
using CellDmuxCbEsMsg = u32(u32 demuxerHandle, u32 esHandle, vm::ptr<CellDmuxEsMsg> esMsg, u32 cbArg);
struct CellDmuxEsCb
// Used for internal callbacks as well
template <typename F>
struct DmuxCb
{
vm::bptr<CellDmuxCbEsMsg> cbEsMsgFunc;
vm::bptr<F> cbFunc;
be_t<u32> cbArg;
};
using CellDmuxCb = DmuxCb<CellDmuxCbMsg>;
using CellDmuxEsCb = DmuxCb<CellDmuxCbEsMsg>;
struct CellDmuxAttr
{
be_t<u32> memSize;
@ -275,3 +282,46 @@ struct CellDmuxAuInfoEx
CellCodecTimeStamp pts;
CellCodecTimeStamp dts;
};
struct CellDmuxPamfAttr;
struct CellDmuxPamfEsAttr;
using DmuxNotifyDemuxDone = error_code(vm::ptr<void>, u32, vm::ptr<void>);
using DmuxNotifyFatalErr = error_code(vm::ptr<void>, u32, vm::ptr<void>);
using DmuxNotifyProgEndCode = error_code(vm::ptr<void>, vm::ptr<void>);
using DmuxEsNotifyAuFound = error_code(vm::ptr<void>, vm::cptr<void>, vm::ptr<void>);
using DmuxEsNotifyFlushDone = error_code(vm::ptr<void>, vm::ptr<void>);
using CellDmuxCoreOpQueryAttr = error_code(vm::cptr<void>, vm::ptr<CellDmuxPamfAttr>);
using CellDmuxCoreOpOpen = error_code(vm::cptr<void>, vm::cptr<CellDmuxResource>, vm::cptr<CellDmuxResourceSpurs>, vm::cptr<DmuxCb<DmuxNotifyDemuxDone>>, vm::cptr<DmuxCb<DmuxNotifyProgEndCode>>, vm::cptr<DmuxCb<DmuxNotifyFatalErr>>, vm::pptr<void>);
using CellDmuxCoreOpClose = error_code(vm::ptr<void>);
using CellDmuxCoreOpResetStream = error_code(vm::ptr<void>);
using CellDmuxCoreOpCreateThread = error_code(vm::ptr<void>);
using CellDmuxCoreOpJoinThread = error_code(vm::ptr<void>);
using CellDmuxCoreOpSetStream = error_code(vm::ptr<void>, vm::cptr<void>, u32, b8, u64);
using CellDmuxCoreOpFreeMemory = error_code(vm::ptr<void>, vm::ptr<void>, u32);
using CellDmuxCoreOpQueryEsAttr = error_code(vm::cptr<void>, vm::cptr<void>, vm::ptr<CellDmuxPamfEsAttr>);
using CellDmuxCoreOpEnableEs = error_code(vm::ptr<void>, vm::cptr<void>, vm::cptr<CellDmuxEsResource>, vm::cptr<DmuxCb<DmuxEsNotifyAuFound>>, vm::cptr<DmuxCb<DmuxEsNotifyFlushDone>>, vm::cptr<void>, vm::pptr<void>);
using CellDmuxCoreOpDisableEs = u32(vm::ptr<void>);
using CellDmuxCoreOpFlushEs = u32(vm::ptr<void>);
using CellDmuxCoreOpResetEs = u32(vm::ptr<void>);
using CellDmuxCoreOpResetStreamAndWaitDone = u32(vm::ptr<void>);
struct CellDmuxCoreOps
{
vm::bptr<CellDmuxCoreOpQueryAttr> queryAttr;
vm::bptr<CellDmuxCoreOpOpen> open;
vm::bptr<CellDmuxCoreOpClose> close;
vm::bptr<CellDmuxCoreOpResetStream> resetStream;
vm::bptr<CellDmuxCoreOpCreateThread> createThread;
vm::bptr<CellDmuxCoreOpJoinThread> joinThread;
vm::bptr<CellDmuxCoreOpSetStream> setStream;
vm::bptr<CellDmuxCoreOpFreeMemory> freeMemory;
vm::bptr<CellDmuxCoreOpQueryEsAttr> queryEsAttr;
vm::bptr<CellDmuxCoreOpEnableEs> enableEs;
vm::bptr<CellDmuxCoreOpDisableEs> disableEs;
vm::bptr<CellDmuxCoreOpFlushEs> flushEs;
vm::bptr<CellDmuxCoreOpResetEs> resetEs;
vm::bptr<CellDmuxCoreOpResetStreamAndWaitDone> resetStreamAndWaitDone;
};

View File

@ -0,0 +1,170 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "cellPamf.h"
#include "cellDmux.h"
#include "cellDmuxPamf.h"
vm::gvar<CellDmuxCoreOps> g_cell_dmux_core_ops_pamf;
vm::gvar<CellDmuxCoreOps> g_cell_dmux_core_ops_raw_es;
LOG_CHANNEL(cellDmuxPamf)
error_code _CellDmuxCoreOpQueryAttr(vm::cptr<CellDmuxPamfSpecificInfo> pamfSpecificInfo, vm::ptr<CellDmuxPamfAttr> pamfAttr)
{
cellDmuxPamf.todo("_CellDmuxCoreOpQueryAttr(pamfSpecificInfo=*0x%x, pamfAttr=*0x%x)", pamfSpecificInfo, pamfAttr);
return CELL_OK;
}
error_code _CellDmuxCoreOpOpen(vm::cptr<CellDmuxPamfSpecificInfo> pamfSpecificInfo, vm::cptr<CellDmuxResource> demuxerResource, vm::cptr<CellDmuxResourceSpurs> demuxerResourceSpurs, vm::cptr<DmuxCb<DmuxNotifyDemuxDone>> notifyDemuxDone,
vm::cptr<DmuxCb<DmuxNotifyProgEndCode>> notifyProgEndCode, vm::cptr<DmuxCb<DmuxNotifyFatalErr>> notifyFatalErr, vm::pptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpOpen(pamfSpecificInfo=*0x%x, demuxerResource=*0x%x, demuxerResourceSpurs=*0x%x, notifyDemuxDone=*0x%x, notifyProgEndCode=*0x%x, notifyFatalErr=*0x%x, handle=**0x%x)",
pamfSpecificInfo, demuxerResource, demuxerResourceSpurs, notifyDemuxDone, notifyProgEndCode, notifyFatalErr, handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpClose(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpClose(handle=*0x%x)", handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpResetStream(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpResetStream(handle=*0x%x)", handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpCreateThread(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpCreateThread(handle=*0x%x)", handle);
return CELL_OK;
}
error_code _CellDmuxCoreOpJoinThread(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpJoinThread(handle=*0x%x)", handle);
return CELL_OK;
}
template <bool raw_es>
error_code _CellDmuxCoreOpSetStream(vm::ptr<void> handle, vm::cptr<void> streamAddress, u32 streamSize, b8 discontinuity, u64 userData)
{
cellDmuxPamf.todo("_CellDmuxCoreOpSetStream<raw_es=%d>(handle=*0x%x, streamAddress=*0x%x, streamSize=0x%x, discontinuity=%d, userData=0x%llx)", raw_es, handle, streamAddress, streamSize, +discontinuity, userData);
return CELL_OK;
}
error_code _CellDmuxCoreOpFreeMemory(vm::ptr<void> esHandle, vm::ptr<void> memAddr, u32 memSize)
{
cellDmuxPamf.todo("_CellDmuxCoreOpFreeMemory(esHandle=*0x%x, memAddr=*0x%x, memSize=0x%x)", esHandle, memAddr, memSize);
return CELL_OK;
}
template <bool raw_es>
error_code _CellDmuxCoreOpQueryEsAttr(vm::cptr<void> esFilterId, vm::cptr<void> esSpecificInfo, vm::ptr<CellDmuxPamfEsAttr> attr)
{
cellDmuxPamf.todo("_CellDmuxCoreOpQueryEsAttr<raw_es=%d>(esFilterId=*0x%x, esSpecificInfo=*0x%x, attr=*0x%x)", raw_es, esFilterId, esSpecificInfo, attr);
return CELL_OK;
}
template <bool raw_es>
error_code _CellDmuxCoreOpEnableEs(vm::ptr<void> handle, vm::cptr<void> esFilterId, vm::cptr<CellDmuxEsResource> esResource, vm::cptr<DmuxCb<DmuxEsNotifyAuFound>> notifyAuFound,
vm::cptr<DmuxCb<DmuxEsNotifyFlushDone>> notifyFlushDone, vm::cptr<void> esSpecificInfo, vm::pptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpEnableEs<raw_es=%d>(handle=*0x%x, esFilterId=*0x%x, esResource=*0x%x, notifyAuFound=*0x%x, notifyFlushDone=*0x%x, esSpecificInfo=*0x%x, esHandle)",
raw_es, handle, esFilterId, esResource, notifyAuFound, notifyFlushDone, esSpecificInfo, esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpDisableEs(vm::ptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpDisableEs(esHandle=*0x%x)", esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpFlushEs(vm::ptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpFlushEs(esHandle=*0x%x)", esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpResetEs(vm::ptr<void> esHandle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpResetEs(esHandle=*0x%x)", esHandle);
return CELL_OK;
}
error_code _CellDmuxCoreOpResetStreamAndWaitDone(vm::ptr<void> handle)
{
cellDmuxPamf.todo("_CellDmuxCoreOpResetStreamAndWaitDone(handle=*0x%x)", handle);
return CELL_OK;
}
static void init_gvar(const vm::gvar<CellDmuxCoreOps>& var)
{
var->queryAttr.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpQueryAttr)));
var->open.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpOpen)));
var->close.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpClose)));
var->resetStream.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpResetStream)));
var->createThread.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpCreateThread)));
var->joinThread.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpJoinThread)));
var->freeMemory.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpFreeMemory)));
var->disableEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpDisableEs)));
var->flushEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpFlushEs)));
var->resetEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpResetEs)));
var->resetStreamAndWaitDone.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpResetStreamAndWaitDone)));
}
DECLARE(ppu_module_manager::cellDmuxPamf)("cellDmuxPamf", []
{
REG_VNID(cellDmuxPamf, 0x28b2b7b2, g_cell_dmux_core_ops_pamf).init = []
{
g_cell_dmux_core_ops_pamf->setStream.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpSetStream<false>)));
g_cell_dmux_core_ops_pamf->queryEsAttr.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpQueryEsAttr<false>)));
g_cell_dmux_core_ops_pamf->enableEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpEnableEs<false>)));
init_gvar(g_cell_dmux_core_ops_pamf);
};
REG_VNID(cellDmuxPamf, 0x9728a0e9, g_cell_dmux_core_ops_raw_es).init = []
{
g_cell_dmux_core_ops_raw_es->setStream.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpSetStream<true>)));
g_cell_dmux_core_ops_raw_es->queryEsAttr.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpQueryEsAttr<true>)));
g_cell_dmux_core_ops_raw_es->enableEs.set(g_fxo->get<ppu_function_manager>().func_addr(FIND_FUNC(_CellDmuxCoreOpEnableEs<true>)));
init_gvar(g_cell_dmux_core_ops_raw_es);
};
REG_HIDDEN_FUNC(_CellDmuxCoreOpQueryAttr);
REG_HIDDEN_FUNC(_CellDmuxCoreOpOpen);
REG_HIDDEN_FUNC(_CellDmuxCoreOpClose);
REG_HIDDEN_FUNC(_CellDmuxCoreOpResetStream);
REG_HIDDEN_FUNC(_CellDmuxCoreOpCreateThread);
REG_HIDDEN_FUNC(_CellDmuxCoreOpJoinThread);
REG_HIDDEN_FUNC(_CellDmuxCoreOpSetStream<false>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpSetStream<true>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpFreeMemory);
REG_HIDDEN_FUNC(_CellDmuxCoreOpQueryEsAttr<false>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpQueryEsAttr<true>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpEnableEs<false>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpEnableEs<true>);
REG_HIDDEN_FUNC(_CellDmuxCoreOpDisableEs);
REG_HIDDEN_FUNC(_CellDmuxCoreOpFlushEs);
REG_HIDDEN_FUNC(_CellDmuxCoreOpResetEs);
REG_HIDDEN_FUNC(_CellDmuxCoreOpResetStreamAndWaitDone);
});

View File

@ -0,0 +1,15 @@
#pragma once
struct CellDmuxPamfAttr
{
be_t<u32> maxEnabledEsNum;
be_t<u32> version;
be_t<u32> memSize;
};
struct CellDmuxPamfEsAttr
{
be_t<u32> auQueueMaxSize;
be_t<u32> memSize;
be_t<u32> specificInfoSize;
};

View File

@ -199,6 +199,7 @@ static void ppu_initialize_modules(ppu_linkage_info* link, utils::serial* ar = n
&ppu_module_manager::cellDaisy,
&ppu_module_manager::cellDDPdec,
&ppu_module_manager::cellDmux,
&ppu_module_manager::cellDmuxPamf,
&ppu_module_manager::cellDtcpIpUtility,
&ppu_module_manager::cellDTSdec,
&ppu_module_manager::cellDTSHDCOREdec,

View File

@ -184,6 +184,7 @@ public:
static const ppu_static_module cellDaisy;
static const ppu_static_module cellDDPdec;
static const ppu_static_module cellDmux;
static const ppu_static_module cellDmuxPamf;
static const ppu_static_module cellDtcpIpUtility;
static const ppu_static_module cellDTSdec;
static const ppu_static_module cellDTSHDCOREdec;

View File

@ -300,6 +300,7 @@
<ClCompile Include="Emu\Cell\Modules\cellCrossController.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellDaisy.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellDmux.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellDmuxPamf.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellDtcpIpUtility.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellFiber.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellFont.cpp" />
@ -820,6 +821,7 @@
<ClInclude Include="Emu\Cell\Modules\cellBgdl.h" />
<ClInclude Include="Emu\Cell\Modules\cellCamera.h" />
<ClInclude Include="Emu\Cell\Modules\cellDmux.h" />
<ClInclude Include="Emu\Cell\Modules\cellDmuxPamf.h" />
<ClInclude Include="Emu\Cell\Modules\cellFiber.h" />
<ClInclude Include="Emu\Cell\Modules\cellFont.h" />
<ClInclude Include="Emu\Cell\Modules\cellFontFT.h" />

View File

@ -393,6 +393,9 @@
<ClCompile Include="Emu\Cell\Modules\cellDmux.cpp">
<Filter>Emu\Cell\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\Cell\Modules\cellDmuxPamf.cpp">
<Filter>Emu\Cell\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\Cell\Modules\cellDtcpIpUtility.cpp">
<Filter>Emu\Cell\Modules</Filter>
</ClCompile>
@ -1641,6 +1644,9 @@
<ClInclude Include="Emu\Cell\Modules\cellDmux.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellDmuxPamf.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellFiber.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>