当前位置: 首页>>代码示例>>C++>>正文


C++ SifCallRpc函数代码示例

本文整理汇总了C++中SifCallRpc函数的典型用法代码示例。如果您正苦于以下问题:C++ SifCallRpc函数的具体用法?C++ SifCallRpc怎么用?C++ SifCallRpc使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SifCallRpc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PS2MouseSetPosition

int PS2MouseSetPosition(int x, int y)

{
  s32* data = (s32 *) buffer;
  
  data[0] = x;
  data[1] = y;

  if (SifCallRpc(&mouseif, PS2MOUSE_SETPOSITION, 0, buffer, 128, buffer, 128, 0, 0) < 0)
    return -1;

  return 1;
}
开发者ID:AzagraMac,项目名称:PS2_SDK,代码行数:13,代码来源:libmouse.c

示例2: sbcall_soundgcoreattr

int sbcall_soundgcoreattr(tge_sbcall_rpc_arg_t *carg)
{
	tge_sbacall_soundgetcoreattr_arg_t *arg = (tge_sbacall_soundgetcoreattr_arg_t *) carg->sbarg;

	if (!soundInitialized) {
		return -1;
	}
	rpcBuffer[1] = arg->index;
	if (SifCallRpc(&sdrsif, SOUND_GCORE_ATTR, SIF_RPC_M_NOWAIT, rpcBuffer, 64, rpcResultBuffer, 16, soundCallback, carg) < 0) {
		return -SIF_RPCE_SENDP;
	}
	return 0;
}
开发者ID:rickgaiser,项目名称:kernelloader,代码行数:13,代码来源:sound.c

示例3: getsockopt

// return buffer:
// Offset 0 = getsockopt return value
// 0ffset 1 = optlen
// Offset 2 = optval (max 128 bytes)
int getsockopt(int s, int level, int optname, void* optval, socklen_t* optlen)
{
	((int*)_rpc_buffer)[0] = s;
	((int*)_rpc_buffer)[1] = level;
	((int*)_rpc_buffer)[2] = optname;

	SifCallRpc(&_ps2ip, ID_GETSOCKOPT, 0, (void*)_rpc_buffer, 12, (void*)_rpc_buffer, 136, 0, 0);

	if(_rpc_buffer[1] < *optlen) *optlen = _rpc_buffer[1];
	memcpy((void*)optval, &_rpc_buffer[2], *optlen);

	return _rpc_buffer[0];
}
开发者ID:joshdekock,项目名称:jim-ps2ware,代码行数:17,代码来源:ps2ipc.c

示例4: setsockopt

int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen)
{
	((int*)_rpc_buffer)[0] = s;
	((int*)_rpc_buffer)[1] = level;
	((int*)_rpc_buffer)[2] = optname;
	((int*)_rpc_buffer)[3] = optlen;

    memcpy(&_rpc_buffer[4], optval, optlen);

	SifCallRpc(&_ps2ip, ID_SETSOCKOPT, 0, (void*)_rpc_buffer, 16 + optlen, (void*)_rpc_buffer, 4, 0, 0);

	return _rpc_buffer[0];
}
开发者ID:joshdekock,项目名称:jim-ps2ware,代码行数:13,代码来源:ps2ipc.c

示例5: usb_mass_getConnectState

// tk
// returns connection state of usb device
int usb_mass_getConnectState( unsigned int slot )
{
	int *ret;
	unsigned int *nums;

	nums	= (unsigned int*) rpcBuffer;
	nums[0] = slot;

	SifCallRpc(&client,6,0,(void*)(&rpcBuffer[0]), 4,(void*)(&rpcBuffer[0]),4,0,0);

	ret = (int*) rpcBuffer;
	return *ret;
}
开发者ID:smiley22,项目名称:myPS2,代码行数:15,代码来源:mass_rpc.c

示例6: sndStreamOpen

int sndStreamOpen(char *file, u32 voices, u32 flags, u32 bufaddr, u32 bufsize)
{
	u32 buf[32] ALIGNED(64);
	buf[0] = voices;
	buf[1] = flags;
	buf[2] = bufaddr;
	buf[3] = bufsize;
	strncpy((char*)&buf[4], file, 27*4);
	buf[31] = 0;

	SifCallRpc(&sd_client, PS2SND_StreamOpen, 0, buf, 128, buf, 4, NULL, NULL);
	return(((s32 *)buf)[0]);
}
开发者ID:AKuHAK2,项目名称:ps2sdk,代码行数:13,代码来源:ps2snd.c

示例7: PS2CamSetLEDMode

int PS2CamSetLEDMode(int handle, int mode)
{
	int *ret;

	ret = (int *)&data[0];

	ret[0] = handle;
	ret[1] = mode;

	SifCallRpc(&cdata, PS2CAM_RPC_SETLEDMODE, 0, (void*)(&data[0]),4,(void*)(&data[0]),4,0,0);

	return ret[0];
}
开发者ID:AKuHAK2,项目名称:ps2sdk,代码行数:13,代码来源:ps2cam_rpc.c

示例8: PS2MouseGetAccel

float PS2MouseGetAccel()

{
  u32* uncached = (u32 *) UNCACHED_SEG(buffer);
  u32 accel_fixed;

  if (SifCallRpc(&mouseif, PS2MOUSE_GETACCEL, 0, buffer, 128, buffer, 128, 0, 0) < 0)
    return -1;

  accel_fixed = uncached[0];

  return ((float) accel_fixed) / 65536.0 ;
}
开发者ID:AzagraMac,项目名称:PS2_SDK,代码行数:13,代码来源:libmouse.c

示例9: padGetButtonMask

int
padGetButtonMask(int port, int slot)
{

    *(u32 *)(&buffer[0])=PAD_RPCCMD_GET_BTNMASK;
    *(u32 *)(&buffer[4])=port;
    *(u32 *)(&buffer[8])=slot;

    if (SifCallRpc(&padsif[0], 1, 0, buffer, 128, buffer, 128, NULL, NULL) < 0)
        return 0;

    return *(int *)(&buffer[12]);
}
开发者ID:AKuHAK2,项目名称:ps2sdk,代码行数:13,代码来源:libpadx.c

示例10: sbcall_soundtransstat

int sbcall_soundtransstat(tge_sbcall_rpc_arg_t *carg)
{
	tge_sbcall_soundtransferstat_arg_t *arg = (tge_sbcall_soundtransferstat_arg_t *) carg->sbarg;

	if (!soundInitialized) {
		return -1;
	}
	rpcBuffer[1] = arg->channel;
	rpcBuffer[2] = arg->flag;
	if (SifCallRpc(&sdrsif, SOUND_SCORE_TRANS, SIF_RPC_M_NOWAIT, rpcBuffer, 64, rpcResultBuffer, 16, soundCallback, carg) < 0) {
		return -SIF_RPCE_SENDP;
	}
	return 0;
}
开发者ID:rickgaiser,项目名称:kernelloader,代码行数:14,代码来源:sound.c

示例11: connect

int connect(int s, struct sockaddr *name, int namelen)
{
	cmd_pkt *pkt = (cmd_pkt *)_rpc_buffer;

	if(!_init_check) return -1;

	pkt->socket = s;
	pkt->len = namelen;
	memcpy((void *)&pkt->sockaddr, (void *)name, sizeof(struct sockaddr));

	SifCallRpc(&_ps2ip, ID_CONNECT, 0, (void*)_rpc_buffer, sizeof(cmd_pkt), (void*)_rpc_buffer, 4, 0, 0);

	return _rpc_buffer[0];
}
开发者ID:joshdekock,项目名称:jim-ps2ware,代码行数:14,代码来源:ps2ipc.c

示例12: NetManSetLinkMode

int NetManSetLinkMode(int mode){
	int result;

	WaitSema(NetManIOSemaID);

	*(int*)TransmitBuffer = mode;
	if((result=SifCallRpc(&NETMAN_rpc_cd, NETMAN_IOP_RPC_FUNC_SET_LINK_MODE, 0, TransmitBuffer, sizeof(int), ReceiveBuffer, sizeof(int), NULL, NULL))>=0){
		result=*(int*)ReceiveBuffer;
	}

	SignalSema(NetManIOSemaID);

	return result;
}
开发者ID:israfilistek,项目名称:ps2sdk,代码行数:14,代码来源:rpc_client.c

示例13: NetManSetLinkMode

int NetManSetLinkMode(int mode)
{
	int result;

	WaitSema(NetManIOSemaID);

	TransmitBuffer.mode = mode;
	if((result=SifCallRpc(&NETMAN_rpc_cd, NETMAN_IOP_RPC_FUNC_SET_LINK_MODE, 0, &TransmitBuffer, sizeof(s32), &ReceiveBuffer, sizeof(s32), NULL, NULL))>=0)
		result=ReceiveBuffer.result;

	SignalSema(NetManIOSemaID);

	return result;
}
开发者ID:AKuHAK,项目名称:ps2sdk,代码行数:14,代码来源:rpc_client.c

示例14: NetManRPCUnregisterNetworkStack

int NetManRPCUnregisterNetworkStack(void)
{
	int result;

	WaitSema(NetManIOSemaID);

	result=SifCallRpc(&NETMAN_rpc_cd, NETMAN_IOP_RPC_FUNC_UNREG_NETWORK_STACK, 0, NULL, 0, NULL, 0, NULL, NULL);
	IOPFrameBuffer = NULL;
	IOPFrameBufferWrPtr = 0;

	SignalSema(NetManIOSemaID);

	return result;
}
开发者ID:AKuHAK,项目名称:ps2sdk,代码行数:14,代码来源:rpc_client.c

示例15: audsrv_load_adpcm

int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size)
{
	void* iop_addr;
	SifDmaTransfer_t sifdma;
	int id, ret;

	iop_addr = SifAllocIopHeap(size);
	if (iop_addr == 0)
	{
		return -AUDSRV_ERR_OUT_OF_MEMORY;
	}

	sifdma.src = buffer;
	sifdma.dest = iop_addr;
	sifdma.size = size;
	sifdma.attr = 0;

	/* send by dma */
	while((id = SifSetDma(&sifdma, 1)) == 0);
	while(SifDmaStat(id) >= 0);

	WaitSema(completion_sema);

	sbuff[0] = (int)iop_addr;
	sbuff[1] = size;
	sbuff[2] = (int)adpcm; /* use as id */

	SifCallRpc(&cd0, AUDSRV_LOAD_ADPCM, 0, sbuff, 12, sbuff, 16, NULL, NULL);

	if(sbuff[0] != 0)
	{
		adpcm->buffer = 0;
		ret = sbuff[0];
	}
	else
	{
		adpcm->buffer = buffer;
		adpcm->size = size;
		adpcm->pitch = sbuff[1];
		adpcm->loop = sbuff[2];
		adpcm->channels = sbuff[3];
		ret = AUDSRV_ERR_NOERROR;
	}

	SignalSema(completion_sema);

	SifFreeIopHeap(iop_addr);

	return ret;
}
开发者ID:ps2dev,项目名称:ps2sdk,代码行数:50,代码来源:audsrv_rpc.c


注:本文中的SifCallRpc函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。