2014-07-12 09:46:14 +02:00
|
|
|
#include "stdafx.h"
|
2016-03-21 20:43:03 +01:00
|
|
|
#include "Emu/Cell/PPUModule.h"
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2017-07-21 17:41:11 +02:00
|
|
|
#include "cellSubDisplay.h"
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2017-07-21 17:41:11 +02:00
|
|
|
logs::channel cellSubDisplay("cellSubDisplay");
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
template<>
|
|
|
|
|
void fmt_class_string<CellSubDisplayError>::format(std::string& out, u64 arg)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-05-15 13:30:14 +02:00
|
|
|
format_enum(out, arg, [](auto error)
|
|
|
|
|
{
|
|
|
|
|
switch (error)
|
|
|
|
|
{
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_FATAL);
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_NOT_FOUND);
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_INVALID_VALUE);
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_NOT_INITIALIZED);
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_SET_SAMPLE);
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_AUDIOOUT_IS_BUSY);
|
|
|
|
|
STR_CASE(CELL_SUBDISPLAY_ERROR_ZERO_REGISTERED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return unknown;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
error_code cellSubDisplayInit(vm::ptr<CellSubDisplayParam> pParam, vm::ptr<CellSubDisplayHandler> func, vm::ptr<void> userdata, u32 container)
|
|
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayInit(pParam=*0x%x, func=*0x%x, userdata=*0x%x, container=0x%x)", pParam, func, userdata, container);
|
2018-05-03 21:48:23 +02:00
|
|
|
return CELL_SUBDISPLAY_ERROR_ZERO_REGISTERED;
|
2013-09-28 04:36:57 +02:00
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayEnd()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayEnd()");
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayGetRequiredMemory(vm::ptr<CellSubDisplayParam> pParam)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.warning("cellSubDisplayGetRequiredMemory(pParam=*0x%x)", pParam);
|
2014-12-30 21:15:00 +01:00
|
|
|
|
2017-07-21 17:41:11 +02:00
|
|
|
switch (pParam->version)
|
2014-12-30 21:15:00 +01:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
case CELL_SUBDISPLAY_VERSION_0001: return not_an_error(CELL_SUBDISPLAY_0001_MEMORY_CONTAINER_SIZE);
|
|
|
|
|
case CELL_SUBDISPLAY_VERSION_0002: return not_an_error(CELL_SUBDISPLAY_0002_MEMORY_CONTAINER_SIZE);
|
|
|
|
|
case CELL_SUBDISPLAY_VERSION_0003: return not_an_error(CELL_SUBDISPLAY_0003_MEMORY_CONTAINER_SIZE);
|
2014-12-30 21:15:00 +01:00
|
|
|
}
|
2017-07-21 17:41:11 +02:00
|
|
|
|
|
|
|
|
return CELL_SUBDISPLAY_ERROR_INVALID_VALUE;
|
2013-09-28 04:36:57 +02:00
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayStart()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayStart()");
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayStop()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayStop()");
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayGetVideoBuffer(s32 groupId, vm::pptr<void> ppVideoBuf, vm::ptr<u32> pSize)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayGetVideoBuffer(groupId=%d, ppVideoBuf=**0x%x, pSize=*0x%x)", groupId, ppVideoBuf, pSize);
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayAudioOutBlocking(s32 groupId, vm::ptr<void> pvData, s32 samples)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayAudioOutBlocking(groupId=%d, pvData=*0x%x, samples=%d)", groupId, pvData, samples);
|
2017-05-15 13:30:14 +02:00
|
|
|
|
|
|
|
|
if (samples % 1024)
|
|
|
|
|
{
|
|
|
|
|
return CELL_SUBDISPLAY_ERROR_SET_SAMPLE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayAudioOutNonBlocking(s32 groupId, vm::ptr<void> pvData, s32 samples)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayAudioOutNonBlocking(groupId=%d, pvData=*0x%x, samples=%d)", groupId, pvData, samples);
|
2017-05-15 13:30:14 +02:00
|
|
|
|
|
|
|
|
if (samples % 1024)
|
|
|
|
|
{
|
|
|
|
|
return CELL_SUBDISPLAY_ERROR_SET_SAMPLE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayGetPeerNum(s32 groupId)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayGetPeerNum(groupId=%d)", groupId);
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
error_code cellSubDisplayGetPeerList(s32 groupId, vm::ptr<CellSubDisplayPeerInfo> pInfo, vm::ptr<s32> pNum)
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-07-21 17:41:11 +02:00
|
|
|
cellSubDisplay.todo("cellSubDisplayGetPeerList(groupId=%d, pInfo=*0x%x, pNum=*0x%x)", groupId, pInfo, pNum);
|
2017-05-15 13:30:14 +02:00
|
|
|
|
|
|
|
|
*pNum = 0;
|
|
|
|
|
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-21 17:41:11 +02:00
|
|
|
error_code cellSubDisplayGetTouchInfo(s32 groupId, vm::ptr<CellSubDisplayTouchInfo> pTouchInfo, vm::ptr<s32> pNumTouchInfo)
|
|
|
|
|
{
|
|
|
|
|
cellSubDisplay.todo("cellSubDisplayGetTouchInfo(groupId=%d, pTouchInfo=*0x%x, pNumTouchInfo=*0x%x)", groupId, pTouchInfo, pNumTouchInfo);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DECLARE(ppu_module_manager::cellSubDisplay)("cellSubDisplay", []()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2017-05-15 13:30:14 +02:00
|
|
|
// Initialization / Termination Functions
|
2017-07-21 17:41:11 +02:00
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayInit);
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayEnd);
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayGetRequiredMemory);
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayStart);
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayStop);
|
2015-02-20 14:58:40 +01:00
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
// Data Setting Functions
|
2017-07-21 17:41:11 +02:00
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayGetVideoBuffer);
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayAudioOutBlocking);
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayAudioOutNonBlocking);
|
2015-02-20 14:58:40 +01:00
|
|
|
|
2017-05-15 13:30:14 +02:00
|
|
|
// Peer Status Acquisition Functions
|
2017-07-21 17:41:11 +02:00
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayGetPeerNum);
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayGetPeerList);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
REG_FUNC(cellSubDisplay, cellSubDisplayGetTouchInfo);
|
2015-02-18 17:22:06 +01:00
|
|
|
});
|