From ecff5e58679454c947975da6edcfec724b0fe0aa Mon Sep 17 00:00:00 2001 From: "SND\\shalma_cp" Date: Thu, 2 Dec 2010 18:39:26 +0000 Subject: 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 --- libpcsxcore/cdriso.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ libpcsxcore/cdrom.c | 15 +++++++++++++ 2 files changed, 74 insertions(+) (limited to 'libpcsxcore') 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