X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdriso.c;h=a5a16a56c53a815b150701aaa35f6540a6252806;hb=5b5680983b7b3dde95acfe42f58e748d9f7fe1cb;hp=4c146461c4f997e955b9613fa994c30a2d8a46cf;hpb=6fe8a1d4501485790b5a58f1a4c62130dd70afb4;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 4c146461..a5a16a56 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -70,16 +70,13 @@ static unsigned char subbuffer[SUB_FRAMESIZE]; static boolean playing = FALSE; static boolean cddaBigEndian = FALSE; -// cdda sectors in toc, byte offset in file -static unsigned int cdda_cur_sector; -static unsigned int cdda_file_offset; /* 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 * not in the CD image, so that cdrom code can fake subchannel data instead. * XXX: there could be multiple pregaps but PSX dumps only have one? */ static unsigned int pregapOffset; -#define cddaCurPos cdda_cur_sector +static unsigned int cddaCurPos; // compressed image stuff static struct { @@ -1423,6 +1420,7 @@ static int cdread_chd(FILE *f, unsigned int base, void *dest, int sector) return CD_FRAMESIZE_RAW; } #endif + static int cdread_2048(FILE *f, unsigned int base, void *dest, int sector) { int ret; @@ -1652,8 +1650,6 @@ static long CALLBACK ISOopen(void) { if (numtracks > 1 && ti[1].handle == NULL) { ti[1].handle = fopen(bin_filename, "rb"); } - cdda_cur_sector = 0; - cdda_file_offset = 0; if (Config.AsyncCD) { readThreadStart(); @@ -1812,7 +1808,7 @@ static boolean CALLBACK ISOreadTrack(unsigned char *time) { fseek(subHandle, sector * SUB_FRAMESIZE, SEEK_SET); if (fread(subbuffer, 1, SUB_FRAMESIZE, subHandle) != SUB_FRAMESIZE) /* Faulty subchannel data shouldn't cause a read failure */ - return 0; + return 1; if (subChanRaw) DecodeRawSubData(); } @@ -1823,7 +1819,7 @@ static boolean CALLBACK ISOreadTrack(unsigned char *time) { // plays cdda audio // sector: byte 0 - minute; byte 1 - second; byte 2 - frame // does NOT uses bcd format -static long CALLBACK ISOplay(void) { +static long CALLBACK ISOplay(unsigned char *time) { playing = TRUE; return 0; }