aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authornotaz2013-04-05 01:37:31 +0300
committernotaz2013-04-05 02:40:05 +0300
commit92f43ab07c8daf13c89a96f61e0c8a2ccce8f32a (patch)
tree012c08a7d00ee3fe9c982ea8db07dd96b09da203 /libpcsxcore
parent10858959854a4e0864cad8629756216c4b2d4310 (diff)
downloadpcsx_rearmed-92f43ab07c8daf13c89a96f61e0c8a2ccce8f32a.tar.gz
pcsx_rearmed-92f43ab07c8daf13c89a96f61e0c8a2ccce8f32a.tar.bz2
pcsx_rearmed-92f43ab07c8daf13c89a96f61e0c8a2ccce8f32a.zip
cdriso: prefer .toc over .cue
as .toc has subchannel flags
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/cdriso.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c
index dde21bc..36ff405 100644
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -327,6 +327,14 @@ static int parsetoc(const char *isofile) {
return -1;
}
}
+ // check if it's really a TOC named as a .cue
+ fgets(linebuf, sizeof(linebuf), fi);
+ token = strtok(tmp, " ");
+ if (strncmp(token, "CD", 2) != 0 && strcmp(token, "CATALOG") != 0) {
+ fclose(fi);
+ return -1;
+ }
+ fseek(fi, 0, SEEK_SET);
}
memset(&ti, 0, sizeof(ti));
@@ -1227,10 +1235,7 @@ static long CALLBACK ISOopen(void) {
CDR_getBuffer = ISOgetBuffer;
cdimg_read_func = cdread_normal;
- if (parsecue(GetIsoFile()) == 0) {
- SysPrintf("[+cue]");
- }
- else if (parsetoc(GetIsoFile()) == 0) {
+ if (parsetoc(GetIsoFile()) == 0) {
SysPrintf("[+toc]");
}
else if (parseccd(GetIsoFile()) == 0) {
@@ -1239,6 +1244,9 @@ static long CALLBACK ISOopen(void) {
else if (parsemds(GetIsoFile()) == 0) {
SysPrintf("[+mds]");
}
+ else if (parsecue(GetIsoFile()) == 0) {
+ SysPrintf("[+cue]");
+ }
if (handlepbp(GetIsoFile()) == 0) {
SysPrintf("[pbp]");
CDR_getBuffer = ISOgetBuffer_compr;