• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PAD_ButtonsHeld函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: FPAD_Update

void FPAD_Update( void )
{
	if (WPAD_ScanPads() > WPAD_ERR_NONE) {
		WPAD_Pressed = WPAD_ButtonsDown(0) | WPAD_ButtonsDown(1) | WPAD_ButtonsDown(2) | WPAD_ButtonsDown(3);
		WPAD_Pressed |= WPAD_ButtonsHeld(0) | WPAD_ButtonsHeld(1) | WPAD_ButtonsHeld(2) | WPAD_ButtonsHeld(3);
	} else {
		// No Wii remotes are connected
		WPAD_Pressed = 0;
	}
	
	if (PAD_ScanPads() > PAD_ERR_NONE) {
		PAD_Pressed  = PAD_ButtonsDown(0) | PAD_ButtonsDown(1) | PAD_ButtonsDown(2) | PAD_ButtonsDown(3);
		PAD_Pressed  |= PAD_ButtonsHeld(0) | PAD_ButtonsHeld(1) | PAD_ButtonsHeld(2) | PAD_ButtonsHeld(3);
		PAD_Stick_Y	 = PAD_StickY(0) | PAD_StickY(1) | PAD_StickY(2) | PAD_StickY(3);
		PAD_Stick_X	 = PAD_StickX(0) | PAD_StickX(1) | PAD_StickX(2) | PAD_StickX(3);
	} else {
		// No GC controllers are connected
		PAD_Pressed = 0;
		PAD_Stick_Y = 0;
		PAD_Stick_X = 0;
	}
		
	if( WPAD_Pressed == 0 && PAD_Pressed == 0 && ( PAD_Stick_Y < 25 && PAD_Stick_Y > -25 )  && ( PAD_Stick_X < 25 && PAD_Stick_X > -25 ) )
	{
		SLock = false;
		SpeedX= DELAY_START;
	}
}
开发者ID:ysei,项目名称:nintendont-mirror,代码行数:28,代码来源:FPad.c


示例2: DrawArgsSelector

void DrawArgsSelector(char *fileName) {

	Parameters* params = getParameters();
	int param_selection = 0;
	int params_per_page = 6;
	
	while ((PAD_ButtonsHeld(0) & PAD_BUTTON_A)){ VIDEO_WaitVSync (); }
	while(1) {
		doBackdrop();
		DrawEmptyBox(20,60, vmode->fbWidth-20, 460, COLOR_BLACK);
		sprintf(txtbuffer, "%s Parameters:", fileName);
		WriteFontStyled(25, 62, txtbuffer, GetTextScaleToFitInWidth(txtbuffer, vmode->fbWidth-50), false, defaultColor);

		int j = 0;
		int current_view_start = MIN(MAX(0,param_selection-params_per_page/2),MAX(0,params->num_params-params_per_page));
		int current_view_end = MIN(params->num_params, MAX(param_selection+params_per_page/2,params_per_page));
	
		int scrollBarHeight = 90+(params_per_page*20);
		int scrollBarTabHeight = (int)((float)scrollBarHeight/(float)params->num_params);
		DrawVertScrollBar(vmode->fbWidth-45, 120, 25, scrollBarHeight, (float)((float)param_selection/(float)(params->num_params-1)),scrollBarTabHeight);
		for(j = 0; current_view_start<current_view_end; ++current_view_start,++j) {
			drawParameterForArgsSelector(&params->parameters[current_view_start], 25, 120+j*35, current_view_start==param_selection);
		}
		// Write about the default if there is any
		DrawTransparentBox( 35, 350, vmode->fbWidth-35, 400);
		WriteFontStyled(33, 345, "Default values will be used by the DOL being loaded if a", 0.8f, false, defaultColor);
		WriteFontStyled(33, 365, "parameter is not enabled. Please check the documentation", 0.8f, false, defaultColor);
		WriteFontStyled(33, 385, "for this DOL if you are unsure of the default values.", 0.8f, false, defaultColor);
		WriteFontStyled(640/2, 440, "(A) Toggle Param - (Start) Load the DOL", 1.0f, true, defaultColor);
		DrawFrameFinish();

		while (!(PAD_ButtonsHeld(0) & (PAD_BUTTON_RIGHT|PAD_BUTTON_LEFT|PAD_BUTTON_UP|PAD_BUTTON_DOWN|PAD_BUTTON_START|PAD_BUTTON_A)))
			{ VIDEO_WaitVSync (); }
		u16 btns = PAD_ButtonsHeld(0);
		if((btns & (PAD_BUTTON_RIGHT|PAD_BUTTON_LEFT)) && params->parameters[param_selection].enable) {
			int curValIdx = params->parameters[param_selection].currentValueIdx;
			int maxValIdx = params->parameters[param_selection].num_values;
			curValIdx = btns & PAD_BUTTON_LEFT ? 
				((--curValIdx < 0) ? maxValIdx-1 : curValIdx):((curValIdx + 1) % maxValIdx);
			params->parameters[param_selection].currentValueIdx = curValIdx;
		}
		if(btns & (PAD_BUTTON_UP|PAD_BUTTON_DOWN)) {
			param_selection = btns & PAD_BUTTON_UP ? 
				((--param_selection < 0) ? params->num_params-1 : param_selection)
				:((param_selection + 1) % params->num_params);
		}
		if(btns & PAD_BUTTON_A) {
			params->parameters[param_selection].enable ^= 1;
		}
		if(btns & PAD_BUTTON_START) {
			break;
		}
		while (PAD_ButtonsHeld(0) & (PAD_BUTTON_RIGHT|PAD_BUTTON_LEFT|PAD_BUTTON_UP|PAD_BUTTON_DOWN|PAD_BUTTON_START|PAD_BUTTON_A))
			{ VIDEO_WaitVSync (); }
	}
}
开发者ID:Extrems,项目名称:Swiss,代码行数:56,代码来源:FrameBufferMagic.c


示例3: UpdatePads

void
UpdatePads()
{
	#ifdef HW_RVL
	WiiDRC_ScanPads();
	WPAD_ScanPads();
	#endif
	
	PAD_ScanPads();

	for(int i=3; i >= 0; i--)
	{
		userInput[i].pad.btns_d = PAD_ButtonsDown(i);
		userInput[i].pad.btns_u = PAD_ButtonsUp(i);
		userInput[i].pad.btns_h = PAD_ButtonsHeld(i);
		userInput[i].pad.stickX = PAD_StickX(i);
		userInput[i].pad.stickY = PAD_StickY(i);
		userInput[i].pad.substickX = PAD_SubStickX(i);
		userInput[i].pad.substickY = PAD_SubStickY(i);
		userInput[i].pad.triggerL = PAD_TriggerL(i);
		userInput[i].pad.triggerR = PAD_TriggerR(i);
	}
#ifdef HW_RVL
	if(WiiDRC_Inited() && WiiDRC_Connected())
	{
		userInput[0].wiidrcdata.btns_d = WiiDRC_ButtonsDown();
		userInput[0].wiidrcdata.btns_u = WiiDRC_ButtonsUp();
		userInput[0].wiidrcdata.btns_h = WiiDRC_ButtonsHeld();
		userInput[0].wiidrcdata.stickX = WiiDRC_lStickX();
		userInput[0].wiidrcdata.stickY = WiiDRC_lStickY();
		userInput[0].wiidrcdata.substickX = WiiDRC_rStickX();
		userInput[0].wiidrcdata.substickY = WiiDRC_rStickY();
	}
#endif
}
开发者ID:dborth,项目名称:fceugx,代码行数:35,代码来源:pad.cpp


示例4: UpdatePadsCB

/****************************************************************************
 * UpdatePadsCB
 *
 * called by postRetraceCallback in InitGCVideo - scans gcpad and wpad
 ***************************************************************************/
static void
UpdatePadsCB ()
{
	#ifdef HW_RVL
	WPAD_ScanPads();
	#endif
	PAD_ScanPads();

	for(int i=3; i >= 0; i--)
	{
		#ifdef HW_RVL
		memcpy(&userInput[i].wpad, WPAD_Data(i), sizeof(WPADData));
		#endif

		userInput[i].chan = i;
		userInput[i].pad.btns_d = PAD_ButtonsDown(i);
		userInput[i].pad.btns_u = PAD_ButtonsUp(i);
		userInput[i].pad.btns_h = PAD_ButtonsHeld(i);
		userInput[i].pad.stickX = PAD_StickX(i);
		userInput[i].pad.stickY = PAD_StickY(i);
		userInput[i].pad.substickX = PAD_SubStickX(i);
		userInput[i].pad.substickY = PAD_SubStickY(i);
		userInput[i].pad.triggerL = PAD_TriggerL(i);
		userInput[i].pad.triggerR = PAD_TriggerR(i);
	}
}
开发者ID:brijohn,项目名称:onscripter-wii,代码行数:31,代码来源:video.cpp


示例5: StandardGamecube

u32 StandardGamecube(unsigned short pad)
{
	u32 J = 0;
	u32 jp = PAD_ButtonsHeld(pad);
	if (jp & PAD_BUTTON_UP)
		J |= VBA_UP;
	if (jp & PAD_BUTTON_DOWN)
		J |= VBA_DOWN;
	if (jp & PAD_BUTTON_LEFT)
		J |= VBA_LEFT;
	if (jp & PAD_BUTTON_RIGHT)
		J |= VBA_RIGHT;
	if (jp & PAD_BUTTON_A)
		J |= VBA_BUTTON_A;
	if (jp & PAD_BUTTON_B)
		J |= VBA_BUTTON_B;
	if (jp & PAD_BUTTON_START)
		J |= VBA_BUTTON_START;
	if (jp & PAD_BUTTON_X)
		J |= VBA_BUTTON_SELECT;
	if (jp & PAD_TRIGGER_L)
		J |= VBA_BUTTON_L;
	if (jp & PAD_TRIGGER_R)
		J |= VBA_BUTTON_R;
	if (jp & PAD_TRIGGER_Z || jp & PAD_BUTTON_Y)
		J |= VBA_SPEED;
	return J;
}
开发者ID:feraligatr,项目名称:vbagx,代码行数:28,代码来源:input.cpp


示例6: GetInput

/****************************************************************************
 * Controller Configuration
 *
 * Snes9x 1.51 uses a cmd system to work out which button has been pressed.
 * Here, I simply move the designated value to the gcpadmaps array, which
 * saves on updating the cmd sequences.
 ***************************************************************************/
u32
GetInput (u16 ctrlr_type)
{
	//u32 exp_type;
	u32 pressed;
	pressed=0;
	s8 gc_px = 0;

	while( PAD_ButtonsHeld(0)
#ifdef HW_RVL
	| WPAD_ButtonsHeld(0)
#endif
	) VIDEO_WaitVSync();	// button 'debounce'

	while (pressed == 0)
	{
		VIDEO_WaitVSync();
		// get input based on controller type
		if (ctrlr_type == CTRLR_GCPAD)
		{
			pressed = PAD_ButtonsHeld (0);
			gc_px = PAD_SubStickX (0);
		}
#ifdef HW_RVL
		else
		{
		//	if ( WPAD_Probe( 0, &exp_type) == 0)	// check wiimote and expansion status (first if wiimote is connected & no errors)
		//	{
				pressed = WPAD_ButtonsHeld (0);

		//		if (ctrlr_type != CTRLR_WIIMOTE && exp_type != ctrlr_type+1)	// if we need input from an expansion, and its not connected...
		//			pressed = 0;
		//	}
		}
#endif
		/*** check for exit sequence (c-stick left OR home button) ***/
		if ( (gc_px < -70) || (pressed & WPAD_BUTTON_HOME) || (pressed & WPAD_CLASSIC_BUTTON_HOME) )
			return 0;
	}	// end while
	while( pressed == (PAD_ButtonsHeld(0)
#ifdef HW_RVL
						| WPAD_ButtonsHeld(0)
#endif
						) ) VIDEO_WaitVSync();

	return pressed;
}	// end GetInput()
开发者ID:feraligatr,项目名称:snes9xgx,代码行数:54,代码来源:menu.cpp


示例7: WPAD_ButtonsHeld

u32 InputDevices::GetPadButtonStatus(int channel)
{
    u32 extensions;
    WPADData data;
    u32 buttons, gcbuttons;
    PAD2WPAD *p2w;
    joystick_t padjoy;

    // Check standard buttons
    buttons = WPAD_ButtonsHeld(channel);

    // Add GameCube buttons
    gcbuttons = PAD_ButtonsHeld(channel);
    p2w = pad2wpad;
    while( p2w->pad ) {
        if( gcbuttons & p2w->pad ) {
            buttons |= p2w->wpad;
        }
        p2w++;
    }

    // Key translations for default WiiMote buttons
    ProcessWPadButtons(channel, wpad_default);

    // Check extensions
    WPAD_Probe(channel, &extensions);
    if( extensions == WPAD_EXP_NUNCHUK ) {
      // Nunchuk stick
      WPAD_Expansion(channel, &data.exp);
      buttons |= GetJoystickDirection(&data.exp.nunchuk.js);
      // Nunchuck key translations
      ProcessWPadButtons(channel, wpad_nunchuk);
    } else if( extensions == WPAD_EXP_CLASSIC ) {
      // Both classic controller sticks
      WPAD_Expansion(channel, &data.exp);
      buttons |= GetJoystickDirection(&data.exp.classic.ljs);
      buttons |= GetJoystickDirection(&data.exp.classic.rjs);
      // Classic controller key translations
      ProcessWPadButtons(channel, wpad_classic);
    }

    // Scan GameCube sticks
    padjoy.min.x = 0;
    padjoy.min.y = 0;
    padjoy.max.x = 255;
    padjoy.max.y = 255;
    padjoy.center.x = 128;
    padjoy.center.y = 128;

    padjoy.pos.x = (int)PAD_StickX(channel) + 128;
    padjoy.pos.y = (int)PAD_StickY(channel) + 128;
    buttons |= GetJoystickDirection(&padjoy);

    padjoy.pos.x = (int)PAD_SubStickX(channel) + 128;
    padjoy.pos.y = (int)PAD_SubStickY(channel) + 128;
    buttons |= GetJoystickDirection(&padjoy);

    return buttons;
}
开发者ID:meesokim,项目名称:bluemsx-wii,代码行数:59,代码来源:InputDevices.cpp


示例8: NGCReportButtons

/****************************************************************************
 * NGCReportButtons
 *
 * Called on each rendered frame
 * Our way of putting controller input into Snes9x
 ***************************************************************************/
void NGCReportButtons ()
{
	s8 gc_px = PAD_SubStickX (0);
	s8 gc_py = PAD_SubStickY (0);

	u16 gc_pb = PAD_ButtonsHeld (0);

#ifdef HW_RVL
	s8 wm_sx = WPAD_StickX (0,1);
	s8 wm_sy = WPAD_StickY (0,1);
	u32 wm_pb = WPAD_ButtonsHeld (0);	// wiimote / expansion button info
#endif


	/*** Check for video zoom ***/
	if (GCSettings.NGCZoom)
	{
		if (gc_py < -36 || gc_py > 36)
			zoom ((float) gc_py / -36);
#ifdef HW_RVL
		if (wm_sy < -36 || wm_sy > 36)
			zoom ((float) wm_sy / -36);
#endif
	}

    Settings.TurboMode = ( (gc_px > 70)
#ifdef HW_RVL
							|| (wm_sx > 70)
#endif
							);	// RIGHT on c-stick and on classic ctrlr right joystick

	/*** Check for menu:
	       CStick left
	       OR "L+R+X+Y" (eg. Hombrew/Adapted SNES controllers)
	       OR "Home" on the wiimote or classic controller
	       OR LEFT on classic right analog stick***/

    if ((gc_px < -70) ||
        ((gc_pb & PAD_TRIGGER_L) &&
         (gc_pb & PAD_TRIGGER_R ) &&
         (gc_pb & PAD_BUTTON_X) &&
         (gc_pb & PAD_BUTTON_Y ))
#ifdef HW_RVL
		 || (wm_pb & WPAD_BUTTON_HOME)
		 || (wm_pb & WPAD_CLASSIC_BUTTON_HOME)
		 || (wm_sx < -70)
#endif
       )
    {
        ConfigRequested = 1;	// go to the menu
    }
    else
    {
        int j = (Settings.MultiPlayer5Master == true ? 4 : 2);
        for (int i = 0; i < j; i++)
            decodepad (i);
    }
}
开发者ID:feraligatr,项目名称:snes9xgx,代码行数:64,代码来源:input.cpp


示例9: WPAD_ButtonsHeld

void CMenu::ButtonsHeld()
{
	gc_btnsHeld = 0;
	for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--)
	{
		wii_btnsHeld[chan] = WPAD_ButtonsHeld(chan);
		gc_btnsHeld |= PAD_ButtonsHeld(chan);
		wupc_btnsHeld[chan] = WUPC_ButtonsHeld(chan);
	}
}
开发者ID:Fledge68,项目名称:my-open-wiiflow-mod,代码行数:10,代码来源:menu_input.cpp


示例10: populateDeviceAvailability

// Checks if devices are available, prints name of device being detected for slow init devices
void populateDeviceAvailability() {
	if(PAD_ButtonsHeld(0) & PAD_BUTTON_B) {
		deviceHandler_setAllDevicesAvailable();
		return;
	}
	uiDrawObj_t *msgBox = DrawPublish(DrawProgressBar(true, 0, "Detecting devices ...\nThis can be skipped by holding B next time"));
	int i;
	for(i = 0; i < MAX_DEVICES; i++) {
		if(allDevices[i] != NULL && !deviceHandler_getDeviceAvailable(allDevices[i])) {
			print_gecko("Checking device availability for device %s\r\n", allDevices[i]->deviceName);
			deviceHandler_setDeviceAvailable(allDevices[i], allDevices[i]->test());
		}
		if(PAD_ButtonsHeld(0) & PAD_BUTTON_B) {
			deviceHandler_setAllDevicesAvailable();
			break;
		}
	}
	DrawDispose(msgBox);
}
开发者ID:emukidid,项目名称:swiss-gc,代码行数:20,代码来源:main.c


示例11: DecodeGamecube

u32 DecodeGamecube(unsigned short pad)
{
	u32 J = 0;
	u32 jp = PAD_ButtonsHeld(pad);
	for (int i = 0; i < MAXJP; i++)
	{
		if (jp & btnmap[CTRLR_GCPAD][i])
			J |= vbapadmap[i];
	}
	return J;
}
开发者ID:feraligatr,项目名称:vbagx,代码行数:11,代码来源:input.cpp


示例12: GetInput

/****************************************************************************
 * Controller Configuration
 *
 * Snes9x 1.50 uses a cmd system to work out which button has been pressed.
 * Here, I simply move the designated value to the gcpadmaps array, which saves
 * on updating the cmd sequences.
 ****************************************************************************/
u32
GetInput (u16 ctrlr_type)
{
	u32 exp_type, pressed;
	pressed=0;
	
	while( PAD_ButtonsHeld(0)
#ifdef HW_RVL
	| WPAD_ButtonsHeld(0)
#endif
	) VIDEO_WaitVSync();	// button 'debounce'
	
	while (pressed == 0)
	{
		VIDEO_WaitVSync();
		// get input based on controller type
		//if (ctrlr_type == CTRLR_GCPAD) 
		//{
			pressed = PAD_ButtonsHeld (0);
		//} 
#ifdef HW_RVL
		//else 
		//{	
		//	if ( WPAD_Probe( 0, &exp_type) == 0)	// check wiimote and expansion status (first if wiimote is connected & no errors)
		//	{
				pressed = WPAD_ButtonsHeld (0);
				
		//		if (ctrlr_type != CTRLR_WIIMOTE && exp_type != ctrlr_type+1)	// if we need input from an expansion, and its not connected...
		//			pressed = 0;
		//	}
		//}
#endif
	}	// end while
	while( pressed == (PAD_ButtonsHeld(0) 
#ifdef HW_RVL
						| WPAD_ButtonsHeld(0)
#endif
						) ) VIDEO_WaitVSync();
	
	return pressed;
}	// end GetInput()
开发者ID:feraligatr,项目名称:snes9xgx,代码行数:48,代码来源:menu.cpp


示例13: GetInput

/****************************************************************************
 * Controller Configuration
 ***************************************************************************/
u32
GetInput (u16 ctrlr_type)
{
	//u32 exp_type;
	u32 pressed;
	pressed=0;
	s8 gc_px = 0;

	while( PAD_ButtonsHeld(0)
#ifdef HW_RVL
	| WPAD_ButtonsHeld(0)
#endif
	) VIDEO_WaitVSync();	// button 'debounce'

	while (pressed == 0)
	{
		VIDEO_WaitVSync();
		// get input based on controller type
		if (ctrlr_type == CTRLR_GCPAD)
		{
			pressed = PAD_ButtonsHeld (0);
			gc_px = PAD_SubStickX (0);
		}
#ifdef HW_RVL
		else
		{
			pressed = WPAD_ButtonsHeld (0);
		}
#endif
		/*** check for exit sequence (c-stick left OR home button) ***/
		if ( (gc_px < -70) || (pressed & WPAD_BUTTON_HOME) || (pressed & WPAD_CLASSIC_BUTTON_HOME) )
			return 0;
	}	// end while
	while( pressed == (PAD_ButtonsHeld(0)
#ifdef HW_RVL
						| WPAD_ButtonsHeld(0)
#endif
						) ) VIDEO_WaitVSync();

	return pressed;
}	// end GetInput()
开发者ID:feraligatr,项目名称:vbagx,代码行数:44,代码来源:menu.cpp


示例14: OnePieceInput

u32 OnePieceInput(unsigned short pad) {
	// Only Nunchuk and Gamecube controls available
	// Wiimote and Classic controls depend on user configuration
	u32 J = StandardMovement(pad) 
		    | DecodeWiimote(pad) | DecodeClassic(pad);
	static u32 LastDir = VBA_RIGHT;
	bool JumpButton=0, AttackButton=0, ViewButton=0, CharacterButton=0, PauseButton=0,
	DashButton=0, GrabButton=0, SpeedButton=0, AttackUpButton = 0;
#ifdef HW_RVL
	WPADData * wp = WPAD_Data(pad);
	// Nunchuk controls are based on One Piece: Unlimited Adventure for the Wii
	if (wp->exp.type == WPAD_EXP_NUNCHUK) {
		J |= StandardDPad(pad);
		JumpButton = wp->btns_h & WPAD_BUTTON_B;
		AttackButton = wp->btns_h & WPAD_BUTTON_A;
		CharacterButton = wp->btns_h & WPAD_BUTTON_MINUS;
		PauseButton = wp->btns_h & WPAD_BUTTON_PLUS;
		DashButton = wp->btns_h & WPAD_NUNCHUK_BUTTON_C;
		GrabButton = wp->btns_h & WPAD_NUNCHUK_BUTTON_Z;
		ViewButton = wp->btns_h & WPAD_BUTTON_1; // doesn't do anything?
		SpeedButton = wp->btns_h & WPAD_BUTTON_2;
	}
#endif
	// Gamecube controls are based on One Piece Grand Adventure
	{
		u32 gc = PAD_ButtonsHeld(pad);
		signed char gc_px = PAD_SubStickX(pad);
		if (gc_px > 70) J |= VBA_SPEED;
		JumpButton = JumpButton || gc & PAD_BUTTON_Y;
		AttackButton = AttackButton || gc & PAD_BUTTON_A;
		GrabButton = GrabButton || gc & PAD_BUTTON_B;
		AttackUpButton = AttackUpButton || gc & PAD_BUTTON_X;
		DashButton = DashButton || gc & PAD_TRIGGER_L;
		PauseButton = PauseButton || gc & PAD_BUTTON_START;
		CharacterButton = CharacterButton || gc & PAD_TRIGGER_R; // supposed to be block
	}
	
	if (JumpButton) J |= VBA_BUTTON_A;
	if (AttackButton) J |= VBA_BUTTON_B;
	if (AttackUpButton) J |= VBA_UP | VBA_BUTTON_B;
	if (CharacterButton) J |= VBA_BUTTON_L;
	if (DashButton) J |= LastDir;
	if (PauseButton) J |= VBA_BUTTON_START;
	if (GrabButton) J |= VBA_BUTTON_R;
	if (SpeedButton) J |= VBA_SPEED;
	if (ViewButton) J |= VBA_BUTTON_SELECT; // doesn't do anything?

	if (J & VBA_RIGHT) LastDir = VBA_RIGHT;
	else if (J & VBA_LEFT) LastDir = VBA_LEFT;
	
	return J;
}
开发者ID:alfromagario,项目名称:vba-wii,代码行数:52,代码来源:gameinput.cpp


示例15: wii_is_any_button_held

/*
 * Checks to see if any buttons are held
 *
 * joys   The number of joysticks to check
 * return Whether any of the buttons are held
 */
BOOL wii_is_any_button_held( int joys )
{
  int i;
  for( i = 0; i < joys; i++ )
  {
    if( WPAD_ButtonsHeld( i ) || PAD_ButtonsHeld( i ) )
    {
      return TRUE;
    }
  }

  return FALSE;
}
开发者ID:chipsoftwaretester,项目名称:OpenEmu,代码行数:19,代码来源:wii_input.c


示例16: waitA

void waitA(){
	printf("Press A to continue\n");
	while (1){
		PAD_ScanPads();
		if (PAD_ButtonsDown(0) & PAD_BUTTON_A){
			while (PAD_ButtonsHeld(0) & PAD_BUTTON_A){
				PAD_ScanPads();
			}
			break;
		}
		VIDEO_WaitVSync();
	}
}
开发者ID:suloku,项目名称:dolaunch,代码行数:13,代码来源:main.c


示例17: pad_config

/*******************************
  gamepad support
*******************************/
static void pad_config(int num, int padtype)
{
  int i,j,max;
  u16 p;
  u8 quit;
  char msg[30];

  u32 pad = PAD_ScanPads() & (1<<num);
  if (!pad)
  {
    sprintf(msg, "PAD #%d is not connected !", num+1);
    WaitPrompt(msg);
    return;
  }

  /* configure keys */
  max = (padtype == DEVICE_6BUTTON) ? MAX_KEYS : (MAX_KEYS - 3);
  for (i=0; i<max; i++)
  {
    /* remove any pending keys */
    while (PAD_ButtonsHeld(num))
    {
      VIDEO_WaitVSync();
      PAD_ScanPads();
    }

    ClearScreen();
    sprintf(msg,"Press key for %s",keys_name[i]);
    WriteCentre(254, msg);
    SetScreen();

    /* check buttons state */
    quit = 0;
    while (quit == 0)
    {
      VIDEO_WaitVSync();
      PAD_ScanPads();
      p = PAD_ButtonsDown(num);

      for (j=0; j<8; j++)
      {
        if (p & pad_keys[j])
        {
           config.pad_keymap[num][i] = pad_keys[j];
           quit = 1;
           j = 9;   /* exit loop */
        }
      }
    }
  }
}
开发者ID:AliSayed,项目名称:MoSync,代码行数:54,代码来源:ogc_input.c


示例18: UpdatePads

/****************************************************************************
 * UpdatePads
 *
 * Scans pad and wpad
 ***************************************************************************/
void UpdatePads() {
    XenonInputUpdate();

    for (int i = 3; i >= 0; i--) {
        userInput[i].pad.btns_d = PAD_ButtonsDown(i);
        userInput[i].pad.btns_u = PAD_ButtonsUp(i);
        userInput[i].pad.btns_h = PAD_ButtonsHeld(i);
        //        userInput[i].pad.stickX = PAD_StickX(i);
        //        userInput[i].pad.stickY = PAD_StickY(i);
        userInput[i].pad.substickX = PAD_SubStickX(i);
        userInput[i].pad.substickY = PAD_SubStickY(i);
        userInput[i].pad.triggerL = PAD_TriggerL(i);
        userInput[i].pad.triggerR = PAD_TriggerR(i);
    }
}
开发者ID:LibXenonProject,项目名称:fceux-xenon,代码行数:20,代码来源:gui_input.cpp


示例19: ButtonsHold

u32 ButtonsHold(void)
{

	int i;
	u32 buttons = 0;
	WUPC_UpdateButtonStats();
	WPAD_ScanPads();
	PAD_ScanPads();

	for (i = 3; i >= 0; i--)
	{
		buttons |= WUPC_ButtonsHeld(i);
		buttons |= PAD_ButtonsHeld(i);
		buttons |= WPAD_ButtonsHeld(i);
	}
	return buttons;
}
开发者ID:Jeremy-D-Miller,项目名称:usbloader-gui,代码行数:17,代码来源:wpad.c


示例20: populateDeviceAvailability

// Checks if devices are available, prints name of device being detected for slow init devices
void populateDeviceAvailability() {
	DrawFrameStart();
	DrawMessageBox(D_INFO, "Detecting devices ...\nThis can be skipped by holding B next time");
	DrawFrameFinish();
	if(PAD_ButtonsHeld(0) & PAD_BUTTON_B) {
		deviceHandler_setAllDevicesAvailable();
		return;
	}
	const DISC_INTERFACE* carda = &__io_gcsda;
	const DISC_INTERFACE* cardb = &__io_gcsdb;
	// DVD
	deviceHandler_setDeviceAvailable(DVD_DISC, swissSettings.hasDVDDrive);
	// SD Gecko
	DrawFrameStart();
	DrawMessageBox(D_INFO, "Detecting devices [SD] ...\nThis can be skipped by holding B next time");
	DrawFrameFinish();
	deviceHandler_setDeviceAvailable(SD_CARD, carda->isInserted() || cardb->isInserted());
	// IDE-EXI
	DrawFrameStart();
	DrawMessageBox(D_INFO, "Detecting devices [IDE-EXI] ...\nThis can be skipped by holding B next time");
	DrawFrameFinish();
	deviceHandler_setDeviceAvailable(IDEEXI, ide_exi_inserted(0) || ide_exi_inserted(1));
	// Qoob
	deviceHandler_setDeviceAvailable(QOOB_FLASH, 0);	// Hidden by default, add auto detect at some point
	// WODE
	deviceHandler_setDeviceAvailable(WODE, 0);	// Hidden by default, add auto detect at some point
	// Memory card
	DrawFrameStart();
	DrawMessageBox(D_INFO, "Detecting devices [Memory Card] ...\nThis can be skipped by holding B next time");
	DrawFrameFinish();
	deviceHandler_setDeviceAvailable(MEMCARD, (initialize_card(0)==CARD_ERROR_READY) || (initialize_card(1)==CARD_ERROR_READY));
	// WKF/WASP
	DrawFrameStart();
	DrawMessageBox(D_INFO, "Detecting devices [WKF/WASP] ...\nThis can be skipped by holding B next time");
	DrawFrameFinish();
	deviceHandler_setDeviceAvailable(WKF, swissSettings.hasDVDDrive && (__wkfSpiReadId() != 0 && __wkfSpiReadId() != 0xFFFFFFFF));
	// USB Gecko
	deviceHandler_setDeviceAvailable(USBGECKO, usb_isgeckoalive(1));
	// BBA/SAMBA
	deviceHandler_setDeviceAvailable(SAMBA, exi_bba_exists());
	// System, always there
	deviceHandler_setDeviceAvailable(SYS, 1);
}
开发者ID:KirovAir,项目名称:swiss-gc,代码行数:44,代码来源:main.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PAGE_ALIGN函数代码示例发布时间:2022-05-30
下一篇:
C++ PADP函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap