PSX: Try loading optional cd_bios.rom from both game dir and parent dir (#555)

This commit is contained in:
David Lindecrantz
2022-02-25 13:49:10 +01:00
committed by GitHub
parent 55318af1bb
commit fa7690d335

View File

@@ -616,7 +616,8 @@ void psx_mount_cd(int f_index, int s_index, const char *filename)
{
int bios_loaded = 0;
strcpy(buf, last_dir);
// load cd_bios.rom from game directory
sprintf(buf, "%s/", last_dir);
p = strrchr(buf, '/');
if (p)
{
@@ -624,6 +625,17 @@ void psx_mount_cd(int f_index, int s_index, const char *filename)
bios_loaded = load_bios(buf);
}
// load cd_bios.rom from parent directory
if (!bios_loaded) {
strcpy(buf, last_dir);
p = strrchr(buf, '/');
if (p)
{
strcpy(p + 1, "cd_bios.rom");
bios_loaded = load_bios(buf);
}
}
if (!bios_loaded)
{
sprintf(buf, "%s/boot.rom", HomeDir());