Skip to content

Commit

Permalink
Support RETRO_ENVIRONMENT_GET_FILE_BROWSER_START_DIRECTORY
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanvb committed Sep 14, 2024
1 parent 7601df9 commit b2a61dc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libretro-common/include/libretro.h
Original file line number Diff line number Diff line change
Expand Up @@ -2556,6 +2556,19 @@ enum retro_mod
*/
#define RETRO_ENVIRONMENT_GET_PLAYLIST_DIRECTORY 79

/**
* Returns the "file browser" start directory of the frontend.
*
* This directory can serve as a start directory for the core in case it
* provides an internal way of loading content.
*
* @param[out] data <tt>const char **</tt>.
* May be \c NULL. If so, no such directory is defined, and it's up to the
* implementation to find a suitable directory.
* @return \c true if the environment call is available.
*/
#define RETRO_ENVIRONMENT_GET_FILE_BROWSER_START_DIRECTORY 80

/**@}*/

/**
Expand Down
11 changes: 11 additions & 0 deletions runloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,17 @@ bool runloop_environment_cb(unsigned cmd, void *data)
break;
}

case RETRO_ENVIRONMENT_GET_FILE_BROWSER_START_DIRECTORY:
{
const char **dir = (const char**)data;
const char *dir_content = settings->paths.directory_menu_content;

*dir = *dir_content ? dir_content : NULL;
RARCH_LOG("[Environ]: FILE_BROWSER_START_DIRECTORY: \"%s\".\n",
dir_content);
break;
}

case RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO:
/**
* Update the system Audio/Video information.
Expand Down

0 comments on commit b2a61dc

Please sign in to comment.