Add CHD support for Android
authorretro-wertz <retro-wertz@users.noreply.github.com>
Thu, 16 May 2019 00:44:30 +0000 (08:44 +0800)
committerretro-wertz <retro-wertz@users.noreply.github.com>
Thu, 16 May 2019 00:44:30 +0000 (08:44 +0800)
- and buildfix

jni/Android.mk

index 756f54c..f48674c 100644 (file)
@@ -14,6 +14,7 @@ FRONTEND_DIR := $(ROOT_DIR)/frontend
 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
 
 # core
 SOURCES_C := $(CORE_DIR)/cdriso.c \
@@ -68,10 +69,55 @@ SOURCES_C += $(FRONTEND_DIR)/main.c \
              $(FRONTEND_DIR)/cspace.c \
              $(FRONTEND_DIR)/libretro.c
 
+# libchdr
+SOURCES_C += \
+             $(DEPS_DIR)/crypto/md5.c \
+             $(DEPS_DIR)/crypto/sha1.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/bitmath.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/bitreader.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/cpu.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/crc.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/fixed.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/fixed_intrin_sse2.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/fixed_intrin_ssse3.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/float.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/format.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_avx2.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_sse2.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_sse41.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/lpc_intrin_sse.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/md5.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/memory.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/metadata_iterators.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/metadata_object.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/stream_decoder.c \
+             $(DEPS_DIR)/flac-1.3.2/src/libFLAC/window.c \
+             $(DEPS_DIR)/lzma-16.04/C/Alloc.c \
+             $(DEPS_DIR)/lzma-16.04/C/Bra86.c \
+             $(DEPS_DIR)/lzma-16.04/C/Bra.c \
+             $(DEPS_DIR)/lzma-16.04/C/BraIA64.c \
+             $(DEPS_DIR)/lzma-16.04/C/CpuArch.c \
+             $(DEPS_DIR)/lzma-16.04/C/Delta.c \
+             $(DEPS_DIR)/lzma-16.04/C/LzFind.c \
+             $(DEPS_DIR)/lzma-16.04/C/Lzma86Dec.c \
+             $(DEPS_DIR)/lzma-16.04/C/Lzma86Enc.c \
+             $(DEPS_DIR)/lzma-16.04/C/LzmaDec.c \
+             $(DEPS_DIR)/lzma-16.04/C/LzmaEnc.c \
+             $(DEPS_DIR)/lzma-16.04/C/LzmaLib.c \
+             $(DEPS_DIR)/lzma-16.04/C/Sort.c \
+             $(DEPS_DIR)/libchdr/bitstream.c \
+             $(DEPS_DIR)/libchdr/cdrom.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
 
 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
+
 
 ifeq ($(TARGET_ARCH),arm)
   SOURCES_ASM := $(CORE_DIR)/gte_arm.S \
@@ -108,6 +154,7 @@ LOCAL_MODULE        := retro
 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_LDFLAGS       := -Wl,-version-script=$(FRONTEND_DIR)/link.T
 LOCAL_LDLIBS        := -lz -llog
 LOCAL_ARM_MODE      := arm