From 5f9901e09806c5d5e2010fa81326b5b120b80432 Mon Sep 17 00:00:00 2001 From: kub Date: Mon, 25 Mar 2024 18:49:19 +0100 Subject: [PATCH] libretro, add Pico pad overlay and storyware pages handling --- Makefile | 2 + Makefile.libretro | 1 + jni/Android.mk | 11 + .../libretro/libretro-common/file/file_path.c | 768 +++++----- .../libretro-common/file/file_path_io.c | 149 ++ .../libretro-common/formats/png/rpng.c | 1251 +++++++++++++++++ .../formats/png/rpng_internal.h | 49 + .../libretro-common/include/file/file_path.h | 332 +++-- .../libretro-common/include/filters.h | 103 ++ .../libretro-common/include/formats/image.h | 102 ++ .../libretro-common/include/formats/rpng.h | 64 + .../libretro-common/include/retro_math.h | 190 +++ .../include/streams/trans_stream.h | 106 ++ .../libretro-common/streams/trans_stream.c | 92 ++ .../streams/trans_stream_pipe.c | 111 ++ .../streams/trans_stream_zlib.c | 330 +++++ platform/libretro/libretro.c | 231 ++- 17 files changed, 3415 insertions(+), 477 deletions(-) create mode 100644 platform/libretro/libretro-common/file/file_path_io.c create mode 100644 platform/libretro/libretro-common/formats/png/rpng.c create mode 100644 platform/libretro/libretro-common/formats/png/rpng_internal.h create mode 100644 platform/libretro/libretro-common/include/filters.h create mode 100644 platform/libretro/libretro-common/include/formats/image.h create mode 100644 platform/libretro/libretro-common/include/formats/rpng.h create mode 100644 platform/libretro/libretro-common/include/retro_math.h create mode 100644 platform/libretro/libretro-common/include/streams/trans_stream.h create mode 100644 platform/libretro/libretro-common/streams/trans_stream.c create mode 100644 platform/libretro/libretro-common/streams/trans_stream_pipe.c create mode 100644 platform/libretro/libretro-common/streams/trans_stream_zlib.c diff --git a/Makefile b/Makefile index 3fe87cbe..7b87043e 100644 --- a/Makefile +++ b/Makefile @@ -72,8 +72,10 @@ CFLAGS += $(call chkCCflag, -fno-caller-saves -fno-guess-branch-probability -fno CFLAGS += $(call chkCCflag, -fno-tree-loop-if-convert -fipa-pta -fno-ipa-cp) endif else +ifneq ($(STATIC_LINKING), 1) CFLAGS += $(call chkCCflag, -flto) endif +endif # revision info from repository if this not a tagged release ifeq "$(shell git describe --tags --exact-match HEAD 2>/dev/null)" "" diff --git a/Makefile.libretro b/Makefile.libretro index d849be81..9a2e2ebb 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -30,6 +30,7 @@ CFLAGS ?= CFLAGS += -I platform/libretro/libretro-common/include CFLAGS += -I platform/libretro/libretro-common/include/compat CFLAGS += -I platform/libretro/libretro-common/include/encodings +CFLAGS += -I platform/libretro/libretro-common/include/formats CFLAGS += -I platform/libretro/libretro-common/include/streams CFLAGS += -I platform/libretro/libretro-common/include/string CFLAGS += -I platform/libretro/libretro-common/include/vfs diff --git a/jni/Android.mk b/jni/Android.mk index f89e1324..b4d0143c 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -54,7 +54,18 @@ endif include $(COMMON_DIR)/common.mak SOURCES_C := $(LIBRETRO_DIR)/libretro.c \ + $(LIBRETRO_COMM_DIR)/formats/png/rpng.c \ + $(LIBRETRO_COMM_DIR)/streams/trans_stream.c \ + $(LIBRETRO_COMM_DIR)/streams/trans_stream_pipe.c \ + $(LIBRETRO_COMM_DIR)/streams/trans_stream_zlib.c \ + $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ + $(LIBRETRO_COMM_DIR)/file/file_path.c \ + $(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \ + $(LIBRETRO_COMM_DIR)/time/rtime.c \ + $(LIBRETRO_COMM_DIR)/string/stdstring.c \ + $(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \ $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \ + $(LIBRETRO_COMM_DIR)/compat/compat_strl.c \ $(COMMON_DIR)/mp3.c \ $(COMMON_DIR)/mp3_sync.c \ $(COMMON_DIR)/mp3_dummy.c \ diff --git a/platform/libretro/libretro-common/file/file_path.c b/platform/libretro/libretro-common/file/file_path.c index 320c5a2d..c696ff04 100644 --- a/platform/libretro/libretro-common/file/file_path.c +++ b/platform/libretro/libretro-common/file/file_path.c @@ -24,13 +24,12 @@ #include #include #include -#include +#include #include #include #include -#include #include #include #include