X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=37e67d4db9248dadffd58bddb7cd791ae6ae28e9;hb=0e481d53e19263f5b62533e7c595bb99f793a99f;hp=a12ec31d97d803dc120bbfcae03d66481ba7b579;hpb=b7f50ee7e6412032ed5bb4559fbc8b18e6ba0c72;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index a12ec31d..37e67d4d 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -75,7 +75,6 @@ static boolean multifile = FALSE; static unsigned char cdbuffer[CD_FRAMESIZE_RAW]; static unsigned char subbuffer[SUB_FRAMESIZE]; -static boolean playing = FALSE; static boolean cddaBigEndian = FALSE; /* Frame offset into CD image where pregap data would be found if it was there. * If a game seeks there we must *not* return subchannel data since it's @@ -83,8 +82,6 @@ static boolean cddaBigEndian = FALSE; * XXX: there could be multiple pregaps but PSX dumps only have one? */ static unsigned int pregapOffset; -static unsigned int cddaCurPos; - // compressed image stuff static struct { unsigned char buff_raw[16][CD_FRAMESIZE_RAW]; @@ -233,11 +230,12 @@ static int parsetoc(const char *isofile) { } // check if it's really a TOC named as a .cue if (fgets(linebuf, sizeof(linebuf), fi) != NULL) { - token = strtok(linebuf, " "); - if (token && strncmp(token, "CD", 2) != 0 && strcmp(token, "CATALOG") != 0) { - fclose(fi); - return -1; - } + token = strtok(linebuf, " "); + if (token && strncmp(token, "CD", 2) != 0) { + // && strcmp(token, "CATALOG") != 0) - valid for a real .cue + fclose(fi); + return -1; + } } fseek(fi, 0, SEEK_SET); } @@ -1598,7 +1596,8 @@ static void PrintTracks(void) { for (i = 1; i <= numtracks; i++) { SysPrintf(_("Track %.2d (%s) - Start %.2d:%.2d:%.2d, Length %.2d:%.2d:%.2d\n"), - i, (ti[i].type == DATA ? "DATA" : "AUDIO"), + i, (ti[i].type == DATA ? "DATA" : + (ti[i].type == CDDA ? "AUDIO" : "UNKNOWN")), ti[i].start[0], ti[i].start[1], ti[i].start[2], ti[i].length[0], ti[i].length[1], ti[i].length[2]); } @@ -1748,7 +1747,6 @@ static long CALLBACK ISOclose(void) { fclose(subHandle); subHandle = NULL; } - playing = FALSE; cddaHandle = NULL; if (compr_img != NULL) { @@ -1884,13 +1882,11 @@ static boolean CALLBACK ISOreadTrack(unsigned char *time) { // sector: byte 0 - minute; byte 1 - second; byte 2 - frame // does NOT uses bcd format static long CALLBACK ISOplay(unsigned char *time) { - playing = TRUE; return 0; } // stops cdda audio static long CALLBACK ISOstop(void) { - playing = FALSE; return 0; } @@ -1921,22 +1917,10 @@ static unsigned char* CALLBACK ISOgetBufferSub(int sector) { } static long CALLBACK ISOgetStatus(struct CdrStat *stat) { - u32 sect; - CDR__getStatus(stat); - if (playing) { - stat->Type = 0x02; - stat->Status |= 0x80; - } - else { - // BIOS - boot ID (CD type) - stat->Type = ti[1].type; - } - - // relative -> absolute time - sect = cddaCurPos; - sec2msf(sect, (char *)stat->Time); + // BIOS - boot ID (CD type) + stat->Type = ti[1].type; return 0; } @@ -1946,6 +1930,7 @@ long CALLBACK ISOreadCDDA(unsigned char m, unsigned char s, unsigned char f, uns unsigned char msf[3] = {m, s, f}; unsigned int track, track_start = 0; FILE *handle = cdHandle; + unsigned int cddaCurPos; int ret; cddaCurPos = msf2sec((char *)msf);