From fa7690d3359ddbae1677af981c4f54e3cff5e9d9 Mon Sep 17 00:00:00 2001 From: David Lindecrantz Date: Fri, 25 Feb 2022 13:49:10 +0100 Subject: [PATCH] PSX: Try loading optional cd_bios.rom from both game dir and parent dir (#555) --- support/psx/psx.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/support/psx/psx.cpp b/support/psx/psx.cpp index b99fdcb..1dac91d 100644 --- a/support/psx/psx.cpp +++ b/support/psx/psx.cpp @@ -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());