From ba913459848e7c3708f4918c8a06b7e8a854f710 Mon Sep 17 00:00:00 2001 From: raven02 Date: Wed, 4 Jun 2014 17:12:48 +0800 Subject: [PATCH 1/4] enum for vertex data type --- rpcs3/Emu/GS/GCM.h | 29 ++++++++++++++++++++++-- rpcs3/Emu/GS/GL/GLGSRender.cpp | 30 +++++++++++++------------ rpcs3/Emu/SysCalls/Modules/cellResc.cpp | 6 ++--- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/rpcs3/Emu/GS/GCM.h b/rpcs3/Emu/GS/GCM.h index dc5d7b2203..d73aad78c4 100644 --- a/rpcs3/Emu/GS/GCM.h +++ b/rpcs3/Emu/GS/GCM.h @@ -22,10 +22,27 @@ enum CELL_GCM_DISPLAY_FREQUENCY_DISABLE = 3, }; +enum +{ + CELL_GCM_VERTEX_S1 = 1, + CELL_GCM_VERTEX_F = 2, + CELL_GCM_VERTEX_S = 3, + CELL_GCM_VERTEX_UB = 4, + CELL_GCM_VERTEX_S32K = 5, + CELL_GCM_VERTEX_CMP = 6, + CELL_GCM_VERTEX_UB256 = 7, +} + +enum +{ + CELL_GCM_DRAW_INDEX_ARRAY_TYPE_32 = 0, + CELL_GCM_DRAW_INDEX_ARRAY_TYPE_16 = 1, +} + // GCM Texture enum { - // Format + // Color Flag CELL_GCM_TEXTURE_B8 = 0x81, CELL_GCM_TEXTURE_A1R5G5B5 = 0x82, CELL_GCM_TEXTURE_A4R4G4B4 = 0x83, @@ -54,9 +71,11 @@ enum CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8 = 0xAD, CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8 = 0xAE, - // Format flags + // Swizzle Flag CELL_GCM_TEXTURE_SZ = 0x00, CELL_GCM_TEXTURE_LN = 0x20, + + // Normalization Flag CELL_GCM_TEXTURE_NR = 0x00, CELL_GCM_TEXTURE_UN = 0x40, }; @@ -75,6 +94,12 @@ enum // Depth CELL_GCM_SURFACE_Z16 = 1, CELL_GCM_SURFACE_Z24S8 = 2, + + // Antialias + CELL_GCM_SURFACE_CENTER_1 = 2, + CELL_GCM_SURFACE_DIAGONAL_CENTERED_2 = 3, + CELL_GCM_SURFACE_SQUARE_CENTERED_4 = 4, + CELL_GCM_SURFACE_SQUARE_ROTATED_4 = 5, }; // GCM Reports diff --git a/rpcs3/Emu/GS/GL/GLGSRender.cpp b/rpcs3/Emu/GS/GL/GLGSRender.cpp index 33bd1b2619..ec9a1753a8 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.cpp +++ b/rpcs3/Emu/GS/GL/GLGSRender.cpp @@ -172,7 +172,7 @@ void GLGSRender::EnableVertexData(bool indexed_draw) dump.Write(wxString::Format("VertexData[%d]:\n", i)); switch(m_vertex_data[i].type) { - case 1: + case CELL_GCM_VERTEX_S1: for(u32 j = 0; j gcmSurface, mem_ptr_tantialias) { - case 5: xW=xH=2; break; //case CELL_GCM_SURFACE_SQUARE_ROTATED_4: - case 4: xW=xH=2; break; //case CELL_GCM_SURFACE_SQUARE_CENTERED_4: - case 3: xW=2; break; //case CELL_GCM_SURFACE_DIAGONAL_CENTERED_2: + case CELL_GCM_SURFACE_SQUARE_ROTATED_4: xW=xH=2; break; + case CELL_GCM_SURFACE_SQUARE_CENTERED_4: xW=xH=2; break; + case CELL_GCM_SURFACE_DIAGONAL_CENTERED_2: xW=2; break; default: break; } From c7b26f1372540e3996fa04a5438a6bd4ad5e9843 Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 5 Jun 2014 00:03:31 +0800 Subject: [PATCH 2/4] cellSpurs task error code fixes and plus bunch of new functions add --- rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp | 340 +++++++++++++++++++++-- 1 file changed, 311 insertions(+), 29 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index f3a6096efa..412e8519fa 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -367,6 +367,24 @@ int cellSpursEventFlagTryWait() return CELL_OK; } +int cellSpursEventFlaggetDirection() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursEventFlaggetClearMode() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursEventFlaggetTasksetAddress() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + int _cellSpursLFQueueInitialize() { UNIMPLEMENTED_FUNC(cellSpurs); @@ -397,6 +415,178 @@ int cellSpursQueueDetachLv2EventQueue() return CELL_OK; } +int _cellSpursLFQueuePopBody() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursLFQueueGetTasksetAddress() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncLFQueueGetEntrySize() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} +int cellSyncLFQueueSize() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncLFQueueClear() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} +int _cellSyncLFQueueCompletePushPointer2() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueGetPopPointer2() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueuePeek() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueueSize() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueuePop() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueCompletePushPointer() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueAttachLv2EventQueue() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueuePush() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueueTryPeek() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueGetPushPointer2() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueueTryPush() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueGetPopPointer() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueCompletePopPointer2() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueDetachLv2EventQueue() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueueClear() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncQueueTryPop() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncLFQueueInitialize() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueGetSignalAddress() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueuePushBody() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncLFQueueGetDirection() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSyncLFQueueDepth() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueuePopBody() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueGetPushPointer() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int _cellSyncLFQueueCompletePopPointer() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + int _cellSpursQueueInitialize() { UNIMPLEMENTED_FUNC(cellSpurs); @@ -479,8 +669,8 @@ int _cellSpursSendSignal(mem_ptr_t taskset, u32 taskID) if (!taskset.IsGood()) { - cellSpurs.Error("_cellSpursSendSignal : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("_cellSpursSendSignal : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; @@ -528,8 +718,8 @@ int cellSpursCreateTaskset(mem_ptr_t spurs, mem_ptr_t taskset) if (!taskset.IsGood()) { - cellSpurs.Error("cellSpursJoinTaskset : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursJoinTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; @@ -554,8 +744,8 @@ int cellSpursGetTasksetId(mem_ptr_t taskset, mem32_t workloadI if (!taskset.IsGood() || !workloadId.IsGood()) { - cellSpurs.Error("cellSpursGetTasksetId : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursGetTasksetId : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; @@ -567,8 +757,8 @@ int cellSpursShutdownTaskset(mem_ptr_t taskset) if (!taskset.IsGood()) { - cellSpurs.Error("cellSpursShutdownTaskset : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursShutdownTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; @@ -583,8 +773,8 @@ int cellSpursCreateTask(mem_ptr_t taskset, mem32_t taskID, mem if (!taskset.IsGood()) { - cellSpurs.Error("cellSpursCreateTask : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursCreateTask : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; @@ -686,6 +876,42 @@ int cellSpursDestroyTaskset2() return CELL_OK; } +int cellSpursCreateTask2WithBinInfo() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursLookUpTasksetAddress() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursTasksetGetSpursAddress() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpurssetExceptionEventHandler() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursUnsetExceptionEventHandler() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursGetTasksetInfo() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + int _cellSpursTasksetAttributeInitialize() { UNIMPLEMENTED_FUNC(cellSpurs); @@ -716,12 +942,24 @@ int cellSpursJobChainAttributeSetHaltOnError() return CELL_OK; } +int cellSpursJobChainAttributesetJobTypeMemoryCheck() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + int cellSpursJobGuardNotify() { UNIMPLEMENTED_FUNC(cellSpurs); return CELL_OK; } +int cellSpursJobGuardReset() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + int cellSpursRunJobChain() { UNIMPLEMENTED_FUNC(cellSpurs); @@ -736,7 +974,7 @@ int cellSpursJobChainGetError() void cellSpurs_init() { - //libspurs core functions + // Core cellSpurs.AddFunc(0xacfc8dbc, cellSpursInitialize); cellSpurs.AddFunc(0xaa6269a8, cellSpursInitializeWithAttribute); cellSpurs.AddFunc(0x30aa96c4, cellSpursInitializeWithAttribute2); @@ -753,10 +991,15 @@ void cellSpurs_init() cellSpurs.AddFunc(0x1f402f8f, cellSpursGetInfo); cellSpurs.AddFunc(0x84d2f6d5, cellSpursSetMaxContention); cellSpurs.AddFunc(0x80a29e27, cellSpursSetPriorities); + // cellSpurs.AddFunc(, cellSpursSetPriority); cellSpurs.AddFunc(0x4de203e2, cellSpursSetPreemptionVictimHints); cellSpurs.AddFunc(0xb9bc6207, cellSpursAttachLv2EventQueue); cellSpurs.AddFunc(0x4e66d483, cellSpursDetachLv2EventQueue); - cellSpurs.AddFunc(0xe0a6dbe4, _cellSpursSendSignal); + cellSpurs.AddFunc(0x32b94add, cellSpursEnableExceptionEventHandler); + cellSpurs.AddFunc(0x7517724a, cellSpursSetGlobalExceptionEventHandler); + cellSpurs.AddFunc(0x861237f8, cellSpursUnsetGlobalExceptionEventHandler); + + // Event flag cellSpurs.AddFunc(0x5ef96465, _cellSpursEventFlagInitialize); cellSpurs.AddFunc(0x87630976, cellSpursEventFlagAttachLv2EventQueue); cellSpurs.AddFunc(0x22aab31d, cellSpursEventFlagDetachLv2EventQueue); @@ -764,11 +1007,11 @@ void cellSpurs_init() cellSpurs.AddFunc(0x4ac7bae4, cellSpursEventFlagClear); cellSpurs.AddFunc(0xf5507729, cellSpursEventFlagSet); cellSpurs.AddFunc(0x6d2d9339, cellSpursEventFlagTryWait); - cellSpurs.AddFunc(0x32b94add, cellSpursEnableExceptionEventHandler); - cellSpurs.AddFunc(0x7517724a, cellSpursSetGlobalExceptionEventHandler); - cellSpurs.AddFunc(0x861237f8, cellSpursUnsetGlobalExceptionEventHandler); + cellSpurs.AddFunc(0x890f9e5a, cellSpursEventFlaggetDirection); + cellSpurs.AddFunc(0x4d1e9373, cellSpursEventFlaggetClearMode); + cellSpurs.AddFunc(0x947efb0b, cellSpursEventFlaggetTasksetAddress); - //libspurs task functions + // Taskset cellSpurs.AddFunc(0x52cc6c82, cellSpursCreateTaskset); cellSpurs.AddFunc(0xc10931cb, cellSpursCreateTasksetWithAttribute); cellSpurs.AddFunc(0x16394a4e, _cellSpursTasksetAttributeInitialize); @@ -777,12 +1020,6 @@ void cellSpurs_init() cellSpurs.AddFunc(0x9f72add3, cellSpursJoinTaskset); cellSpurs.AddFunc(0xe7dd87e1, cellSpursGetTasksetId); cellSpurs.AddFunc(0xa789e631, cellSpursShutdownTaskset); - cellSpurs.AddFunc(0x4a6465e3, cellSpursCreateTaskset2); - cellSpurs.AddFunc(0xe14ca62d, cellSpursCreateTask2); - cellSpurs.AddFunc(0xa7a94892, cellSpursJoinTask2); - cellSpurs.AddFunc(0x838fa4f0, cellSpursTryJoinTask2); - cellSpurs.AddFunc(0x1ebcf459, cellSpursDestroyTaskset2); - cellSpurs.AddFunc(0xbeb600ac, cellSpursCreateTask); cellSpurs.AddFunc(0x1d46fedf, cellSpursCreateTaskWithAttribute); cellSpurs.AddFunc(0xb8474eff, cellSpursTaskAttributeInitialize); @@ -795,22 +1032,38 @@ void cellSpurs_init() cellSpurs.AddFunc(0x7cb33c2e, cellSpursTaskGetReadOnlyAreaPattern); cellSpurs.AddFunc(0x9197915f, cellSpursTaskGenerateLsPattern); cellSpurs.AddFunc(0x9034e538, cellSpursTaskGetContextSaveAreaSize); + cellSpurs.AddFunc(0xe0a6dbe4, _cellSpursSendSignal); + cellSpurs.AddFunc(0x4a6465e3, cellSpursCreateTaskset2); + cellSpurs.AddFunc(0xe14ca62d, cellSpursCreateTask2); + cellSpurs.AddFunc(0xa7a94892, cellSpursJoinTask2); + cellSpurs.AddFunc(0x838fa4f0, cellSpursTryJoinTask2); + cellSpurs.AddFunc(0x1ebcf459, cellSpursDestroyTaskset2); + cellSpurs.AddFunc(0xe4944a1c, cellSpursCreateTask2WithBinInfo); + cellSpurs.AddFunc(0x4cce88a9, cellSpursLookUpTasksetAddress); + cellSpurs.AddFunc(0x58d58fcf, cellSpursTasksetGetSpursAddress); + cellSpurs.AddFunc(0xd2e23fa9, cellSpurssetExceptionEventHandler); + cellSpurs.AddFunc(0x4c75deb8, cellSpursUnsetExceptionEventHandler); + cellSpurs.AddFunc(0x9fcb567b, cellSpursGetTasksetInfo); - //libspurs job functions + // Job Chain cellSpurs.AddFunc(0x60eb2dec, cellSpursCreateJobChain); cellSpurs.AddFunc(0x303c19cd, cellSpursCreateJobChainWithAttribute); cellSpurs.AddFunc(0x738e40e6, cellSpursShutdownJobChain); cellSpurs.AddFunc(0xa7c066de, cellSpursJoinJobChain); cellSpurs.AddFunc(0xbfea60fa, cellSpursKickJobChain); cellSpurs.AddFunc(0xf31731bb, cellSpursRunJobChain); - cellSpurs.AddFunc(0x68aaeba9, cellSpursJobGuardInitialize); - cellSpurs.AddFunc(0xd5d0b256, cellSpursJobGuardNotify); + cellSpurs.AddFunc(0x161da6a7, cellSpursJobChainGetError); cellSpurs.AddFunc(0x3548f483, _cellSpursJobChainAttributeInitialize); cellSpurs.AddFunc(0x9fef70c2, cellSpursJobChainAttributeSetName); cellSpurs.AddFunc(0xbb68d76e, cellSpursJobChainAttributeSetHaltOnError); - cellSpurs.AddFunc(0x161da6a7, cellSpursJobChainGetError); + cellSpurs.AddFunc(0x2cfccb99, cellSpursJobChainAttributesetJobTypeMemoryCheck); - //libspurs queue functions + // Job Guard + cellSpurs.AddFunc(0x68aaeba9, cellSpursJobGuardInitialize); + cellSpurs.AddFunc(0xd5d0b256, cellSpursJobGuardNotify); + cellSpurs.AddFunc(0x00af2519, cellSpursJobGuardReset); + + // Queue/LFQueue cellSpurs.AddFunc(0x011ee38b, _cellSpursLFQueueInitialize); cellSpurs.AddFunc(0x8a85674d, _cellSpursLFQueuePushBody); cellSpurs.AddFunc(0x1656d49f, cellSpursLFQueueAttachLv2EventQueue); @@ -820,5 +1073,34 @@ void cellSpurs_init() cellSpurs.AddFunc(0x92cff6ed, cellSpursQueuePushBody); cellSpurs.AddFunc(0xe5443be7, cellSpursQueueAttachLv2EventQueue); cellSpurs.AddFunc(0x039d70b7, cellSpursQueueDetachLv2EventQueue); + cellSpurs.AddFunc(0x35dae22b, _cellSpursLFQueuePopBody); + cellSpurs.AddFunc(0xb792ca1a, cellSpursLFQueueGetTasksetAddress); + cellSpurs.AddFunc(0x0c7cb9f7, cellSyncLFQueueGetEntrySize); + cellSpurs.AddFunc(0x167ea63e, cellSyncLFQueueSize); + cellSpurs.AddFunc(0x2af0c515, cellSyncLFQueueClear); + cellSpurs.AddFunc(0x35bbdad2, _cellSyncLFQueueCompletePushPointer2); + cellSpurs.AddFunc(0x46356fe0, _cellSyncLFQueueGetPopPointer2); + cellSpurs.AddFunc(0x48154c9b, cellSyncQueuePeek); + cellSpurs.AddFunc(0x4da349b2, cellSyncQueueSize); + cellSpurs.AddFunc(0x4da6d7e0, cellSyncQueuePop); + cellSpurs.AddFunc(0x4e88c68d, _cellSyncLFQueueCompletePushPointer); + cellSpurs.AddFunc(0x54fc2032, _cellSyncLFQueueAttachLv2EventQueue); + cellSpurs.AddFunc(0x5ae841e5, cellSyncQueuePush); + cellSpurs.AddFunc(0x68af923c, cellSyncQueueTryPeek); + cellSpurs.AddFunc(0x6bb4ef9d,_cellSyncLFQueueGetPushPointer2); + cellSpurs.AddFunc(0x705985cd, cellSyncQueueTryPush); + cellSpurs.AddFunc(0x74c37666, _cellSyncLFQueueGetPopPointer); + cellSpurs.AddFunc(0x7a51deee, _cellSyncLFQueueCompletePopPointer2); + cellSpurs.AddFunc(0x811d148e, _cellSyncLFQueueDetachLv2EventQueue); + cellSpurs.AddFunc(0xa5362e73, cellSyncQueueClear); + cellSpurs.AddFunc(0xa58df87f, cellSyncQueueTryPop); + cellSpurs.AddFunc(0xaa355278, cellSyncLFQueueInitialize); + cellSpurs.AddFunc(0xaff7627a, _cellSyncLFQueueGetSignalAddress); + cellSpurs.AddFunc(0xba5961ca, _cellSyncLFQueuePushBody); + cellSpurs.AddFunc(0xd59aa307, cellSyncLFQueueGetDirection); + cellSpurs.AddFunc(0xe18c273c, cellSyncLFQueueDepth); + cellSpurs.AddFunc(0xe1bc7add, _cellSyncLFQueuePopBody); + cellSpurs.AddFunc(0xe9bf2110, _cellSyncLFQueueGetPushPointer); + cellSpurs.AddFunc(0xfe74e8e7, _cellSyncLFQueueCompletePopPointer); } From 7c137cc482e060481acb3542660ef2f1ef244e34 Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 5 Jun 2014 00:53:37 +0800 Subject: [PATCH 3/4] Build fix --- rpcs3/Emu/GS/GCM.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/GS/GCM.h b/rpcs3/Emu/GS/GCM.h index d73aad78c4..62bf689097 100644 --- a/rpcs3/Emu/GS/GCM.h +++ b/rpcs3/Emu/GS/GCM.h @@ -31,13 +31,13 @@ enum CELL_GCM_VERTEX_S32K = 5, CELL_GCM_VERTEX_CMP = 6, CELL_GCM_VERTEX_UB256 = 7, -} +}; enum { CELL_GCM_DRAW_INDEX_ARRAY_TYPE_32 = 0, CELL_GCM_DRAW_INDEX_ARRAY_TYPE_16 = 1, -} +}; // GCM Texture enum From 1827b918826b3044bf10ed4095cb723028b7136d Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 5 Jun 2014 02:52:30 +0800 Subject: [PATCH 4/4] Check 8-byte and 128-byte alignment for spurs --- rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp | 516 +++++++++++++++++------ 1 file changed, 396 insertions(+), 120 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index 412e8519fa..2f013119da 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -11,6 +11,12 @@ int cellSpursInitialize(mem_ptr_t spurs, int nSpus, int spuPriority, { cellSpurs.Warning("cellSpursInitialize(spurs_addr=0x%x, nSpus=%u, spuPriority=%u, ppuPriority=%u, exitIfNoWork=%u)", spurs.GetAddr(), nSpus, spuPriority, ppuPriority, exitIfNoWork); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursInitialize : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood()) { cellSpurs.Error("cellSpursInitialize : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -27,6 +33,12 @@ int cellSpursFinalize(mem_ptr_t spurs) { cellSpurs.Warning("cellSpursFinalize(spurs_addr=0x%x)", spurs.GetAddr()); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursFinalize : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood()) { cellSpurs.Error("cellSpursFinalize : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -40,10 +52,15 @@ int cellSpursFinalize(mem_ptr_t spurs) int cellSpursInitializeWithAttribute(mem_ptr_t spurs, const mem_ptr_t attr) { - cellSpurs.Warning("cellSpursInitializeWithAttribute(spurs_addr=0x%x, spurs_addr=0x%x)", - spurs.GetAddr(), attr.GetAddr()); + cellSpurs.Warning("cellSpursInitializeWithAttribute(spurs_addr=0x%x, spurs_addr=0x%x)", spurs.GetAddr(), attr.GetAddr()); - if (!attr.IsGood() || !spurs.IsGood()) + if ((spurs.GetAddr() % 128 != 0) || (attr.GetAddr() % 8 != 0)) + { + cellSpurs.Error("cellSpursInitializeWithAttribute : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + + if (!spurs.IsGood() || !attr.IsGood()) { cellSpurs.Error("cellSpursInitializeWithAttribute : CELL_SPURS_CORE_ERROR_NULL_POINTER"); return CELL_SPURS_CORE_ERROR_NULL_POINTER; @@ -56,10 +73,15 @@ int cellSpursInitializeWithAttribute(mem_ptr_t spurs, const mem_ptr_t int cellSpursInitializeWithAttribute2(mem_ptr_t spurs, const mem_ptr_t attr) { - cellSpurs.Warning("cellSpursInitializeWithAttribute2(spurs_addr=0x%x, spurs_addr=0x%x)", - spurs.GetAddr(), attr.GetAddr()); + cellSpurs.Warning("cellSpursInitializeWithAttribute2(spurs_addr=0x%x, spurs_addr=0x%x)", spurs.GetAddr(), attr.GetAddr()); - if (!attr.IsGood() || !spurs.IsGood()) + if ((spurs.GetAddr() % 128 != 0) || (attr.GetAddr() % 8 != 0)) + { + cellSpurs.Error("cellSpursInitializeWithAttribute2 : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + + if (!spurs.IsGood() || !attr.IsGood()) { cellSpurs.Error("cellSpursInitializeWithAttribute2 : CELL_SPURS_CORE_ERROR_NULL_POINTER"); return CELL_SPURS_CORE_ERROR_NULL_POINTER; @@ -74,6 +96,12 @@ int _cellSpursAttributeInitialize(mem_ptr_t attr, int nSpus, { cellSpurs.Warning("_cellSpursAttributeInitialize(attr_addr=0x%x, nSpus=%u, spuPriority=%u, ppuPriority=%u, exitIfNoWork=%u)", attr.GetAddr(), nSpus, spuPriority, ppuPriority, exitIfNoWork); + if (attr.GetAddr() % 8 != 0) + { + cellSpurs.Error("_cellSpursAttributeInitialize : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!attr.IsGood()) { cellSpurs.Error("_cellSpursAttributeInitialize : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -89,6 +117,12 @@ int cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t attr, const me { cellSpurs.Warning("cellSpursAttributeSetNamePrefix(attr_addr=0x%x, prefix_addr=0x%x, size=0x%x)", attr.GetAddr(), prefix.GetAddr(), size); + if (attr.GetAddr() % 8 != 0) + { + cellSpurs.Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!attr.IsGood() || !prefix.IsGood()) { cellSpurs.Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -110,7 +150,10 @@ int cellSpursAttributeSetNamePrefix(mem_ptr_t attr, const me } if (size > 15) + { + cellSpurs.Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_INVAL"); return CELL_SPURS_CORE_ERROR_INVAL; + } attr->attr->_setNamePrefix(Memory.ReadString(prefix.GetAddr(), size).c_str(), size); @@ -121,6 +164,12 @@ int cellSpursAttributeEnableSpuPrintfIfAvailable(mem_ptr_t a { cellSpurs.Error("cellSpursAttributeEnableSpuPrintfIfAvailable(attr_addr=0x%x)", attr.GetAddr()); + if (attr.GetAddr() % 8 != 0) + { + cellSpurs.Error("cellSpursAttributeEnableSpuPrintfIfAvailable : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!attr.IsGood()) { cellSpurs.Error("cellSpursAttributeEnableSpuPrintfIfAvailable : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -130,16 +179,16 @@ int cellSpursAttributeEnableSpuPrintfIfAvailable(mem_ptr_t a return CELL_OK; } -int cellSpursTaskAttributeSetExitCodeContainer() -{ - UNIMPLEMENTED_FUNC(cellSpurs); - return CELL_OK; -} - int cellSpursAttributeSetSpuThreadGroupType(mem_ptr_t attr, int type) { cellSpurs.Warning("cellSpursAttributeSetSpuThreadGroupType(attr_addr=0x%x, type=%u)", attr.GetAddr(), type); + if (attr.GetAddr() % 8 != 0) + { + cellSpurs.Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!attr.IsGood()) { cellSpurs.Error("cellSpursAttributeSetSpuThreadGroupType : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -156,6 +205,12 @@ int cellSpursAttributeEnableSystemWorkload(mem_ptr_t attr, c { cellSpurs.Error("cellSpursAttributeEnableSystemWorkload(attr_addr=0x%x, priority[%u], maxSpu=%u, isPreemptible[%u])", attr.GetAddr(), priority, maxSpu, isPreemptible); + if (attr.GetAddr() % 8 != 0) + { + cellSpurs.Error("cellSpursAttributeEnableSystemWorkload : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!attr.IsGood()) { cellSpurs.Error("cellSpursAttributeEnableSystemWorkload : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -177,6 +232,12 @@ int cellSpursGetSpuThreadGroupId(mem_ptr_t spurs, mem32_t group) { cellSpurs.Error("cellSpursGetSpuThreadGroupId(spurs_addr=0x%x, group_addr=0x%x)", spurs.GetAddr(), group.GetAddr()); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursGetSpuThreadGroupId : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood() || group.IsGood()) { cellSpurs.Error("cellSpursGetSpuThreadGroupId : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -190,6 +251,12 @@ int cellSpursGetNumSpuThread(mem_ptr_t spurs, mem32_t nThreads) { cellSpurs.Error("cellSpursGetNumSpuThread(spurs_addr=0x%x, nThreads_addr=0x%x)", spurs.GetAddr(), nThreads.GetAddr()); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursGetNumSpuThread : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood() || nThreads.IsGood()) { cellSpurs.Error("cellSpursGetNumSpuThread : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -203,6 +270,12 @@ int cellSpursGetSpuThreadId(mem_ptr_t spurs, mem32_t thread, mem32_t { cellSpurs.Error("cellSpursGetSpuThreadId(spurs_addr=0x%x, thread_addr=0x%x, nThreads_addr=0x%x)", spurs.GetAddr(), thread.GetAddr(), nThreads.GetAddr()); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursGetSpuThreadId : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood() || !thread.IsGood() || nThreads.IsGood()) { cellSpurs.Error("cellSpursGetSpuThreadId : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -216,6 +289,12 @@ int cellSpursSetMaxContention(mem_ptr_t spurs, u32 workloadId, u32 ma { cellSpurs.Error("cellSpursSetMaxContention(spurs_addr=0x%x, workloadId=%u, maxContention=%u)", spurs.GetAddr(), workloadId, maxContention); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursSetMaxContention : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood()) { cellSpurs.Error("cellSpursSetMaxContention : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -229,6 +308,12 @@ int cellSpursSetPriorities(mem_ptr_t spurs, u32 workloadId, const u8 { cellSpurs.Error("cellSpursSetPriorities(spurs_addr=0x%x, workloadId=%u, priorities[%u])", spurs.GetAddr(), workloadId, priorities); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursSetPriorities : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood()) { cellSpurs.Error("cellSpursSetPriorities : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -242,6 +327,12 @@ int cellSpursSetPriority(mem_ptr_t spurs, u32 workloadId, u32 spuId, { cellSpurs.Error("cellSpursSetPriority(spurs_addr=0x%x, workloadId=%u, spuId=%u, priority=%u)", spurs.GetAddr(), workloadId, spuId, priority); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursSetPriority : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood()) { cellSpurs.Error("cellSpursSetPriority : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -255,6 +346,12 @@ int cellSpursSetPreemptionVictimHints(mem_ptr_t spurs, const bool isP { cellSpurs.Error("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible[%u])", spurs.GetAddr(), isPreemptible); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursSetPreemptionVictimHints : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood()) { cellSpurs.Error("cellSpursSetPreemptionVictimHints : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -268,6 +365,12 @@ int cellSpursAttachLv2EventQueue(mem_ptr_t spurs, u32 queue, mem8_t p { cellSpurs.Error("cellSpursAttachLv2EventQueue(spurs_addr=0x%x, queue=0x%x, port_addr=0x%x, isDynamic=%u)", spurs.GetAddr(), queue, port.GetAddr(), isDynamic); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursAttachLv2EventQueue : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood() || !port.IsGood()) { cellSpurs.Error("cellSpursAttachLv2EventQueue : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -281,6 +384,12 @@ int cellSpursDetachLv2EventQueue(mem_ptr_t spurs, u8 port) { cellSpurs.Error("cellSpursDetachLv2EventQueue(spurs_addr=0x%x, port=0x%x)", spurs.GetAddr(), port); + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursDetachLv2EventQueue : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + if (!spurs.IsGood()) { cellSpurs.Error("cellSpursDetachLv2EventQueue : CELL_SPURS_CORE_ERROR_NULL_POINTER"); @@ -290,98 +399,269 @@ int cellSpursDetachLv2EventQueue(mem_ptr_t spurs, u8 port) return CELL_OK; } +int cellSpursEnableExceptionEventHandler(mem_ptr_t spurs, bool flag) +{ + cellSpurs.Error("cellSpursEnableExceptionEventHandler(spurs_addr=0x%x, flag=%u)", spurs.GetAddr(), flag); + + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEnableExceptionEventHandler : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + + if (!spurs.IsGood()) + { + cellSpurs.Error("cellSpursEnableExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER"); + return CELL_SPURS_CORE_ERROR_NULL_POINTER; + } + + return CELL_OK; +} + +int cellSpursSetGlobalExceptionEventHandler(mem_ptr_t spurs, mem_func_ptr_t eaHandler, mem_ptr_t arg) +{ + cellSpurs.Error("cellSpursSetGlobalExceptionEventHandler(spurs_addr=0x%x, eaHandler_addr=0x%x, arg_addr=0x%x,)", spurs.GetAddr(), eaHandler.GetAddr(), arg.GetAddr()); + + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursSetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + + if (!spurs.IsGood() || eaHandler.IsGood()) + { + cellSpurs.Error("cellSpursSetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER"); + return CELL_SPURS_CORE_ERROR_NULL_POINTER; + } + + return CELL_OK; +} + +int cellSpursUnsetGlobalExceptionEventHandler(mem_ptr_t spurs) +{ + cellSpurs.Error("cellSpursUnsetGlobalExceptionEventHandler(spurs_addr=0x%x)", spurs.GetAddr()); + + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursUnsetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + + if (!spurs.IsGood()) + { + cellSpurs.Error("cellSpursUnsetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER"); + return CELL_SPURS_CORE_ERROR_NULL_POINTER; + } + + return CELL_OK; +} + +int cellSpursGetInfo(mem_ptr_t spurs, mem_ptr_t info) +{ + cellSpurs.Error("cellSpursGetInfo(spurs_addr=0x%x, info_addr=0x%x)", spurs.GetAddr(), info.GetAddr()); + + if (spurs.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursGetInfo : CELL_SPURS_CORE_ERROR_ALIGN"); + return CELL_SPURS_CORE_ERROR_ALIGN; + } + + if (!spurs.IsGood() || !info.IsGood()) + { + cellSpurs.Error("cellSpursGetInfo : CELL_SPURS_CORE_ERROR_NULL_POINTER"); + return CELL_SPURS_CORE_ERROR_NULL_POINTER; + } + + return CELL_OK; +} + int _cellSpursEventFlagInitialize(mem_ptr_t spurs, mem_ptr_t taskset, mem_ptr_t eventFlag, u32 flagClearMode, u32 flagDirection) { cellSpurs.Error("_cellSpursEventFlagInitialize(spurs_addr=0x%x, taskset_addr=0x%x, eventFlag_addr=0x%x, flagClearMode=%u, flagDirection=%u)", spurs.GetAddr(), taskset.GetAddr(), eventFlag.GetAddr(), flagClearMode, flagDirection); - // Arkedo Series 01/02/03 return spurs_addr as 0x0 however eventFlag_addr should be always present and checked. + if ((taskset.GetAddr() % 128 != 0) || (eventFlag.GetAddr() % 128 != 0)) + { + cellSpurs.Error("_cellSpursEventFlagInitialize : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!taskset.IsGood() || !eventFlag.IsGood()) + { + cellSpurs.Error("_cellSpursEventFlagInitialize : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } + + return CELL_OK; +} + +int cellSpursEventFlagAttachLv2EventQueue(mem_ptr_t eventFlag) +{ + cellSpurs.Error("cellSpursEventFlagAttachLv2EventQueue(eventFlag_addr=0x%x)", eventFlag.GetAddr()); + + if (eventFlag.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEventFlagAttachLv2EventQueue : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + if (!eventFlag.IsGood()) { - cellSpurs.Error("_cellSpursEventFlagInitialize : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursEventFlagAttachLv2EventQueue : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; } -int cellSpursEventFlagAttachLv2EventQueue(mem_ptr_t event_flag) +int cellSpursEventFlagDetachLv2EventQueue(mem_ptr_t eventFlag) { - cellSpurs.Error("cellSpursEventFlagAttachLv2EventQueue(event_flag_addr=0x%x)", event_flag.GetAddr()); + cellSpurs.Error("cellSpursEventFlagDetachLv2EventQueue(eventFlag_addr=0x%x)", eventFlag.GetAddr()); - if (!event_flag.IsGood()) + if (eventFlag.GetAddr() % 128 != 0) { - cellSpurs.Error("cellSpursEventFlagAttachLv2EventQueue : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursEventFlagDetachLv2EventQueue : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; } - return CELL_OK; -} - -int cellSpursEventFlagDetachLv2EventQueue(mem_ptr_t event_flag) -{ - cellSpurs.Error("cellSpursEventFlagDetachLv2EventQueue(event_flag_addr=0x%x)", event_flag.GetAddr()); - - if (!event_flag.IsGood()) + if (!eventFlag.IsGood()) { - cellSpurs.Error("cellSpursEventFlagDetachLv2EventQueue : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursEventFlagDetachLv2EventQueue : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; } -int cellSpursEventFlagWait(mem_ptr_t event_flag, mem16_t flag_bits, u32 wait_mode) +int cellSpursEventFlagWait(mem_ptr_t eventFlag, mem16_t mask, u32 mode) { - cellSpurs.Error("cellSpursEventFlagWait(event_flag_addr=0x%x, flag_bits_addr=0x%x, wait_mode=%u)", event_flag.GetAddr(), flag_bits.GetAddr(), wait_mode); + cellSpurs.Error("cellSpursEventFlagWait(eventFlag_addr=0x%x, mask=0x%x, mode=%u)", eventFlag.GetAddr(), mask.GetAddr(), mode); - if (!event_flag.IsGood() || !flag_bits.IsGood()) + if (eventFlag.GetAddr() % 128 != 0) { - cellSpurs.Error("cellSpursEventFlagWait : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; + cellSpurs.Error("cellSpursEventFlagWait : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!eventFlag.IsGood() || !mask.IsGood()) + { + cellSpurs.Error("cellSpursEventFlagWait : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; } return CELL_OK; } -int cellSpursEventFlagClear() +int cellSpursEventFlagClear(mem_ptr_t eventFlag, u16 bits) { - UNIMPLEMENTED_FUNC(cellSpurs); + cellSpurs.Error("cellSpursEventFlagClear(eventFlag_addr=0x%x, bits=%u)", eventFlag.GetAddr(), bits); + + if (eventFlag.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEventFlagClear : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!eventFlag.IsGood()) + { + cellSpurs.Error("cellSpursEventFlagClear : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } + return CELL_OK; } -int cellSpursTaskAttributeInitialize() +int cellSpursEventFlagSet(mem_ptr_t eventFlag, u16 bits) { - UNIMPLEMENTED_FUNC(cellSpurs); + cellSpurs.Error("cellSpursEventFlagSet(eventFlag_addr=0x%x, bits=%u)", eventFlag.GetAddr(), bits); + + if (eventFlag.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEventFlagSet : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!eventFlag.IsGood()) + { + cellSpurs.Error("cellSpursEventFlagSet : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } + return CELL_OK; } -int cellSpursEventFlagSet() +int cellSpursEventFlagTryWait(mem_ptr_t eventFlag, mem16_t mask, u32 mode) { - UNIMPLEMENTED_FUNC(cellSpurs); + cellSpurs.Error("cellSpursEventFlagTryWait(eventFlag_addr=0x%x, mask_addr=0x%x, mode=%u)", eventFlag.GetAddr(), mask.GetAddr(), mode); + + if (eventFlag.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEventFlagTryWait : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!eventFlag.IsGood()) + { + cellSpurs.Error("cellSpursEventFlagTryWait : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } + return CELL_OK; } -int cellSpursEventFlagTryWait() +int cellSpursEventFlagGetDirection(mem_ptr_t eventFlag, mem32_t direction) { - UNIMPLEMENTED_FUNC(cellSpurs); + cellSpurs.Error("cellSpursEventFlagGetDirection(eventFlag_addr=0x%x, direction_addr=%u)", eventFlag.GetAddr(), direction.GetAddr()); + + if (eventFlag.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEventFlagGetDirection : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!eventFlag.IsGood() || !direction.IsGood()) + { + cellSpurs.Error("cellSpursEventFlagGetDirection : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } + return CELL_OK; } -int cellSpursEventFlaggetDirection() +int cellSpursEventFlagGetClearMode(mem_ptr_t eventFlag, mem32_t clear_mode) { - UNIMPLEMENTED_FUNC(cellSpurs); + cellSpurs.Error("cellSpursEventFlagGetClearMode(eventFlag_addr=0x%x, clear_mode_addr=%u)", eventFlag.GetAddr(), clear_mode.GetAddr()); + + if (eventFlag.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEventFlagGetClearMode : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!eventFlag.IsGood() || !clear_mode.IsGood()) + { + cellSpurs.Error("cellSpursEventFlagGetClearMode : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } + return CELL_OK; } -int cellSpursEventFlaggetClearMode() +int cellSpursEventFlagGetTasksetAddress(mem_ptr_t eventFlag, mem_ptr_t taskset) { - UNIMPLEMENTED_FUNC(cellSpurs); - return CELL_OK; -} + cellSpurs.Error("cellSpursEventFlagTryWait(eventFlag_addr=0x%x, taskset_addr=0x%x)", eventFlag.GetAddr(), taskset.GetAddr()); + + if (eventFlag.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursEventFlagTryWait : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!eventFlag.IsGood() || !taskset.IsGood()) + { + cellSpurs.Error("cellSpursEventFlagTryWait : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } -int cellSpursEventFlaggetTasksetAddress() -{ - UNIMPLEMENTED_FUNC(cellSpurs); return CELL_OK; } @@ -611,71 +891,6 @@ int cellSpursQueueAttachLv2EventQueue() return CELL_OK; } -int cellSpursEnableExceptionEventHandler(mem_ptr_t spurs, bool flag) -{ - cellSpurs.Error("cellSpursEnableExceptionEventHandler(spurs_addr=0x%x, flag=%u)", spurs.GetAddr(), flag); - - if (!spurs.IsGood()) - { - cellSpurs.Error("cellSpursEnableExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; - } - - return CELL_OK; -} - -int cellSpursSetGlobalExceptionEventHandler(mem_ptr_t spurs, mem_func_ptr_t eaHandler, mem_ptr_t arg) -{ - cellSpurs.Error("cellSpursEnableExceptionEventHandler(spurs_addr=0x%x, eaHandler_addr=0x%x, arg_addr=0x%x,)", spurs.GetAddr(), eaHandler.GetAddr(), arg.GetAddr()); - - if (!spurs.IsGood() || eaHandler.IsGood()) - { - cellSpurs.Error("cellSpursSetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; - } - - return CELL_OK; -} - -int cellSpursUnsetGlobalExceptionEventHandler(mem_ptr_t spurs) -{ - cellSpurs.Error("cellSpursUnsetGlobalExceptionEventHandler(spurs_addr=0x%x)", spurs.GetAddr()); - - if (!spurs.IsGood()) - { - cellSpurs.Error("cellSpursUnsetGlobalExceptionEventHandler : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; - } - - return CELL_OK; -} - -int cellSpursGetInfo(mem_ptr_t spurs, mem_ptr_t info) -{ - cellSpurs.Error("cellSpursGetInfo(spurs_addr=0x%x, info_addr=0x%x)", spurs.GetAddr(), info.GetAddr()); - - if (!spurs.IsGood() || !info.IsGood()) - { - cellSpurs.Error("cellSpursGetInfo : CELL_SPURS_CORE_ERROR_NULL_POINTER"); - return CELL_SPURS_CORE_ERROR_NULL_POINTER; - } - - return CELL_OK; -} - -int _cellSpursSendSignal(mem_ptr_t taskset, u32 taskID) -{ - cellSpurs.Error("_cellSpursSendSignal(taskset_addr=0x%x, taskID=%u)", taskset.GetAddr(), taskID); - - if (!taskset.IsGood()) - { - cellSpurs.Error("_cellSpursSendSignal : CELL_SPURS_TASK_ERROR_NULL_POINTER"); - return CELL_SPURS_TASK_ERROR_NULL_POINTER; - } - - return CELL_OK; -} - int cellSpursCreateJobChainWithAttribute() { UNIMPLEMENTED_FUNC(cellSpurs); @@ -716,6 +931,12 @@ int cellSpursCreateTaskset(mem_ptr_t spurs, mem_ptr_t taskset) { cellSpurs.Error("cellSpursJoinTaskset(taskset_addr=0x%x)", taskset.GetAddr()); + if (taskset.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursJoinTaskset : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + if (!taskset.IsGood()) { cellSpurs.Error("cellSpursJoinTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER"); @@ -742,6 +969,12 @@ int cellSpursGetTasksetId(mem_ptr_t taskset, mem32_t workloadI { cellSpurs.Error("cellSpursGetTasksetId(taskset_addr=0x%x, workloadId_addr=0x%x)", taskset.GetAddr(), workloadId.GetAddr()); + if (taskset.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursGetTasksetId : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + if (!taskset.IsGood() || !workloadId.IsGood()) { cellSpurs.Error("cellSpursGetTasksetId : CELL_SPURS_TASK_ERROR_NULL_POINTER"); @@ -755,6 +988,12 @@ int cellSpursShutdownTaskset(mem_ptr_t taskset) { cellSpurs.Error("cellSpursShutdownTaskset(taskset_addr=0x%x)", taskset.GetAddr()); + if (taskset.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursShutdownTaskset : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + if (!taskset.IsGood()) { cellSpurs.Error("cellSpursShutdownTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER"); @@ -771,6 +1010,12 @@ int cellSpursCreateTask(mem_ptr_t taskset, mem32_t taskID, mem cellSpurs.Error("cellSpursCreateTask(taskset_addr=0x%x, taskID_addr=0x%x, elf_addr_addr=0x%x, context_addr_addr=0x%x, context_size=%u, lsPattern_addr=0x%x, argument_addr=0x%x)", taskset.GetAddr(), taskID.GetAddr(), elf_addr.GetAddr(), context_addr.GetAddr(), context_size, lsPattern.GetAddr(), argument.GetAddr()); + if (taskset.GetAddr() % 128 != 0) + { + cellSpurs.Error("cellSpursCreateTask : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + if (!taskset.IsGood()) { cellSpurs.Error("cellSpursCreateTask : CELL_SPURS_TASK_ERROR_NULL_POINTER"); @@ -780,6 +1025,25 @@ int cellSpursCreateTask(mem_ptr_t taskset, mem32_t taskID, mem return CELL_OK; } +int _cellSpursSendSignal(mem_ptr_t taskset, u32 taskID) +{ + cellSpurs.Error("_cellSpursSendSignal(taskset_addr=0x%x, taskID=%u)", taskset.GetAddr(), taskID); + + if (taskset.GetAddr() % 128 != 0) + { + cellSpurs.Error("_cellSpursSendSignal : CELL_SPURS_TASK_ERROR_ALIGN"); + return CELL_SPURS_TASK_ERROR_ALIGN; + } + + if (!taskset.IsGood()) + { + cellSpurs.Error("_cellSpursSendSignal : CELL_SPURS_TASK_ERROR_NULL_POINTER"); + return CELL_SPURS_TASK_ERROR_NULL_POINTER; + } + + return CELL_OK; +} + int cellSpursCreateTaskWithAttribute() { UNIMPLEMENTED_FUNC(cellSpurs); @@ -834,6 +1098,18 @@ int cellSpursTaskGenerateLsPattern() return CELL_OK; } +int cellSpursTaskAttributeInitialize() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + +int cellSpursTaskAttributeSetExitCodeContainer() +{ + UNIMPLEMENTED_FUNC(cellSpurs); + return CELL_OK; +} + int _cellSpursTaskAttribute2Initialize() { UNIMPLEMENTED_FUNC(cellSpurs); @@ -1007,9 +1283,9 @@ void cellSpurs_init() cellSpurs.AddFunc(0x4ac7bae4, cellSpursEventFlagClear); cellSpurs.AddFunc(0xf5507729, cellSpursEventFlagSet); cellSpurs.AddFunc(0x6d2d9339, cellSpursEventFlagTryWait); - cellSpurs.AddFunc(0x890f9e5a, cellSpursEventFlaggetDirection); - cellSpurs.AddFunc(0x4d1e9373, cellSpursEventFlaggetClearMode); - cellSpurs.AddFunc(0x947efb0b, cellSpursEventFlaggetTasksetAddress); + cellSpurs.AddFunc(0x890f9e5a, cellSpursEventFlagGetDirection); + cellSpurs.AddFunc(0x4d1e9373, cellSpursEventFlagGetClearMode); + cellSpurs.AddFunc(0x947efb0b, cellSpursEventFlagGetTasksetAddress); // Taskset cellSpurs.AddFunc(0x52cc6c82, cellSpursCreateTaskset);