HLE: stub cellCelpEnc and cellCelp8Enc

This commit is contained in:
Megamouse 2019-11-16 23:31:23 +01:00
parent ca59ab59e9
commit 41505117a7
4 changed files with 213 additions and 61 deletions

View file

@ -1,63 +1,80 @@
#include "stdafx.h" #include "stdafx.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUModule.h" #include "Emu/Cell/PPUModule.h"
#include "cellCelp8Enc.h" #include "cellCelp8Enc.h"
LOG_CHANNEL(cellCelp8Enc); LOG_CHANNEL(cellCelp8Enc);
template <>
s32 cellCelp8EncQueryAttr() void fmt_class_string<CellCelp8EncError>::format(std::string& out, u64 arg)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); format_enum(out, arg, [](CellCelp8EncError value)
{
switch (value)
{
STR_CASE(CELL_CELP8ENC_ERROR_FAILED);
STR_CASE(CELL_CELP8ENC_ERROR_SEQ);
STR_CASE(CELL_CELP8ENC_ERROR_ARG);
STR_CASE(CELL_CELP8ENC_ERROR_CORE_FAILED);
STR_CASE(CELL_CELP8ENC_ERROR_CORE_SEQ);
STR_CASE(CELL_CELP8ENC_ERROR_CORE_ARG);
}
return unknown;
});
}
error_code cellCelp8EncQueryAttr(vm::ptr<CellCelp8EncAttr> attr)
{
cellCelp8Enc.todo("cellCelp8EncQueryAttr(attr=*0x%x)", attr);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncOpen() error_code cellCelp8EncOpen(vm::ptr<CellCelp8EncResource> res, vm::pptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncOpen(res=*0x%x, handle=*0x%x)", res, handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncOpenEx() error_code cellCelp8EncOpenEx(vm::ptr<CellCelp8EncResource> res, vm::pptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncOpenEx(res=*0x%x, handle=*0x%x)", res, handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncClose() error_code cellCelp8EncClose(vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncClose(handle=*0x%x)", handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncStart() error_code cellCelp8EncStart(vm::ptr<void> handle, vm::ptr<CellCelp8EncParam> param)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncStart(handle=*0x%x, param=*0x%x)", handle, param);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncEnd() error_code cellCelp8EncEnd(vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncEnd(handle=*0x%x)", handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncEncodeFrame() error_code cellCelp8EncEncodeFrame(vm::ptr<void> handle, vm::ptr<CellCelp8EncPcmInfo> frameInfo)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncEncodeFrame(handle=*0x%x, frameInfo=*0x%x)", handle, frameInfo);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncWaitForOutput() error_code cellCelp8EncWaitForOutput(vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncWaitForOutput(handle=*0x%x)", handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelp8EncGetAu() error_code cellCelp8EncGetAu(vm::ptr<void> handle, vm::ptr<void> outBuffer, vm::ptr<CellCelp8EncAuInfo> auItem)
{ {
UNIMPLEMENTED_FUNC(cellCelp8Enc); cellCelp8Enc.todo("cellCelp8EncGetAu(handle=*0x%x, outBuffer=*0x%x, auItem=*0x%x)", handle, outBuffer, auItem);
return CELL_OK; return CELL_OK;
} }

View file

@ -1,11 +1,13 @@
#pragma once #pragma once
struct CellSpurs;
// libCelp8Enc = 0x806140a1 - 0x806140bf // libCelp8Enc = 0x806140a1 - 0x806140bf
// typedef void* CellCelp8EncHandle;
// Return Codes // Return Codes
enum enum CellCelp8EncError : u32
{ {
CELL_CELP8ENC_ERROR_FAILED = 0x806140a1, CELL_CELP8ENC_ERROR_FAILED = 0x806140a1,
CELL_CELP8ENC_ERROR_SEQ = 0x806140a2, CELL_CELP8ENC_ERROR_SEQ = 0x806140a2,
@ -16,12 +18,8 @@ enum
}; };
// Definitions // Definitions
enum enum CELL_CELP8ENC_MPE_CONFIG
{ {
CELL_CELP8ENC_FS_8kHz = 1,
CELL_CELP8ENC_EXCITATION_MODE_MPE = 0,
CELL_CELP8ENC_MPE_CONFIG_0 = 0, CELL_CELP8ENC_MPE_CONFIG_0 = 0,
CELL_CELP8ENC_MPE_CONFIG_2 = 2, CELL_CELP8ENC_MPE_CONFIG_2 = 2,
CELL_CELP8ENC_MPE_CONFIG_6 = 6, CELL_CELP8ENC_MPE_CONFIG_6 = 6,
@ -32,6 +30,66 @@ enum
CELL_CELP8ENC_MPE_CONFIG_21 = 21, CELL_CELP8ENC_MPE_CONFIG_21 = 21,
CELL_CELP8ENC_MPE_CONFIG_24 = 24, CELL_CELP8ENC_MPE_CONFIG_24 = 24,
CELL_CELP8ENC_MPE_CONFIG_26 = 26, CELL_CELP8ENC_MPE_CONFIG_26 = 26,
};
enum CELL_CELP8ENC_SAMPEL_RATE
{
CELL_CELP8ENC_FS_8kHz = 1,
};
enum CELL_CELP8ENC_EXCITATION_MODE
{
CELL_CELP8ENC_EXCITATION_MODE_MPE = 0,
};
enum CELL_CELP8ENC_WORD_SZ
{
CELL_CELP8ENC_WORD_SZ_FLOAT, CELL_CELP8ENC_WORD_SZ_FLOAT,
}; };
struct CellCelp8EncAttr
{
be_t<u32> workMemSize;
be_t<u32> celpEncVerUpper;
be_t<u32> celpEncVerLower;
};
struct CellCelp8EncResource
{
be_t<u32> totalMemSize;
vm::bptr<void> startAddr;
be_t<u32> ppuThreadPriority;
be_t<u32> spuThreadPriority;
be_t<u32/*size_t*/> ppuThreadStackSize;
};
struct CellCelp8EncParam
{
be_t<u32> excitationMode;
be_t<u32> sampleRate;
be_t<u32> configuration;
be_t<u32> wordSize;
vm::bptr<u8> outBuff;
be_t<u32> outSize;
};
struct CellCelp8EncAuInfo
{
vm::bptr<void> startAddr;
be_t<u32> size;
};
struct CellCelp8EncPcmInfo
{
vm::bptr<void> startAddr;
be_t<u32> size;
};
struct CellCelp8EncResourceEx
{
be_t<u32> totalMemSize;
vm::bptr<void> startAddr;
vm::bptr<CellSpurs> spurs;
u8 priority[8];
be_t<u32> maxContention;
};

View file

@ -1,67 +1,86 @@
#include "stdafx.h" #include "stdafx.h"
#include "Emu/Cell/PPUModule.h" #include "Emu/Cell/PPUModule.h"
#include "cellCelpEnc.h" #include "cellCelpEnc.h"
LOG_CHANNEL(cellCelpEnc); LOG_CHANNEL(cellCelpEnc);
s32 cellCelpEncQueryAttr() template <>
void fmt_class_string<CellCelpEncError>::format(std::string& out, u64 arg)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); format_enum(out, arg, [](CellCelpEncError value)
{
switch (value)
{
STR_CASE(CELL_CELPENC_ERROR_FAILED);
STR_CASE(CELL_CELPENC_ERROR_SEQ);
STR_CASE(CELL_CELPENC_ERROR_ARG);
STR_CASE(CELL_CELPENC_ERROR_CORE_FAILED);
STR_CASE(CELL_CELPENC_ERROR_CORE_SEQ);
STR_CASE(CELL_CELPENC_ERROR_CORE_ARG);
}
return unknown;
});
}
error_code cellCelpEncQueryAttr(vm::ptr<CellCelpEncAttr> attr)
{
cellCelpEnc.todo("cellCelpEncQueryAttr(attr=*0x%x)", attr);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncOpen() error_code cellCelpEncOpen(vm::ptr<CellCelpEncResource> res, vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncOpen(res=*0x%x ,attr=*0x%x)", res, handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncOpenEx() error_code cellCelpEncOpenEx(vm::ptr<CellCelpEncResourceEx> res, vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncOpenEx(res=*0x%x ,attr=*0x%x)", res, handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncOpenExt() error_code cellCelpEncOpenExt()
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncOpenExt()");
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncClose() error_code cellCelpEncClose(vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncClose(handle=*0x%x)", handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncStart() error_code cellCelpEncStart(vm::ptr<void> handle, vm::ptr<CellCelpEncParam> param)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncStart(handle=*0x%x, attr=*0x%x)", handle, param);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncEnd() error_code cellCelpEncEnd(vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncEnd(handle=*0x%x)", handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncEncodeFrame() error_code cellCelpEncEncodeFrame(vm::ptr<void> handle, vm::ptr<CellCelpEncPcmInfo> frameInfo)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncEncodeFrame(handle=*0x%x, frameInfo=*0x%x)", handle, frameInfo);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncWaitForOutput() error_code cellCelpEncWaitForOutput(vm::ptr<void> handle)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncWaitForOutput(handle=*0x%x)", handle);
return CELL_OK; return CELL_OK;
} }
s32 cellCelpEncGetAu() error_code cellCelpEncGetAu(vm::ptr<void> handle, vm::ptr<void> outBuffer, vm::ptr<CellCelpEncAuInfo> auItem)
{ {
UNIMPLEMENTED_FUNC(cellCelpEnc); cellCelpEnc.todo("cellCelpEncGetAu(handle=*0x%x, outBuffer=*0x%x, auItem=*0x%x)", handle, outBuffer, auItem);
return CELL_OK; return CELL_OK;
} }

View file

@ -1,11 +1,13 @@
#pragma once #pragma once
struct CellSpurs;
// libCelpEnc = 0x80614001 - 0x806140ff // libCelpEnc = 0x80614001 - 0x806140ff
// typedef void* CellCelpEncHandle;
// Return Codes // Return Codes
enum enum CellCelpEncError : u32
{ {
CELL_CELPENC_ERROR_FAILED = 0x80614001, CELL_CELPENC_ERROR_FAILED = 0x80614001,
CELL_CELPENC_ERROR_SEQ = 0x80614002, CELL_CELPENC_ERROR_SEQ = 0x80614002,
@ -16,17 +18,73 @@ enum
}; };
// Definitions // Definitions
enum enum CELL_CELPENC_RPE_CONFIG
{ {
CELL_CELPENC_FS_16kHz = 2,
CELL_CELPENC_EXCITATION_MODE_RPE = 1,
CELL_CELPENC_RPE_CONFIG_0, CELL_CELPENC_RPE_CONFIG_0,
CELL_CELPENC_RPE_CONFIG_1, CELL_CELPENC_RPE_CONFIG_1,
CELL_CELPENC_RPE_CONFIG_2, CELL_CELPENC_RPE_CONFIG_2,
CELL_CELPENC_RPE_CONFIG_3, CELL_CELPENC_RPE_CONFIG_3,
};
CELL_CELPENC_WORD_SZ_INI16_LE,
CELL_CELPENC_WORD_SZ_FLOAT, enum CELL_CELPENC_SAMPEL_RATE
{
CELL_CELPENC_FS_16kHz = 2,
};
enum CELL_CELPENC_EXCITATION_MODE
{
CELL_CELPENC_EXCITATION_MODE_RPE = 1,
};
enum CELL_CELPENC_WORD_SZ
{
CELL_CELPENC_WORD_SZ_INT16_LE,
CELL_CELPENC_WORD_SZ_FLOAT
};
struct CellCelpEncAttr
{
be_t<u32> workMemSize;
be_t<u32> celpEncVerUpper;
be_t<u32> celpEncVerLower;
};
struct CellCelpEncResource
{
be_t<u32> totalMemSize;
vm::bptr<void> startAddr;
be_t<u32> ppuThreadPriority;
be_t<u32> spuThreadPriority;
be_t<u32/*size_t*/> ppuThreadStackSize;
};
struct CellCelpEncParam
{
be_t<u32> excitationMode;
be_t<u32> sampleRate;
be_t<u32> configuration;
be_t<u32> wordSize;
vm::bptr<u8> outBuff;
be_t<u32> outSize;
};
struct CellCelpEncAuInfo
{
vm::bptr<void> startAddr;
be_t<u32> size;
};
struct CellCelpEncPcmInfo
{
vm::bptr<void> startAddr;
be_t<u32> size;
};
struct CellCelpEncResourceEx
{
be_t<u32> totalMemSize;
vm::bptr<void> startAddr;
vm::bptr<CellSpurs> spurs;
u8 priority[8];
be_t<u32> maxContention;
}; };