예제 #1
0
int main(int argc, char **argv)
{
#else
int __entry_menu(int argc, char **argv)
{
   InitFunctionPointers();
#endif
#if 1
   setup_os_exceptions();
#else
   InstallExceptionHandler();
#endif
   socket_lib_init();
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
   log_init(PC_DEVELOPMENT_IP_ADDRESS, PC_DEVELOPMENT_TCP_PORT);
#endif
   devoptab_list[STD_OUT] = &dotab_stdout;
   devoptab_list[STD_ERR] = &dotab_stdout;
   memoryInitialize();
   mount_sd_fat("sd");
   VPADInit();

   verbosity_enable();
   DEBUG_VAR(argc);
   DEBUG_STR(argv[0]);
   DEBUG_STR(argv[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
//   int frames = 0;
   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);
//   }while(frames++ < 300);

   main_exit(NULL);
   unmount_sd_fat("sd");
   memoryRelease();
   fflush(stdout);
   fflush(stderr);
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
   log_deinit();
#endif

   return 0;
}
예제 #2
0
파일: input.c 프로젝트: Noah670/URetro
void initInputs() {
	VPADInit();
}
예제 #3
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;
}
예제 #4
0
파일: main.c 프로젝트: ajd4096/ddd
/* Entry point */
int Menu_Main(void)
{
    //!*******************************************************************
    //!                   Initialize function pointers                   *
    //!*******************************************************************
    //! do OS (for acquire) and sockets first so we got logging
    InitOSFunctionPointers();
    InitSocketFunctionPointers();
    InitFSFunctionPointers();
    InitVPadFunctionPointers();
    InitSysFunctionPointers();
    InitAocFunctionPointers();

    log_init("192.168.178.3");
    log_deinit();
    log_init("192.168.178.3");
    log_printf("Started %s\n", cosAppXmlInfoStruct.rpx_name);

    if(strcasecmp("men.rpx", cosAppXmlInfoStruct.rpx_name) == 0)
    {
        CheckPendingMetaDump();
        return EXIT_RELAUNCH_ON_LOAD;
    }
    else if(strlen(cosAppXmlInfoStruct.rpx_name) > 0 && strcasecmp("ffl_app.rpx", cosAppXmlInfoStruct.rpx_name) != 0)
    {
        StartDumper();
        return EXIT_RELAUNCH_ON_LOAD;
    }

    // initialize memory tables once on start
    memoryInitAreaTable();
    rpxRplTableInit();
    SetupKernelCallback();
    PatchMethodHooks();

    memoryInitialize();

    VPADInit();

    // Prepare screen
    int screen_buf0_size = 0;
    int screen_buf1_size = 0;

    // Init screen and screen buffers
    OSScreenInit();
    screen_buf0_size = OSScreenGetBufferSizeEx(0);
    screen_buf1_size = OSScreenGetBufferSizeEx(1);

    unsigned char *screenBuffer = MEM1_alloc(screen_buf0_size + screen_buf1_size, 0x40);

    OSScreenSetBufferEx(0, screenBuffer);
    OSScreenSetBufferEx(1, (screenBuffer + screen_buf0_size));

    OSScreenEnableEx(0, 1);
    OSScreenEnableEx(1, 1);

    char msg[80];
    uint8_t sel_ip = 3;
    int launchMethod = 0;
    int update_screen = 1;
    int vpadError = -1;
    VPADData vpad_data;
    u_serv_ip ip;
    ip.full = GetServerIp();
    int delay = 0;

    while (1)
    {
        // Read vpad
        VPADRead(0, &vpad_data, 1, &vpadError);

        if(update_screen)
        {
            OSScreenClearBufferEx(0, 0);
            OSScreenClearBufferEx(1, 0);

            // Print message
            PRINT_TEXT2(14, 1, "-- DDD v0.2 by Dimok --");
            PRINT_TEXT2(0, 5, "1.    Setup IP address of server application.");

            // Print ip digit selector
            uint8_t x_shift = 17 + 4 * sel_ip;
            PRINT_TEXT2(x_shift, 6, "vvv");

            PRINT_TEXT2(0, 7, "      Server IP: %3d.%3d.%3d.%3d", ip.digit[0], ip.digit[1], ip.digit[2], ip.digit[3]);

            PRINT_TEXT2(0, 10, "2.   Press A to install dumper and try to launch disc.");
            PRINT_TEXT2(0, 11, "  or Press X to install dumper and return to system menu.");

            PRINT_TEXT2(0, 13, "3.   Start the title to be dumped.");

            PRINT_TEXT2(0, 17, "Press home button to exit ...");


            OSScreenFlipBuffersEx(0);
            OSScreenFlipBuffersEx(1);
        }

        u32 pressedBtns = vpad_data.btns_d | vpad_data.btns_h;

        // Check for buttons
        // Home Button
        if (pressedBtns & VPAD_BUTTON_HOME) {
            launchMethod = 0;
            break;
        }
        // A Button
        if (pressedBtns & VPAD_BUTTON_A) {
            SetServerIp(ip.full);
            launchMethod = 1;
            break;
        }
        // A Button
        if (pressedBtns & VPAD_BUTTON_X) {
            SetServerIp(ip.full);
            launchMethod = 2;
            break;
        }
        // Left/Right Buttons
        if (vpad_data.btns_d & VPAD_BUTTON_LEFT )
        {
            if(sel_ip == 0)
                sel_ip = 3;
            else
                --sel_ip;
        }

        if (vpad_data.btns_d & VPAD_BUTTON_RIGHT)
        {
            sel_ip = ((sel_ip + 1) % 4);
        }

        // Up/Down Buttons
        if (pressedBtns & VPAD_BUTTON_UP)
        {
            if(--delay <= 0) {
                ip.digit[sel_ip]++;
                delay = (vpad_data.btns_d & VPAD_BUTTON_UP) ? 6 : 0;
            }
        }
        else if (pressedBtns & VPAD_BUTTON_DOWN)
        {
            if(--delay <= 0) {
                ip.digit[sel_ip]--;
                delay = (vpad_data.btns_d & VPAD_BUTTON_DOWN) ? 6 : 0;
            }
        }
        else {
            delay = 0;
        }

        // Button pressed ?
        update_screen = (pressedBtns & (VPAD_BUTTON_LEFT | VPAD_BUTTON_RIGHT | VPAD_BUTTON_UP | VPAD_BUTTON_DOWN)) ? 1 : 0;
        usleep(20000);
    }

	MEM1_free(screenBuffer);
	screenBuffer = NULL;

    log_deinit();

    memoryRelease();

    if(launchMethod == 0)
    {
        RestoreInstructions();
        return EXIT_SUCCESS;
    }
    else if(launchMethod == 1)
    {
        char buf_vol_odd[20];
        snprintf(buf_vol_odd, sizeof(buf_vol_odd), "%s", "/vol/storage_odd03");
        _SYSLaunchTitleByPathFromLauncher(buf_vol_odd, 18, 0);
    }
    else
    {
        SYSLaunchMenu();
    }

    return EXIT_RELAUNCH_ON_LOAD;
}