From: notaz Date: Tue, 20 Sep 2016 23:24:37 +0000 (+0300) Subject: Merge branch 'mainline' into libretro X-Git-Tag: r24l~831 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9766e77ddec3157cbf8b7da407b99f47467a8f72;p=pcsx_rearmed.git Merge branch 'mainline' into libretro --- 9766e77ddec3157cbf8b7da407b99f47467a8f72 diff --cc Makefile.libretro index 01c1fcfa,223ba9f9..0f6608d9 --- a/Makefile.libretro +++ b/Makefile.libretro @@@ -185,33 -128,8 +185,33 @@@ else ifeq ($(platform), qnx 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))) @@@ -245,29 -163,36 +245,40 @@@ # 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 diff --cc frontend/libretro.c index 444719a5,940ff05a..1e865091 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@@ -1550,20 -1206,12 +1554,25 @@@ void retro_init(void 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");