From 6fde958b00c798e8e7ea932112264ed496db439a 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 | 6 + Makefile.libretro | 1 + jni/Android.mk | 9 + .../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, 3417 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 cbed7900b..c5c877d7d 100644 --- a/Makefile +++ b/Makefile @@ -246,7 +246,13 @@ endif ifeq "$(PLATFORM)" "libretro" OBJS += platform/libretro/libretro.o ifneq ($(STATIC_LINKING), 1) +CFLAGS += -DHAVE_ZLIB OBJS += platform/libretro/libretro-common/compat/compat_strcasestr.o +OBJS += platform/libretro/libretro-common/file/file_path_io.o +OBJS += platform/libretro/libretro-common/formats/png/rpng.o +OBJS += platform/libretro/libretro-common/streams/trans_stream.o +OBJS += platform/libretro/libretro-common/streams/trans_stream_pipe.o +OBJS += platform/libretro/libretro-common/streams/trans_stream_zlib.o ifeq "$(USE_LIBRETRO_VFS)" "1" OBJS += platform/libretro/libretro-common/compat/compat_posix_string.o OBJS += platform/libretro/libretro-common/compat/compat_strl.o diff --git a/Makefile.libretro b/Makefile.libretro index d849be811..9a2e2ebb3 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 f89e1324b..afc62af86 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -55,6 +55,15 @@ include $(COMMON_DIR)/common.mak SOURCES_C := $(LIBRETRO_DIR)/libretro.c \ $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.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 \ $(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 320c5a2da..c696ff045 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