X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=jni%2FAndroid.mk;h=819d7fbae5ab4a18583fd8eff1a9997c1a04be43;hb=28d1bea2e828cd079593abc8c97ea6ff4fd7d4f4;hp=f48674cc44feeb9d1cbf924627ea7ed32daf869e;hpb=36e1dd7c54e92db6076ba2e249a3b2bee9f5f7c4;p=pcsx_rearmed.git diff --git a/jni/Android.mk b/jni/Android.mk index f48674cc..819d7fba 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -4,6 +4,8 @@ $(shell cd "$(LOCAL_PATH)" && ((git describe || echo) | sed -e 's/.*/#define REV $(shell cd "$(LOCAL_PATH)" && (diff -q ../frontend/revision.h_ ../frontend/revision.h > /dev/null 2>&1 || cp ../frontend/revision.h_ ../frontend/revision.h)) $(shell cd "$(LOCAL_PATH)" && (rm ../frontend/revision.h_)) +HAVE_CHD ?= 1 + ROOT_DIR := $(LOCAL_PATH)/.. CORE_DIR := $(ROOT_DIR)/libpcsxcore SPU_DIR := $(ROOT_DIR)/plugins/dfsound @@ -15,6 +17,8 @@ NEON_DIR := $(ROOT_DIR)/plugins/gpu_neon UNAI_DIR := $(ROOT_DIR)/plugins/gpu_unai DYNAREC_DIR := $(ROOT_DIR)/libpcsxcore/new_dynarec DEPS_DIR := $(ROOT_DIR)/deps +LIBRETRO_COMMON := $(ROOT_DIR)/libretro-common +EXTRA_INCLUDES := # core SOURCES_C := $(CORE_DIR)/cdriso.c \ @@ -111,36 +115,77 @@ SOURCES_C += \ $(DEPS_DIR)/libchdr/chd.c \ $(DEPS_DIR)/libchdr/flac.c \ $(DEPS_DIR)/libchdr/huffman.c - -# dynarec -SOURCES_C += $(DYNAREC_DIR)/backends/psx/emu_if.c +SOURCES_ASM := COREFLAGS := -ffast-math -funroll-loops -DHAVE_LIBRETRO -DNO_FRONTEND -DFRONTEND_SUPPORTS_RGB565 -DANDROID -DREARMED COREFLAGS += -DPACKAGE_VERSION=\"1.3.2\" -DFLAC__HAS_OGG=0 -DFLAC__NO_DLL -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DFLAC__NO_DLL -D_7ZIP_ST -DHAVE_SYS_PARAM_H +COREFLAGS += -DHAVE_CHD +HAVE_ARI64=0 +HAVE_LIGHTREC=0 +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) + HAVE_ARI64=1 +else ifeq ($(TARGET_ARCH_ABI),armeabi) + HAVE_ARI64=1 +else ifeq ($(TARGET_ARCH_ABI),arm64-v8a) + HAVE_LIGHTREC=1 +else ifeq ($(TARGET_ARCH_ABI),x86_64) + HAVE_LIGHTREC=1 +else ifeq ($(TARGET_ARCH_ABI),x86) + HAVE_LIGHTREC=1 +else + COREFLAGS += -DDRC_DISABLE +endif -ifeq ($(TARGET_ARCH),arm) - SOURCES_ASM := $(CORE_DIR)/gte_arm.S \ +ifeq ($(HAVE_ARI64),1) + COREFLAGS += -DNEW_DYNAREC + SOURCES_ASM += $(CORE_DIR)/gte_arm.S \ $(SPU_DIR)/arm_utils.S \ $(DYNAREC_DIR)/arm/linkage_arm.S SOURCES_C += $(DYNAREC_DIR)/new_dynarec.c \ $(DYNAREC_DIR)/backends/psx/pcsxmem.c -else - COREFLAGS += -DDRC_DISABLE - SOURCES_ASM := endif +ifeq ($(HAVE_LIGHTREC),1) + COREFLAGS += -DLIGHTREC -DLIGHTREC_STATIC + EXTRA_INCLUDES += $(DEPS_DIR)/lightning/include \ + $(DEPS_DIR)/lightrec + SOURCES_C += $(DEPS_DIR)/lightrec/blockcache.c \ + $(DEPS_DIR)/lightrec/disassembler.c \ + $(DEPS_DIR)/lightrec/emitter.c \ + $(DEPS_DIR)/lightrec/interpreter.c \ + $(DEPS_DIR)/lightrec/lightrec.c \ + $(DEPS_DIR)/lightrec/memmanager.c \ + $(DEPS_DIR)/lightrec/optimizer.c \ + $(DEPS_DIR)/lightrec/regcache.c \ + $(DEPS_DIR)/lightrec/recompiler.c + SOURCES_C += $(DEPS_DIR)/lightning/lib/jit_disasm.c \ + $(DEPS_DIR)/lightning/lib/jit_memory.c \ + $(DEPS_DIR)/lightning/lib/jit_names.c \ + $(DEPS_DIR)/lightning/lib/jit_note.c \ + $(DEPS_DIR)/lightning/lib/jit_print.c \ + $(DEPS_DIR)/lightning/lib/jit_size.c \ + $(DEPS_DIR)/lightning/lib/lightning.c + SOURCES_C += $(CORE_DIR)/lightrec/plugin.c +endif + + ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) - COREFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP + COREFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP -DGPU_NEON SOURCES_ASM += $(CORE_DIR)/gte_neon.S \ $(NEON_DIR)/psx_gpu/psx_gpu_arm_neon.S \ $(FRONTEND_DIR)/cspace_neon.S SOURCES_C += $(NEON_DIR)/psx_gpu_if.c + SOURCES_C += $(DYNAREC_DIR)/backends/psx/emu_if.c else ifeq ($(TARGET_ARCH_ABI),armeabi) + COREFLAGS += -DUSE_GPULIB=1 -DGPU_UNAI + COREFLAGS += -DINLINE="static __inline__" -Dasm="__asm__ __volatile__" SOURCES_ASM += $(UNAI_DIR)/gpu_arm.S \ $(FRONTEND_DIR)/cspace_arm.S SOURCES_C += $(UNAI_DIR)/gpulib_if.cpp else + COREFLAGS += -DUSE_GPULIB=1 -DGPU_UNAI + COREFLAGS += -DINLINE="static __inline__" -Dasm="__asm__ __volatile__" SOURCES_C += $(UNAI_DIR)/gpulib_if.cpp endif @@ -155,6 +200,8 @@ LOCAL_SRC_FILES := $(SOURCES_C) $(SOURCES_ASM) LOCAL_CFLAGS := $(COREFLAGS) LOCAL_C_INCLUDES := $(ROOT_DIR)/include LOCAL_C_INCLUDES += $(DEPS_DIR)/crypto $(DEPS_DIR)/flac-1.3.2/include $(DEPS_DIR)/flac-1.3.2/src/libFLAC/include $(DEPS_DIR)/lzma-16.04/C $(DEPS_DIR)/libchdr +LOCAL_C_INCLUDES += $(LIBRETRO_COMMON)/include +LOCAL_C_INCLUDES += $(EXTRA_INCLUDES) LOCAL_LDFLAGS := -Wl,-version-script=$(FRONTEND_DIR)/link.T LOCAL_LDLIBS := -lz -llog LOCAL_ARM_MODE := arm