summaryrefslogtreecommitdiff
path: root/libpcsxcore/cdriso.c
diff options
context:
space:
mode:
authorSND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-12-02 18:39:26 +0000
committerSND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-12-02 18:39:26 +0000
commitecff5e58679454c947975da6edcfec724b0fe0aa (patch)
tree593e61c56e64f2201b4bc5ee831a87d7215b8868 /libpcsxcore/cdriso.c
parenta8ffba8f7e9bf2eb80486e058b99ae6d40c0ab4b (diff)
Redump.org SBI - cdrom.c, cdriso.c
- native support (LibCrypt) ex. TOCA World Touring Cars (Europe) 1) Run CDROM - download SBI from redump.org - place in emu folder - name "redump.sbi" - run CDROM (subchannel optional) 2) Run ISO - download SBI from redump.org - place in iso folder - "toca world cars.bin", "toca world cars.cue", "toca world cars.sbi" or "toca world cars.img", "toca world cars.ccd", "toca world cars.sbi" - run ISO (subchannel file optional) git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@60534 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/cdriso.c')
-rw-r--r--libpcsxcore/cdriso.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c
index 301eb267..7f210772 100644
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -695,6 +695,61 @@ static int opensubfile(const char *isoname) {
return 0;
}
+// redump.org SBI files
+u8 sbitime[256][3];
+u8 sbicount;
+
+int opensbifile(const char *isoname) {
+ FILE *sbihandle;
+ char sbiname[MAXPATHLEN];
+
+
+ // init
+ sbicount = 0;
+
+
+ // copy name of the iso and change extension from .img to .sbi
+ strncpy(sbiname, isoname, sizeof(sbiname));
+ sbiname[MAXPATHLEN - 1] = '\0';
+ if (strlen(sbiname) >= 4) {
+ strcpy(sbiname + strlen(sbiname) - 4, ".sbi");
+ }
+ else {
+ return -1;
+ }
+
+ sbihandle = fopen(sbiname, "rb");
+ if (sbihandle == NULL) {
+ return -1;
+ }
+
+
+ // 4-byte SBI header
+ fread( sbiname, 1, 4, sbihandle );
+ while( !feof(sbihandle) ) {
+ u8 subq[11];
+ fread( sbitime[ sbicount++ ], 1, 3, sbihandle );
+ fread( subq, 1, 11, sbihandle );
+ }
+
+
+ return 0;
+}
+
+int checkSBI(u8 *time) {
+ int lcv;
+
+ // both BCD format
+ for( lcv=0; lcv<sbicount; lcv++ ) {
+ if( time[0] == sbitime[lcv][0] &&
+ time[1] == sbitime[lcv][1] &&
+ time[2] == sbitime[lcv][2] )
+ return 1;
+ }
+
+ return 0;
+}
+
long CALLBACK ISOinit(void) {
assert(cdHandle == NULL);
assert(subHandle == NULL);
@@ -761,6 +816,10 @@ static long CALLBACK ISOopen(void) {
SysPrintf("[+sub]");
}
+ if (opensbifile(GetIsoFile()) == 0) {
+ SysPrintf("[+sbi]");
+ }
+
SysPrintf(".\n");
PrintTracks();