Add AppImage roms path detection and fix Mac roms path overriding -R

This commit is contained in:
RichardG867
2022-02-13 18:33:31 -03:00
parent 2af0b79e56
commit 68ca979fd2

View File

@@ -395,8 +395,10 @@ pc_init(int argc, char *argv[])
{
char path[2048], path2[2048];
char *cfg = NULL, *p;
#ifdef __APPLE__
#if defined(__APPLE__)
char mac_rom_path[2048];
#elif !defined(_WIN32)
char *appimage;
#endif
char temp[128];
struct tm *info;
@@ -590,11 +592,20 @@ usage:
plat_dir_create(usr_path);
}
if (path2[0] == '\0') {
#if defined(__APPLE__)
getDefaultROMPath(path2);
#elif !defined(_WIN32)
appimage = getenv("APPIMAGE");
if (appimage && (appimage[0] != '\0')) {
plat_get_dirname(path2, appimage);
plat_path_slash(path2);
strcat(path2, "roms");
plat_path_slash(path2);
}
#endif
}
#ifdef __APPLE__
getDefaultROMPath(mac_rom_path);
strcpy(path2, mac_rom_path);
#endif
if (vmrp && (path2[0] == '\0')) {
strcpy(path2, usr_path);
plat_path_slash(path2);