mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 01:08:39 +12:00
Reordered functions for organization.
This commit is contained in:
parent
a62552b086
commit
eab81deb27
1 changed files with 519 additions and 494 deletions
|
@ -44,7 +44,7 @@ int32_t cellGcmUnmapEaIoAddress(u64 ea);
|
||||||
int32_t cellGcmUnmapIoAddress(u64 io);
|
int32_t cellGcmUnmapIoAddress(u64 io);
|
||||||
int32_t cellGcmUnreserveIoMapSize(u32 size);
|
int32_t cellGcmUnreserveIoMapSize(u32 size);
|
||||||
|
|
||||||
//------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
CellGcmConfig current_config;
|
CellGcmConfig current_config;
|
||||||
CellGcmContextData current_context;
|
CellGcmContextData current_context;
|
||||||
|
@ -53,6 +53,113 @@ gcmInfo gcm_info;
|
||||||
u32 map_offset_addr = 0;
|
u32 map_offset_addr = 0;
|
||||||
u32 map_offset_pos = 0;
|
u32 map_offset_pos = 0;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// Data Retrieval
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
u32 cellGcmGetLabelAddress(u8 index)
|
||||||
|
{
|
||||||
|
cellGcmSys.Log("cellGcmGetLabelAddress(index=%d)", index);
|
||||||
|
return Memory.RSXCMDMem.GetStartAddr() + 0x10 * index;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 cellGcmGetReportDataAddressLocation(u8 location, u32 index)
|
||||||
|
{
|
||||||
|
ConLog.Warning("cellGcmGetReportDataAddressLocation(location=%d, index=%d)", location, index);
|
||||||
|
return Emu.GetGSManager().GetRender().m_report_main_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
u64 cellGcmGetTimeStamp(u32 index)
|
||||||
|
{
|
||||||
|
cellGcmSys.Log("cellGcmGetTimeStamp(index=%d)", index);
|
||||||
|
return Memory.Read64(Memory.RSXFBMem.GetStartAddr() + index * 0x10);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// Command Buffer Control
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
u32 cellGcmGetControlRegister()
|
||||||
|
{
|
||||||
|
cellGcmSys.Log("cellGcmGetControlRegister()");
|
||||||
|
|
||||||
|
return gcm_info.control_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 cellGcmGetDefaultCommandWordSize()
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmGetDefaultCommandWordSize()");
|
||||||
|
return 0x400;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 cellGcmGetDefaultSegmentWordSize()
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmGetDefaultSegmentWordSize()");
|
||||||
|
return 0x100;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmInitDefaultFifoMode(int mode)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmInitDefaultFifoMode(mode=%d)", mode);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetDefaultFifoSize(u32 bufferSize, u32 segmentSize)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmSetDefaultFifoSize(bufferSize=0x%x, segmentSize=0x%x)", bufferSize, segmentSize);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
// Hardware Resource Management
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
int cellGcmBindTile(u8 index)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmBindTile(index=%d)", index);
|
||||||
|
|
||||||
|
if (index >= RSXThread::m_tiles_count)
|
||||||
|
{
|
||||||
|
return CELL_GCM_ERROR_INVALID_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& tile = Emu.GetGSManager().GetRender().m_tiles[index];
|
||||||
|
tile.m_binded = true;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmBindZcull(u8 index)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("TODO: cellGcmBindZcull(index=%d)", index);
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmGetConfiguration(mem_ptr_t<CellGcmConfig> config)
|
||||||
|
{
|
||||||
|
cellGcmSys.Log("cellGcmGetConfiguration(config_addr=0x%x)", config.GetAddr());
|
||||||
|
|
||||||
|
if (!config.IsGood()) return CELL_EFAULT;
|
||||||
|
|
||||||
|
*config = current_config;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmGetFlipStatus()
|
||||||
|
{
|
||||||
|
return Emu.GetGSManager().GetRender().m_flip_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 cellGcmGetTiledPitchSize(u32 size)
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
cellGcmSys.Warning("cellGcmGetTiledPitchSize(size=%d)", size);
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
int cellGcmInit(u32 context_addr, u32 cmdSize, u32 ioSize, u32 ioAddress)
|
int cellGcmInit(u32 context_addr, u32 cmdSize, u32 ioSize, u32 ioAddress)
|
||||||
{
|
{
|
||||||
cellGcmSys.Warning("cellGcmInit(context_addr=0x%x,cmdSize=0x%x,ioSize=0x%x,ioAddress=0x%x)", context_addr, cmdSize, ioSize, ioAddress);
|
cellGcmSys.Warning("cellGcmInit(context_addr=0x%x,cmdSize=0x%x,ioSize=0x%x,ioAddress=0x%x)", context_addr, cmdSize, ioSize, ioAddress);
|
||||||
|
@ -119,13 +226,27 @@ int cellGcmInit(u32 context_addr, u32 cmdSize, u32 ioSize, u32 ioAddress)
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmGetConfiguration(mem_ptr_t<CellGcmConfig> config)
|
int cellGcmResetFlipStatus()
|
||||||
{
|
{
|
||||||
cellGcmSys.Log("cellGcmGetConfiguration(config_addr=0x%x)", config.GetAddr());
|
Emu.GetGSManager().GetRender().m_flip_status = 1;
|
||||||
|
|
||||||
if(!config.IsGood()) return CELL_EFAULT;
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
*config = current_config;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -151,17 +272,50 @@ int cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 cellGcmGetLabelAddress(u8 index)
|
int cellGcmSetFlip(mem_ptr_t<CellGcmContextData> ctxt, u32 id)
|
||||||
{
|
{
|
||||||
cellGcmSys.Log("cellGcmGetLabelAddress(index=%d)", index);
|
cellGcmSys.Log("cellGcmSetFlip(ctx=0x%x, id=0x%x)", ctxt.GetAddr(), id);
|
||||||
return Memory.RSXCMDMem.GetStartAddr() + 0x10 * index;
|
|
||||||
|
int res = cellGcmSetPrepareFlip(ctxt, id);
|
||||||
|
return res < 0 ? CELL_GCM_ERROR_FAILURE : CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 cellGcmGetControlRegister()
|
int cellGcmSetFlipHandler(u32 handler_addr)
|
||||||
{
|
{
|
||||||
cellGcmSys.Log("cellGcmGetControlRegister()");
|
cellGcmSys.Warning("cellGcmSetFlipHandler(handler_addr=%d)", handler_addr);
|
||||||
|
if (handler_addr != 0 && !Memory.IsGoodAddr(handler_addr))
|
||||||
|
{
|
||||||
|
return CELL_EFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
return gcm_info.control_addr;
|
Emu.GetGSManager().GetRender().m_flip_handler.SetAddr(handler_addr);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetFlipMode(u32 mode)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmSetFlipMode(mode=%d)", mode);
|
||||||
|
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case CELL_GCM_DISPLAY_HSYNC:
|
||||||
|
case CELL_GCM_DISPLAY_VSYNC:
|
||||||
|
case CELL_GCM_DISPLAY_HSYNC_WITH_NOISE:
|
||||||
|
Emu.GetGSManager().GetRender().m_flip_mode = mode;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return CELL_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cellGcmSetFlipStatus()
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmSetFlipStatus()");
|
||||||
|
|
||||||
|
Emu.GetGSManager().GetRender().m_flip_status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmSetPrepareFlip(mem_ptr_t<CellGcmContextData> ctxt, u32 id)
|
int cellGcmSetPrepareFlip(mem_ptr_t<CellGcmContextData> ctxt, u32 id)
|
||||||
|
@ -198,265 +352,24 @@ int cellGcmSetPrepareFlip(mem_ptr_t<CellGcmContextData> ctxt, u32 id)
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmSetFlipCommand(u32 ctx, u32 id)
|
int cellGcmSetSecondVFrequency(u32 freq)
|
||||||
{
|
{
|
||||||
return cellGcmSetPrepareFlip(ctx, id);
|
cellGcmSys.Warning("cellGcmSetSecondVFrequency(level=%d)", freq);
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetZcull(u8 index, u32 offset, u32 width, u32 height, u32 cullStart, u32 zFormat, u32 aaFormat, u32 zCullDir, u32 zCullFormat, u32 sFunc, u32 sRef, u32 sMask)
|
switch (freq)
|
||||||
{
|
{
|
||||||
cellGcmSys.Warning("TODO: cellGcmSetZcull(index=%d, offset=0x%x, width=%d, height=%d, cullStart=0x%x, zFormat=0x%x, aaFormat=0x%x, zCullDir=0x%x, zCullFormat=0x%x, sFunc=0x%x, sRef=0x%x, sMask=0x%x)",
|
case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ:
|
||||||
index, offset, width, height, cullStart, zFormat, aaFormat, zCullDir, zCullFormat, sFunc, sRef, sMask);
|
case CELL_GCM_DISPLAY_FREQUENCY_SCANOUT:
|
||||||
|
case CELL_GCM_DISPLAY_FREQUENCY_DISABLE:
|
||||||
return CELL_OK;
|
Emu.GetGSManager().GetRender().m_frequency_mode = freq;
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmBindZcull(u8 index)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("TODO: cellGcmBindZcull(index=%d)", index);
|
|
||||||
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 cellGcmGetZcullInfo()
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmGetZcullInfo()");
|
|
||||||
return Emu.GetGSManager().GetRender().m_zculls_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmGetFlipStatus()
|
|
||||||
{
|
|
||||||
return Emu.GetGSManager().GetRender().m_flip_status;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmResetFlipStatus()
|
|
||||||
{
|
|
||||||
Emu.GetGSManager().GetRender().m_flip_status = 1;
|
|
||||||
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetFlipMode(u32 mode)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmSetFlipMode(mode=%d)", mode);
|
|
||||||
|
|
||||||
switch(mode)
|
|
||||||
{
|
|
||||||
case CELL_GCM_DISPLAY_HSYNC:
|
|
||||||
case CELL_GCM_DISPLAY_VSYNC:
|
|
||||||
case CELL_GCM_DISPLAY_HSYNC_WITH_NOISE:
|
|
||||||
Emu.GetGSManager().GetRender().m_flip_mode = mode;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default: return CELL_EINVAL;
|
||||||
return CELL_EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 cellGcmGetTiledPitchSize(u32 size)
|
|
||||||
{
|
|
||||||
//TODO
|
|
||||||
cellGcmSys.Warning("cellGcmGetTiledPitchSize(size=%d)", size);
|
|
||||||
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 cellGcmSetUserHandler(u32 handler)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmSetUserHandler(handler=0x%x)", handler);
|
|
||||||
return handler;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 cellGcmGetDefaultCommandWordSize()
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmGetDefaultCommandWordSize()");
|
|
||||||
return 0x400;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 cellGcmGetDefaultSegmentWordSize()
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmGetDefaultSegmentWordSize()");
|
|
||||||
return 0x100;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetDefaultFifoSize(u32 bufferSize, u32 segmentSize)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmSetDefaultFifoSize(bufferSize=0x%x, segmentSize=0x%x)", bufferSize, segmentSize);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmUnbindZcull(u8 index)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmUnbindZcull(index=%d)", index);
|
|
||||||
if(index >= 8)
|
|
||||||
return CELL_EINVAL;
|
|
||||||
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
u64 cellGcmGetTimeStamp(u32 index)
|
|
||||||
{
|
|
||||||
cellGcmSys.Log("cellGcmGetTimeStamp(index=%d)", index);
|
|
||||||
return Memory.Read64(Memory.RSXFBMem.GetStartAddr() + index * 0x10);
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetFlipHandler(u32 handler_addr)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmSetFlipHandler(handler_addr=%d)", handler_addr);
|
|
||||||
if(handler_addr != 0 && !Memory.IsGoodAddr(handler_addr))
|
|
||||||
{
|
|
||||||
return CELL_EFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
Emu.GetGSManager().GetRender().m_flip_handler.SetAddr(handler_addr);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
s64 cellGcmFunc15()
|
|
||||||
{
|
|
||||||
cellGcmSys.Error("cellGcmFunc15()");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetFlipCommandWithWaitLabel(u32 ctx, u32 id, u32 label_index, u32 label_value)
|
|
||||||
{
|
|
||||||
int res = cellGcmSetPrepareFlip(ctx, id);
|
|
||||||
Memory.Write32(Memory.RSXCMDMem.GetStartAddr() + 0x10 * label_index, label_value);
|
|
||||||
return res < 0 ? CELL_GCM_ERROR_FAILURE : CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetFlip(mem_ptr_t<CellGcmContextData> ctxt, u32 id)
|
|
||||||
{
|
|
||||||
cellGcmSys.Log("cellGcmSetFlip(ctx=0x%x, id=0x%x)", ctxt.GetAddr(), id);
|
|
||||||
|
|
||||||
int res = cellGcmSetPrepareFlip(ctxt, id);
|
|
||||||
return res < 0 ? CELL_GCM_ERROR_FAILURE : CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetWaitFlip(mem_ptr_t<CellGcmContextData> ctxt)
|
|
||||||
{
|
|
||||||
cellGcmSys.Log("cellGcmSetWaitFlip(ctx=0x%x)", ctxt.GetAddr());
|
|
||||||
|
|
||||||
GSLockCurrent lock(GS_LOCK_WAIT_FLIP);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmInitCursor()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetCursorPosition(s32 x, s32 y)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetCursorDisable()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetVBlankHandler()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmUpdateCursor()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetCursorEnable()
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetCursorImageOffset(u32 offset)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 cellGcmGetDisplayInfo()
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmGetDisplayInfo() = 0x%x", Emu.GetGSManager().GetRender().m_gcm_buffers_addr);
|
|
||||||
return Emu.GetGSManager().GetRender().m_gcm_buffers_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmGetCurrentDisplayBufferId(u32 id_addr)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmGetCurrentDisplayBufferId(id_addr=0x%x)", id_addr);
|
|
||||||
|
|
||||||
if(!Memory.IsGoodAddr(id_addr))
|
|
||||||
{
|
|
||||||
return CELL_EFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
Memory.Write32(id_addr, Emu.GetGSManager().GetRender().m_gcm_current_buffer);
|
|
||||||
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cellGcmSetDefaultCommandBuffer()
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmSetDefaultCommandBuffer()");
|
|
||||||
Memory.Write32(Emu.GetGSManager().GetRender().m_ctxt_addr, gcm_info.context_addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void cellGcmSetFlipStatus()
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmSetFlipStatus()");
|
|
||||||
|
|
||||||
Emu.GetGSManager().GetRender().m_flip_status = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 comp, u16 base, u8 bank)
|
|
||||||
{
|
|
||||||
cellGcmSys.Warning("cellGcmSetTile(index=%d, location=%d, offset=%d, size=%d, pitch=%d, comp=%d, base=%d, bank=%d)",
|
|
||||||
index, location, offset, size, pitch, comp, base, bank);
|
|
||||||
|
|
||||||
// Copied form cellGcmSetTileInfo
|
|
||||||
if(index >= RSXThread::m_tiles_count || base >= 800 || bank >= 4)
|
|
||||||
{
|
|
||||||
return CELL_GCM_ERROR_INVALID_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(offset & 0xffff || size & 0xffff || pitch & 0xf)
|
|
||||||
{
|
|
||||||
return CELL_GCM_ERROR_INVALID_ALIGNMENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(location >= 2 || (comp != 0 && (comp < 7 || comp > 12)))
|
|
||||||
{
|
|
||||||
return CELL_GCM_ERROR_INVALID_ENUM;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(comp)
|
|
||||||
{
|
|
||||||
cellGcmSys.Error("cellGcmSetTile: bad comp! (%d)", comp);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto& tile = Emu.GetGSManager().GetRender().m_tiles[index];
|
|
||||||
tile.m_location = location;
|
|
||||||
tile.m_offset = offset;
|
|
||||||
tile.m_size = size;
|
|
||||||
tile.m_pitch = pitch;
|
|
||||||
tile.m_comp = comp;
|
|
||||||
tile.m_base = base;
|
|
||||||
tile.m_bank = bank;
|
|
||||||
Memory.WriteData(Emu.GetGSManager().GetRender().m_tiles_addr + sizeof(CellGcmTileInfo) * index, tile.Pack());
|
|
||||||
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int cellGcmSetTileInfo(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 comp, u16 base, u8 bank)
|
int cellGcmSetTileInfo(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 comp, u16 base, u8 bank)
|
||||||
{
|
{
|
||||||
cellGcmSys.Warning("cellGcmSetTileInfo(index=%d, location=%d, offset=%d, size=%d, pitch=%d, comp=%d, base=%d, bank=%d)",
|
cellGcmSys.Warning("cellGcmSetTileInfo(index=%d, location=%d, offset=%d, size=%d, pitch=%d, comp=%d, base=%d, bank=%d)",
|
||||||
|
@ -495,17 +408,30 @@ int cellGcmSetTileInfo(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmBindTile(u8 index)
|
u32 cellGcmSetUserHandler(u32 handler)
|
||||||
{
|
{
|
||||||
cellGcmSys.Warning("cellGcmBindTile(index=%d)", index);
|
cellGcmSys.Warning("cellGcmSetUserHandler(handler=0x%x)", handler);
|
||||||
|
return handler;
|
||||||
if(index >= RSXThread::m_tiles_count)
|
|
||||||
{
|
|
||||||
return CELL_GCM_ERROR_INVALID_VALUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& tile = Emu.GetGSManager().GetRender().m_tiles[index];
|
int cellGcmSetVBlankHandler()
|
||||||
tile.m_binded = true;
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetWaitFlip(mem_ptr_t<CellGcmContextData> ctxt)
|
||||||
|
{
|
||||||
|
cellGcmSys.Log("cellGcmSetWaitFlip(ctx=0x%x)", ctxt.GetAddr());
|
||||||
|
|
||||||
|
GSLockCurrent lock(GS_LOCK_WAIT_FLIP);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetZcull(u8 index, u32 offset, u32 width, u32 height, u32 cullStart, u32 zFormat, u32 aaFormat, u32 zCullDir, u32 zCullFormat, u32 sFunc, u32 sRef, u32 sMask)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("TODO: cellGcmSetZcull(index=%d, offset=0x%x, width=%d, height=%d, cullStart=0x%x, zFormat=0x%x, aaFormat=0x%x, zCullDir=0x%x, zCullFormat=0x%x, sFunc=0x%x, sRef=0x%x, sMask=0x%x)",
|
||||||
|
index, offset, width, height, cullStart, zFormat, aaFormat, zCullDir, zCullFormat, sFunc, sRef, sMask);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
@ -525,63 +451,50 @@ int cellGcmUnbindTile(u8 index)
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cellGcmUnbindZcull(u8 index)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmUnbindZcull(index=%d)", index);
|
||||||
|
if (index >= 8)
|
||||||
|
return CELL_EINVAL;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
u32 cellGcmGetTileInfo()
|
u32 cellGcmGetTileInfo()
|
||||||
{
|
{
|
||||||
cellGcmSys.Warning("cellGcmGetTileInfo()");
|
cellGcmSys.Warning("cellGcmGetTileInfo()");
|
||||||
return Emu.GetGSManager().GetRender().m_tiles_addr;
|
return Emu.GetGSManager().GetRender().m_tiles_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmInitDefaultFifoMode(int mode)
|
u32 cellGcmGetZcullInfo()
|
||||||
{
|
{
|
||||||
cellGcmSys.Warning("cellGcmInitDefaultFifoMode(mode=%d)", mode);
|
cellGcmSys.Warning("cellGcmGetZcullInfo()");
|
||||||
return CELL_OK;
|
return Emu.GetGSManager().GetRender().m_zculls_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 cellGcmGetReportDataAddressLocation(u8 location, u32 index)
|
u32 cellGcmGetDisplayInfo()
|
||||||
{
|
{
|
||||||
ConLog.Warning("cellGcmGetReportDataAddressLocation(location=%d, index=%d)", location, index);
|
cellGcmSys.Warning("cellGcmGetDisplayInfo() = 0x%x", Emu.GetGSManager().GetRender().m_gcm_buffers_addr);
|
||||||
return Emu.GetGSManager().GetRender().m_report_main_addr;
|
return Emu.GetGSManager().GetRender().m_gcm_buffers_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmSetDebugOutputLevel (int level)
|
int cellGcmGetCurrentDisplayBufferId(u32 id_addr)
|
||||||
{
|
{
|
||||||
cellGcmSys.Warning("cellGcmSetDebugOutputLevel(level=%d)", level);
|
cellGcmSys.Warning("cellGcmGetCurrentDisplayBufferId(id_addr=0x%x)", id_addr);
|
||||||
|
|
||||||
switch (level)
|
if (!Memory.IsGoodAddr(id_addr))
|
||||||
{
|
{
|
||||||
case CELL_GCM_DEBUG_LEVEL0:
|
return CELL_EFAULT;
|
||||||
case CELL_GCM_DEBUG_LEVEL1:
|
|
||||||
case CELL_GCM_DEBUG_LEVEL2:
|
|
||||||
Emu.GetGSManager().GetRender().m_debug_level = level;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default: return CELL_EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Memory.Write32(id_addr, Emu.GetGSManager().GetRender().m_gcm_current_buffer);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellGcmSetSecondVFrequency (u32 freq)
|
//----------------------------------------------------------------------------
|
||||||
{
|
// Memory Mapping
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CELL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*------------------------------------------------------------
|
|
||||||
Memory Mapping
|
|
||||||
------------------------------------------------------------*/
|
|
||||||
|
|
||||||
gcm_offset offsetTable = { 0, 0 };
|
gcm_offset offsetTable = { 0, 0 };
|
||||||
|
|
||||||
|
@ -811,7 +724,119 @@ int32_t cellGcmUnreserveIoMapSize(u32 size)
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
// Cursor
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
|
int cellGcmInitCursor()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetCursorPosition(s32 x, s32 y)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetCursorDisable()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int cellGcmUpdateCursor()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetCursorEnable()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetCursorImageOffset(u32 offset)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
// Functions for Maintaining Compatibility
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void cellGcmSetDefaultCommandBuffer()
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmSetDefaultCommandBuffer()");
|
||||||
|
Memory.Write32(Emu.GetGSManager().GetRender().m_ctxt_addr, gcm_info.context_addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
// Other
|
||||||
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
|
int cellGcmSetFlipCommand(u32 ctx, u32 id)
|
||||||
|
{
|
||||||
|
return cellGcmSetPrepareFlip(ctx, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
s64 cellGcmFunc15()
|
||||||
|
{
|
||||||
|
cellGcmSys.Error("cellGcmFunc15()");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetFlipCommandWithWaitLabel(u32 ctx, u32 id, u32 label_index, u32 label_value)
|
||||||
|
{
|
||||||
|
int res = cellGcmSetPrepareFlip(ctx, id);
|
||||||
|
Memory.Write32(Memory.RSXCMDMem.GetStartAddr() + 0x10 * label_index, label_value);
|
||||||
|
return res < 0 ? CELL_GCM_ERROR_FAILURE : CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 comp, u16 base, u8 bank)
|
||||||
|
{
|
||||||
|
cellGcmSys.Warning("cellGcmSetTile(index=%d, location=%d, offset=%d, size=%d, pitch=%d, comp=%d, base=%d, bank=%d)",
|
||||||
|
index, location, offset, size, pitch, comp, base, bank);
|
||||||
|
|
||||||
|
// Copied form cellGcmSetTileInfo
|
||||||
|
if(index >= RSXThread::m_tiles_count || base >= 800 || bank >= 4)
|
||||||
|
{
|
||||||
|
return CELL_GCM_ERROR_INVALID_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(offset & 0xffff || size & 0xffff || pitch & 0xf)
|
||||||
|
{
|
||||||
|
return CELL_GCM_ERROR_INVALID_ALIGNMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(location >= 2 || (comp != 0 && (comp < 7 || comp > 12)))
|
||||||
|
{
|
||||||
|
return CELL_GCM_ERROR_INVALID_ENUM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(comp)
|
||||||
|
{
|
||||||
|
cellGcmSys.Error("cellGcmSetTile: bad comp! (%d)", comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& tile = Emu.GetGSManager().GetRender().m_tiles[index];
|
||||||
|
tile.m_location = location;
|
||||||
|
tile.m_offset = offset;
|
||||||
|
tile.m_size = size;
|
||||||
|
tile.m_pitch = pitch;
|
||||||
|
tile.m_comp = comp;
|
||||||
|
tile.m_base = base;
|
||||||
|
tile.m_bank = bank;
|
||||||
|
Memory.WriteData(Emu.GetGSManager().GetRender().m_tiles_addr + sizeof(CellGcmTileInfo) * index, tile.Pack());
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
void cellGcmSys_init()
|
void cellGcmSys_init()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue