From 6c13b5b29d66f7b0a48a4efc543170ab7503d68c Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 20 Oct 2024 03:04:51 +0300 Subject: [PATCH] update Android.mk no idea if it compiles a working library though... --- Makefile | 1 - frontend/libretro-extern.T | 25 +++++++++++++++++++++++++ jni/Android.mk | 27 +++++++++++++++++++++------ 3 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 frontend/libretro-extern.T diff --git a/Makefile b/Makefile index d269bb0c..7f95fe4a 100644 --- a/Makefile +++ b/Makefile @@ -484,7 +484,6 @@ endif clean: $(PLAT_CLEAN) clean_plugins $(RM) $(TARGET) *.o $(OBJS) $(TARGET).map frontend/revision.h - $(RM) frontend/libretro-extern.T ifneq ($(PLUGINS),) plugins_: $(PLUGINS) diff --git a/frontend/libretro-extern.T b/frontend/libretro-extern.T new file mode 100644 index 00000000..22555b32 --- /dev/null +++ b/frontend/libretro-extern.T @@ -0,0 +1,25 @@ +EXTERN(retro_api_version) +EXTERN(retro_cheat_reset) +EXTERN(retro_cheat_set) +EXTERN(retro_deinit) +EXTERN(retro_get_memory_data) +EXTERN(retro_get_memory_size) +EXTERN(retro_get_region) +EXTERN(retro_get_system_av_info) +EXTERN(retro_get_system_info) +EXTERN(retro_init) +EXTERN(retro_load_game) +EXTERN(retro_load_game_special) +EXTERN(retro_reset) +EXTERN(retro_run) +EXTERN(retro_serialize) +EXTERN(retro_serialize_size) +EXTERN(retro_set_audio_sample) +EXTERN(retro_set_audio_sample_batch) +EXTERN(retro_set_controller_port_device) +EXTERN(retro_set_environment) +EXTERN(retro_set_input_poll) +EXTERN(retro_set_input_state) +EXTERN(retro_set_video_refresh) +EXTERN(retro_unload_game) +EXTERN(retro_unserialize) diff --git a/jni/Android.mk b/jni/Android.mk index 27459da8..eeafc4ec 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -6,6 +6,8 @@ $(shell cd "$(LOCAL_PATH)" && (rm ../frontend/revision.h_)) USE_LIBRETRO_VFS ?= 0 USE_ASYNC_CDROM ?= 1 +USE_RTHREADS ?= 0 +NDRC_THREAD ?= 1 ROOT_DIR := $(LOCAL_PATH)/.. CORE_DIR := $(ROOT_DIR)/libpcsxcore @@ -122,13 +124,9 @@ SOURCES_C += \ $(LIBRETRO_COMMON)/vfs/vfs_implementation.c COREFLAGS += -DUSE_LIBRETRO_VFS endif -ifeq ($(USE_ASYNC_CDROM),1) -SOURCES_C += \ - $(FRONTEND_DIR)/libretro-rthreads.c -COREFLAGS += -DUSE_ASYNC_CDROM -endif EXTRA_INCLUDES += $(LIBRETRO_COMMON)/include +USE_RTHREADS=0 HAVE_ARI64=0 HAVE_LIGHTREC=0 LIGHTREC_CUSTOM_MAP=0 @@ -164,6 +162,10 @@ ifeq ($(HAVE_ARI64),1) $(SPU_DIR)/arm_utils.S \ $(DYNAREC_DIR)/linkage_arm.S endif + ifeq ($(NDRC_THREAD),1) + COREFLAGS += -DNDRC_THREAD + USE_RTHREADS := 1 + endif endif SOURCES_C += $(DYNAREC_DIR)/emu_if.c @@ -223,6 +225,17 @@ else SOURCES_C += $(PEOPS_DIR)/gpulib_if.c endif +ifeq ($(USE_ASYNC_CDROM),1) +COREFLAGS += -DUSE_ASYNC_CDROM +USE_RTHREADS := 1 +endif +ifeq ($(USE_RTHREADS),1) +SOURCES_C += \ + $(FRONTEND_DIR)/libretro-rthreads.c \ + $(LIBRETRO_COMMON)/features/features_cpu.c +COREFLAGS += -DHAVE_RTHREADS +endif + GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" ifneq ($(GIT_VERSION)," unknown") COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" @@ -235,7 +248,9 @@ LOCAL_CFLAGS := $(COREFLAGS) LOCAL_C_INCLUDES := $(ROOT_DIR)/include LOCAL_C_INCLUDES += $(DEPS_DIR)/crypto LOCAL_C_INCLUDES += $(EXTRA_INCLUDES) -LOCAL_LDFLAGS := -Wl,-version-script=$(FRONTEND_DIR)/libretro-version-script +LOCAL_LDFLAGS += -Wl,-version-script=$(FRONTEND_DIR)/libretro-version-script +LOCAL_LDFLAGS += -Wl,--script=$(FRONTEND_DIR)/libretro-extern.T +LOCAL_LDFLAGS += -Wl,--gc-sections LOCAL_LDLIBS := -lz -llog LOCAL_ARM_MODE := arm -- 2.39.5