the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 63 lines 1.9 kB view raw
1/* SCE CONFIDENTIAL 2PlayStation(R)3 Programmer Tool Runtime Library 430.001 3* Copyright (C) 2007 Sony Computer Entertainment Inc. 4* All Rights Reserved. 5*/ 6 7/* common headers */ 8#include <stdint.h> 9#include <stdlib.h> 10#include <spu_intrinsics.h> 11#include <cell/spurs.h> 12#include <cell/dma.h> 13#include <cell/spurs/job_queue.h> 14 15#include "CompressedTileStorage_SPU.h" 16#include "..\Common\DmaData.h" 17 18// #define SPU_HEAPSIZE (128*1024) 19// #define SPU_STACKSIZE (16*1024) 20// 21// CELL_SPU_LS_PARAM(128*1024, 16*1024); // can't use #defines here as it seems to create an asm instruction 22 23 24static const bool sc_verbose = false; 25 26CellSpursJobContext2* g_pSpursJobContext; 27 28void cellSpursJobQueueMain(CellSpursJobContext2 *pContext, CellSpursJob256 *pJob) 29{ 30// CellSpursTaskId idTask = cellSpursGetTaskId(); 31 unsigned int idSpu = cellSpursGetCurrentSpuId(); 32 33 if(sc_verbose) 34 spu_print("CompressedTile [SPU#%u] start\n", idSpu); 35 36 g_pSpursJobContext = pContext; 37// void* pVolatileMem = NULL; 38// uint32_t volatileSize = 0; 39// ret = cellSpursGetTaskVolatileArea(&pVolatileMem, &volatileSize); 40// spu_print( "----------------- CompressedTile SPU Memory ------------------\n" 41// "Stack : %dKb\n" 42// "Heap : %dKb\n" 43// "Prog : %dKb\n" 44// "Free : %dKb\n" 45// "-------------------------------------------------------------\n", 46// SPU_STACKSIZE/1024, 47// SPU_HEAPSIZE/1024, 48// 256 - ((SPU_HEAPSIZE+SPU_STACKSIZE+volatileSize)/1024), 49// volatileSize/1024); 50 51 52// uint32_t eaEventFlag = spu_extract((vec_uint4)argTask, 0); 53 uint32_t eaDataIn = pJob->workArea.userData[0]; 54 uint32_t eaDataOut =pJob->workArea.userData[1]; 55 56 TileCompressData_SPU compressedData;// = new TileCompressData_SPU; 57 DmaData_SPU::getAndWait(&compressedData, eaDataIn, sizeof(TileCompressData_SPU)); 58 compressedData.uncompress(eaDataOut); 59 60 if(sc_verbose) 61 spu_print("CompressedTile [SPU#%u] exit\n", idSpu); 62} 63