Merge pull request #26 from O1L/master

Added cellFont module (dummy in this moment) & minor changes in default settings
This commit is contained in:
DHrpcs3 2013-11-25 09:56:33 -08:00
commit 12c2e13dfa
9 changed files with 492 additions and 8 deletions

View File

@ -191,6 +191,11 @@ void VFS::SaveLoadDevices(Array<VFSManagerEntry>& res, bool is_load)
res[idx].path = "$(GameDir)";
res[idx].mount = "/app_home/";
res[idx].device = vfsDevice_LocalFile;
idx = res.Move(new VFSManagerEntry());
res[idx].path = "";
res[idx].mount = "/host_root/";
res[idx].device = vfsDevice_LocalFile;
return;
}

View File

@ -8,6 +8,20 @@ enum
CELL_GCM_DISPLAY_HSYNC_WITH_NOISE = 3,
};
enum
{
CELL_GCM_DEBUG_LEVEL0 = 1,
CELL_GCM_DEBUG_LEVEL1 = 2,
CELL_GCM_DEBUG_LEVEL2 = 3,
};
enum
{
CELL_GCM_DISPLAY_FREQUENCY_59_94HZ = 1,
CELL_GCM_DISPLAY_FREQUENCY_SCANOUT = 2,
CELL_GCM_DISPLAY_FREQUENCY_DISABLE = 3,
};
struct CellGcmControl
{
u32 put;

View File

@ -252,6 +252,9 @@ public:
u32 m_ioAddress, m_ioSize, m_ctrlAddress;
int m_flip_status;
int m_flip_mode;
int m_debug_level;
int m_frequency_mode;
u32 m_tiles_addr;
u32 m_zculls_addr;
@ -518,6 +521,8 @@ protected:
, m_ctrl(nullptr)
, m_flip_status(0)
, m_flip_mode(CELL_GCM_DISPLAY_VSYNC)
, m_debug_level(CELL_GCM_DEBUG_LEVEL0)
, m_frequency_mode(CELL_GCM_DISPLAY_FREQUENCY_DISABLE)
, m_main_mem_addr(0)
, m_local_mem_addr(0)
, m_draw_mode(0)

View File

@ -0,0 +1,421 @@
#include "stdafx.h"
#include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h"
void cellFont_init();
Module cellFont(0x0019, cellFont_init);
// 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 CellFontConfig
{
u32 buffer;
u32 size;
u32 userFontEntryMax;
u32 userFontEntrys;
u32 flags;
};
struct CellFontType
{
u32 type;
u32 map;
};
struct CellFontHorizontalLayout
{
float baseLineY;
float lineHeight;
float effectHeight;
};
struct CellFontVerticalLayout
{
float baseLineX;
float lineWidth;
float effectWidth;
};
struct CellFontGlyphMetrics
{
float width;
float height;
struct Horizontal
{
float bearingX;
float bearingY;
float advance;
};
struct Vertical
{
float bearingX;
float bearingY;
float advance;
};
};
struct CellFontRendererConfig
{
struct BufferingPolicy
{
u32 buffer;
u32 initSize;
u32 maxSize;
u32 expandSize;
u32 resetSize;
};
};
s32 cellFontInit (u32 buffer, u32 size, u32 userFontEntryMax, u32 userFontEntrys, u32 flags)
{
cellFont.Log("cellFontInit(buffer=0x%x,size=0x%x,userFontEntryMax=0x%x,flags=0x%x)", buffer, size, userFontEntryMax, flags);
return CELL_FONT_OK;
}
s32 cellFontSetFontsetOpenMode(u32 openMode)
{
cellFont.Log("cellFontSetFontsetOpenMode(openMode=0x%x)", openMode);
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
s32 cellFontSetFontOpenMode(u32 openMode)
{
cellFont.Log("cellFontSetFontOpenMode(openMode=0x%x)", openMode);
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontCreateRenderer()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGetHorizontalLayout()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontDestroyRenderer()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetupRenderScalePixel()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontOpenFontInstance()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetScalePixel()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGetRenderCharGlyphMetrics()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontEndLibrary()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontBindRenderer()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontEnd()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetEffectSlant ()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontRenderCharGlyphImage()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
void cellFontRenderSurfaceInit()
{
UNIMPLEMENTED_FUNC(cellFont);
}
int cellFontGetFontIdCode()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontOpenFontset()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontCloseFont()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
void cellFontRenderSurfaceSetScissor()
{
UNIMPLEMENTED_FUNC(cellFont);
}
int cellFontGetCharGlyphMetrics()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontUnbindRenderer()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontInitializeWithRevision()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGraphicsSetFontRGBA()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontOpenFontsetOnMemory()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontOpenFontFile()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGraphicsSetScalePixel()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGraphicsGetScalePixel()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetEffectWeight()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGlyphSetupVertexesGlyph()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGetVerticalLayout()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGetRenderCharGlyphMetricsVertical()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetScalePoint()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetupRenderEffectSlant()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGraphicsSetLineRGBA()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGraphicsSetDrawType()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontEndGraphics()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGraphicsSetupDrawContext()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontOpenFontMemory()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetupRenderEffectWeight()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGlyphGetOutlineControlDistance()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGlyphGetVertexesGlyphSize()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGenerateCharGlyph()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontDeleteGlyph()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontExtend()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontRenderCharGlyphImageVertical()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontSetResolutionDpi()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
int cellFontGetCharGlyphMetricsVertical()
{
UNIMPLEMENTED_FUNC(cellFont);
return CELL_FONT_OK;
}
void cellFont_init()
{
cellFont.AddFunc(0x25c107e6, cellFontInit);
cellFont.AddFunc(0x6bf6f832, cellFontSetFontsetOpenMode);
cellFont.AddFunc(0x6cfada83, cellFontSetFontOpenMode);
cellFont.AddFunc(0x042e74e3, cellFontCreateRenderer);
cellFont.AddFunc(0x1387c45c, cellFontGetHorizontalLayout);
cellFont.AddFunc(0x21ebb248, cellFontDestroyRenderer);
cellFont.AddFunc(0x227e1e3c, cellFontSetupRenderScalePixel);
cellFont.AddFunc(0x29329541, cellFontOpenFontInstance);
cellFont.AddFunc(0x297f0e93, cellFontSetScalePixel);
cellFont.AddFunc(0x2da9fd9d, cellFontGetRenderCharGlyphMetrics);
cellFont.AddFunc(0x40d40544, cellFontEndLibrary);
cellFont.AddFunc(0x66a23100, cellFontBindRenderer);
cellFont.AddFunc(0x7ab47f7e, cellFontEnd);
cellFont.AddFunc(0x8657c8f5, cellFontSetEffectSlant);
cellFont.AddFunc(0x88be4799, cellFontRenderCharGlyphImage);
cellFont.AddFunc(0x90b9465e, cellFontRenderSurfaceInit);
cellFont.AddFunc(0x98ac5524, cellFontGetFontIdCode);
cellFont.AddFunc(0xa885cc9b, cellFontOpenFontset);
cellFont.AddFunc(0xb276f1f6, cellFontCloseFont);
cellFont.AddFunc(0xb422b005, cellFontRenderSurfaceSetScissor);
cellFont.AddFunc(0xd8eaee9f, cellFontGetCharGlyphMetrics);
cellFont.AddFunc(0xf03dcc29, cellFontInitializeWithRevision);
cellFont.AddFunc(0x061049ad, cellFontGraphicsSetFontRGBA);
cellFont.AddFunc(0x073fa321, cellFontOpenFontsetOnMemory);
cellFont.AddFunc(0x0a7306a4, cellFontOpenFontFile);
cellFont.AddFunc(0x16322df1, cellFontGraphicsSetScalePixel);
cellFont.AddFunc(0x2388186c, cellFontGraphicsGetScalePixel);
cellFont.AddFunc(0x25253fe4, cellFontSetEffectWeight);
cellFont.AddFunc(0x53f529fe, cellFontGlyphSetupVertexesGlyph);
cellFont.AddFunc(0x698897f8, cellFontGetVerticalLayout);
cellFont.AddFunc(0x700e6223, cellFontGetRenderCharGlyphMetricsVertical);
cellFont.AddFunc(0x70f3e728, cellFontSetScalePoint);
cellFont.AddFunc(0x78d05e08, cellFontSetupRenderEffectSlant);
cellFont.AddFunc(0x7c83bc15, cellFontGraphicsSetLineRGBA);
cellFont.AddFunc(0x87bd650f, cellFontGraphicsSetDrawType);
cellFont.AddFunc(0x8a35c887, cellFontEndGraphics);
cellFont.AddFunc(0x970d4c22, cellFontGraphicsSetupDrawContext);
cellFont.AddFunc(0x9e19072b, cellFontOpenFontMemory);
cellFont.AddFunc(0xa6dc25d1, cellFontSetupRenderEffectWeight);
cellFont.AddFunc(0xa8fae920, cellFontGlyphGetOutlineControlDistance);
cellFont.AddFunc(0xb4d112af, cellFontGlyphGetVertexesGlyphSize);
cellFont.AddFunc(0xc17259de, cellFontGenerateCharGlyph);
cellFont.AddFunc(0xd62f5d76, cellFontDeleteGlyph);
cellFont.AddFunc(0xdee0836c, cellFontExtend);
cellFont.AddFunc(0xe857a0ca, cellFontRenderCharGlyphImageVertical);
cellFont.AddFunc(0xfb3341ba, cellFontSetResolutionDpi);
cellFont.AddFunc(0xfe9a6dd7, cellFontGetCharGlyphMetricsVertical);
cellFont.AddFunc(0xf16379fa, cellFontUnbindRenderer);
}

View File

@ -511,6 +511,38 @@ u32 cellGcmGetReportDataAddressLocation(u8 location, u32 index)
return Emu.GetGSManager().GetRender().m_report_main_addr;
}
int cellGcmSetDebugOutputLevel (int level)
{
cellGcmSys.Warning("cellGcmSetDebugOutputLevel(level=%d)", level);
switch (level)
{
case CELL_GCM_DEBUG_LEVEL0:
case CELL_GCM_DEBUG_LEVEL1:
case CELL_GCM_DEBUG_LEVEL2:
Emu.GetGSManager().GetRender().m_debug_level = level;
break;
default: return CELL_EINVAL;
}
}
int cellGcmSetSecondVFrequency (u32 freq)
{
cellGcmSys.Warning("cellGcmSetSecondVFrequency(level=%d)", freq);
switch (freq)
{
case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ:
case CELL_GCM_DISPLAY_FREQUENCY_SCANOUT:
case CELL_GCM_DISPLAY_FREQUENCY_DISABLE:
Emu.GetGSManager().GetRender().m_frequency_mode = freq;
break;
default: return CELL_EINVAL;
}
}
void cellGcmSys_init()
{
cellGcmSys.AddFunc(0x055bd74d, cellGcmGetTiledPitchSize);
@ -555,4 +587,6 @@ void cellGcmSys_init()
cellGcmSys.AddFunc(0x657571f7, cellGcmGetTileInfo);
cellGcmSys.AddFunc(0xcaabd992, cellGcmInitDefaultFifoMode);
cellGcmSys.AddFunc(0x8572bce2, cellGcmGetReportDataAddressLocation);
cellGcmSys.AddFunc(0x51c9d62b, cellGcmSetDebugOutputLevel);
cellGcmSys.AddFunc(0x4d7ce993, cellGcmSetSecondVFrequency);
}

View File

@ -79,6 +79,7 @@ extern int cellGcmSetFlipHandler(u32 handler_addr);
extern int cellGcmAddressToOffset(u32 address, mem32_t offset);
extern int cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height);
extern int cellGcmSetPrepareFlip(mem_ptr_t<CellGcmContextData> ctx, u32 id);
extern int cellGcmSetSecondVFrequency(u32 freq);
int cellRescGetNumColorBuffers(u32 dstMode, u32 palTemporalMode, u32 reserved);
// Help Functions
@ -522,7 +523,7 @@ int cellRescSetDisplayMode(u32 displayMode)
//int ret = InitSystemResource();
//if (ret) return ret;
//InitLabels();
//cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
//cellGcmSetVBlankHandler(CCellRescInternal::IntrHandler50);
//cellGcmSetSecondVHandler(CCellRescInternal::IntrHandler60);
cellGcmSetFlipHandler(NULL);
@ -530,14 +531,14 @@ int cellRescSetDisplayMode(u32 displayMode)
else if (IsPalDrop())
{
//InitLabels();
//cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
//cellGcmSetVBlankHandler(NULL);
//cellGcmSetSecondVHandler(CCellRescInternal::IntrHandler60Drop);
cellGcmSetFlipHandler(NULL);
}
else if (IsPal60Hsync())
{
//cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
//cellGcmSetVBlankHandler(NULL);
}

View File

@ -128,13 +128,13 @@ public:
void Load()
{
CPUDecoderMode.Load(2);
GSRenderMode.Load(0);
GSRenderMode.Load(1);
GSResolution.Load(4);
GSAspectRatio.Load(1);
GSAspectRatio.Load(2);
GSVSyncEnable.Load(false);
GSDumpColorBuffers.Load(true);
GSDumpDepthBuffer.Load(true);
PadHandlerMode.Load(0);
PadHandlerMode.Load(1);
KeyboardHandlerMode.Load(0);
MouseHandlerMode.Load(0);
}

View File

@ -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">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@ -260,6 +260,7 @@
<ClCompile Include="Emu\SysCalls\lv2\SC_TTY.cpp" />
<ClCompile Include="Emu\SysCalls\Modules.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellAudio.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellFont.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellGame.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellGcmSys.cpp" />
<ClCompile Include="Emu\SysCalls\Modules\cellGifDec.cpp" />

View File

@ -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">
<ItemGroup>
<Filter Include="Emu">
@ -322,6 +322,9 @@
<ClCompile Include="Emu\SysCalls\Modules\cellAudio.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\cellFont.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\SysCalls\Modules\cellRtc.cpp">
<Filter>Emu\SysCalls\Modules</Filter>
</ClCompile>