Пример #1
0
CInputWii::CInputWii()
{
	s32 wpad_state;
    s32 status;
    u32 type;
    u32 index;

	//eWPADStatus wpad;
    //e memset( (void *)(&wpad), 0, sizeof(WPADStatus));

	//orkprintf("created Dummy Input Device\n");
	WPADRegisterAllocator(myAlloc, myFree);

#if WPAD
	WPADInit();
	do
    {
       wpad_state = WPADGetStatus();
    } while (WPAD_STATE_SETUP != wpad_state);
#else
    KPADInit() ;		// Controller
    KPADSetControlDpdCallback(0, dpd_callback);
    KPADSetSamplingCallback(0, sampling_callback);

    KPADReset() ;
    KPADSetPosParam ( 0,  pos_play_radius,  pos_sensitivity ) ;
    KPADSetHoriParam( 0, hori_play_radius, hori_sensitivity ) ;
    KPADSetDistParam( 0, dist_play_radius, dist_sensitivity ) ;
    KPADSetAccParam ( 0,  acc_play_radius,  acc_sensitivity ) ;
    KPADSetBtnRepeat( 0, repeat_delay_sec, repeat_pulse_sec ) ;


	PADInit();

	KPADDisableStickCrossClamp() ;
	WPADSetAutoSleepTime(5);

#endif


}
Пример #2
0
int main(int argc, char **argv)
{
#if 1
   setup_os_exceptions();
#else
   InstallExceptionHandler();
#endif
   ProcUIInit(&SaveCallback);

   socket_lib_init();
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
   log_init(PC_DEVELOPMENT_IP_ADDRESS, PC_DEVELOPMENT_TCP_PORT);
   devoptab_list[STD_OUT] = &dotab_stdout;
   devoptab_list[STD_ERR] = &dotab_stdout;
#endif
#ifndef IS_SALAMANDER
   VPADInit();
   WPADEnableURCC(true);
   WPADEnableWiiRemote(true);
   KPADInit();
#endif
   verbosity_enable();

   printf("starting\n");
   fflush(stdout);
   DEBUG_VAR(ARGV_PTR);
   if(ARGV_PTR && ((u32)ARGV_PTR < 0x01000000))
   {
      struct
      {
         u32 magic;
         u32 argc;
         char * argv[3];
      }*param = ARGV_PTR;
      if(param->magic == ARGV_MAGIC)
      {
         argc = param->argc;
         argv = param->argv;
      }
      ARGV_PTR = NULL;
   }

   DEBUG_VAR(argc);
   DEBUG_STR(argv[0]);
   DEBUG_STR(argv[1]);
   fflush(stdout);
#ifdef IS_SALAMANDER
   int salamander_main(int, char **);
   salamander_main(argc, argv);
#else
#if 1
#if 0
   int argc_ = 2;
//   char* argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.nes", NULL};
   char *argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.sfc", NULL};

   rarch_main(argc_, argv_, NULL);
#else
   rarch_main(argc, argv, NULL);
#endif
   do
   {
      unsigned sleep_ms = 0;
      int ret = runloop_iterate(&sleep_ms);

      if (ret == 1 && sleep_ms > 0)
         retro_sleep(sleep_ms);

      task_queue_ctl(TASK_QUEUE_CTL_WAIT, NULL);

      if (ret == -1)
         break;

   }
   while (1);

   main_exit(NULL);
#endif
#endif
   fflush(stdout);
   fflush(stderr);
   ProcUIShutdown();

#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
   log_deinit();
#endif

   /* returning non 0 here can prevent loading a different rpx/elf in the HBL environment */
   return 0;
}