예제 #1
0
파일: main.c 프로젝트: freakdave/RetroArch
static void system_init(void)
{
#ifdef _XBOX1
   // Mount drives
   xbox_io_mount("A:", "cdrom0");
   xbox_io_mount("C:", "Harddisk0\\Partition0");
   xbox_io_mount("E:", "Harddisk0\\Partition1");
   xbox_io_mount("Z:", "Harddisk0\\Partition2");
   xbox_io_mount("F:", "Harddisk0\\Partition6");
   xbox_io_mount("G:", "Harddisk0\\Partition7");
#endif
}
예제 #2
0
static void system_init(void *data)
{
   (void)data;
#if defined(_XBOX1) && !defined(IS_SALAMANDER)
   // Mount drives
   xbox_io_mount("A:", "cdrom0");
   xbox_io_mount("C:", "Harddisk0\\Partition0");
   xbox_io_mount("E:", "Harddisk0\\Partition1");
   xbox_io_mount("Z:", "Harddisk0\\Partition2");
   xbox_io_mount("F:", "Harddisk0\\Partition6");
   xbox_io_mount("G:", "Harddisk0\\Partition7");
#endif
}
예제 #3
0
static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
      void *args, void *params_data)
{
   HRESULT ret;
   (void)ret;

#ifndef IS_SALAMANDER
   bool *verbose         = retro_main_verbosity();
   bool original_verbose = *verbose;

   *verbose              = true;
#endif

#ifndef IS_SALAMANDER
#if defined(HAVE_LOGGER)
   logger_init();
#elif defined(HAVE_FILE_LOGGER)
   retro_main_log_file_init("/retroarch-log.txt");
#endif
#endif

#ifdef _XBOX360
   // detect install environment
   unsigned long license_mask;
   DWORD volume_device_type;

   if (XContentGetLicenseMask(&license_mask, NULL) == ERROR_SUCCESS)
   {
      XContentQueryVolumeDeviceType("GAME",&volume_device_type, NULL);

      switch(volume_device_type)
      {
         case XCONTENTDEVICETYPE_HDD: /* Launched from content package on HDD */
         case XCONTENTDEVICETYPE_MU:  /* Launched from content package on USB/Memory Unit. */
         case XCONTENTDEVICETYPE_ODD: /* Launched from content package on Optial Disc Drive. */
         default:                     /* Launched from content package on unknown device. */
            break;
      }
   }
#endif

#if defined(_XBOX1)
   strlcpy(g_defaults.dir.core, "D:", sizeof(g_defaults.dir.core));
   strlcpy(g_defaults.dir.core_info, "D:", sizeof(g_defaults.dir.core_info));
   fill_pathname_join(g_defaults.path.config, g_defaults.dir.core,
         "retroarch.cfg", sizeof(g_defaults.path.config));
   fill_pathname_join(g_defaults.dir.savestate, g_defaults.dir.core,
         "savestates", sizeof(g_defaults.dir.savestate));
   fill_pathname_join(g_defaults.dir.sram, g_defaults.dir.core,
         "savefiles", sizeof(g_defaults.dir.sram));
   fill_pathname_join(g_defaults.dir.system, g_defaults.dir.core,
         "system", sizeof(g_defaults.dir.system));
   fill_pathname_join(g_defaults.dir.screenshot, g_defaults.dir.core,
         "screenshots", sizeof(g_defaults.dir.screenshot));
#elif defined(_XBOX360)
   strlcpy(g_defaults.dir.core, "game:", sizeof(g_defaults.dir.core));
   strlcpy(g_defaults.dir.core_info,
         "game:", sizeof(g_defaults.dir.core_info));
   strlcpy(g_defaults.path.config,
         "game:\\retroarch.cfg", sizeof(g_defaults.path.config));
   strlcpy(g_defaults.dir.screenshot,
         "game:", sizeof(g_defaults.dir.screenshot));
   strlcpy(g_defaults.dir.savestate,
         "game:\\savestates", sizeof(g_defaults.dir.savestate));
   strlcpy(g_defaults.dir.playlist,
         "game:\\playlists", sizeof(g_defaults.dir.playlist));
   strlcpy(g_defaults.dir.sram,
         "game:\\savefiles", sizeof(g_defaults.dir.sram));
   strlcpy(g_defaults.dir.system,
         "game:\\system", sizeof(g_defaults.dir.system));
#endif

#ifndef IS_SALAMANDER
   static char path[PATH_MAX_LENGTH];
   *path = '\0';
#if defined(_XBOX1)
   LAUNCH_DATA ptr;
   DWORD launch_type;

   if (XGetLaunchInfo(&launch_type, &ptr) == ERROR_SUCCESS)
   {
      char *extracted_path = NULL;
      if (launch_type == LDT_FROM_DEBUGGER_CMDLINE)
         goto exit;

      extracted_path = (char*)&ptr.Data;

      if (extracted_path && extracted_path[0] != '\0'
            && (strstr(extracted_path, "Pool") == NULL)
            /* Hack. Unknown problem */)
      {
         /* Auto-start game */
         strlcpy(path, extracted_path, sizeof(path));
      }
   }
#elif defined(_XBOX360)
   DWORD dwLaunchDataSize;
   if (XGetLaunchDataSize(&dwLaunchDataSize) == ERROR_SUCCESS)
   {
      BYTE* pLaunchData = new BYTE[dwLaunchDataSize];
      XGetLaunchData(pLaunchData, dwLaunchDataSize);
	  AURORA_LAUNCHDATA_EXECUTABLE* aurora = (AURORA_LAUNCHDATA_EXECUTABLE*)pLaunchData;
	  char* extracted_path = new char[dwLaunchDataSize];
	  memset(extracted_path, 0, dwLaunchDataSize);
	  if (aurora->ApplicationId == AURORA_LAUNCHDATA_APPID && aurora->FunctionId == AURORA_LAUNCHDATA_EXECUTABLE_FUNCID)
	  {
		  if (xbox_io_mount("aurora:", aurora->SystemPath) >= 0)
			  sprintf_s(extracted_path, dwLaunchDataSize, "aurora:%s%s", aurora->RelativePath, aurora->Exectutable);
	  }
	  else
		  sprintf_s(extracted_path, dwLaunchDataSize, "%s", pLaunchData);
      if (extracted_path && extracted_path[0] != '\0')
      {
         /* Auto-start game */
         strlcpy(path, extracted_path, sizeof(path));
      }

      if (pLaunchData)
         delete []pLaunchData;
   }
#endif
   if (path && path[0] != '\0')
   {
         struct rarch_main_wrap *args = (struct rarch_main_wrap*)params_data;

         if (args)
         {
            /* Auto-start game. */
            args->touched        = true;
            args->no_content     = false;
            args->verbose        = false;
            args->config_path    = NULL;
            args->sram_path      = NULL;
            args->state_path     = NULL;
            args->content_path   = path;
            args->libretro_path  = NULL;
         }
   }
#endif

#ifndef IS_SALAMANDER
exit:
   *verbose = original_verbose;
#endif
}
예제 #4
0
static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
      void *args, void *params_data)
{
   HRESULT ret;
   (void)ret;

#ifndef IS_SALAMANDER
   bool original_verbose = g_extern.verbosity;
   g_extern.verbosity = true;
#endif

#ifndef IS_SALAMANDER
#if defined(HAVE_LOGGER)
   logger_init();
#elif defined(HAVE_FILE_LOGGER)
   g_extern.log_file = fopen("/retroarch-log.txt", "w");
#endif
#endif

#ifdef _XBOX360
   // detect install environment
   unsigned long license_mask;
   DWORD volume_device_type;

   if (XContentGetLicenseMask(&license_mask, NULL) != ERROR_SUCCESS)
      RARCH_LOG("RetroArch was launched as a standalone DVD, or using DVD emulation, or from the development area of the HDD.\n");
   else
   {
      XContentQueryVolumeDeviceType("GAME",&volume_device_type, NULL);

      switch(volume_device_type)
      {
         case XCONTENTDEVICETYPE_HDD:
            RARCH_LOG("RetroArch was launched from a content package on HDD.\n");
            break;
         case XCONTENTDEVICETYPE_MU:
            RARCH_LOG("RetroArch was launched from a content package on USB or Memory Unit.\n");
            break;
         case XCONTENTDEVICETYPE_ODD:
            RARCH_LOG("RetroArch was launched from a content package on Optical Disc Drive.\n");
            break;
         default:
            RARCH_LOG("RetroArch was launched from a content package on an unknown device type.\n");
            break;
      }
   }
#endif

#if defined(_XBOX1)
   strlcpy(g_defaults.core_dir, "D:", sizeof(g_defaults.core_dir));
   strlcpy(g_defaults.core_info_dir, "D:", sizeof(g_defaults.core_info_dir));
   fill_pathname_join(g_defaults.config_path, g_defaults.core_dir,
         "retroarch.cfg", sizeof(g_defaults.config_path));
   fill_pathname_join(g_defaults.savestate_dir, g_defaults.core_dir,
         "savestates", sizeof(g_defaults.savestate_dir));
   fill_pathname_join(g_defaults.sram_dir, g_defaults.core_dir,
         "savefiles", sizeof(g_defaults.sram_dir));
   fill_pathname_join(g_defaults.system_dir, g_defaults.core_dir,
         "system", sizeof(g_defaults.system_dir));
   fill_pathname_join(g_defaults.screenshot_dir, g_defaults.core_dir,
         "screenshots", sizeof(g_defaults.screenshot_dir));
#elif defined(_XBOX360)
   strlcpy(g_defaults.core_dir, "game:", sizeof(g_defaults.core_dir));
   strlcpy(g_defaults.core_info_dir,
         "game:", sizeof(g_defaults.core_info_dir));
   strlcpy(g_defaults.config_path,
         "game:\\retroarch.cfg", sizeof(g_defaults.config_path));
   strlcpy(g_defaults.screenshot_dir,
         "game:", sizeof(g_defaults.screenshot_dir));
   strlcpy(g_defaults.savestate_dir,
         "game:\\savestates", sizeof(g_defaults.savestate_dir));
   strlcpy(g_defaults.playlist_dir,
         "game:\\playlists", sizeof(g_defaults.playlist_dir));
   strlcpy(g_defaults.sram_dir,
         "game:\\savefiles", sizeof(g_defaults.sram_dir));
   strlcpy(g_defaults.system_dir,
         "game:\\system", sizeof(g_defaults.system_dir));
#endif

#ifndef IS_SALAMANDER
   static char path[PATH_MAX_LENGTH];
   *path = '\0';
#if defined(_XBOX1)
   RARCH_LOG("Gets here top.\n");
   LAUNCH_DATA ptr;
   DWORD launch_type;

   if (XGetLaunchInfo(&launch_type, &ptr) == ERROR_SUCCESS)
   {
      if (launch_type == LDT_FROM_DEBUGGER_CMDLINE)
      {
         RARCH_LOG("Launched from commandline debugger.\n");
         goto exit;
      }
      else
      {
         char *extracted_path = (char*)&ptr.Data;

         if (extracted_path && extracted_path[0] != '\0'
            && (strstr(extracted_path, "Pool") == NULL)
            /* Hack. Unknown problem */)
         {
            strlcpy(path, extracted_path, sizeof(path));
            RARCH_LOG("Auto-start game %s.\n", path);
         }
      }
   }
#elif defined(_XBOX360)
   DWORD dwLaunchDataSize;
   if (XGetLaunchDataSize(&dwLaunchDataSize) == ERROR_SUCCESS)
   {
      BYTE* pLaunchData = new BYTE[dwLaunchDataSize];
      XGetLaunchData(pLaunchData, dwLaunchDataSize);
	  AURORA_LAUNCHDATA_EXECUTABLE* aurora = (AURORA_LAUNCHDATA_EXECUTABLE*)pLaunchData;
	  char* extracted_path = new char[dwLaunchDataSize];
	  memset(extracted_path, 0, dwLaunchDataSize);
	  if (aurora->ApplicationId == AURORA_LAUNCHDATA_APPID && aurora->FunctionId == AURORA_LAUNCHDATA_EXECUTABLE_FUNCID)
	  {
		  if (xbox_io_mount("aurora:", aurora->SystemPath) >= 0)
			  sprintf_s(extracted_path, dwLaunchDataSize, "aurora:%s%s", aurora->RelativePath, aurora->Exectutable);
		  else
			  RARCH_LOG("Failed to mount %s as aurora:.\n", aurora->SystemPath);
	  }
	  else
		  sprintf_s(extracted_path, dwLaunchDataSize, "%s", pLaunchData);
      if (extracted_path && extracted_path[0] != '\0')
      {
         strlcpy(path, extracted_path, sizeof(path));
         RARCH_LOG("Auto-start game %s.\n", path);
      }

      if (pLaunchData)
         delete []pLaunchData;
   }
#endif
   if (path && path[0] != '\0')
   {
         struct rarch_main_wrap *args = (struct rarch_main_wrap*)params_data;

         if (args)
         {
            args->touched        = true;
            args->no_content     = false;
            args->verbose        = false;
            args->config_path    = NULL;
            args->sram_path      = NULL;
            args->state_path     = NULL;
            args->content_path   = path;
            args->libretro_path  = NULL;

            RARCH_LOG("Auto-start game %s.\n", path);
         }
   }
#endif

#ifndef IS_SALAMANDER
exit:
   g_extern.verbosity = original_verbose;
#endif
}