notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spu: implement irq on dma
[pcsx_rearmed.git]
/
libpcsxcore
/
cdriso.c
diff --git
a/libpcsxcore/cdriso.c
b/libpcsxcore/cdriso.c
index
8367750
..
1233ba3
100644
(file)
--- a/
libpcsxcore/cdriso.c
+++ b/
libpcsxcore/cdriso.c
@@
-36,18
+36,16
@@
#include <process.h>
#include <windows.h>
#define strcasecmp _stricmp
#include <process.h>
#include <windows.h>
#define strcasecmp _stricmp
-#el
se
+#el
if P_HAVE_PTHREAD
#include <pthread.h>
#include <sys/time.h>
#include <unistd.h>
#endif
#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
// 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>
#ifdef USE_LIBRETRO_VFS
#include <streams/file_stream_transforms.h>
@@
-1079,7
+1077,7
@@
static int opensbifile(const char *isoname) {
return LoadSBI(sbiname, s);
}
return LoadSBI(sbiname, s);
}
-#if
ndef
USE_READ_THREAD
+#if
!
USE_READ_THREAD
static void readThreadStop() {}
static void readThreadStart() {}
#else
static void readThreadStop() {}
static void readThreadStart() {}
#else
@@
-1497,7
+1495,7
@@
static int cdread_2048(FILE *f, unsigned int base, void *dest, int sector)
return 12*2 + ret;
}
return 12*2 + ret;
}
-#if
def
USE_READ_THREAD
+#if USE_READ_THREAD
static int cdread_async(FILE *f, unsigned int base, void *dest, int sector) {
boolean found = FALSE;
static int cdread_async(FILE *f, unsigned int base, void *dest, int sector) {
boolean found = FALSE;
@@
-1555,7
+1553,7
@@
static unsigned char * CALLBACK ISOgetBuffer_chd(void) {
}
#endif
}
#endif
-#if
def
USE_READ_THREAD
+#if USE_READ_THREAD
static unsigned char * CALLBACK ISOgetBuffer_async(void) {
unsigned char *buffer;
pthread_mutex_lock(§orbuffer_lock);
static unsigned char * CALLBACK ISOgetBuffer_async(void) {
unsigned char *buffer;
pthread_mutex_lock(§orbuffer_lock);
@@
-1563,7
+1561,6
@@
static unsigned char * CALLBACK ISOgetBuffer_async(void) {
pthread_mutex_unlock(§orbuffer_lock);
return buffer + 12;
}
pthread_mutex_unlock(§orbuffer_lock);
return buffer + 12;
}
-
#endif
static unsigned char * CALLBACK ISOgetBuffer(void) {
#endif
static unsigned char * CALLBACK ISOgetBuffer(void) {
@@
-1588,7
+1585,6
@@
static long CALLBACK ISOopen(void) {
char alt_bin_filename[MAXPATHLEN];
const char *bin_filename;
char image_str[1024];
char alt_bin_filename[MAXPATHLEN];
const char *bin_filename;
char image_str[1024];
- int is_chd = 0;
if (cdHandle != NULL) {
return 0; // it's already open
if (cdHandle != NULL) {
return 0; // it's already open
@@
-1643,7
+1639,6
@@
static long CALLBACK ISOopen(void) {
CDR_getBuffer = ISOgetBuffer_chd;
cdimg_read_func = cdread_chd;
cdimg_read_sub_func = cdread_sub_chd;
CDR_getBuffer = ISOgetBuffer_chd;
cdimg_read_func = cdread_chd;
cdimg_read_sub_func = cdread_sub_chd;
- is_chd = 1;
}
#endif
}
#endif
@@
-1684,14
+1679,11
@@
static long CALLBACK ISOopen(void) {
}
// guess whether it is mode1/2048
}
// guess whether it is mode1/2048
- if (ftello(cdHandle) % 2048 == 0) {
+ if (
cdimg_read_func == cdread_normal &&
ftello(cdHandle) % 2048 == 0) {
unsigned int modeTest = 0;
fseek(cdHandle, 0, SEEK_SET);
if (!fread(&modeTest, sizeof(modeTest), 1, cdHandle)) {
unsigned int modeTest = 0;
fseek(cdHandle, 0, SEEK_SET);
if (!fread(&modeTest, sizeof(modeTest), 1, cdHandle)) {
-#ifndef NDEBUG
SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__);
SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__);
-#endif
- return -1;
}
if (SWAP32(modeTest) != 0xffffff00) {
strcat(image_str, "[2048]");
}
if (SWAP32(modeTest) != 0xffffff00) {
strcat(image_str, "[2048]");
@@
-1704,7
+1696,7
@@
static long CALLBACK ISOopen(void) {
PrintTracks();
PrintTracks();
- if (subChanMixed &&
!is_chd
) {
+ if (subChanMixed &&
cdimg_read_func == cdread_normal
) {
cdimg_read_func = cdread_sub_mixed;
cdimg_read_sub_func = cdread_sub_sub_mixed;
}
cdimg_read_func = cdread_sub_mixed;
cdimg_read_sub_func = cdread_sub_sub_mixed;
}