2013-12-09 17:56:04 +01:00
|
|
|
#include "stdafx.h"
|
2014-06-02 19:27:24 +02:00
|
|
|
#include "Emu/ConLog.h"
|
|
|
|
|
#include "Emu/Memory/Memory.h"
|
|
|
|
|
#include "Emu/System.h"
|
|
|
|
|
#include "Emu/Cell/PPUThread.h"
|
2013-12-09 17:56:04 +01:00
|
|
|
#include "Emu/SysCalls/SC_FUNC.h"
|
2014-06-02 19:27:24 +02:00
|
|
|
#include "Emu/SysCalls/Modules.h"
|
|
|
|
|
#include "Emu/SysCalls/SysCalls.h"
|
2013-12-09 17:56:04 +01:00
|
|
|
#include "cellFont.h"
|
|
|
|
|
|
|
|
|
|
void cellFontFT_init();
|
2014-04-15 16:12:15 +02:00
|
|
|
void cellFontFT_load();
|
|
|
|
|
void cellFontFT_unload();
|
|
|
|
|
Module cellFontFT(0x001a, cellFontFT_init, cellFontFT_load, cellFontFT_unload);
|
2013-12-09 17:56:04 +01:00
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-15 16:12:15 +02:00
|
|
|
CCellFontFTInternal* s_fontFtInternalInstance = nullptr;
|
2013-12-09 17:56:04 +01:00
|
|
|
|
|
|
|
|
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);
|
2014-04-15 16:12:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void cellFontFT_load()
|
|
|
|
|
{
|
|
|
|
|
s_fontFtInternalInstance = new CCellFontFTInternal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void cellFontFT_unload()
|
|
|
|
|
{
|
|
|
|
|
delete s_fontFtInternalInstance;
|
2013-12-09 17:56:04 +01:00
|
|
|
}
|