X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=2d371dd232604d9ba18fbcd730665cef4c04dc5a;hp=1e9adedeb3497e3901915e53c8a0aefa961df104;hb=97a238a64737245ec8977d0242059e90e0ac01fb;hpb=858ad5116a9f17609b101a7df7016092c694a415 diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 1e9adede..2d371dd2 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -22,6 +22,7 @@ #include "plugins.h" #include "cdrom.h" #include "cdriso.h" +#include "ppf.h" #ifdef _WIN32 #include @@ -685,6 +686,25 @@ static int opensubfile(const char *isoname) { return 0; } +static int opensbifile(const char *isoname) { + char sbiname[MAXPATHLEN]; + int s; + + strncpy(sbiname, isoname, sizeof(sbiname)); + sbiname[MAXPATHLEN - 1] = '\0'; + if (strlen(sbiname) >= 4) { + strcpy(sbiname + strlen(sbiname) - 4, ".sbi"); + } + else { + return -1; + } + + fseek(cdHandle, 0, SEEK_END); + s = ftell(cdHandle) / 2352; + + return LoadSBI(sbiname, s); +} + static void PrintTracks(void) { int i; @@ -730,6 +750,9 @@ static long CALLBACK ISOopen(void) { if (!subChanMixed && opensubfile(GetIsoFile()) == 0) { SysPrintf("[+sub]"); } + if (opensbifile(GetIsoFile()) == 0) { + SysPrintf("[+sbi]"); + } SysPrintf(".\n"); @@ -765,6 +788,7 @@ static long CALLBACK ISOclose(void) { } } numtracks = 0; + UnloadSBI(); return 0; }