CFLAGS += -O2 -DNDEBUG
endif
endif
-CFLAGS += -DHAVE_MMAP=$(if $(NO_MMAP),0,1)
+CFLAGS += -DHAVE_MMAP=$(if $(NO_MMAP),0,1) \
+ -DHAVE_PTHREAD=$(if $(NO_PTHREAD),0,1)
CXXFLAGS += $(CFLAGS)
#DRC_DBG = 1
#PCNT = 1
CFLAGS += -DARM -D__aarch64__=1 -march=armv8-a -mtune=cortex-a57 -mtp=soft -DHAVE_INTTYPES -DLSB_FIRST -ffast-math -mcpu=cortex-a57+crc+fp+simd -ffunction-sections
CFLAGS += -ftree-vectorize
CFLAGS += -Ifrontend/switch -ftree-vectorize
+ NO_PTHREAD=1
LIBPTHREAD :=
STATIC_LINKING=1
BUILTIN_GPU = neon
DYNAREC = ari64
ARCH = arm
STATIC_LINKING = 1
+ NO_PTHREAD=1
# CTR(3DS)
else ifeq ($(platform), ctr)
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITARM)/bin/arm-none-eabi-g++$(EXE_EXT)
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
- CFLAGS += -DARM11 -D_3DS -DNO_OS -DNO_DYLIB -DNO_SOCKET -DTHREAD_ENABLED -DGPU_UNAI_USE_FLOATMATH -DGPU_UNAI_USE_FLOAT_DIV_MULTINV
+ CFLAGS += -DARM11 -D_3DS -DNO_OS -DNO_DYLIB -DNO_SOCKET -DGPU_UNAI_USE_FLOATMATH -DGPU_UNAI_USE_FLOAT_DIV_MULTINV
CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft
CFLAGS += -Wall -mword-relocations
CFLAGS += -fomit-frame-pointer -ffast-math -funroll-loops
endif
CFLAGS += -D__WIN32__ -DNO_DYLIB
MMAP_WIN32=1
+ NO_PTHREAD=1
MAIN_LDLIBS += -lws2_32
LIBPTHREAD :=
LIBDL :=
spu_config.iUseThread = 0;
}
-#ifndef _WIN32
- var.value = NULL;
- var.key = "pcsx_rearmed_async_cd";
- if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
- {
- if (strcmp(var.value, "async") == 0)
- {
- Config.AsyncCD = 1;
- Config.CHD_Precache = 0;
- }
- else if (strcmp(var.value, "sync") == 0)
- {
- Config.AsyncCD = 0;
- Config.CHD_Precache = 0;
- }
- else if (strcmp(var.value, "precache") == 0)
- {
- Config.AsyncCD = 0;
- Config.CHD_Precache = 1;
- }
+ if (HAVE_PTHREAD) {
+ var.value = NULL;
+ var.key = "pcsx_rearmed_async_cd";
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
+ {
+ if (strcmp(var.value, "async") == 0)
+ {
+ Config.AsyncCD = 1;
+ Config.CHD_Precache = 0;
+ }
+ else if (strcmp(var.value, "sync") == 0)
+ {
+ Config.AsyncCD = 0;
+ Config.CHD_Precache = 0;
+ }
+ else if (strcmp(var.value, "precache") == 0)
+ {
+ Config.AsyncCD = 0;
+ Config.CHD_Precache = 1;
+ }
+ }
}
-#endif
var.value = NULL;
var.key = "pcsx_rearmed_noxadecoding";
},
"enabled",
},
-#if !defined(THREAD_ENABLED) && !defined(_WIN32) && !defined(NO_OS)
+#if HAVE_PTHREAD
{
"pcsx_rearmed_spu_thread",
"Threaded SPU",
},
"disabled",
},
-#endif // THREAD_ENABLED
+#endif // HAVE_PTHREAD
{
"pcsx_rearmed_show_input_settings",
"Show Input Settings",
#include <process.h>
#include <windows.h>
#define strcasecmp _stricmp
-#else
+#elif 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 //HAVE_PTHREAD
#ifdef USE_LIBRETRO_VFS
#include <streams/file_stream_transforms.h>
return LoadSBI(sbiname, s);
}
-#ifndef USE_READ_THREAD
+#if !USE_READ_THREAD
static void readThreadStop() {}
static void readThreadStart() {}
#else
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) {
* *
***************************************************************************/
-#if !defined(THREAD_ENABLED) && !defined(_WIN32) && !defined(NO_OS)
-#define THREAD_ENABLED 1
-#endif
#include "stdafx.h"
#define _IN_SPU
// optional worker thread handling
-#if defined(THREAD_ENABLED) || defined(WANT_THREAD_CODE)
+#if HAVE_PTHREAD || defined(WANT_THREAD_CODE)
// worker thread state
static struct spu_worker {
static const void * const worker = NULL;
-#endif // THREAD_ENABLED
+#endif // HAVE_PTHREAD || defined(WANT_THREAD_CODE)
////////////////////////////////////////////////////////////////////////
// MAIN SPU FUNCTION
/* special code for TI C64x DSP */
#include "spu_c64x.c"
-#elif defined(THREAD_ENABLED)
+#elif HAVE_PTHREAD
#include <pthread.h>
#include <semaphore.h>
worker = NULL;
}
-#else // if !THREAD_ENABLED
+#else // if !HAVE_PTHREAD
static void init_spu_thread(void)
{