#include <process.h>
#include <windows.h>
#define strcasecmp _stricmp
-#else
+#elif P_HAVE_PTHREAD
#include <pthread.h>
#include <sys/time.h>
#include <unistd.h>
#endif
-#ifndef _WIN32
// to enable the USE_READ_THREAD code, fix:
// - https://github.com/notaz/pcsx_rearmed/issues/257
// - ISOgetBufferSub to not race with async code
-//#define USE_READ_THREAD
-#endif
+#define USE_READ_THREAD 0 //P_HAVE_PTHREAD
#ifdef USE_LIBRETRO_VFS
#include <streams/file_stream_transforms.h>
char start[3]; // MSF-format
char length[3]; // MSF-format
FILE *handle; // for multi-track images CDDA
- unsigned int start_offset; // byte offset from start of above file
+ unsigned int start_offset; // byte offset from start of above file (chd: sector offset)
};
#define MAXTRACKS 100 /* How many tracks can a CD hold? */
return LoadSBI(sbiname, s);
}
-#ifndef USE_READ_THREAD
+#if !USE_READ_THREAD
static void readThreadStop() {}
static void readThreadStart() {}
#else
{
int hunk;
- assert(base == 0);
+ sector += base;
hunk = sector / chd_img->sectors_per_hunk;
chd_img->sector_in_hunk = sector % chd_img->sectors_per_hunk;
return 12*2 + ret;
}
-#ifdef USE_READ_THREAD
+#if USE_READ_THREAD
static int cdread_async(FILE *f, unsigned int base, void *dest, int sector) {
boolean found = FALSE;
}
#endif
-#ifdef USE_READ_THREAD
+#if USE_READ_THREAD
static unsigned char * CALLBACK ISOgetBuffer_async(void) {
unsigned char *buffer;
pthread_mutex_lock(§orbuffer_lock);
pthread_mutex_unlock(§orbuffer_lock);
return buffer + 12;
}
-
#endif
static unsigned char * CALLBACK ISOgetBuffer(void) {