mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
First cellFont functions & minor changes
* Edited .gitignore * Moved some functions to cellFontFT. * Now cellFont initializes correctly, but it doesn't render anything yet. There are still several things to change and functions to implement. I will take care of it.
This commit is contained in:
parent
5ce57e963f
commit
849af30bfd
7 changed files with 530 additions and 123 deletions
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -40,5 +40,13 @@
|
||||||
/bin/VertexProgram.txt
|
/bin/VertexProgram.txt
|
||||||
/bin/BreakPoints.dat
|
/bin/BreakPoints.dat
|
||||||
/bin/textures
|
/bin/textures
|
||||||
/bin/data/
|
|
||||||
rpcs3/git-version.h
|
rpcs3/git-version.h
|
||||||
|
|
||||||
|
# Copyrighted files
|
||||||
|
/bin/data/
|
||||||
|
/bin/dev_flash/data/font
|
||||||
|
|
||||||
|
# Ignore installed games except test homebrews
|
||||||
|
!/bin/dev_hdd0/game/
|
||||||
|
/bin/dev_hdd0/game/*
|
||||||
|
!/bin/dev_hdd0/game/TEST12345/
|
||||||
|
|
|
@ -40,7 +40,7 @@ static const g_module_list[] =
|
||||||
{0x0017, "sys_io"},
|
{0x0017, "sys_io"},
|
||||||
{0x0018, "cellPngDec"},
|
{0x0018, "cellPngDec"},
|
||||||
{0x0019, "cellFont"},
|
{0x0019, "cellFont"},
|
||||||
{0x001a, "cellFontFt"},
|
{0x001a, "cellFontFT"},
|
||||||
{0x001b, "cellFreetype"},
|
{0x001b, "cellFreetype"},
|
||||||
{0x001c, "cellUsbd"},
|
{0x001c, "cellUsbd"},
|
||||||
{0x001d, "cellSail"},
|
{0x001d, "cellSail"},
|
||||||
|
|
|
@ -1,104 +1,256 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Emu/SysCalls/SysCalls.h"
|
#include "Emu/SysCalls/SysCalls.h"
|
||||||
#include "Emu/SysCalls/SC_FUNC.h"
|
#include "Emu/SysCalls/SC_FUNC.h"
|
||||||
|
#include "cellFont.h"
|
||||||
|
|
||||||
void cellFont_init();
|
void cellFont_init();
|
||||||
Module cellFont(0x0019, cellFont_init);
|
void cellFont_unload();
|
||||||
|
Module cellFont(0x0019, cellFont_init, nullptr, cellFont_unload);
|
||||||
|
|
||||||
// error codes
|
// Font Set Types
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_FONT_TYPE_RODIN_SANS_SERIF_LATIN = 0x00000000,
|
||||||
|
CELL_FONT_TYPE_RODIN_SANS_SERIF_LIGHT_LATIN = 0x00000001,
|
||||||
|
CELL_FONT_TYPE_RODIN_SANS_SERIF_BOLD_LATIN = 0x00000002,
|
||||||
|
CELL_FONT_TYPE_RODIN_SANS_SERIF_LATIN2 = 0x00000018,
|
||||||
|
CELL_FONT_TYPE_RODIN_SANS_SERIF_LIGHT_LATIN2 = 0x00000019,
|
||||||
|
CELL_FONT_TYPE_RODIN_SANS_SERIF_BOLD_LATIN2 = 0x0000001a,
|
||||||
|
CELL_FONT_TYPE_MATISSE_SERIF_LATIN = 0x00000020,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_JAPANESE = 0x00000008,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_LIGHT_JAPANESE = 0x00000009,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_BOLD_JAPANESE = 0x0000000a,
|
||||||
|
CELL_FONT_TYPE_YD_GOTHIC_KOREAN = 0x0000000c,
|
||||||
|
CELL_FONT_TYPE_SEURAT_MARU_GOTHIC_LATIN = 0x00000040,
|
||||||
|
CELL_FONT_TYPE_SEURAT_MARU_GOTHIC_LATIN2 = 0x00000041,
|
||||||
|
CELL_FONT_TYPE_VAGR_SANS_SERIF_ROUND = 0x00000043,
|
||||||
|
CELL_FONT_TYPE_VAGR_SANS_SERIF_ROUND_LATIN2 = 0x00000044,
|
||||||
|
CELL_FONT_TYPE_SEURAT_MARU_GOTHIC_JAPANESE = 0x00000048,
|
||||||
|
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_JP_SET = 0x00000100,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_LATIN_SET = 0x00000101,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_RODIN_SET = 0x00000104,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_RODIN2_SET = 0x00000204,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_RODIN2_SET = 0x00000201,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_DFHEI5_SET = 0x00000108,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_DFHEI5_RODIN_SET = 0x00000109,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_DFHEI5_RODIN2_SET = 0x00000209,
|
||||||
|
CELL_FONT_TYPE_DFHEI5_GOTHIC_YG_NEWRODIN_TCH_SET = 0x0000010a,
|
||||||
|
CELL_FONT_TYPE_DFHEI5_GOTHIC_YG_NEWRODIN_RODIN_TCH_SET = 0x0000010b,
|
||||||
|
CELL_FONT_TYPE_DFHEI5_GOTHIC_YG_NEWRODIN_RODIN2_TCH_SET = 0x0000020b,
|
||||||
|
CELL_FONT_TYPE_DFHEI5_GOTHIC_YG_NEWRODIN_SCH_SET = 0x0000010c,
|
||||||
|
CELL_FONT_TYPE_DFHEI5_GOTHIC_YG_NEWRODIN_RODIN_SCH_SET = 0x0000010d,
|
||||||
|
CELL_FONT_TYPE_DFHEI5_GOTHIC_YG_NEWRODIN_RODIN2_SCH_SET = 0x0000020d,
|
||||||
|
|
||||||
|
CELL_FONT_TYPE_SEURAT_MARU_GOTHIC_RSANS_SET = 0x00300104,
|
||||||
|
CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_RSANS_SET = 0x00300105,
|
||||||
|
CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_JP_SET = 0x00300107,
|
||||||
|
CELL_FONT_TYPE_SEURAT_MARU_GOTHIC_YG_DFHEI5_RSANS_SET = 0x00300109,
|
||||||
|
CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_YG_DFHEI5_RSANS_SET = 0x0030010F,
|
||||||
|
CELL_FONT_TYPE_VAGR_SEURAT_CAPIE_MARU_GOTHIC_RSANS_SET = 0x00300124,
|
||||||
|
CELL_FONT_TYPE_VAGR_SEURAT_CAPIE_MARU_GOTHIC_YG_DFHEI5_RSANS_SET = 0x00300129,
|
||||||
|
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_LIGHT_SET = 0x00040100,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_RODIN_LIGHT_SET = 0x00040101,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_RODIN2_LIGHT_SET = 0x00040201,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_RODIN_LIGHT_SET = 0x00040104,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_RODIN2_LIGHT_SET = 0x00040204,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_BOLD_SET = 0x00070100,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_RODIN_BOLD_SET = 0x00070101,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_YG_RODIN2_BOLD_SET = 0x00070201,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_RODIN_BOLD_SET = 0x00070104,
|
||||||
|
CELL_FONT_TYPE_NEWRODIN_GOTHIC_RODIN2_BOLD_SET = 0x00070204,
|
||||||
|
|
||||||
|
CELL_FONT_TYPE_SEURAT_MARU_GOTHIC_RSANS2_SET = 0x00300204,
|
||||||
|
CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_RSANS2_SET = 0x00300205,
|
||||||
|
CELL_FONT_TYPE_SEURAT_MARU_GOTHIC_YG_DFHEI5_RSANS2_SET = 0x00300209,
|
||||||
|
CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_YG_DFHEI5_RSANS2_SET = 0x0030020F,
|
||||||
|
CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_YG_DFHEI5_VAGR2_SET = 0x00300229,
|
||||||
|
CELL_FONT_TYPE_SEURAT_CAPIE_MARU_GOTHIC_VAGR2_SET = 0x00300224,
|
||||||
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
CELL_FONT_OK = 0,
|
CELL_FONT_MAP_FONT = 0,
|
||||||
CELL_FONT_ERROR_FATAL = 0x80540001,
|
CELL_FONT_MAP_UNICODE = 1,
|
||||||
CELL_FONT_ERROR_INVALID_PARAMETER = 0x80540002,
|
|
||||||
CELL_FONT_ERROR_UNINITIALIZED = 0x80540003,
|
|
||||||
CELL_FONT_ERROR_INITIALIZE_FAILED = 0x80540004,
|
|
||||||
CELL_FONT_ERROR_INVALID_CACHE_BUFFER = 0x80540005,
|
|
||||||
CELL_FONT_ERROR_ALREADY_INITIALIZED = 0x80540006,
|
|
||||||
CELL_FONT_ERROR_ALLOCATION_FAILED = 0x80540007,
|
|
||||||
CELL_FONT_ERROR_NO_SUPPORT_FONTSET = 0x80540008,
|
|
||||||
CELL_FONT_ERROR_OPEN_FAILED = 0x80540009,
|
|
||||||
CELL_FONT_ERROR_READ_FAILED = 0x8054000a,
|
|
||||||
CELL_FONT_ERROR_FONT_OPEN_FAILED = 0x8054000b,
|
|
||||||
CELL_FONT_ERROR_FONT_NOT_FOUND = 0x8054000c,
|
|
||||||
CELL_FONT_ERROR_FONT_OPEN_MAX = 0x8054000d,
|
|
||||||
CELL_FONT_ERROR_FONT_CLOSE_FAILED = 0x8054000e,
|
|
||||||
CELL_FONT_ERROR_ALREADY_OPENED = 0x8054000f,
|
|
||||||
CELL_FONT_ERROR_NO_SUPPORT_FUNCTION = 0x80540010,
|
|
||||||
CELL_FONT_ERROR_NO_SUPPORT_CODE = 0x80540011,
|
|
||||||
CELL_FONT_ERROR_NO_SUPPORT_GLYPH = 0x80540012,
|
|
||||||
CELL_FONT_ERROR_BUFFER_SIZE_NOT_ENOUGH = 0x80540016,
|
|
||||||
CELL_FONT_ERROR_RENDERER_ALREADY_BIND = 0x80540020,
|
|
||||||
CELL_FONT_ERROR_RENDERER_UNBIND = 0x80540021,
|
|
||||||
CELL_FONT_ERROR_RENDERER_INVALID = 0x80540022,
|
|
||||||
CELL_FONT_ERROR_RENDERER_ALLOCATION_FAILED = 0x80540023,
|
|
||||||
CELL_FONT_ERROR_ENOUGH_RENDERING_BUFFER = 0x80540024,
|
|
||||||
CELL_FONT_ERROR_NO_SUPPORT_SURFACE = 0x80540040,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellFontConfig
|
struct CellFontConfig
|
||||||
{
|
{
|
||||||
u32 buffer;
|
struct {
|
||||||
u32 size;
|
be_t<u32> buffer_addr;
|
||||||
u32 userFontEntryMax;
|
be_t<u32> size;
|
||||||
u32 userFontEntrys;
|
} FileCache;
|
||||||
u32 flags;
|
|
||||||
|
be_t<u32> userFontEntryMax;
|
||||||
|
be_t<u32> userFontEntrys_addr;
|
||||||
|
be_t<u32> flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellFontRenderer
|
||||||
|
{
|
||||||
|
u32 SystemReserved_addr; //void *systemReserved[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellFont
|
||||||
|
{
|
||||||
|
//void* SystemReserved[64];
|
||||||
|
be_t<float> scale_x;
|
||||||
|
be_t<float> scale_y;
|
||||||
|
be_t<float> slant;
|
||||||
|
be_t<u32> renderer_addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellFontType
|
struct CellFontType
|
||||||
{
|
{
|
||||||
u32 type;
|
be_t<u32> type;
|
||||||
u32 map;
|
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
|
struct CellFontHorizontalLayout
|
||||||
{
|
{
|
||||||
float baseLineY;
|
be_t<float> baseLineY;
|
||||||
float lineHeight;
|
be_t<float> lineHeight;
|
||||||
float effectHeight;
|
be_t<float> effectHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellFontVerticalLayout
|
struct CellFontVerticalLayout
|
||||||
{
|
{
|
||||||
float baseLineX;
|
be_t<float> baseLineX;
|
||||||
float lineWidth;
|
be_t<float> lineWidth;
|
||||||
float effectWidth;
|
be_t<float> effectWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellFontGlyphMetrics
|
struct CellFontGlyphMetrics
|
||||||
{
|
{
|
||||||
float width;
|
be_t<float> width;
|
||||||
float height;
|
be_t<float> height;
|
||||||
struct Horizontal
|
struct {
|
||||||
{
|
be_t<float> bearingX;
|
||||||
float bearingX;
|
be_t<float> bearingY;
|
||||||
float bearingY;
|
be_t<float> advance;
|
||||||
float advance;
|
} Horizontal;
|
||||||
};
|
struct {
|
||||||
struct Vertical
|
be_t<float> bearingX;
|
||||||
{
|
be_t<float> bearingY;
|
||||||
float bearingX;
|
be_t<float> advance;
|
||||||
float bearingY;
|
} Vertical;
|
||||||
float advance;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellFontRendererConfig
|
struct CellFontRendererConfig
|
||||||
{
|
{
|
||||||
struct BufferingPolicy
|
struct BufferingPolicy
|
||||||
{
|
{
|
||||||
u32 buffer;
|
be_t<u32> buffer;
|
||||||
u32 initSize;
|
be_t<u32> initSize;
|
||||||
u32 maxSize;
|
be_t<u32> maxSize;
|
||||||
u32 expandSize;
|
be_t<u32> expandSize;
|
||||||
u32 resetSize;
|
be_t<u32> resetSize;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
s32 cellFontInit (u32 buffer, u32 size, u32 userFontEntryMax, u32 userFontEntrys, u32 flags)
|
struct CellFontRenderSurface
|
||||||
{
|
{
|
||||||
cellFont.Log("cellFontInit(buffer=0x%x,size=0x%x,userFontEntryMax=0x%x,flags=0x%x)", buffer, size, userFontEntryMax, flags);
|
be_t<u32> buffer_addr;
|
||||||
|
be_t<u32> widthByte;
|
||||||
|
be_t<u32> pixelSizeByte;
|
||||||
|
be_t<u32> width, height;
|
||||||
|
struct {
|
||||||
|
be_t<u32> x0, y0;
|
||||||
|
be_t<u32> x1, y1;
|
||||||
|
} Scissor;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Internal Datatypes
|
||||||
|
struct CCellFontInternal //Module cellFont
|
||||||
|
{
|
||||||
|
u32 m_buffer_addr, m_buffer_size;
|
||||||
|
u32 m_userFontEntrys_addr, m_userFontEntryMax;
|
||||||
|
|
||||||
|
bool m_bInitialized;
|
||||||
|
bool m_bFontGcmInitialized;
|
||||||
|
|
||||||
|
CCellFontInternal()
|
||||||
|
: m_buffer_addr(NULL)
|
||||||
|
, m_buffer_size(0)
|
||||||
|
, m_bInitialized(false)
|
||||||
|
, m_bFontGcmInitialized(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CCellFontInternal* s_fontInternalInstance = new CCellFontInternal();
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
int cellFontInitializeWithRevision(u64 revisionFlags, mem_ptr_t<CellFontConfig> config)
|
||||||
|
{
|
||||||
|
cellFont.Warning("cellFontInitializeWithRevision(revisionFlags=0x%llx, config=0x%x)", revisionFlags, config.GetAddr());
|
||||||
|
|
||||||
|
if (s_fontInternalInstance->m_bInitialized)
|
||||||
|
return CELL_FONT_ERROR_ALREADY_INITIALIZED;
|
||||||
|
if (!config.IsGood())
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
if (!Memory.IsGoodAddr(config->FileCache.buffer_addr))
|
||||||
|
return CELL_FONT_ERROR_INVALID_CACHE_BUFFER;
|
||||||
|
if (config->FileCache.size < 24)
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
if (config->flags != 0)
|
||||||
|
cellFont.Warning("cellFontInitializeWithRevision: Unknown flags (0x%x)", config->flags);
|
||||||
|
|
||||||
|
s_fontInternalInstance->m_buffer_addr = config->FileCache.buffer_addr;
|
||||||
|
s_fontInternalInstance->m_buffer_size = config->FileCache.size;
|
||||||
|
s_fontInternalInstance->m_userFontEntrys_addr = config->userFontEntrys_addr;
|
||||||
|
s_fontInternalInstance->m_userFontEntryMax = config->userFontEntryMax;
|
||||||
|
s_fontInternalInstance->m_bInitialized = true;
|
||||||
|
return CELL_FONT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontGetRevisionFlags(mem64_t revisionFlags)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
|
return CELL_FONT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontInit(mem_ptr_t<CellFontConfig> config)
|
||||||
|
{
|
||||||
|
cellFont.Log("cellFontInit(config=0x%x)", config.GetAddr());
|
||||||
|
|
||||||
|
MemoryAllocator<u64> revisionFlags = 0;
|
||||||
|
cellFontGetRevisionFlags(revisionFlags.GetAddr());
|
||||||
|
return cellFontInitializeWithRevision(revisionFlags, config.GetAddr());
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontEnd()
|
||||||
|
{
|
||||||
|
cellFont.Log("cellFontEnd()");
|
||||||
|
|
||||||
|
if (!s_fontInternalInstance->m_bInitialized)
|
||||||
|
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||||
|
|
||||||
|
s_fontInternalInstance->m_bInitialized = false;
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +261,30 @@ s32 cellFontSetFontsetOpenMode(u32 openMode)
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cellFontOpenFontset(mem_ptr_t<CellFontLibrary> library, mem_ptr_t<CellFontType> fontType, mem_ptr_t<CellFont> font)
|
||||||
|
{
|
||||||
|
cellFont.Warning("cellFontOpenFontset(library_addr=0x%x, fontType_addr=0x%x, font_addr=0x%x)",
|
||||||
|
library.GetAddr(), fontType.GetAddr(), font.GetAddr());
|
||||||
|
|
||||||
|
if (!library.IsGood() || !fontType.IsGood() || !font.IsGood())
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
if (!s_fontInternalInstance->m_bInitialized)
|
||||||
|
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||||
|
if (fontType->map != CELL_FONT_MAP_UNICODE)
|
||||||
|
cellFont.Warning("cellFontOpenFontset: Only Unicode is supported");
|
||||||
|
|
||||||
|
font->renderer_addr = NULL;
|
||||||
|
//TODO: Write data in font
|
||||||
|
|
||||||
|
return CELL_FONT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontOpenFontInstance(mem_ptr_t<CellFont> openedFont, mem_ptr_t<CellFont> font)
|
||||||
|
{
|
||||||
|
cellFont.Warning("cellFontOpenFontInstance(openedFont=0x%x, font=0x%x)", openedFont.GetAddr(), font.GetAddr());
|
||||||
|
return CELL_FONT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
s32 cellFontSetFontOpenMode(u32 openMode)
|
s32 cellFontSetFontOpenMode(u32 openMode)
|
||||||
{
|
{
|
||||||
cellFont.Log("cellFontSetFontOpenMode(openMode=0x%x)", openMode);
|
cellFont.Log("cellFontSetFontOpenMode(openMode=0x%x)", openMode);
|
||||||
|
@ -116,15 +292,96 @@ s32 cellFontSetFontOpenMode(u32 openMode)
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontCreateRenderer()
|
int cellFontCreateRenderer(mem_ptr_t<CellFontLibrary> library, mem_ptr_t<CellFontRendererConfig> config, mem_ptr_t<CellFontRenderer> Renderer)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
cellFont.Warning("cellFontCreateRenderer(library_addr=0x%x, config_addr=0x%x, Renderer_addr=0x%x)",
|
||||||
|
library.GetAddr(), config.GetAddr(), Renderer.GetAddr());
|
||||||
|
|
||||||
|
if (!library.IsGood() || !config.IsGood() || !Renderer.IsGood())
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
if (!s_fontInternalInstance->m_bInitialized)
|
||||||
|
return CELL_FONT_ERROR_UNINITIALIZED;
|
||||||
|
|
||||||
|
//Write data in Renderer
|
||||||
|
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGetHorizontalLayout()
|
void cellFontRenderSurfaceInit(mem_ptr_t<CellFontRenderSurface> surface, u32 buffer_addr, s32 bufferWidthByte, s32 pixelSizeByte, s32 w, s32 h)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
cellFont.Warning("cellFontRenderSurfaceInit(surface_addr=0x%x, buffer_addr=0x%x, bufferWidthByte=%d, pixelSizeByte=%d, w=%d, h=%d)",
|
||||||
|
surface.GetAddr(), buffer_addr, bufferWidthByte, pixelSizeByte, w, h);
|
||||||
|
|
||||||
|
surface->buffer_addr = buffer_addr;
|
||||||
|
surface->widthByte = bufferWidthByte;
|
||||||
|
surface->pixelSizeByte = pixelSizeByte;
|
||||||
|
surface->width = w;
|
||||||
|
surface->height = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cellFontRenderSurfaceSetScissor(mem_ptr_t<CellFontRenderSurface> surface, s32 x0, s32 y0, s32 w, s32 h)
|
||||||
|
{
|
||||||
|
cellFont.Warning("cellFontRenderSurfaceSetScissor(surface_addr=0x%x, x0=%d, y0=%d, w=%d, h=%d)",
|
||||||
|
surface.GetAddr(), x0, y0, w, h);
|
||||||
|
|
||||||
|
surface->Scissor.x0 = x0;
|
||||||
|
surface->Scissor.y0 = y0;
|
||||||
|
surface->Scissor.x1 = w;
|
||||||
|
surface->Scissor.y1 = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontSetScalePixel(mem_ptr_t<CellFont> font, float w, float h)
|
||||||
|
{
|
||||||
|
h = GetCurrentPPUThread().FPR[1]; // TODO: Something is wrong with the float arguments
|
||||||
|
cellFont.Warning("cellFontSetScalePixel(font_addr=0x%x, w=%f, h=%f)", font.GetAddr(), w, h);
|
||||||
|
|
||||||
|
if (!font.IsGood())
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
font->scale_x = w;
|
||||||
|
font->scale_y = h;
|
||||||
|
return CELL_FONT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontGetHorizontalLayout(mem_ptr_t<CellFont> font, mem_ptr_t<CellFontHorizontalLayout> layout)
|
||||||
|
{
|
||||||
|
cellFont.Warning("cellFontGetHorizontalLayout(font_addr=0x%x, layout_addr=0x%x)",
|
||||||
|
font.GetAddr(), layout.GetAddr());
|
||||||
|
|
||||||
|
if (!font.IsGood() || !layout.IsGood())
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
//TODO: This values are (probably) wrong and just for testing purposes! Find the way of calculating them.
|
||||||
|
layout->baseLineY = font->scale_y - 4;
|
||||||
|
layout->lineHeight = font->scale_y;
|
||||||
|
layout->effectHeight = 4;
|
||||||
|
return CELL_FONT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontBindRenderer(mem_ptr_t<CellFont> font, mem_ptr_t<CellFontRenderer> renderer)
|
||||||
|
{
|
||||||
|
cellFont.Warning("cellFontBindRenderer(font_addr=0x%x, renderer_addr=0x%x)",
|
||||||
|
font.GetAddr(), renderer.GetAddr());
|
||||||
|
|
||||||
|
if (!font.IsGood() || !renderer.GetAddr())
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
if (font->renderer_addr)
|
||||||
|
return CELL_FONT_ERROR_RENDERER_ALREADY_BIND;
|
||||||
|
|
||||||
|
font->renderer_addr = renderer.GetAddr();
|
||||||
|
return CELL_FONT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontUnbindRenderer(mem_ptr_t<CellFont> font)
|
||||||
|
{
|
||||||
|
cellFont.Warning("cellFontBindRenderer(font_addr=0x%x)", font.GetAddr());
|
||||||
|
|
||||||
|
if (!font.IsGood())
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
if (!font->renderer_addr)
|
||||||
|
return CELL_FONT_ERROR_RENDERER_UNBIND;
|
||||||
|
|
||||||
|
font->renderer_addr = NULL;
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,18 +397,6 @@ int cellFontSetupRenderScalePixel()
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontOpenFontInstance()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
|
||||||
return CELL_FONT_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellFontSetScalePixel()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
|
||||||
return CELL_FONT_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellFontGetRenderCharGlyphMetrics()
|
int cellFontGetRenderCharGlyphMetrics()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
|
@ -164,21 +409,25 @@ int cellFontEndLibrary()
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontBindRenderer()
|
int cellFontSetEffectSlant(mem_ptr_t<CellFont> font, float slantParam)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
cellFont.Warning("cellFontSetEffectSlant(font_addr=0x%x, slantParam=%f)", font.GetAddr(), slantParam);
|
||||||
|
|
||||||
|
if (!font.IsGood() || slantParam < -1.0 || slantParam > 1.0)
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
font->slant = slantParam;
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontEnd()
|
int cellFontGetEffectSlant(mem_ptr_t<CellFont> font, mem32_t slantParam)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
cellFont.Warning("cellFontSetEffectSlant(font_addr=0x%x, slantParam_addr=0x%x)", font.GetAddr(), slantParam.GetAddr());
|
||||||
return CELL_FONT_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellFontSetEffectSlant ()
|
if (!font.IsGood() || !slantParam.IsGood())
|
||||||
{
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
|
||||||
|
slantParam = font->slant;
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,20 +437,14 @@ int cellFontRenderCharGlyphImage()
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cellFontRenderSurfaceInit()
|
int cellFontGetFontIdCode(mem_ptr_t<CellFont> font, u32 code, mem32_t fontId, mem32_t fontCode)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
cellFont.Warning("cellFontGetFontIdCode(font_addr=0x%x, code=0x%x, fontId_addr=0x%x, fontCode_addr=0x%x",
|
||||||
}
|
font.GetAddr(), code, fontId.GetAddr(), fontCode.GetAddr());
|
||||||
|
|
||||||
int cellFontGetFontIdCode()
|
if (!font.IsGood() || !fontId.IsGood()) //fontCode isn't used
|
||||||
{
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
|
||||||
return CELL_FONT_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellFontOpenFontset()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,26 +454,23 @@ int cellFontCloseFont()
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cellFontRenderSurfaceSetScissor()
|
int cellFontGetCharGlyphMetrics(mem_ptr_t<CellFont> font, u32 code, mem_ptr_t<CellFontGlyphMetrics> metrics)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
cellFont.Warning("cellFontGetCharGlyphMetrics(font_addr=0x%x, code=0x%x, metrics_addr=0x%x",
|
||||||
}
|
font.GetAddr(), code, metrics.GetAddr());
|
||||||
|
|
||||||
int cellFontGetCharGlyphMetrics()
|
if (!font.IsGood() || metrics.IsGood())
|
||||||
{
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
|
||||||
return CELL_FONT_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellFontUnbindRenderer()
|
//TODO: This values are (probably) wrong and just for testing purposes! Find the way of calculating them.
|
||||||
{
|
metrics->width = 0;
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
metrics->height = 0;
|
||||||
return CELL_FONT_OK;
|
metrics->Horizontal.bearingX = 0;
|
||||||
}
|
metrics->Horizontal.bearingY = 0;
|
||||||
|
metrics->Horizontal.advance = 0;
|
||||||
int cellFontInitializeWithRevision()
|
metrics->Vertical.bearingX = 0;
|
||||||
{
|
metrics->Vertical.bearingY = 0;
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
metrics->Vertical.advance = 0;
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,81 +527,111 @@ int cellFontGetRenderCharGlyphMetricsVertical()
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontSetScalePoint()
|
int cellFontSetScalePoint()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontSetupRenderEffectSlant()
|
int cellFontSetupRenderEffectSlant()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGraphicsSetLineRGBA()
|
int cellFontGraphicsSetLineRGBA()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGraphicsSetDrawType()
|
int cellFontGraphicsSetDrawType()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontEndGraphics()
|
int cellFontEndGraphics()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGraphicsSetupDrawContext()
|
int cellFontGraphicsSetupDrawContext()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontOpenFontMemory()
|
int cellFontOpenFontMemory()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontSetupRenderEffectWeight()
|
int cellFontSetupRenderEffectWeight()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGlyphGetOutlineControlDistance()
|
int cellFontGlyphGetOutlineControlDistance()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGlyphGetVertexesGlyphSize()
|
int cellFontGlyphGetVertexesGlyphSize()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGenerateCharGlyph()
|
int cellFontGenerateCharGlyph()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontDeleteGlyph()
|
int cellFontDeleteGlyph()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
int cellFontExtend()
|
|
||||||
|
int cellFontExtend(u32 a1, u32 a2, u32 a3)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
cellFont.Warning("cellFontExtend(a1=0x%x, a2=0x%x, a3=0x%x)", a1, a2, a3);
|
||||||
|
//In a test I did: a1=0xcfe00000, a2=0x0, a3=(pointer to something)
|
||||||
|
if (a1 == 0xcfe00000)
|
||||||
|
{
|
||||||
|
if (a2 != 0 || a3 == 0)
|
||||||
|
{
|
||||||
|
//Something happens
|
||||||
|
}
|
||||||
|
if (Memory.Read32(a3) == 0)
|
||||||
|
{
|
||||||
|
//Something happens
|
||||||
|
}
|
||||||
|
//Something happens
|
||||||
|
}
|
||||||
|
//Something happens?
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontRenderCharGlyphImageVertical()
|
int cellFontRenderCharGlyphImageVertical()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontSetResolutionDpi()
|
int cellFontSetResolutionDpi()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
return CELL_FONT_OK;
|
return CELL_FONT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellFontGetCharGlyphMetricsVertical()
|
int cellFontGetCharGlyphMetricsVertical()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellFont);
|
UNIMPLEMENTED_FUNC(cellFont);
|
||||||
|
@ -384,6 +654,7 @@ void cellFont_init()
|
||||||
cellFont.AddFunc(0x66a23100, cellFontBindRenderer);
|
cellFont.AddFunc(0x66a23100, cellFontBindRenderer);
|
||||||
cellFont.AddFunc(0x7ab47f7e, cellFontEnd);
|
cellFont.AddFunc(0x7ab47f7e, cellFontEnd);
|
||||||
cellFont.AddFunc(0x8657c8f5, cellFontSetEffectSlant);
|
cellFont.AddFunc(0x8657c8f5, cellFontSetEffectSlant);
|
||||||
|
cellFont.AddFunc(0xe16e679a, cellFontGetEffectSlant);
|
||||||
cellFont.AddFunc(0x88be4799, cellFontRenderCharGlyphImage);
|
cellFont.AddFunc(0x88be4799, cellFontRenderCharGlyphImage);
|
||||||
cellFont.AddFunc(0x90b9465e, cellFontRenderSurfaceInit);
|
cellFont.AddFunc(0x90b9465e, cellFontRenderSurfaceInit);
|
||||||
cellFont.AddFunc(0x98ac5524, cellFontGetFontIdCode);
|
cellFont.AddFunc(0x98ac5524, cellFontGetFontIdCode);
|
||||||
|
@ -418,4 +689,11 @@ void cellFont_init()
|
||||||
cellFont.AddFunc(0xfb3341ba, cellFontSetResolutionDpi);
|
cellFont.AddFunc(0xfb3341ba, cellFontSetResolutionDpi);
|
||||||
cellFont.AddFunc(0xfe9a6dd7, cellFontGetCharGlyphMetricsVertical);
|
cellFont.AddFunc(0xfe9a6dd7, cellFontGetCharGlyphMetricsVertical);
|
||||||
cellFont.AddFunc(0xf16379fa, cellFontUnbindRenderer);
|
cellFont.AddFunc(0xf16379fa, cellFontUnbindRenderer);
|
||||||
|
cellFont.AddFunc(0xb015a84e, cellFontGetRevisionFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cellFont_unload()
|
||||||
|
{
|
||||||
|
s_fontInternalInstance->m_bInitialized = false;
|
||||||
|
s_fontInternalInstance->m_bFontGcmInitialized = false;
|
||||||
}
|
}
|
47
rpcs3/Emu/SysCalls/Modules/cellFont.h
Normal file
47
rpcs3/Emu/SysCalls/Modules/cellFont.h
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Error codes
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_FONT_OK = 0,
|
||||||
|
CELL_FONT_ERROR_FATAL = 0x80540001,
|
||||||
|
CELL_FONT_ERROR_INVALID_PARAMETER = 0x80540002,
|
||||||
|
CELL_FONT_ERROR_UNINITIALIZED = 0x80540003,
|
||||||
|
CELL_FONT_ERROR_INITIALIZE_FAILED = 0x80540004,
|
||||||
|
CELL_FONT_ERROR_INVALID_CACHE_BUFFER = 0x80540005,
|
||||||
|
CELL_FONT_ERROR_ALREADY_INITIALIZED = 0x80540006,
|
||||||
|
CELL_FONT_ERROR_ALLOCATION_FAILED = 0x80540007,
|
||||||
|
CELL_FONT_ERROR_NO_SUPPORT_FONTSET = 0x80540008,
|
||||||
|
CELL_FONT_ERROR_OPEN_FAILED = 0x80540009,
|
||||||
|
CELL_FONT_ERROR_READ_FAILED = 0x8054000a,
|
||||||
|
CELL_FONT_ERROR_FONT_OPEN_FAILED = 0x8054000b,
|
||||||
|
CELL_FONT_ERROR_FONT_NOT_FOUND = 0x8054000c,
|
||||||
|
CELL_FONT_ERROR_FONT_OPEN_MAX = 0x8054000d,
|
||||||
|
CELL_FONT_ERROR_FONT_CLOSE_FAILED = 0x8054000e,
|
||||||
|
CELL_FONT_ERROR_ALREADY_OPENED = 0x8054000f,
|
||||||
|
CELL_FONT_ERROR_NO_SUPPORT_FUNCTION = 0x80540010,
|
||||||
|
CELL_FONT_ERROR_NO_SUPPORT_CODE = 0x80540011,
|
||||||
|
CELL_FONT_ERROR_NO_SUPPORT_GLYPH = 0x80540012,
|
||||||
|
CELL_FONT_ERROR_BUFFER_SIZE_NOT_ENOUGH = 0x80540016,
|
||||||
|
CELL_FONT_ERROR_RENDERER_ALREADY_BIND = 0x80540020,
|
||||||
|
CELL_FONT_ERROR_RENDERER_UNBIND = 0x80540021,
|
||||||
|
CELL_FONT_ERROR_RENDERER_INVALID = 0x80540022,
|
||||||
|
CELL_FONT_ERROR_RENDERER_ALLOCATION_FAILED = 0x80540023,
|
||||||
|
CELL_FONT_ERROR_ENOUGH_RENDERING_BUFFER = 0x80540024,
|
||||||
|
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;
|
||||||
|
};
|
70
rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp
Normal file
70
rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "Emu/SysCalls/SysCalls.h"
|
||||||
|
#include "Emu/SysCalls/SC_FUNC.h"
|
||||||
|
#include "cellFont.h"
|
||||||
|
|
||||||
|
void cellFontFT_init();
|
||||||
|
Module cellFontFT(0x001a, cellFontFT_init);
|
||||||
|
|
||||||
|
struct CellFontLibraryConfigFT
|
||||||
|
{
|
||||||
|
u32 library_addr; //void*
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CCellFontFTInternal* s_fontFtInternalInstance = new CCellFontFTInternal();
|
||||||
|
|
||||||
|
int cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, mem_ptr_t<CellFontLibraryConfigFT> config, u32 lib_addr_addr)
|
||||||
|
{
|
||||||
|
cellFontFT.Warning("cellFontInitLibraryFreeTypeWithRevision(revisionFlags=0x%llx, config_addr=0x%x, lib_addr_addr=0x%x",
|
||||||
|
revisionFlags, config.GetAddr(), lib_addr_addr);
|
||||||
|
|
||||||
|
if (!config.IsGood() || !Memory.IsGoodAddr(lib_addr_addr))
|
||||||
|
return CELL_FONT_ERROR_INVALID_PARAMETER;
|
||||||
|
//if (s_fontInternalInstance->m_bInitialized)
|
||||||
|
//return CELL_FONT_ERROR_UNINITIALIZED;
|
||||||
|
|
||||||
|
Memory.Write32(lib_addr_addr, Memory.Alloc(sizeof(CellFontLibrary), 1));
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontFTGetRevisionFlags()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellFontFT);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFontFTGetInitializedRevisionFlags()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellFontFT);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cellFontFT_init()
|
||||||
|
{
|
||||||
|
cellFontFT.AddFunc(0x7a0a83c4, cellFontInitLibraryFreeTypeWithRevision);
|
||||||
|
cellFontFT.AddFunc(0xec89a187, cellFontFTGetRevisionFlags);
|
||||||
|
cellFontFT.AddFunc(0xfa0c2de0, cellFontFTGetInitializedRevisionFlags);
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
@ -260,6 +260,7 @@
|
||||||
<ClCompile Include="Emu\SysCalls\Modules.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellAudio.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellAudio.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellFont.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellFont.cpp" />
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\cellFontFT.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellGame.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellGame.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellGcmSys.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellGcmSys.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellGifDec.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellGifDec.cpp" />
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Emu">
|
<Filter Include="Emu">
|
||||||
|
@ -340,6 +340,9 @@
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellGame.cpp">
|
<ClCompile Include="Emu\SysCalls\Modules\cellGame.cpp">
|
||||||
<Filter>Emu\SysCalls\Modules</Filter>
|
<Filter>Emu\SysCalls\Modules</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\cellFontFT.cpp">
|
||||||
|
<Filter>Emu\SysCalls\Modules</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="rpcs3.rc" />
|
<ResourceCompile Include="rpcs3.rc" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue