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 {
return CD_FRAMESIZE_RAW;
}
#endif
+
static int cdread_2048(FILE *f, unsigned int base, void *dest, int sector)
{
int ret;
sec2msf(sector + 2 * 75, (char *)&cdbuffer[12]);
cdbuffer[12 + 3] = 1;
- return ret;
+ return 12*2 + ret;
}
#ifndef _WIN32
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();
}
ret = cdimg_read_func(cdHandle, 0, cdbuffer, sector);
- if (ret < 0)
+ if (ret < 12*2 + 2048)
return 0;
if (subHandle != NULL) {