Start getting rid of RETRO_ENVIRONMENT_SET_LIBRETRO_PATH

This commit is contained in:
twinaphex 2016-01-25 03:04:42 +01:00
parent b7434c6564
commit d71c782459
4 changed files with 5 additions and 22 deletions

View File

@ -953,8 +953,7 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
#else
char *fullpath = NULL;
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH,
(void*)settings->libretro);
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, settings->libretro);
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)fullpath);
event_cmd_ctl(EVENT_CMD_QUIT, NULL);
#endif

View File

@ -1215,14 +1215,6 @@ bool rarch_environment_cb(unsigned cmd, void *data)
return video_driver_get_current_software_framebuffer((struct retro_framebuffer*)data);
/* Private extensions for internal use, not part of libretro API. */
case RETRO_ENVIRONMENT_SET_LIBRETRO_PATH:
RARCH_LOG("Environ (Private) SET_LIBRETRO_PATH.\n");
if (!path_file_exists((const char*)data))
return false;
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, data);
break;
case RETRO_ENVIRONMENT_EXEC:
case RETRO_ENVIRONMENT_EXEC_ESCAPE:
{

View File

@ -359,7 +359,8 @@ static void frontend_gx_process_args(int *argc, char *argv[])
if (!settings->libretro[0] && *argc >= 1 && strrchr(argv[0], '/'))
{
strlcpy(path, strrchr(argv[0], '/') + 1, sizeof(path));
rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, path);
if (path_file_exists(path))
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, path);
}
#endif
}

View File

@ -27,16 +27,7 @@
#include "libretro.h"
#define RETRO_ENVIRONMENT_SET_LIBRETRO_PATH (RETRO_ENVIRONMENT_PRIVATE | 0)
/* const char * --
* Sets the absolute path for the
* libretro core pointed to.
* RETRO_ENVIRONMENT_EXEC will use
* the last libretro core set with this call.
* Returns false if file for absolute path
* could not be found.
*/
#define RETRO_ENVIRONMENT_EXEC (RETRO_ENVIRONMENT_PRIVATE | 1)
#define RETRO_ENVIRONMENT_EXEC (RETRO_ENVIRONMENT_PRIVATE | 0)
/* const char * --
* Requests that this core is
* deinitialized, and a new core is loaded.
@ -44,7 +35,7 @@
* SET_LIBRETRO_PATH, and path to
* game is passed in _EXEC. NULL
* means no game. */
#define RETRO_ENVIRONMENT_EXEC_ESCAPE (RETRO_ENVIRONMENT_PRIVATE | 2)
#define RETRO_ENVIRONMENT_EXEC_ESCAPE (RETRO_ENVIRONMENT_PRIVATE | 1)
/* const char * --
* Requests that this core is
* deinitialized, and a new core