sbi support for multidisc pbp
authorSakitoshi <sakitoshi@gmail.com>
Thu, 24 Oct 2019 04:14:07 +0000 (01:14 -0300)
committerSakitoshi <sakitoshi@gmail.com>
Thu, 24 Oct 2019 04:14:07 +0000 (01:14 -0300)
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

index daed921..8171674 100644 (file)
@@ -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;