diff --git a/shell/libretro/libretro.cpp b/shell/libretro/libretro.cpp index ca2c8209f..b81ccc729 100644 --- a/shell/libretro/libretro.cpp +++ b/shell/libretro/libretro.cpp @@ -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; diff --git a/shell/libretro/oslib.cpp b/shell/libretro/oslib.cpp index 17c3957c9..f21ac97e0 100644 --- a/shell/libretro/oslib.cpp +++ b/shell/libretro/oslib.cpp @@ -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; @@ -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)