From ba1cce07fd9b6f6734b272a51322aebb18683138 Mon Sep 17 00:00:00 2001 From: Sakitoshi Date: Thu, 24 Oct 2019 01:14:07 -0300 Subject: sbi support for multidisc pbp same syntaxis as beetle-psx, name the sbi file after the pbp and append an underscore and the number of the disc at the end. --- libpcsxcore/cdriso.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index daed921..8171674 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -1140,13 +1140,18 @@ static int opensubfile(const char *isoname) { } static int opensbifile(const char *isoname) { - char sbiname[MAXPATHLEN]; + char sbiname[MAXPATHLEN], disknum[MAXPATHLEN] = "0"; int s; strncpy(sbiname, isoname, sizeof(sbiname)); sbiname[MAXPATHLEN - 1] = '\0'; if (strlen(sbiname) >= 4) { - strcpy(sbiname + strlen(sbiname) - 4, ".sbi"); + if (cdrIsoMultidiskCount > 1) { + sprintf(disknum, "_%i.sbi", cdrIsoMultidiskSelect + 1); + strcpy(sbiname + strlen(sbiname) - 4, disknum); + } + else + strcpy(sbiname + strlen(sbiname) - 4, ".sbi"); } else { return -1; -- cgit v1.2.3