DRC_CACHE_BASE = 0
BUILTIN_GPU = neon
ARCH = arm
- CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
+ CFLAGS += -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
+ MAIN_LDLIBS += -lsocket
+ LIBPTHREAD :=
+ LIBDL :=
+
+#Raspberry Pi 2
+else ifeq ($(platform), rpi2)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
+ ASFLAGS += -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
+ HAVE_NEON = 1
+ ARCH = arm
+ BUILTIN_GPU = neon
+ USE_DYNAREC = 1
+
+#Raspberry Pi 3
+else ifeq ($(platform), rpi3)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -marm -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
+ ASFLAGS += -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
+ HAVE_NEON = 1
+ ARCH = arm
+ BUILTIN_GPU = neon
+ USE_DYNAREC = 1
# ARM
else ifneq (,$(findstring armv,$(platform)))
# Windows
else
TARGET := $(TARGET_NAME)_libretro.dll
- CC = gcc
- fpic := -fPIC
- LD_FLAGS := -fPIC
- SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=libretro/link.T
- CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
+ MAIN_LDFLAGS += -static-libgcc -static-libstdc++ -s
+ CFLAGS += -D__WIN32__
MMAP_WIN32=1
-endif
-
-CFLAGS += -fPIC
-ifeq ($(platform),win)
MAIN_LDLIBS += -lws2_32
-else ifneq ($(platform),qnx)
- LDLIBS += -lpthread
- MAIN_LDLIBS += -ldl
+ LIBPTHREAD :=
+ LIBDL :=
endif
+
+CFLAGS += $(fpic)
MAIN_LDFLAGS += -shared
-MAIN_LDLIBS += -lm -lz
-EXTRA_LDFLAGS =
+MAIN_LDLIBS += $(LIBPTHREAD) $(LIBDL) $(LIBZ)
+
+# try to autodetect stuff for the lazy
+ifndef ARCH
+ARCH = $(shell $(CC) -dumpmachine | awk -F- '{print $$1}')
+endif
+ifndef HAVE_NEON
+HAVE_NEON = $(shell $(CC) -E -dD - < /dev/null 2> /dev/null | grep -q __ARM_NEON__ && echo 1 || echo 0)
+endif
+ifeq ($(NO_UNDEF_CHECK)$(shell ld -v 2> /dev/null | awk '{print $$1}'),GNU)
+MAIN_LDFLAGS += -Wl,--no-undefined
+endif
+ # try to autodetect stuff for the lazy
+ ifndef ARCH
+ ARCH = $(shell $(CC) -dumpmachine | awk -F- '{print $$1}')
+ endif
+ ifndef HAVE_NEON
+ HAVE_NEON = $(shell $(CC) -E -dD - < /dev/null 2> /dev/null | grep -q __ARM_NEON__ && echo 1 || echo 0)
+ endif
+ ifeq ($(shell ld -v 2> /dev/null | awk '{print $$1}'),GNU)
+ MAIN_LDFLAGS += -Wl,--no-undefined
+ endif
+
TARGET ?= libretro.so
PLATFORM = libretro
BUILTIN_GPU ?= peops
int i, ret;
bool found_bios = false;
+ #ifdef __MACH__
+ // magic sauce to make the dynarec work on iOS
+ syscall(SYS_ptrace, 0 /*PTRACE_TRACEME*/, 0, 0, 0);
+ #endif
+
+#ifdef _3DS
+ psxMapHook = pl_3ds_mmap;
+ psxUnmapHook = pl_3ds_munmap;
+#endif
+#ifdef VITA
+ psxMapHook = pl_vita_mmap;
+ psxUnmapHook = pl_vita_munmap;
+#endif
ret = emu_core_preinit();
+#ifdef _3DS
+ /* emu_core_preinit sets the cpu to dynarec */
+ if(!__ctr_svchax)
+ Config.Cpu = CPU_INTERPRETER;
+#endif
ret |= emu_core_init();
if (ret != 0) {
SysPrintf("PCSX init failed.\n");