+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);
+}
+