Add RETRO_ENVIRONMENT_GET_LIBRETRO_PATH.

Vital for cores which do not load a ROM, but still want to load assets
somehow. Demos and the like ...
This commit is contained in:
Themaister 2013-07-07 11:15:29 +02:00 committed by twinaphex
parent b9cbcd0b81
commit b7fa652b1e
2 changed files with 17 additions and 0 deletions

View File

@ -700,6 +700,17 @@ static bool environment_cb(unsigned cmd, void *data)
break;
}
case RETRO_ENVIRONMENT_GET_LIBRETRO_PATH:
{
const char **path = (const char**)data;
#ifdef HAVE_DYNAMIC
*path = g_settings.libretro;
#else
*path = NULL;
#endif
break;
}
default:
RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd);
return false;

View File

@ -480,6 +480,12 @@ enum retro_mod
// If true, the libretro implementation supports calls to retro_load_game() with NULL as argument.
// Used by cores which can run without particular game data.
// This should be called within retro_set_environment() only.
//
#define RETRO_ENVIRONMENT_GET_LIBRETRO_PATH 19
// const char ** --
// Retrieves the absolute path from where this libretro implementation was loaded.
// NULL is returned if the libretro was loaded statically (i.e. linked statically to frontend), or if the path cannot be determined.
// Mostly useful in cooperation with SET_SUPPORT_NO_GAME as assets can be loaded without ugly hacks.
// Pass this to retro_video_refresh_t if rendering to hardware.