Skip to content

Commit

Permalink
[Libretro] Add game dir as fall back for arcade BIOSes
Browse files Browse the repository at this point in the history
  • Loading branch information
bslenul authored and flyinghead committed Nov 6, 2024
1 parent 9d4d486 commit f892630
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion shell/libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static char game_dir[1024];
char game_dir_no_slash[1024];
char vmu_dir_no_slash[PATH_MAX];
char content_name[PATH_MAX];
static char g_roms_dir[PATH_MAX];
char g_roms_dir[PATH_MAX];
static std::mutex mtx_serialization;
static bool gl_ctx_resetting = false;
static bool is_dupe;
Expand Down
13 changes: 9 additions & 4 deletions shell/libretro/oslib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const char *retro_get_system_directory();
extern char game_dir_no_slash[1024];
extern char vmu_dir_no_slash[PATH_MAX];
extern char content_name[PATH_MAX];
extern char g_roms_dir[PATH_MAX];
extern unsigned per_content_vmus;
extern std::string arcadeFlashPath;

Expand Down Expand Up @@ -102,10 +103,14 @@ std::string findNaomiBios(const std::string& name)
{
std::string basepath(game_dir_no_slash);
basepath += path_default_slash() + name;
if (file_exists(basepath))
return basepath;
else
return "";
if (!file_exists(basepath))
{
// File not found in system dir, try game dir instead
basepath = g_roms_dir + name;
if (!file_exists(basepath))
return "";
}
return basepath;
}

std::string getSavestatePath(int index, bool writable)
Expand Down

0 comments on commit f892630

Please sign in to comment.