예제 #1
0
s32 sysSaveAutoSave2 (s32 version,
    const char *directoryName,
    sysSaveErrorDialogMode errorDialogMode,
    sysSaveBufferSettings *bufferSettings,
    sysSaveStatusCallback statusCb,
    sysSaveFileCallback fileCb,
    sys_mem_container_t container,
    void *user_data)
{
  return sysSaveAutoSave2Ex (version,
      directoryName, errorDialogMode, bufferSettings,
      (opd32*) __get_opd32(statusCb),
      (opd32*) __get_opd32(fileCb),
      container, user_data);
}
예제 #2
0
s32 sysSaveListSave2 (u32 version,
    sysSaveListSettings *listSettings,
    sysSaveBufferSettings *bufferSettings,
    sysSaveListCallback listCb,
    sysSaveStatusCallback statusCb,
    sysSaveFileCallback fileCb,
    sys_mem_container_t container,
    void *user_data)
{
  return sysSaveListSave2Ex (version,
      listSettings, bufferSettings,
      (opd32*) __get_opd32(listCb),
      (opd32*) __get_opd32(statusCb),
      (opd32*) __get_opd32(fileCb),
      container, user_data);
}
예제 #3
0
s32 sysSaveListAutoSave (u32 version,
    sysSaveErrorDialogMode errorDialogMode,
    sysSaveListSettings *listSettings,
    sysSaveBufferSettings *bufferSettings,
    sysSaveFixedCallback fixedCb,
    sysSaveStatusCallback statusCb,
    sysSaveFileCallback fileCb,
    sys_mem_container_t container,
    void *user_data)
{
  return sysSaveListAutoSaveEx (version,
      errorDialogMode, listSettings, bufferSettings,
      (opd32*) __get_opd32(fixedCb),
      (opd32*) __get_opd32(statusCb),
      (opd32*) __get_opd32(fileCb),
      container, user_data);
}
예제 #4
0
파일: init.c 프로젝트: giantpune/PSL1GHT
void rsxSetupContextData(gcmContextData *context,const u32 *addr,const u32 size,gcmContextCallback cb)
{
	u32 alignedSize = size&~0x3;

	context->begin = __get_addr32(addr);
	context->current = __get_addr32(addr);
	context->end = __get_addr32(addr + alignedSize - 4);
	context->callback = __get_addr32(__get_opd32(cb));
}
예제 #5
0
void gcmSetUserHandler(void (*handler)(const u32 cause))
{
	gcmSetUserHandlerEx((opd32*)__get_opd32(handler));
}
예제 #6
0
void gcmSetGraphicsHandler(void (*handler)(const u32 val))
{
	gcmSetGraphicsHandlerEx((opd32*)__get_opd32(handler));
}
예제 #7
0
static bool ps3_load_jpeg(const char *path, struct texture_image *out_img)
{
   size_t img_size;
#ifndef __PSL1GHT__
   CtrlMallocArg              MallocArg;
   CtrlFreeArg                FreeArg;
   CellJpgDecDataCtrlParam       dCtrlParam;
#endif
   CellJpgDecMainHandle          mHandle = PTR_NULL;
   CellJpgDecSubHandle           sHandle = PTR_NULL;
   CellJpgDecThreadInParam       InParam;
   CellJpgDecThreadOutParam      OutParam;
   CellJpgDecSrc                 src;
   CellJpgDecOpnInfo             opnInfo;
   CellJpgDecInfo                info;
   CellJpgDecInParam             inParam;
   CellJpgDecOutParam            outParam;
   CellJpgDecDataOutInfo         dOutInfo;

   InParam.spu_enable = CELL_JPGDEC_SPU_THREAD_ENABLE;
   InParam.ppu_prio = 1001;
   InParam.spu_prio = 250;
#ifdef __PSL1GHT__
   InParam.malloc_func = __get_addr32(__get_opd32(img_malloc));
   InParam.free_func = __get_addr32(__get_opd32(img_free));
   InParam.malloc_arg = 0;
   InParam.free_arg = 0;
#else
   MallocArg.mallocCallCounts = 0;
   FreeArg.freeCallCounts = 0;
   InParam.malloc_func = img_malloc;
   InParam.free_func = img_free;
   InParam.malloc_arg = &MallocArg;
   InParam.free_arg = &FreeArg;
#endif

   int ret_jpeg, ret = -1;
   ret_jpeg = cellJpgDecCreate(&mHandle, &InParam, &OutParam);

   if (ret_jpeg != CELL_OK)
      goto error;

   memset(&src, 0, sizeof(CellJpgDecSrc));
   src.stream_select    = CELL_JPGDEC_FILE;
#ifdef __PSL1GHT__
   src.file_name        = __get_addr32(path);
#else
   src.file_name        = path;
#endif
   src.file_offset      = 0;
   src.file_size        = 0;
   src.stream_ptr       = PTR_NULL;
   src.stream_size      = 0;

   src.spu_enable  = CELL_JPGDEC_SPU_THREAD_ENABLE;

   ret = cellJpgDecOpen(mHandle, &sHandle, &src, &opnInfo);

   if (ret != CELL_OK)
      goto error;

   ret = cellJpgDecReadHeader(mHandle, sHandle, &info);

   if (ret != CELL_OK)
      goto error;

   inParam.cmd_ptr            = PTR_NULL;
   inParam.quality            = CELL_JPGDEC_FAST;
   inParam.output_mode        = CELL_JPGDEC_TOP_TO_BOTTOM;
   inParam.color_space        = CELL_JPG_ARGB;
   inParam.down_scale         = 1;
   inParam.color_alpha        = 0xfe;
   ret = cellJpgDecSetParameter(mHandle, sHandle, &inParam, &outParam);

   if (ret != CELL_OK)
      goto error;

   img_size = outParam.output_width * outParam.output_height * sizeof(uint32_t);
   out_img->pixels = (uint32_t*)malloc(img_size);
   memset(out_img->pixels, 0, img_size);

#ifdef __PSL1GHT__
   uint64_t output_bytes_per_line = outParam.output_width * 4;
   ret = cellJpgDecDecodeData(mHandle, sHandle, (uint8_t*)out_img->pixels, &output_bytes_per_line, &dOutInfo);
#else
   dCtrlParam.output_bytes_per_line = outParam.output_width * 4;
   ret = cellJpgDecDecodeData(mHandle, sHandle, (uint8_t*)out_img->pixels, &dCtrlParam, &dOutInfo);
#endif

   if (ret != CELL_OK || dOutInfo.status != CELL_JPGDEC_DEC_STATUS_FINISH)
      goto error;

   out_img->width = outParam.output_width;
   out_img->height = outParam.output_height;

   cellJpgDecClose(mHandle, sHandle);
   cellJpgDecDestroy(mHandle);

   return true;

error:
   if (out_img->pixels)
      free(out_img->pixels);
   out_img->pixels = 0;
   if (mHandle && sHandle)
	   cellJpgDecClose(mHandle, sHandle);
   if (mHandle)
	   cellJpgDecDestroy(mHandle);
   return false;
}
예제 #8
0
s32 httpClientSetCookieRecvCallback(httpClientId cid, httpCookieRecvCallback cb, void *arg)
{
    printf ( "IN: httpClientSetCookieRecvCallback(%p, %p, %p)\n", cid, cb, arg ) ;
    printf ( "OUT: httpClientSetCookieRecvCallbackEx(%p, %p, %p)\n", cid, (opd32*)__get_opd32(cb), arg ) ;
    return httpClientSetCookieRecvCallbackEx(cid, (opd32*)__get_opd32(cb),arg);
}
예제 #9
0
s32 httpClientSetTransactionStateCallback(httpClientId cid,httpTransactionStateCallback cb,void *arg)
{
    printf ( "IN: httpClientSetTransactionStateCallback(%p, %p, %p)\n", cid, cb, arg ) ;
    printf ( "OUT: httpClientSetTransactionStateCallbackEx(%p, %p, %p)\n", cid, (opd32*)__get_opd32(cb), arg ) ;
    return httpClientSetTransactionStateCallbackEx(cid,(opd32*)__get_opd32(cb),arg);
}
예제 #10
0
파일: pngdec.c 프로젝트: an0nym0u5/PSL1GHT
static s32 decodePNG(pngDecSource *src,pngData *out)
{
	s32 mHandle,sHandle,ret;
	u32 space_allocated;
	u64 bytes_per_line;
	pngDecInfo DecInfo;
	pngDecInParam inParam;
	pngDecOutParam outParam;
	pngDecDataInfo DecDataInfo;
	pngDecThreadInParam InThdParam;
	pngDecThreadOutParam OutThdParam;

	InThdParam.enable = 0;
	InThdParam.ppu_prio = 512;
	InThdParam.spu_prio = 200;
	InThdParam.malloc_func = __get_addr32(__get_opd32(png_malloc));
	InThdParam.malloc_arg = 0; // no args
	InThdParam.free_func = __get_addr32(__get_opd32(png_free));
	InThdParam.free_arg = 0; // no args

	ret= pngDecCreate(&mHandle, &InThdParam, &OutThdParam);

	out->bmp_out = NULL;
	if(ret==0) {
		ret = pngDecOpen(mHandle,&sHandle,src,&space_allocated);
		if(ret==0) {
			ret = pngDecReadHeader(mHandle,sHandle,&DecInfo);
			if(ret==0) {
				inParam.cmd_ptr = 0;
				inParam.mode = PNGDEC_TOP_TO_BOTTOM;
				inParam.space = PNGDEC_ARGB;
				inParam.bit_depth = 8;
				inParam.pack_flag = 1;
				if(DecInfo.space==PNGDEC_GRAYSCALE_ALPHA || DecInfo.space==PNGDEC_RGBA || DecInfo.chunk_info&0x10)
					inParam.alpha_select = 0;
				else
					inParam.alpha_select = 1;

				inParam.alpha = 0xff;

				ret = pngDecSetParameter(mHandle,sHandle,&inParam,&outParam);
			}

			if(ret==0) {
				out->pitch = bytes_per_line = outParam.width*4;
				//out->bmp_out = malloc(out->pitch*outParam.height);
				out->bmp_out = rsxMemalign(64, out->pitch*outParam.height);
				if(!out->bmp_out)
					ret = -1;
				else {
					memset(out->bmp_out,0,(bytes_per_line*outParam.height));
					
					ret = pngDecDecodeData(mHandle,sHandle,out->bmp_out,&bytes_per_line,&DecDataInfo);
					if(ret==0 && DecDataInfo.status==0) {
						out->width = outParam.width;
						out->height = outParam.height;

						ret = 0;
					}
				}
			}
			pngDecClose(mHandle,sHandle);
		}
		if(ret && out->bmp_out) {
			free(out->bmp_out);
			out->bmp_out = NULL;
		}

		pngDecDestroy(mHandle);
	}
	return ret;
}
예제 #11
0
s32 msgDialogOpenErrorCode(u32 errorCode,msgDialogCallback cb,void *usrData,void *unused)
{
	return msgDialogOpenErrorCodeEx(errorCode,(opd32*)__get_opd32(cb),usrData,unused);
}
예제 #12
0
s32 msgDialogOpen2(msgType type,const char *msg,msgDialogCallback cb,void *usrData,void *unused)
{
	return msgDialogOpen2Ex(type,msg,(opd32*)__get_opd32(cb),usrData,unused);
}
예제 #13
0
/* sysUtil wrapper functions */
s32 sysUtilRegisterCallback(s32 slot,sysutilCallback cb,void *usrdata)
{
	return sysUtilRegisterCallbackEx(slot,(opd32*)__get_opd32(cb),usrdata);
}
예제 #14
0
/* Disc utility support */
s32 sysDiscRegisterDiscChangeCallback(sysDiscEjectCallback cbEject,sysDiscInsertCallback cbInsert)
{
	return sysDiscRegisterDiscChangeCallbackEx((opd32*)__get_opd32(cbEject),(opd32*)__get_opd32(cbInsert));
}
예제 #15
0
/* game utility support */
s32 sysGameThemeInstallFromBuffer(u32 fileSize, u32 bufSize, void *buf, sysGameThemeInstallCallback themeCb, u32 option)
{
	return sysGameThemeInstallFromBufferEx(fileSize,bufSize,buf,(opd32*)__get_opd32(themeCb),option);
}
예제 #16
0
void gcmSetQueueHandler(void (*handler)(const u32 head))
{
	gcmSetQueueHandlerEx((opd32*)__get_opd32(handler));
}
예제 #17
0
void gcmSetUserCommand(void (*handler)(const u32 cause))
{
	gcmSetUserCommandEx((opd32*)__get_opd32(handler));
}
예제 #18
0
s32 sysSpuPrintfInitialize(int prio,void (*entry)(void*))
{
	return sysSpuPrintfInitializeEx(prio,(opd32*)__get_opd32(entry));
}