mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +00:00
Support for dos salamander
This commit is contained in:
parent
86b78e2fea
commit
70c57beea9
@ -129,6 +129,7 @@ elif [ $PLATFORM = "dos" ]; then
|
|||||||
platform=dos
|
platform=dos
|
||||||
MAKEFILE_GRIFFIN=yes
|
MAKEFILE_GRIFFIN=yes
|
||||||
EXT=a
|
EXT=a
|
||||||
|
SALAMANDER=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup Salamander core if it exists
|
# Cleanup Salamander core if it exists
|
||||||
@ -153,6 +154,10 @@ if [ $SALAMANDER = "yes" ]; then
|
|||||||
if [ $PLATFORM = "psp1" ] ; then
|
if [ $PLATFORM = "psp1" ] ; then
|
||||||
mv -f ../EBOOT.PBP ../pkg/${platform}/EBOOT.PBP
|
mv -f ../EBOOT.PBP ../pkg/${platform}/EBOOT.PBP
|
||||||
fi
|
fi
|
||||||
|
if [ $platform = "dos" ] ; then
|
||||||
|
mkdir -p ../pkg/${platform}
|
||||||
|
mv -f ../retrodos_salamander.exe ../pkg/${platform}/RETRODOS.EXE
|
||||||
|
fi
|
||||||
if [ $PLATFORM = "vita" ] ; then
|
if [ $PLATFORM = "vita" ] ; then
|
||||||
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/livearea/contents
|
mkdir -p ../pkg/${platform}/retroarch.vpk/vpk/sce_sys/livearea/contents
|
||||||
vita-make-fself -c -s ../retroarchvita_salamander.velf ../pkg/${platform}/retroarch.vpk/vpk/eboot.bin
|
vita-make-fself -c -s ../retroarchvita_salamander.velf ../pkg/${platform}/retroarch.vpk/vpk/eboot.bin
|
||||||
@ -307,8 +312,8 @@ for f in `ls -v *_${platform}.${EXT}`; do
|
|||||||
elif [ $PLATFORM = "wii" ] ; then
|
elif [ $PLATFORM = "wii" ] ; then
|
||||||
mv -f ../retroarch_${platform}.dol ../pkg/${platform}/${name}_libretro_${platform}.dol
|
mv -f ../retroarch_${platform}.dol ../pkg/${platform}/${name}_libretro_${platform}.dol
|
||||||
elif [ $PLATFORM = "dos" ] ; then
|
elif [ $PLATFORM = "dos" ] ; then
|
||||||
mkdir -p ../pkg/${platform}
|
mkdir -p ../pkg/${platform}/cores
|
||||||
mv -f ../retrodos.exe ../pkg/${platform}/${name}_libretro_${platform}.exe
|
mv -f ../retrodos.exe ../pkg/${platform}/cores/${name}.exe
|
||||||
elif [ $PLATFORM = "emscripten" ] ; then
|
elif [ $PLATFORM = "emscripten" ] ; then
|
||||||
mkdir -p ../pkg/emscripten/
|
mkdir -p ../pkg/emscripten/
|
||||||
mv -f ../${name}_libretro.js ../pkg/emscripten/${name}_libretro.js
|
mv -f ../${name}_libretro.js ../pkg/emscripten/${name}_libretro.js
|
||||||
|
@ -16,8 +16,14 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <process.h>
|
||||||
|
#include <string/stdstring.h>
|
||||||
|
#include <file/file_path.h>
|
||||||
|
|
||||||
#include "../frontend_driver.h"
|
#include "../frontend_driver.h"
|
||||||
|
#include "../../defaults.h"
|
||||||
|
|
||||||
|
static enum frontend_fork dos_fork_mode = FRONTEND_FORK_NONE;
|
||||||
|
|
||||||
static void frontend_dos_init(void *data)
|
static void frontend_dos_init(void *data)
|
||||||
{
|
{
|
||||||
@ -47,12 +53,18 @@ static void frontend_dos_get_env_settings(int *argc, char *argv[],
|
|||||||
|
|
||||||
retro_main_log_file_init("retrodos.txt", false);
|
retro_main_log_file_init("retrodos.txt", false);
|
||||||
|
|
||||||
strlcpy(base_path, "retrodos", sizeof(base_path));
|
strlcpy(base_path, argv[0], sizeof(base_path));
|
||||||
|
char *slash = strrchr(base_path, '/');
|
||||||
|
if (slash)
|
||||||
|
*slash = '\0';
|
||||||
|
slash = strrchr(base_path, '/');
|
||||||
|
if (slash && strcasecmp(slash, "/cores"))
|
||||||
|
*slash = '\0';
|
||||||
|
|
||||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], base_path,
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], base_path,
|
||||||
"cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
|
"cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
|
||||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], base_path,
|
||||||
"cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
|
"coreinfo", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO]));
|
||||||
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], base_path,
|
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG], base_path,
|
||||||
"autoconf", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
|
"autoconf", sizeof(g_defaults.dirs[DEFAULT_DIR_AUTOCONFIG]));
|
||||||
|
|
||||||
@ -101,14 +113,80 @@ static void frontend_dos_get_env_settings(int *argc, char *argv[],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void frontend_dos_exec(const char *path, bool should_load_game)
|
||||||
|
{
|
||||||
|
printf("Loading %s, %d\n", path, should_load_game);
|
||||||
|
|
||||||
|
char *newargv[] = { NULL, NULL };
|
||||||
|
size_t len = strlen(path);
|
||||||
|
|
||||||
|
newargv[0] = (char*)malloc(len);
|
||||||
|
|
||||||
|
strlcpy(newargv[0], path, len);
|
||||||
|
|
||||||
|
execv(path, newargv);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void frontend_dos_exitspawn(char *s, size_t len, char *args)
|
||||||
|
{
|
||||||
|
bool should_load_content = false;
|
||||||
|
|
||||||
|
if (dos_fork_mode == FRONTEND_FORK_NONE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (dos_fork_mode)
|
||||||
|
{
|
||||||
|
case FRONTEND_FORK_CORE_WITH_ARGS:
|
||||||
|
should_load_content = true;
|
||||||
|
break;
|
||||||
|
case FRONTEND_FORK_NONE:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
frontend_dos_exec(s, should_load_content);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool frontend_unix_set_fork(enum frontend_fork fork_mode)
|
||||||
|
{
|
||||||
|
switch (fork_mode)
|
||||||
|
{
|
||||||
|
case FRONTEND_FORK_CORE:
|
||||||
|
RARCH_LOG("FRONTEND_FORK_CORE\n");
|
||||||
|
unix_fork_mode = fork_mode;
|
||||||
|
break;
|
||||||
|
case FRONTEND_FORK_CORE_WITH_ARGS:
|
||||||
|
RARCH_LOG("FRONTEND_FORK_CORE_WITH_ARGS\n");
|
||||||
|
unix_fork_mode = fork_mode;
|
||||||
|
break;
|
||||||
|
case FRONTEND_FORK_RESTART:
|
||||||
|
RARCH_LOG("FRONTEND_FORK_RESTART\n");
|
||||||
|
unix_fork_mode = FRONTEND_FORK_CORE;
|
||||||
|
|
||||||
|
{
|
||||||
|
char executable_path[PATH_MAX_LENGTH] = {0};
|
||||||
|
fill_pathname_application_path(executable_path,
|
||||||
|
sizeof(executable_path));
|
||||||
|
path_set(RARCH_PATH_CORE, executable_path);
|
||||||
|
}
|
||||||
|
command_event(CMD_EVENT_QUIT, NULL);
|
||||||
|
break;
|
||||||
|
case FRONTEND_FORK_NONE:
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
frontend_ctx_driver_t frontend_ctx_dos = {
|
frontend_ctx_driver_t frontend_ctx_dos = {
|
||||||
frontend_dos_get_env_settings,/* environment_get */
|
frontend_dos_get_env_settings,/* environment_get */
|
||||||
frontend_dos_init, /* init */
|
frontend_dos_init, /* init */
|
||||||
NULL, /* deinit */
|
NULL, /* deinit */
|
||||||
NULL, /* exitspawn */
|
frontend_dos_exitspawn, /* exitspawn */
|
||||||
NULL, /* process_args */
|
NULL, /* process_args */
|
||||||
NULL, /* exec */
|
frontend_dos_exec, /* exec */
|
||||||
NULL, /* set_fork */
|
frontend_dos_set_fork, /* set_fork */
|
||||||
frontend_dos_shutdown, /* shutdown */
|
frontend_dos_shutdown, /* shutdown */
|
||||||
NULL, /* get_name */
|
NULL, /* get_name */
|
||||||
NULL, /* get_os */
|
NULL, /* get_os */
|
||||||
|
@ -218,6 +218,9 @@ bool frontend_driver_get_core_extension(char *s, size_t len)
|
|||||||
#elif defined(HAVE_LIBNX)
|
#elif defined(HAVE_LIBNX)
|
||||||
strlcpy(s, "nro", len);
|
strlcpy(s, "nro", len);
|
||||||
return true;
|
return true;
|
||||||
|
#elif defined(DJGPP)
|
||||||
|
strlcpy(s, "exe", len);
|
||||||
|
return true;
|
||||||
#elif defined(_3DS)
|
#elif defined(_3DS)
|
||||||
if (envIsHomebrew())
|
if (envIsHomebrew())
|
||||||
strlcpy(s, "3dsx", len);
|
strlcpy(s, "3dsx", len);
|
||||||
@ -264,6 +267,9 @@ bool frontend_driver_get_salamander_basename(char *s, size_t len)
|
|||||||
#elif defined(_3DS)
|
#elif defined(_3DS)
|
||||||
strlcpy(s, "retroarch.core", len);
|
strlcpy(s, "retroarch.core", len);
|
||||||
return true;
|
return true;
|
||||||
|
#elif defined(DJGPP)
|
||||||
|
strlcpy(s, "retrodos.exe", len);
|
||||||
|
return true;
|
||||||
#elif defined(SWITCH)
|
#elif defined(SWITCH)
|
||||||
strlcpy(s, "retroarch_switch.nro", len);
|
strlcpy(s, "retroarch_switch.nro", len);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user