mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
cellCelp8Enc, cellCelpEnc module added
This commit is contained in:
parent
06ef95fbea
commit
13a5a96117
@ -8,6 +8,8 @@ extern Module cellAtracMulti;
|
||||
extern Module cellAudio;
|
||||
extern Module cellAvconfExt;
|
||||
extern Module cellCamera;
|
||||
extern Module cellCelp8Enc;
|
||||
extern Module cellCelpEnc;
|
||||
extern Module cellDmux;
|
||||
extern Module cellFiber;
|
||||
extern Module cellFont;
|
||||
@ -136,7 +138,7 @@ static const g_module_list[] =
|
||||
{ 0x0045, "sceNpTus", &sceNpTus },
|
||||
{ 0x0046, "cellVoice", &cellVoice },
|
||||
{ 0x0047, "cellAdecCelp8", nullptr },
|
||||
{ 0x0048, "cellCelp8Enc", nullptr },
|
||||
{ 0x0048, "cellCelp8Enc", &cellCelp8Enc },
|
||||
{ 0x0049, "cellLicenseArea", nullptr },
|
||||
{ 0x004a, "cellMusic2", nullptr },
|
||||
{ 0x004e, "cellScreenShotUtility", &cellScreenshot },
|
||||
@ -149,7 +151,7 @@ static const g_module_list[] =
|
||||
{ 0x0057, "cellRudp", &cellRudp },
|
||||
{ 0x0059, "sceNpSns", &sceNpSns },
|
||||
{ 0x005a, "libgem", &cellGem },
|
||||
{ 0xf00a, "cellCelpEnc", nullptr },
|
||||
{ 0xf00a, "cellCelpEnc", &cellCelpEnc },
|
||||
{ 0xf010, "cellGifDec", &cellGifDec },
|
||||
{ 0xf019, "cellAdecCelp", nullptr },
|
||||
{ 0xf01b, "cellAdecM2bc", nullptr },
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "stdafx.h"
|
||||
#if 0
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
|
||||
void cellCelp8Enc_init();
|
||||
Module cellCelp8Enc(0x0048, cellCelp8Enc_init);
|
||||
extern Module cellCelp8Enc;
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
@ -15,61 +16,61 @@ enum
|
||||
CELL_CELP8ENC_ERROR_CORE_ARG = 0x806140b3,
|
||||
};
|
||||
|
||||
int cellCelp8EncQueryAttr()
|
||||
s32 cellCelp8EncQueryAttr()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncOpen()
|
||||
s32 cellCelp8EncOpen()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncOpenEx()
|
||||
s32 cellCelp8EncOpenEx()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncClose()
|
||||
s32 cellCelp8EncClose()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncStart()
|
||||
s32 cellCelp8EncStart()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncEnd()
|
||||
s32 cellCelp8EncEnd()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncEncodeFrame()
|
||||
s32 cellCelp8EncEncodeFrame()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncWaitForOutput()
|
||||
s32 cellCelp8EncWaitForOutput()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelp8EncGetAu()
|
||||
s32 cellCelp8EncGetAu()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelp8Enc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void cellCelp8Enc_init()
|
||||
Module cellCelp8Enc("cellCelp8Enc", []()
|
||||
{
|
||||
REG_FUNC(cellCelp8Enc, cellCelp8EncQueryAttr);
|
||||
REG_FUNC(cellCelp8Enc, cellCelp8EncOpen);
|
||||
@ -80,5 +81,4 @@ void cellCelp8Enc_init()
|
||||
REG_FUNC(cellCelp8Enc, cellCelp8EncEncodeFrame);
|
||||
REG_FUNC(cellCelp8Enc, cellCelp8EncWaitForOutput);
|
||||
REG_FUNC(cellCelp8Enc, cellCelp8EncGetAu);
|
||||
}
|
||||
#endif
|
||||
});
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "stdafx.h"
|
||||
#if 0
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
|
||||
void cellCelpEnc_init();
|
||||
Module cellCelpEnc(0xf00a, cellCelpEnc_init);
|
||||
extern Module cellCelpEnc;
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
@ -15,61 +16,61 @@ enum
|
||||
CELL_CELPENC_ERROR_CORE_ARG = 0x80614083,
|
||||
};
|
||||
|
||||
int cellCelpEncQueryAttr()
|
||||
s32 cellCelpEncQueryAttr()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncOpen()
|
||||
s32 cellCelpEncOpen()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncOpenEx()
|
||||
s32 cellCelpEncOpenEx()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncClose()
|
||||
s32 cellCelpEncClose()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncStart()
|
||||
s32 cellCelpEncStart()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncEnd()
|
||||
s32 cellCelpEncEnd()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncEncodeFrame()
|
||||
s32 cellCelpEncEncodeFrame()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncWaitForOutput()
|
||||
s32 cellCelpEncWaitForOutput()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellCelpEncGetAu()
|
||||
s32 cellCelpEncGetAu()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellCelpEnc);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void cellCelpEnc_init()
|
||||
Module cellCelpEnc("cellCelpEnc", []()
|
||||
{
|
||||
REG_FUNC(cellCelpEnc, cellCelpEncQueryAttr);
|
||||
REG_FUNC(cellCelpEnc, cellCelpEncOpen);
|
||||
@ -80,5 +81,4 @@ void cellCelpEnc_init()
|
||||
REG_FUNC(cellCelpEnc, cellCelpEncEncodeFrame);
|
||||
REG_FUNC(cellCelpEnc, cellCelpEncWaitForOutput);
|
||||
REG_FUNC(cellCelpEnc, cellCelpEncGetAu);
|
||||
}
|
||||
#endif
|
||||
});
|
||||
|
@ -8,19 +8,23 @@
|
||||
|
||||
extern Module cellFont;
|
||||
|
||||
std::unique_ptr<CellFontInternal> g_font;
|
||||
struct font_instance_t
|
||||
{
|
||||
std::atomic<bool> init{ false };
|
||||
}
|
||||
g_font;
|
||||
|
||||
// Functions
|
||||
s32 cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr<CellFontConfig> config)
|
||||
{
|
||||
cellFont.Warning("cellFontInitializeWithRevision(revisionFlags=0x%llx, config=*0x%x)", revisionFlags, config);
|
||||
|
||||
if (g_font->m_bInitialized)
|
||||
if (g_font.init.load())
|
||||
{
|
||||
return CELL_FONT_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
if (config->FileCache.size < 24)
|
||||
if (config->fc_size < 24)
|
||||
{
|
||||
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
@ -30,11 +34,11 @@ s32 cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr<CellFontConfig> co
|
||||
cellFont.Error("cellFontInitializeWithRevision: Unknown flags (0x%x)", config->flags);
|
||||
}
|
||||
|
||||
g_font->m_buffer_addr = config->FileCache.buffer_addr;
|
||||
g_font->m_buffer_size = config->FileCache.size;
|
||||
g_font->m_userFontEntrys_addr = config->userFontEntrys_addr;
|
||||
g_font->m_userFontEntryMax = config->userFontEntryMax;
|
||||
g_font->m_bInitialized = true;
|
||||
if (g_font.init.exchange(true))
|
||||
{
|
||||
throw EXCEPTION("Unexpected");
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -44,11 +48,11 @@ s32 cellFontGetRevisionFlags(vm::ptr<u64> revisionFlags)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellFontInit(PPUThread& CPU, vm::ptr<CellFontConfig> config)
|
||||
s32 cellFontInit(PPUThread& ppu, vm::ptr<CellFontConfig> config)
|
||||
{
|
||||
cellFont.Warning("cellFontInit(config=*0x%x)", config);
|
||||
|
||||
vm::stackvar<be_t<u64>> revisionFlags(CPU);
|
||||
vm::stackvar<be_t<u64>> revisionFlags(ppu);
|
||||
revisionFlags.value() = 0;
|
||||
cellFontGetRevisionFlags(revisionFlags);
|
||||
|
||||
@ -59,12 +63,15 @@ s32 cellFontEnd()
|
||||
{
|
||||
cellFont.Warning("cellFontEnd()");
|
||||
|
||||
if (!g_font->m_bInitialized)
|
||||
if (!g_font.init.load())
|
||||
{
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
}
|
||||
|
||||
g_font->m_bInitialized = false;
|
||||
if (!g_font.init.exchange(false))
|
||||
{
|
||||
throw EXCEPTION("Unexpected");
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -79,7 +86,7 @@ s32 cellFontOpenFontMemory(vm::ptr<CellFontLibrary> library, u32 fontAddr, u32 f
|
||||
{
|
||||
cellFont.Warning("cellFontOpenFontMemory(library=*0x%x, fontAddr=0x%x, fontSize=%d, subNum=%d, uniqueId=%d, font=*0x%x)", library, fontAddr, fontSize, subNum, uniqueId, font);
|
||||
|
||||
if (!g_font->m_bInitialized)
|
||||
if (!g_font.init.load())
|
||||
{
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
}
|
||||
@ -115,11 +122,11 @@ s32 cellFontOpenFontFile(vm::ptr<CellFontLibrary> library, vm::cptr<char> fontPa
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 cellFontOpenFontset(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
|
||||
s32 cellFontOpenFontset(PPUThread& ppu, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
|
||||
{
|
||||
cellFont.Warning("cellFontOpenFontset(library=*0x%x, fontType=*0x%x, font=*0x%x)", library, fontType, font);
|
||||
|
||||
if (!g_font->m_bInitialized)
|
||||
if (!g_font.init.load())
|
||||
{
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
}
|
||||
@ -195,7 +202,7 @@ s32 cellFontOpenFontset(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::pt
|
||||
return CELL_FONT_ERROR_NO_SUPPORT_FONTSET;
|
||||
}
|
||||
|
||||
vm::stackvar<char> f(CPU, (u32)file.length() + 1, 1);
|
||||
vm::stackvar<char> f(ppu, (u32)file.length() + 1, 1);
|
||||
memcpy(f.get_ptr(), file.c_str(), file.size() + 1);
|
||||
s32 ret = cellFontOpenFontFile(library, f, 0, 0, font); //TODO: Find the correct values of subNum, uniqueId
|
||||
font->origin = CELL_FONT_OPEN_FONTSET;
|
||||
@ -227,7 +234,7 @@ s32 cellFontCreateRenderer(vm::ptr<CellFontLibrary> library, vm::ptr<CellFontRen
|
||||
{
|
||||
cellFont.Todo("cellFontCreateRenderer(library=*0x%x, config=*0x%x, Renderer=*0x%x)", library, config, Renderer);
|
||||
|
||||
if (!g_font->m_bInitialized)
|
||||
if (!g_font.init.load())
|
||||
{
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
}
|
||||
@ -241,26 +248,21 @@ void cellFontRenderSurfaceInit(vm::ptr<CellFontRenderSurface> surface, vm::ptr<v
|
||||
{
|
||||
cellFont.Warning("cellFontRenderSurfaceInit(surface=*0x%x, buffer=*0x%x, bufferWidthByte=%d, pixelSizeByte=%d, w=%d, h=%d)", surface, buffer, bufferWidthByte, pixelSizeByte, w, h);
|
||||
|
||||
surface->buffer_addr = buffer.addr();
|
||||
surface->widthByte = bufferWidthByte;
|
||||
surface->pixelSizeByte = pixelSizeByte;
|
||||
surface->width = w;
|
||||
surface->height = h;
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
surface->buffer_addr = vm::alloc(bufferWidthByte * h, vm::main); // TODO: Huge memory leak
|
||||
}
|
||||
surface->buffer = buffer;
|
||||
surface->widthByte = bufferWidthByte;
|
||||
surface->pixelSizeByte = pixelSizeByte;
|
||||
surface->width = w;
|
||||
surface->height = h;
|
||||
}
|
||||
|
||||
void cellFontRenderSurfaceSetScissor(vm::ptr<CellFontRenderSurface> surface, s32 x0, s32 y0, s32 w, s32 h)
|
||||
{
|
||||
cellFont.Warning("cellFontRenderSurfaceSetScissor(surface=*0x%x, x0=%d, y0=%d, w=%d, h=%d)", surface, x0, y0, w, h);
|
||||
|
||||
surface->Scissor.x0 = x0;
|
||||
surface->Scissor.y0 = y0;
|
||||
surface->Scissor.x1 = w;
|
||||
surface->Scissor.y1 = h;
|
||||
surface->sc_x0 = x0;
|
||||
surface->sc_y0 = y0;
|
||||
surface->sc_x1 = w;
|
||||
surface->sc_y1 = h;
|
||||
}
|
||||
|
||||
s32 cellFontSetScalePixel(vm::ptr<CellFont> font, float w, float h)
|
||||
@ -374,7 +376,7 @@ s32 cellFontRenderCharGlyphImage(vm::ptr<CellFont> font, u32 code, vm::ptr<CellF
|
||||
baseLineY = (int)((float)ascent * scale); // ???
|
||||
|
||||
// Move the rendered character to the surface
|
||||
unsigned char* buffer = vm::get_ptr<unsigned char>(surface->buffer_addr);
|
||||
unsigned char* buffer = vm::get_ptr<unsigned char>(surface->buffer.addr());
|
||||
for (u32 ypos = 0; ypos < (u32)height; ypos++)
|
||||
{
|
||||
if ((u32)y + ypos + yoff + baseLineY >= surface->height)
|
||||
@ -457,12 +459,12 @@ s32 cellFontGetCharGlyphMetrics(vm::ptr<CellFont> font, u32 code, vm::ptr<CellFo
|
||||
// TODO: Add the rest of the information
|
||||
metrics->width = (x1-x0) * scale;
|
||||
metrics->height = (y1-y0) * scale;
|
||||
metrics->Horizontal.bearingX = (float)leftSideBearing * scale;
|
||||
metrics->Horizontal.bearingY = 0.f;
|
||||
metrics->Horizontal.advance = (float)advanceWidth * scale;
|
||||
metrics->Vertical.bearingX = 0.f;
|
||||
metrics->Vertical.bearingY = 0.f;
|
||||
metrics->Vertical.advance = 0.f;
|
||||
metrics->h_bearingX = (float)leftSideBearing * scale;
|
||||
metrics->h_bearingY = 0.f;
|
||||
metrics->h_advance = (float)advanceWidth * scale;
|
||||
metrics->v_bearingX = 0.f;
|
||||
metrics->v_bearingY = 0.f;
|
||||
metrics->v_advance = 0.f;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -473,11 +475,11 @@ s32 cellFontGraphicsSetFontRGBA()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellFontOpenFontsetOnMemory(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
|
||||
s32 cellFontOpenFontsetOnMemory(PPUThread& ppu, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
|
||||
{
|
||||
cellFont.Todo("cellFontOpenFontsetOnMemory(library=*0x%x, fontType=*0x%x, font=*0x%x)", library, fontType, font);
|
||||
|
||||
if (!g_font->m_bInitialized)
|
||||
if (!g_font.init.load())
|
||||
{
|
||||
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
}
|
||||
@ -632,7 +634,7 @@ s32 cellFontGetCharGlyphMetricsVertical()
|
||||
|
||||
Module cellFont("cellFont", []()
|
||||
{
|
||||
g_font = std::make_unique<CellFontInternal>();
|
||||
g_font.init = false;
|
||||
|
||||
REG_FUNC(cellFont, cellFontInit);
|
||||
REG_FUNC(cellFont, cellFontSetFontsetOpenMode);
|
||||
|
@ -32,21 +32,6 @@ enum
|
||||
CELL_FONT_ERROR_NO_SUPPORT_SURFACE = 0x80540040,
|
||||
};
|
||||
|
||||
struct CellFontLibrary
|
||||
{
|
||||
u32 libraryType, libraryVersion;
|
||||
//u32 SystemClosed[];
|
||||
};
|
||||
|
||||
struct CellFontMemoryInterface
|
||||
{
|
||||
u32 Object_addr; //void*
|
||||
//CellFontMallocCallback Malloc;
|
||||
//CellFontFreeCallback Free;
|
||||
//CellFontReallocCallback Realloc;
|
||||
//CellFontCallocCallback Calloc;
|
||||
};
|
||||
|
||||
// Font Set Types
|
||||
enum
|
||||
{
|
||||
@ -115,24 +100,6 @@ enum
|
||||
CELL_FONT_MAP_UNICODE = 1,
|
||||
};
|
||||
|
||||
struct CellFontConfig
|
||||
{
|
||||
struct
|
||||
{
|
||||
be_t<u32> buffer_addr;
|
||||
be_t<u32> size;
|
||||
} FileCache;
|
||||
|
||||
be_t<u32> userFontEntryMax;
|
||||
be_t<u32> userFontEntrys_addr;
|
||||
be_t<u32> flags;
|
||||
};
|
||||
|
||||
struct CellFontRenderer
|
||||
{
|
||||
void *systemReserved[64];
|
||||
};
|
||||
|
||||
//Custom enum to determine the origin of a CellFont object
|
||||
enum
|
||||
{
|
||||
@ -142,20 +109,46 @@ enum
|
||||
CELL_FONT_OPEN_MEMORY,
|
||||
};
|
||||
|
||||
struct stbtt_fontinfo;
|
||||
|
||||
struct CellFont
|
||||
using CellFontMallocCallback = vm::ptr<void>(vm::ptr<void> arg, u32 size);
|
||||
using CellFontFreeCallback = void(vm::ptr<void> arg, vm::ptr<void> ptr);
|
||||
using CellFontReallocCallback = vm::ptr<void>(vm::ptr<void> arg, vm::ptr<void> p, u32 reallocSize);
|
||||
using CellFontCallocCallback = vm::ptr<void>(vm::ptr<void> arg, u32 num, u32 size);
|
||||
|
||||
struct CellFontMemoryInterface
|
||||
{
|
||||
//void* SystemReserved[64];
|
||||
be_t<float> scale_x;
|
||||
be_t<float> scale_y;
|
||||
be_t<float> slant;
|
||||
be_t<u32> renderer_addr;
|
||||
vm::bptr<void> arg;
|
||||
vm::bptr<CellFontMallocCallback> malloc;
|
||||
vm::bptr<CellFontFreeCallback> free;
|
||||
vm::bptr<CellFontReallocCallback> realloc;
|
||||
vm::bptr<CellFontCallocCallback> calloc;
|
||||
};
|
||||
|
||||
be_t<u32> fontdata_addr;
|
||||
be_t<u32> origin;
|
||||
stbtt_fontinfo* stbfont;
|
||||
// hack: don't place anything after pointer
|
||||
struct CellFontEntry
|
||||
{
|
||||
be_t<u32> lock;
|
||||
be_t<u32> uniqueId;
|
||||
vm::bcptr<void> fontLib;
|
||||
vm::bptr<void> fontH;
|
||||
};
|
||||
|
||||
struct CellFontConfig
|
||||
{
|
||||
// FileCache
|
||||
vm::bptr<u32> fc_buffer;
|
||||
be_t<u32> fc_size;
|
||||
|
||||
be_t<u32> userFontEntryMax;
|
||||
vm::bptr<CellFontEntry> userFontEntrys;
|
||||
|
||||
be_t<u32> flags;
|
||||
};
|
||||
|
||||
struct CellFontLibrary
|
||||
{
|
||||
be_t<u32> libraryType;
|
||||
be_t<u32> libraryVersion;
|
||||
// ...
|
||||
};
|
||||
|
||||
struct CellFontType
|
||||
@ -164,119 +157,89 @@ struct CellFontType
|
||||
be_t<u32> map;
|
||||
};
|
||||
|
||||
struct CellFontInitGraphicsConfigGcm
|
||||
{
|
||||
be_t<u32> configType;
|
||||
|
||||
struct
|
||||
{
|
||||
be_t<u32> address;
|
||||
be_t<u32> size;
|
||||
} GraphicsMemory;
|
||||
|
||||
struct
|
||||
{
|
||||
be_t<u32> address;
|
||||
be_t<u32> size;
|
||||
} MappedMainMemory;
|
||||
|
||||
struct
|
||||
{
|
||||
be_t<s16> slotNumber;
|
||||
be_t<s16> slotCount;
|
||||
} VertexShader;
|
||||
};
|
||||
|
||||
struct CellFontGraphics
|
||||
{
|
||||
u32 graphicsType;
|
||||
u32 SystemClosed_addr;
|
||||
};
|
||||
|
||||
struct CellFontHorizontalLayout
|
||||
{
|
||||
be_t<float> baseLineY;
|
||||
be_t<float> lineHeight;
|
||||
be_t<float> effectHeight;
|
||||
be_t<f32> baseLineY;
|
||||
be_t<f32> lineHeight;
|
||||
be_t<f32> effectHeight;
|
||||
};
|
||||
|
||||
struct CellFontVerticalLayout
|
||||
{
|
||||
be_t<float> baseLineX;
|
||||
be_t<float> lineWidth;
|
||||
be_t<float> effectWidth;
|
||||
be_t<f32> baseLineX;
|
||||
be_t<f32> lineWidth;
|
||||
be_t<f32> effectWidth;
|
||||
};
|
||||
|
||||
struct CellFontGlyphMetrics
|
||||
{
|
||||
be_t<float> width;
|
||||
be_t<float> height;
|
||||
be_t<f32> width;
|
||||
be_t<f32> height;
|
||||
|
||||
struct
|
||||
{
|
||||
be_t<float> bearingX;
|
||||
be_t<float> bearingY;
|
||||
be_t<float> advance;
|
||||
} Horizontal;
|
||||
be_t<f32> h_bearingX;
|
||||
be_t<f32> h_bearingY;
|
||||
be_t<f32> h_advance;
|
||||
|
||||
struct
|
||||
{
|
||||
be_t<float> bearingX;
|
||||
be_t<float> bearingY;
|
||||
be_t<float> advance;
|
||||
} Vertical;
|
||||
};
|
||||
|
||||
struct CellFontImageTransInfo
|
||||
{
|
||||
be_t<u32> Image_addr;
|
||||
be_t<u32> imageWidthByte;
|
||||
be_t<u32> imageWidth;
|
||||
be_t<u32> imageHeight;
|
||||
be_t<u32> Surface_addr;
|
||||
be_t<u32> surfWidthByte;
|
||||
};
|
||||
|
||||
struct CellFontRendererConfig
|
||||
{
|
||||
struct BufferingPolicy
|
||||
{
|
||||
be_t<u32> buffer;
|
||||
be_t<u32> initSize;
|
||||
be_t<u32> maxSize;
|
||||
be_t<u32> expandSize;
|
||||
be_t<u32> resetSize;
|
||||
};
|
||||
be_t<f32> v_bearingX;
|
||||
be_t<f32> v_bearingY;
|
||||
be_t<f32> v_advance;
|
||||
};
|
||||
|
||||
struct CellFontRenderSurface
|
||||
{
|
||||
be_t<u32> buffer_addr;
|
||||
be_t<u32> widthByte;
|
||||
be_t<u32> pixelSizeByte;
|
||||
be_t<u32> width, height;
|
||||
vm::bptr<void> buffer;
|
||||
be_t<s32> widthByte;
|
||||
be_t<s32> pixelSizeByte;
|
||||
be_t<s32> width;
|
||||
be_t<s32> height;
|
||||
|
||||
struct
|
||||
{
|
||||
be_t<u32> x0, y0;
|
||||
be_t<u32> x1, y1;
|
||||
} Scissor;
|
||||
// Scissor
|
||||
be_t<u32> sc_x0;
|
||||
be_t<u32> sc_y0;
|
||||
be_t<u32> sc_x1;
|
||||
be_t<u32> sc_y1;
|
||||
};
|
||||
|
||||
// Internal Datatypes
|
||||
struct CellFontInternal //Module cellFont
|
||||
struct CellFontImageTransInfo
|
||||
{
|
||||
u32 m_buffer_addr, m_buffer_size;
|
||||
u32 m_userFontEntrys_addr, m_userFontEntryMax;
|
||||
|
||||
bool m_bInitialized;
|
||||
bool m_bFontGcmInitialized;
|
||||
|
||||
CellFontInternal()
|
||||
: m_buffer_addr(0)
|
||||
, m_buffer_size(0)
|
||||
, m_bInitialized(false)
|
||||
, m_bFontGcmInitialized(false)
|
||||
{
|
||||
}
|
||||
vm::bptr<u8> image;
|
||||
be_t<u32> imageWidthByte;
|
||||
be_t<u32> imageWidth;
|
||||
be_t<u32> imageHeight;
|
||||
vm::bptr<void> surface;
|
||||
be_t<u32> surfWidthByte;
|
||||
};
|
||||
|
||||
struct CellFont
|
||||
{
|
||||
be_t<float> scale_x;
|
||||
be_t<float> scale_y;
|
||||
be_t<float> slant;
|
||||
be_t<u32> renderer_addr;
|
||||
|
||||
be_t<u32> fontdata_addr;
|
||||
be_t<u32> origin;
|
||||
struct stbtt_fontinfo* stbfont;
|
||||
// hack: don't place anything after pointer
|
||||
};
|
||||
|
||||
struct CellFontRendererConfig
|
||||
{
|
||||
// Buffering Policy
|
||||
vm::bptr<void> buffer;
|
||||
be_t<u32> initSize;
|
||||
be_t<u32> maxSize;
|
||||
be_t<u32> expandSize;
|
||||
be_t<u32> resetSize;
|
||||
};
|
||||
|
||||
struct CellFontRenderer
|
||||
{
|
||||
void *systemReserved[64];
|
||||
};
|
||||
|
||||
struct CellFontGraphics
|
||||
{
|
||||
be_t<u32> graphicsType;
|
||||
// ...
|
||||
};
|
@ -2,20 +2,14 @@
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
|
||||
#include "cellFont.h"
|
||||
#include "cellFontFT.h"
|
||||
|
||||
extern Module cellFontFT;
|
||||
|
||||
CCellFontFTInternal* s_fontFtInternalInstance = nullptr;
|
||||
|
||||
s32 cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, vm::ptr<CellFontLibraryConfigFT> config, vm::pptr<CellFontLibrary> lib)
|
||||
{
|
||||
cellFontFT.Warning("cellFontInitLibraryFreeTypeWithRevision(revisionFlags=0x%llx, config=*0x%x, lib=**0x%x)", revisionFlags, config, lib);
|
||||
|
||||
//if (s_fontInternalInstance->m_bInitialized)
|
||||
//return CELL_FONT_ERROR_UNINITIALIZED;
|
||||
|
||||
lib->set(vm::alloc(sizeof(CellFontLibrary), vm::main));
|
||||
|
||||
return CELL_OK;
|
||||
@ -35,13 +29,6 @@ s32 cellFontFTGetInitializedRevisionFlags()
|
||||
|
||||
Module cellFontFT("cellFontFT", []()
|
||||
{
|
||||
s_fontFtInternalInstance = new CCellFontFTInternal();
|
||||
|
||||
cellFontFT.on_stop = []()
|
||||
{
|
||||
delete s_fontFtInternalInstance;
|
||||
};
|
||||
|
||||
REG_FUNC(cellFontFT, cellFontInitLibraryFreeTypeWithRevision);
|
||||
REG_FUNC(cellFontFT, cellFontFTGetRevisionFlags);
|
||||
REG_FUNC(cellFontFT, cellFontFTGetInitializedRevisionFlags);
|
||||
|
@ -1,30 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "cellFont.h"
|
||||
|
||||
namespace vm { using namespace ps3; }
|
||||
|
||||
struct CellFontLibraryConfigFT
|
||||
{
|
||||
u32 library_addr; //void*
|
||||
vm::bptr<void> library;
|
||||
CellFontMemoryInterface MemoryIF;
|
||||
};
|
||||
|
||||
struct CellFontRendererConfigFT
|
||||
{
|
||||
struct {
|
||||
u32 buffer_addr; //void*
|
||||
u32 initSize;
|
||||
u32 maxSize;
|
||||
u32 expandSize;
|
||||
u32 resetSize;
|
||||
} BufferingPolicy;
|
||||
};
|
||||
|
||||
struct CCellFontFTInternal
|
||||
{
|
||||
bool m_bInitialized;
|
||||
|
||||
CCellFontFTInternal()
|
||||
: m_bInitialized(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
using CellFontRendererConfigFT = CellFontRendererConfig;
|
||||
|
@ -416,12 +416,6 @@
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellBgdl.cpp">
|
||||
<Filter>Emu\SysCalls\currently_unused</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellCelp8Enc.cpp">
|
||||
<Filter>Emu\SysCalls\currently_unused</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellCelpEnc.cpp">
|
||||
<Filter>Emu\SysCalls\currently_unused</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellHttpUtil.cpp">
|
||||
<Filter>Emu\SysCalls\currently_unused</Filter>
|
||||
</ClCompile>
|
||||
@ -887,6 +881,12 @@
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellAtracMulti.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellCelp8Enc.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellCelpEnc.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Crypto\aes.h">
|
||||
|
Loading…
Reference in New Issue
Block a user