2012-04-21 23:13:50 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-01-22 13:40:32 +01:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2017-12-11 23:55:31 -08:00
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2012-01-05 22:47:34 +01:00
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2012-01-05 22:47:34 +01:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 23:31:57 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2012-01-05 22:47:34 +01:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-01-24 00:29:03 +01:00
|
|
|
#include <stdint.h>
|
2015-06-15 22:45:02 +02:00
|
|
|
#include <stddef.h>
|
2012-07-08 00:27:48 +03:00
|
|
|
|
2015-06-15 22:45:02 +02:00
|
|
|
#include <xtl.h>
|
2012-01-06 14:12:12 +01:00
|
|
|
#include <xbdm.h>
|
2015-09-20 15:39:59 +02:00
|
|
|
#include <xgraphics.h>
|
2012-07-08 21:42:26 +02:00
|
|
|
|
2014-10-22 01:59:46 +02:00
|
|
|
#include <file/file_path.h>
|
2016-12-07 06:19:05 +01:00
|
|
|
#include <compat/strl.h>
|
2016-09-12 16:39:50 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2015-06-15 22:45:02 +02:00
|
|
|
#ifndef IS_SALAMANDER
|
2016-03-20 14:53:54 +01:00
|
|
|
#include <lists/file_list.h>
|
2015-06-15 22:45:02 +02:00
|
|
|
#endif
|
2015-01-17 05:47:33 +01:00
|
|
|
#include <retro_miscellaneous.h>
|
2015-12-26 07:45:19 +01:00
|
|
|
#include <string/stdstring.h>
|
2013-01-09 01:35:46 +01:00
|
|
|
|
2015-11-29 01:59:41 +01:00
|
|
|
#include "../frontend_driver.h"
|
|
|
|
#include "../../defaults.h"
|
2016-12-07 06:21:21 +01:00
|
|
|
#include "../../file_path_special.h"
|
2016-12-02 01:54:28 +01:00
|
|
|
#include "../../paths.h"
|
2015-11-17 11:35:46 +01:00
|
|
|
#ifndef IS_SALAMANDER
|
|
|
|
#include "../../retroarch.h"
|
2005-04-23 20:22:55 +02:00
|
|
|
#ifdef HAVE_MENU
|
2015-12-06 18:12:40 +01:00
|
|
|
#include "../../menu/menu_driver.h"
|
2005-04-23 20:22:55 +02:00
|
|
|
#endif
|
2015-11-17 11:35:46 +01:00
|
|
|
#endif
|
2016-12-07 06:18:06 +01:00
|
|
|
#include "../../verbosity.h"
|
2015-06-15 22:45:02 +02:00
|
|
|
|
2018-02-05 01:33:54 +01:00
|
|
|
#include "platform_xdk.h"
|
2016-01-13 06:32:57 +01:00
|
|
|
|
2016-02-05 18:47:27 +01:00
|
|
|
static enum frontend_fork xdk_fork_mode = FRONTEND_FORK_NONE;
|
2014-10-02 21:39:29 +02:00
|
|
|
|
2014-06-03 03:35:12 +02:00
|
|
|
static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
|
|
|
|
void *args, void *params_data)
|
2012-01-05 22:47:34 +01:00
|
|
|
{
|
2012-07-23 10:23:27 +02:00
|
|
|
HRESULT ret;
|
2017-10-03 04:36:43 +02:00
|
|
|
#ifdef _XBOX360
|
|
|
|
unsigned long license_mask;
|
|
|
|
DWORD volume_device_type;
|
|
|
|
#endif
|
|
|
|
#ifndef IS_SALAMANDER
|
|
|
|
static char path[PATH_MAX_LENGTH] = {0};
|
|
|
|
#if defined(_XBOX1)
|
|
|
|
LAUNCH_DATA ptr;
|
|
|
|
DWORD launch_type;
|
|
|
|
#elif defined(_XBOX360)
|
|
|
|
DWORD dwLaunchDataSize;
|
|
|
|
#endif
|
|
|
|
#endif
|
2013-08-10 20:59:10 +02:00
|
|
|
#ifndef IS_SALAMANDER
|
2016-05-31 04:42:04 +02:00
|
|
|
bool original_verbose = verbosity_is_enabled();
|
2014-05-31 18:34:06 +02:00
|
|
|
#endif
|
2013-08-10 20:59:10 +02:00
|
|
|
|
2017-10-03 04:36:43 +02:00
|
|
|
(void)ret;
|
|
|
|
|
2014-05-31 18:34:06 +02:00
|
|
|
#ifndef IS_SALAMANDER
|
2013-08-10 20:59:10 +02:00
|
|
|
#if defined(HAVE_LOGGER)
|
|
|
|
logger_init();
|
|
|
|
#elif defined(HAVE_FILE_LOGGER)
|
2015-11-23 15:45:02 +01:00
|
|
|
retro_main_log_file_init("/retroarch-log.txt");
|
2013-08-10 20:59:10 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2012-07-08 00:27:48 +03:00
|
|
|
#ifdef _XBOX360
|
2016-01-13 06:38:20 +01:00
|
|
|
/* Detect install environment. */
|
2015-11-17 22:51:50 +01:00
|
|
|
if (XContentGetLicenseMask(&license_mask, NULL) == ERROR_SUCCESS)
|
2012-04-10 21:23:42 +02:00
|
|
|
{
|
2013-01-09 01:35:46 +01:00
|
|
|
XContentQueryVolumeDeviceType("GAME",&volume_device_type, NULL);
|
2012-04-10 21:23:42 +02:00
|
|
|
|
2013-01-09 01:35:46 +01:00
|
|
|
switch(volume_device_type)
|
2012-04-10 21:23:42 +02:00
|
|
|
{
|
2015-11-17 22:51:50 +01:00
|
|
|
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. */
|
2013-03-11 07:13:11 +01:00
|
|
|
break;
|
2012-04-10 21:23:42 +02:00
|
|
|
}
|
|
|
|
}
|
2012-07-08 00:27:48 +03:00
|
|
|
#endif
|
2012-04-10 21:23:42 +02:00
|
|
|
|
2012-07-25 21:46:22 +02:00
|
|
|
#if defined(_XBOX1)
|
2017-05-23 19:43:58 +02:00
|
|
|
strlcpy(g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"D:", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
|
|
|
|
fill_pathname_join(g_defaults.path.config, g_defaults.dirs[DEFAULT_DIR_CORE],
|
2016-06-20 05:20:14 +02:00
|
|
|
file_path_str(FILE_PATH_MAIN_CONFIG), sizeof(g_defaults.path.config));
|
2017-05-23 19:43:58 +02:00
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"savestates",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SRAM],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"savefiles",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
|
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"system",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"screenshots",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
|
2018-02-19 13:29:16 +01:00
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"overlays",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY]));
|
2018-02-19 13:43:32 +01:00
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"media", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS]));
|
2018-02-19 13:29:16 +01:00
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS]));
|
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
2012-07-25 21:46:22 +02:00
|
|
|
#elif defined(_XBOX360)
|
2017-05-23 19:43:58 +02:00
|
|
|
strlcpy(g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"game:",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
|
2015-07-27 17:18:10 +02:00
|
|
|
strlcpy(g_defaults.path.config,
|
|
|
|
"game:\\retroarch.cfg", sizeof(g_defaults.path.config));
|
2017-05-23 19:43:58 +02:00
|
|
|
strlcpy(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT],
|
|
|
|
"game:",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT]));
|
|
|
|
strlcpy(g_defaults.dirs[DEFAULT_DIR_SAVESTATE],
|
|
|
|
"game:\\savestates",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE]));
|
|
|
|
strlcpy(g_defaults.dirs[DEFAULT_DIR_PLAYLIST],
|
|
|
|
"game:\\playlists",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST]));
|
|
|
|
strlcpy(g_defaults.dirs[DEFAULT_DIR_SRAM],
|
|
|
|
"game:\\savefiles",
|
|
|
|
sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM]));
|
|
|
|
strlcpy(g_defaults.dirs[DEFAULT_DIR_SYSTEM],
|
|
|
|
"game:\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM]));
|
2012-07-08 16:43:50 +03:00
|
|
|
#endif
|
2017-05-23 19:43:58 +02:00
|
|
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO],
|
|
|
|
g_defaults.dirs[DEFAULT_DIR_CORE],
|
|
|
|
"info", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
|
2014-05-31 18:34:06 +02:00
|
|
|
|
|
|
|
#ifndef IS_SALAMANDER
|
2014-06-03 19:14:07 +02:00
|
|
|
#if defined(_XBOX1)
|
|
|
|
if (XGetLaunchInfo(&launch_type, &ptr) == ERROR_SUCCESS)
|
|
|
|
{
|
2015-11-17 22:51:50 +01:00
|
|
|
char *extracted_path = NULL;
|
2014-06-03 19:14:07 +02:00
|
|
|
if (launch_type == LDT_FROM_DEBUGGER_CMDLINE)
|
|
|
|
goto exit;
|
|
|
|
|
2015-11-17 22:51:50 +01:00
|
|
|
extracted_path = (char*)&ptr.Data;
|
|
|
|
|
2015-12-26 07:45:19 +01:00
|
|
|
if (
|
|
|
|
!string_is_empty(extracted_path)
|
2014-09-02 17:42:44 +02:00
|
|
|
&& (strstr(extracted_path, "Pool") == NULL)
|
|
|
|
/* Hack. Unknown problem */)
|
2015-11-17 22:51:50 +01:00
|
|
|
{
|
|
|
|
/* Auto-start game */
|
|
|
|
strlcpy(path, extracted_path, sizeof(path));
|
2014-06-03 19:14:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#elif defined(_XBOX360)
|
|
|
|
if (XGetLaunchDataSize(&dwLaunchDataSize) == ERROR_SUCCESS)
|
|
|
|
{
|
2017-10-03 04:36:43 +02:00
|
|
|
char *extracted_path = (char*)calloc(dwLaunchDataSize, sizeof(char));
|
|
|
|
BYTE* pLaunchData = (BYTE*)calloc(dwLaunchDataSize, sizeof(BYTE));
|
|
|
|
|
|
|
|
XGetLaunchData(pLaunchData, dwLaunchDataSize);
|
2016-08-29 21:23:33 +02:00
|
|
|
memset(extracted_path, 0, dwLaunchDataSize);
|
2017-10-03 04:36:43 +02:00
|
|
|
|
2018-02-05 01:33:54 +01:00
|
|
|
strlcpy(extracted_path, pLaunchData, dwLaunchDataSize);
|
2016-08-29 21:23:33 +02:00
|
|
|
|
|
|
|
/* Auto-start game */
|
2015-12-26 07:45:19 +01:00
|
|
|
if (!string_is_empty(extracted_path))
|
2014-06-03 19:14:07 +02:00
|
|
|
strlcpy(path, extracted_path, sizeof(path));
|
|
|
|
|
|
|
|
if (pLaunchData)
|
2017-10-03 04:36:43 +02:00
|
|
|
free(pLaunchData);
|
2014-06-03 19:14:07 +02:00
|
|
|
}
|
|
|
|
#endif
|
2015-12-26 07:45:19 +01:00
|
|
|
if (!string_is_empty(path))
|
2014-06-03 19:14:07 +02:00
|
|
|
{
|
2015-12-26 07:45:19 +01:00
|
|
|
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;
|
|
|
|
}
|
2014-06-03 19:14:07 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef IS_SALAMANDER
|
2017-09-13 04:35:57 +02:00
|
|
|
#ifdef _XBOX1
|
2014-10-21 08:13:50 +02:00
|
|
|
exit:
|
2016-05-31 04:42:04 +02:00
|
|
|
if (original_verbose)
|
|
|
|
verbosity_enable();
|
|
|
|
else
|
|
|
|
verbosity_disable();
|
2014-05-31 18:34:06 +02:00
|
|
|
#endif
|
2017-09-13 04:35:57 +02:00
|
|
|
#endif
|
2012-02-04 13:33:19 +01:00
|
|
|
}
|
|
|
|
|
2014-05-17 14:56:12 +02:00
|
|
|
static void frontend_xdk_init(void *data)
|
2012-08-06 22:53:57 +02:00
|
|
|
{
|
2013-11-03 16:38:56 +01:00
|
|
|
(void)data;
|
2013-01-09 01:35:46 +01:00
|
|
|
#if defined(_XBOX1) && !defined(IS_SALAMANDER)
|
2016-01-13 06:38:20 +01:00
|
|
|
/* Mount drives */
|
2012-08-06 22:53:57 +02:00
|
|
|
xbox_io_mount("A:", "cdrom0");
|
2012-08-22 16:22:42 +02:00
|
|
|
xbox_io_mount("C:", "Harddisk0\\Partition0");
|
2012-08-06 22:53:57 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2014-05-17 14:56:12 +02:00
|
|
|
static void frontend_xdk_exec(const char *path, bool should_load_game)
|
2013-07-27 03:59:01 +02:00
|
|
|
{
|
2014-05-31 18:34:06 +02:00
|
|
|
#ifndef IS_SALAMANDER
|
2016-05-31 04:42:04 +02:00
|
|
|
bool original_verbose = verbosity_is_enabled();
|
2017-10-03 04:36:43 +02:00
|
|
|
#endif
|
|
|
|
#if defined(_XBOX1)
|
2018-02-18 02:12:15 +01:00
|
|
|
LAUNCH_DATA ptr;
|
2017-10-03 04:36:43 +02:00
|
|
|
#elif defined(_XBOX360)
|
2018-02-18 02:11:41 +01:00
|
|
|
char game_path[1024] = {0};
|
2014-05-31 18:34:06 +02:00
|
|
|
#endif
|
2013-07-27 03:59:01 +02:00
|
|
|
(void)should_load_game;
|
|
|
|
|
|
|
|
#ifdef IS_SALAMANDER
|
2015-12-26 07:45:19 +01:00
|
|
|
if (!string_is_empty(path))
|
2014-06-03 19:14:07 +02:00
|
|
|
XLaunchNewImage(path, NULL);
|
2013-07-27 03:59:01 +02:00
|
|
|
#else
|
|
|
|
#if defined(_XBOX1)
|
|
|
|
memset(&ptr, 0, sizeof(ptr));
|
2015-06-12 23:38:46 +02:00
|
|
|
|
2016-10-03 15:43:03 +02:00
|
|
|
if (should_load_game && !path_is_empty(RARCH_PATH_CONTENT))
|
|
|
|
snprintf((char*)ptr.Data, sizeof(ptr.Data), "%s", path_get(RARCH_PATH_CONTENT));
|
2014-06-03 19:14:07 +02:00
|
|
|
|
2015-12-26 07:45:19 +01:00
|
|
|
if (!string_is_empty(path))
|
2016-12-02 01:54:28 +01:00
|
|
|
XLaunchNewImage(path, !string_is_empty((const char*)ptr.Data) ? &ptr : NULL);
|
2013-07-27 03:59:01 +02:00
|
|
|
#elif defined(_XBOX360)
|
2016-10-03 15:43:03 +02:00
|
|
|
if (should_load_game && !path_is_empty(RARCH_PATH_CONTENT))
|
2013-07-27 03:59:01 +02:00
|
|
|
{
|
2016-10-03 15:43:03 +02:00
|
|
|
strlcpy(game_path, path_get(RARCH_PATH_CONTENT), sizeof(game_path));
|
2013-07-27 03:59:01 +02:00
|
|
|
XSetLaunchData(game_path, MAX_LAUNCH_DATA_SIZE);
|
|
|
|
}
|
2014-06-03 19:14:07 +02:00
|
|
|
|
2015-12-26 07:45:19 +01:00
|
|
|
if (!string_is_empty(path))
|
2017-10-03 04:36:43 +02:00
|
|
|
XLaunchNewImage(path, 0);
|
2013-07-27 03:59:01 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
2014-05-31 18:34:06 +02:00
|
|
|
#ifndef IS_SALAMANDER
|
2016-05-31 04:42:04 +02:00
|
|
|
if (original_verbose)
|
|
|
|
verbosity_enable();
|
|
|
|
else
|
|
|
|
verbosity_disable();
|
2014-05-31 18:34:06 +02:00
|
|
|
#endif
|
2013-07-27 03:59:01 +02:00
|
|
|
}
|
|
|
|
|
2016-02-05 18:47:27 +01:00
|
|
|
#ifndef IS_SALAMANDER
|
2016-02-04 17:46:50 +01:00
|
|
|
static bool frontend_xdk_set_fork(enum frontend_fork fork_mode)
|
2016-01-13 06:38:20 +01:00
|
|
|
{
|
2016-02-04 17:46:50 +01:00
|
|
|
switch (fork_mode)
|
|
|
|
{
|
|
|
|
case FRONTEND_FORK_CORE:
|
2016-02-05 18:47:27 +01:00
|
|
|
RARCH_LOG("FRONTEND_FORK_CORE\n");
|
|
|
|
xdk_fork_mode = fork_mode;
|
2016-02-04 17:46:50 +01:00
|
|
|
break;
|
|
|
|
case FRONTEND_FORK_CORE_WITH_ARGS:
|
2016-02-05 18:47:27 +01:00
|
|
|
RARCH_LOG("FRONTEND_FORK_CORE_WITH_ARGS\n");
|
|
|
|
xdk_fork_mode = fork_mode;
|
2016-02-04 17:46:50 +01:00
|
|
|
break;
|
2016-02-05 18:57:44 +01:00
|
|
|
case FRONTEND_FORK_RESTART:
|
2016-02-05 18:47:27 +01:00
|
|
|
RARCH_LOG("FRONTEND_FORK_SALAMANDER_RESTART\n");
|
|
|
|
/* NOTE: We don't implement Salamander, so just turn
|
|
|
|
* this into FRONTEND_FORK_CORE. */
|
|
|
|
xdk_fork_mode = FRONTEND_FORK_CORE;
|
|
|
|
break;
|
|
|
|
case FRONTEND_FORK_NONE:
|
2016-02-04 17:46:50 +01:00
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
2016-02-04 17:08:09 +01:00
|
|
|
|
|
|
|
return true;
|
2016-01-13 06:38:20 +01:00
|
|
|
}
|
2016-02-05 18:47:27 +01:00
|
|
|
#endif
|
2016-01-13 06:38:20 +01:00
|
|
|
|
|
|
|
static void frontend_xdk_exitspawn(char *s, size_t len)
|
|
|
|
{
|
|
|
|
bool should_load_game = false;
|
|
|
|
#ifndef IS_SALAMANDER
|
2016-02-05 18:47:27 +01:00
|
|
|
if (xdk_fork_mode == FRONTEND_FORK_NONE)
|
2016-01-13 06:38:20 +01:00
|
|
|
return;
|
2016-02-05 18:47:27 +01:00
|
|
|
|
|
|
|
switch (xdk_fork_mode)
|
|
|
|
{
|
|
|
|
case FRONTEND_FORK_CORE_WITH_ARGS:
|
|
|
|
should_load_game = true;
|
|
|
|
break;
|
|
|
|
case FRONTEND_FORK_NONE:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2016-01-13 06:38:20 +01:00
|
|
|
#endif
|
|
|
|
frontend_xdk_exec(s, should_load_game);
|
|
|
|
}
|
|
|
|
|
2014-05-16 22:20:33 +02:00
|
|
|
static int frontend_xdk_get_rating(void)
|
|
|
|
{
|
|
|
|
#if defined(_XBOX360)
|
|
|
|
return 11;
|
|
|
|
#elif defined(_XBOX1)
|
|
|
|
return 7;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-04-18 20:03:59 +02:00
|
|
|
enum frontend_architecture frontend_xdk_get_architecture(void)
|
|
|
|
{
|
|
|
|
#if defined(_XBOX360)
|
|
|
|
return FRONTEND_ARCH_PPC;
|
|
|
|
#elif defined(_XBOX1)
|
|
|
|
return FRONTEND_ARCH_X86;
|
|
|
|
#else
|
|
|
|
return FRONTEND_ARCH_NONE;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2017-05-26 15:52:38 +02:00
|
|
|
static int frontend_xdk_parse_drive_list(void *data, bool load_content)
|
2015-06-15 22:45:02 +02:00
|
|
|
{
|
|
|
|
#ifndef IS_SALAMANDER
|
|
|
|
file_list_t *list = (file_list_t*)data;
|
2017-05-26 15:52:38 +02:00
|
|
|
enum msg_hash_enums enum_idx = load_content ?
|
|
|
|
MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR :
|
|
|
|
MSG_UNKNOWN;
|
2015-06-15 22:45:02 +02:00
|
|
|
|
|
|
|
#if defined(_XBOX1)
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(list,
|
2016-12-13 01:43:18 +01:00
|
|
|
"C:",
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
2017-05-26 15:52:38 +02:00
|
|
|
enum_idx,
|
2017-05-26 16:45:28 +02:00
|
|
|
FILE_TYPE_DIRECTORY, 0, 0);
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(list,
|
2016-12-13 01:43:18 +01:00
|
|
|
"D:",
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
2017-05-26 15:52:38 +02:00
|
|
|
enum_idx,
|
2017-05-26 16:45:28 +02:00
|
|
|
FILE_TYPE_DIRECTORY, 0, 0);
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(list,
|
2016-12-13 01:43:18 +01:00
|
|
|
"E:",
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
2017-05-26 15:52:38 +02:00
|
|
|
enum_idx,
|
2017-05-26 16:45:28 +02:00
|
|
|
FILE_TYPE_DIRECTORY, 0, 0);
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(list,
|
2016-12-13 01:43:18 +01:00
|
|
|
"F:",
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
2017-05-26 15:52:38 +02:00
|
|
|
enum_idx,
|
2017-05-26 16:45:28 +02:00
|
|
|
FILE_TYPE_DIRECTORY, 0, 0);
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(list,
|
2016-12-13 01:43:18 +01:00
|
|
|
"G:",
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
2017-05-26 15:52:38 +02:00
|
|
|
enum_idx,
|
2017-05-26 16:45:28 +02:00
|
|
|
FILE_TYPE_DIRECTORY, 0, 0);
|
2015-06-15 22:45:02 +02:00
|
|
|
#elif defined(_XBOX360)
|
2016-07-13 01:17:09 +02:00
|
|
|
menu_entries_append_enum(list,
|
2016-12-13 01:43:18 +01:00
|
|
|
"game:",
|
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
|
2017-05-26 15:52:38 +02:00
|
|
|
enum_idx,
|
2017-05-26 16:45:28 +02:00
|
|
|
FILE_TYPE_DIRECTORY, 0, 0);
|
2015-06-15 22:45:02 +02:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-07-27 03:44:28 +02:00
|
|
|
frontend_ctx_driver_t frontend_ctx_xdk = {
|
2015-04-18 20:03:59 +02:00
|
|
|
frontend_xdk_get_environment_settings,
|
|
|
|
frontend_xdk_init,
|
2013-07-27 16:36:55 +02:00
|
|
|
NULL, /* deinit */
|
2015-04-18 20:03:59 +02:00
|
|
|
frontend_xdk_exitspawn,
|
2014-06-03 19:21:49 +02:00
|
|
|
NULL, /* process_args */
|
2015-04-18 20:03:59 +02:00
|
|
|
frontend_xdk_exec,
|
2016-02-05 18:47:27 +01:00
|
|
|
#ifdef IS_SALAMANDER
|
|
|
|
NULL,
|
|
|
|
#else
|
2015-04-18 20:03:59 +02:00
|
|
|
frontend_xdk_set_fork,
|
2016-02-05 18:47:27 +01:00
|
|
|
#endif
|
2013-07-27 16:36:55 +02:00
|
|
|
NULL, /* shutdown */
|
2014-06-12 16:26:33 +02:00
|
|
|
NULL, /* get_name */
|
2015-04-07 22:48:46 +02:00
|
|
|
NULL, /* get_os */
|
2015-04-18 20:03:59 +02:00
|
|
|
frontend_xdk_get_rating,
|
2014-10-17 03:55:16 +02:00
|
|
|
NULL, /* load_content */
|
2015-04-18 20:03:59 +02:00
|
|
|
frontend_xdk_get_architecture,
|
2015-04-18 13:56:26 +02:00
|
|
|
NULL, /* get_powerstate */
|
2015-06-15 22:45:02 +02:00
|
|
|
frontend_xdk_parse_drive_list,
|
2016-06-12 02:33:07 +02:00
|
|
|
NULL, /* get_mem_total */
|
2016-06-12 12:44:28 +02:00
|
|
|
NULL, /* get_mem_free */
|
2016-07-08 02:10:40 +02:00
|
|
|
NULL, /* install_signal_handler */
|
2016-07-08 02:20:42 +02:00
|
|
|
NULL, /* get_sighandler_state */
|
2016-07-08 12:48:01 +02:00
|
|
|
NULL, /* set_sighandler_state */
|
2016-07-08 02:24:56 +02:00
|
|
|
NULL, /* destroy_sighandler_state */
|
2016-10-09 17:15:50 +02:00
|
|
|
NULL, /* attach_console */
|
|
|
|
NULL, /* detach_console */
|
2018-01-25 15:50:57 -05:00
|
|
|
NULL, /* watch_path_for_changes */
|
|
|
|
NULL, /* check_for_path_changes */
|
2018-06-19 02:50:33 -04:00
|
|
|
NULL, /* set_sustained_performance_mode */
|
2013-07-27 00:32:56 +02:00
|
|
|
"xdk",
|
|
|
|
};
|