mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
Implement cellPngDecCreate/Destroy()
This commit is contained in:
parent
f545ba08cb
commit
141d8e20ec
1 changed files with 31 additions and 2 deletions
|
@ -3,19 +3,48 @@
|
||||||
#include "Emu/SysCalls/SC_FUNC.h"
|
#include "Emu/SysCalls/SC_FUNC.h"
|
||||||
#include "cellPngDec.h"
|
#include "cellPngDec.h"
|
||||||
#include "stblib/stb_image.h"
|
#include "stblib/stb_image.h"
|
||||||
|
#include <map>
|
||||||
|
|
||||||
void cellPngDec_init();
|
void cellPngDec_init();
|
||||||
Module cellPngDec(0x0018, cellPngDec_init);
|
Module cellPngDec(0x0018, cellPngDec_init);
|
||||||
|
|
||||||
|
static std::map<u32, CellPngDecMainHandle *> cellPngDecMap;
|
||||||
|
|
||||||
|
CellPngDecMainHandle *getCellPngDecCtx(u32 mainHandle) {
|
||||||
|
if (cellPngDecMap.find(mainHandle) == cellPngDecMap.end())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return cellPngDecMap[mainHandle];
|
||||||
|
}
|
||||||
|
|
||||||
int cellPngDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam)
|
int cellPngDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellPngDec);
|
cellPngDec.Error("cellPngDecCreate(mainHandle=0x%x, threadInParam=0x%x, threadOutParam=0x%x)", mainHandle, threadInParam, threadOutParam);
|
||||||
|
CellPngDecMainHandle *ctx = new CellPngDecMainHandle;
|
||||||
|
if (cellPngDecMap.find(mainHandle) != cellPngDecMap.end()) {
|
||||||
|
delete cellPngDecMap[mainHandle];
|
||||||
|
cellPngDecMap.erase(mainHandle);
|
||||||
|
}
|
||||||
|
cellPngDecMap[mainHandle] = ctx;
|
||||||
|
|
||||||
|
ctx->threadInParam = threadInParam;
|
||||||
|
ctx->threadOutParam = threadOutParam;
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellPngDecDestroy(u32 mainHandle)
|
int cellPngDecDestroy(u32 mainHandle)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellPngDec);
|
cellPngDec.Error("cellPngDecDestroy(mainHandle=0x%x)", mainHandle);
|
||||||
|
CellPngDecMainHandle *ctx = getCellPngDecCtx(mainHandle);
|
||||||
|
if (!ctx) {
|
||||||
|
cellPngDec.Warning("cellPngDecCreate(mainHandle=0x%x): bad handle", mainHandle);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete ctx;
|
||||||
|
cellPngDecMap.erase(mainHandle);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue