aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2023-01-08 21:53:44 +0000
committerneonloop2023-01-08 21:53:44 +0000
commit22d451f5c51695194d7a67c468a449e49097a6d3 (patch)
treebb6d0901ef88d45d27b163d3ad8bd8eca1157673
parent6672461fd4911e04f9fd824186d27e26a160ab6d (diff)
downloadpicoarch-22d451f5c51695194d7a67c468a449e49097a6d3.tar.gz
picoarch-22d451f5c51695194d7a67c468a449e49097a6d3.tar.bz2
picoarch-22d451f5c51695194d7a67c468a449e49097a6d3.zip
Updates patches for latest upstream changes
-rw-r--r--patches/pcsx_rearmed/0001-audio-frameskip.patch197
-rw-r--r--patches/pcsx_rearmed/1000-trimui-support.patch56
-rw-r--r--patches/smsplus-gx/1000-trimui-build.patch6
3 files changed, 31 insertions, 228 deletions
diff --git a/patches/pcsx_rearmed/0001-audio-frameskip.patch b/patches/pcsx_rearmed/0001-audio-frameskip.patch
deleted file mode 100644
index e4160c7..0000000
--- a/patches/pcsx_rearmed/0001-audio-frameskip.patch
+++ /dev/null
@@ -1,197 +0,0 @@
-diff --git a/frontend/libretro.c b/frontend/libretro.c
-index 650676f..0243fa0 100644
---- a/frontend/libretro.c
-+++ b/frontend/libretro.c
-@@ -96,17 +96,25 @@ static int show_advanced_gpu_unai_settings = -1;
- static int show_other_input_settings = -1;
- static float mouse_sensitivity = 1.0f;
-
--unsigned frameskip_type = 0;
--unsigned frameskip_threshold = 0;
--unsigned frameskip_counter = 0;
--unsigned frameskip_interval = 0;
-+typedef enum
-+{
-+ FRAMESKIP_NONE = 0,
-+ FRAMESKIP_AUTO,
-+ FRAMESKIP_AUTO_THRESHOLD,
-+ FRAMESKIP_FIXED_INTERVAL
-+} frameskip_type_t;
-+
-+static unsigned frameskip_type = FRAMESKIP_NONE;
-+static unsigned frameskip_threshold = 0;
-+static unsigned frameskip_interval = 0;
-+static unsigned frameskip_counter = 0;
-
--int retro_audio_buff_active = false;
--unsigned retro_audio_buff_occupancy = 0;
--int retro_audio_buff_underrun = false;
-+static int retro_audio_buff_active = false;
-+static unsigned retro_audio_buff_occupancy = 0;
-+static int retro_audio_buff_underrun = false;
-
--unsigned retro_audio_latency = 0;
--int update_audio_latency = false;
-+static unsigned retro_audio_latency = 0;
-+static int update_audio_latency = false;
-
- static unsigned previous_width = 0;
- static unsigned previous_height = 0;
-@@ -1217,20 +1225,33 @@ static void retro_audio_buff_status_cb(
-
- static void retro_set_audio_buff_status_cb(void)
- {
-- if (frameskip_type > 0)
-+ if (frameskip_type == FRAMESKIP_NONE)
- {
-- struct retro_audio_buffer_status_callback buf_status_cb;
-+ environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK, NULL);
-+ retro_audio_latency = 0;
-+ }
-+ else
-+ {
-+ bool calculate_audio_latency = true;
-
-- buf_status_cb.callback = retro_audio_buff_status_cb;
-- if (!environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK,
-- &buf_status_cb))
-+ if (frameskip_type == FRAMESKIP_FIXED_INTERVAL)
-+ environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK, NULL);
-+ else
- {
-- retro_audio_buff_active = false;
-- retro_audio_buff_occupancy = 0;
-- retro_audio_buff_underrun = false;
-- retro_audio_latency = 0;
-+ struct retro_audio_buffer_status_callback buf_status_cb;
-+ buf_status_cb.callback = retro_audio_buff_status_cb;
-+ if (!environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK,
-+ &buf_status_cb))
-+ {
-+ retro_audio_buff_active = false;
-+ retro_audio_buff_occupancy = 0;
-+ retro_audio_buff_underrun = false;
-+ retro_audio_latency = 0;
-+ calculate_audio_latency = false;
-+ }
- }
-- else
-+
-+ if (calculate_audio_latency)
- {
- /* Frameskip is enabled - increase frontend
- * audio latency to minimise potential
-@@ -1244,13 +1265,9 @@ static void retro_set_audio_buff_status_cb(void)
- retro_audio_latency = (retro_audio_latency + 0x1F) & ~0x1F;
- }
- }
-- else
-- {
-- environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK, NULL);
-- retro_audio_latency = 0;
-- }
-
- update_audio_latency = true;
-+ frameskip_counter = 0;
- }
-
- static void update_variables(bool in_flight);
-@@ -1535,23 +1552,23 @@ static void update_variables(bool in_flight)
- #ifdef GPU_PEOPS
- int gpu_peops_fix = 0;
- #endif
-- unsigned prev_frameskip_type;
-+ frameskip_type_t prev_frameskip_type;
-
- var.key = "pcsx_rearmed_frameskip_type";
- var.value = NULL;
-
- prev_frameskip_type = frameskip_type;
-- frameskip_type = 0;
-+ frameskip_type = FRAMESKIP_NONE;
- pl_rearmed_cbs.frameskip = 0;
-
- if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
- {
- if (strcmp(var.value, "auto") == 0)
-- frameskip_type = 1;
-+ frameskip_type = FRAMESKIP_AUTO;
- if (strcmp(var.value, "auto_threshold") == 0)
-- frameskip_type = 2;
-+ frameskip_type = FRAMESKIP_AUTO_THRESHOLD;
- if (strcmp(var.value, "fixed_interval") == 0)
-- frameskip_type = 3;
-+ frameskip_type = FRAMESKIP_FIXED_INTERVAL;
- }
-
- if (frameskip_type != 0)
-@@ -2639,23 +2656,23 @@ void retro_run(void)
- * be skipped */
- pl_rearmed_cbs.fskip_force = 0;
- pl_rearmed_cbs.fskip_dirty = 0;
-- if ((frameskip_type > 0) && retro_audio_buff_active)
-+
-+ if (frameskip_type != FRAMESKIP_NONE)
- {
-- bool skip_frame;
-+ bool skip_frame = false;
-
- switch (frameskip_type)
- {
-- case 1: /* auto */
-- skip_frame = retro_audio_buff_underrun;
-+ case FRAMESKIP_AUTO:
-+ skip_frame = retro_audio_buff_active && retro_audio_buff_underrun;
- break;
-- case 2: /* threshold */
-- skip_frame = (retro_audio_buff_occupancy < frameskip_threshold);
-+ case FRAMESKIP_AUTO_THRESHOLD:
-+ skip_frame = retro_audio_buff_active && (retro_audio_buff_occupancy < frameskip_threshold);
- break;
-- case 3: /* fixed */
-+ case FRAMESKIP_FIXED_INTERVAL:
- skip_frame = true;
- break;
- default:
-- skip_frame = false;
- break;
- }
-
-@@ -3005,8 +3022,9 @@ void retro_deinit(void)
- /* Have to reset disks struct, otherwise
- * fnames/flabels will leak memory */
- disk_init();
-- frameskip_type = 0;
-+ frameskip_type = FRAMESKIP_NONE;
- frameskip_threshold = 0;
-+ frameskip_interval = 0;
- frameskip_counter = 0;
- retro_audio_buff_active = false;
- retro_audio_buff_occupancy = 0;
-diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h
-index 9045791..9188f8b 100644
---- a/frontend/libretro_core_options.h
-+++ b/frontend/libretro_core_options.h
-@@ -105,7 +105,7 @@ struct retro_core_option_definition option_defs_us[] = {
- { "10", NULL },
- { NULL, NULL },
- },
-- "1"
-+ "3"
- },
- {
- "pcsx_rearmed_bios",
-diff --git a/frontend/main.c b/frontend/main.c
-index bf682ee..05c0f9e 100644
---- a/frontend/main.c
-+++ b/frontend/main.c
-@@ -156,7 +156,9 @@ void emu_set_default_config(void)
- #if defined(HAVE_PRE_ARMV7) && !defined(_3DS) /* XXX GPH hack */
- spu_config.iUseReverb = 0;
- spu_config.iUseInterpolation = 0;
-+#ifndef(_MIYOO)
- spu_config.iTempo = 1;
-+#endif
- #endif
- new_dynarec_hacks = 0;
- cycle_multiplier = 200;
diff --git a/patches/pcsx_rearmed/1000-trimui-support.patch b/patches/pcsx_rearmed/1000-trimui-support.patch
index 8d20c24..3076723 100644
--- a/patches/pcsx_rearmed/1000-trimui-support.patch
+++ b/patches/pcsx_rearmed/1000-trimui-support.patch
@@ -1,5 +1,5 @@
diff --git a/Makefile b/Makefile
-index a01c4df..3d08eea 100644
+index e694818..f0a1ba0 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,8 @@ TARGET ?= pcsx
@@ -12,10 +12,10 @@ index a01c4df..3d08eea 100644
ifeq ($(platform), $(filter $(platform), vita ctr))
CFLAGS += -O3 -DNDEBUG
diff --git a/Makefile.libretro b/Makefile.libretro
-index 1ecd359..432d700 100644
+index 7b9618e..6baefbd 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
-@@ -347,6 +347,27 @@ else ifeq ($(platform), rpi4_64)
+@@ -391,6 +391,27 @@ else ifeq ($(platform), rpi4_64)
fpic := -fPIC
CFLAGS += -march=armv8-a+crc+simd -mtune=cortex-a72 -ftree-vectorize
@@ -43,7 +43,7 @@ index 1ecd359..432d700 100644
# Classic Platforms ####################
# Platform affix = classic_<ISA>_<µARCH>
# Help at https://modmyclassic.com/comp
-@@ -459,6 +480,13 @@ CFLAGS += $(fpic)
+@@ -516,6 +537,13 @@ CFLAGS += $(fpic)
MAIN_LDFLAGS += -shared
MAIN_LDLIBS += $(LIBPTHREAD) $(LIBM) $(LIBDL) $(LIBZ)
@@ -58,41 +58,32 @@ index 1ecd359..432d700 100644
ifeq ($(shell $(CC) -E -dD $(CFLAGS) include/arm_features.h | grep __SIZEOF_LONG__ | awk '{print $$3}'),4)
CFLAGS += -D_FILE_OFFSET_BITS=64
diff --git a/frontend/libretro.c b/frontend/libretro.c
-index f3e3c2b..8497459 100644
+index 3e74b23..b4a8385 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
-@@ -2944,7 +2944,7 @@ void retro_init(void)
+@@ -3034,7 +3034,7 @@ void retro_init(void)
* we have to do this because cache misses and some IO penalties
* are not emulated. Warning: changing this may break compatibility. */
- cycle_multiplier = 175;
+ Config.cycle_multiplier = CYCLE_MULT_DEFAULT;
-#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
+#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI)
- cycle_multiplier = 200;
+ Config.cycle_multiplier = 200;
#endif
pl_rearmed_cbs.gpu_peops.iUseDither = 1;
diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h
-index a1b85d4..775ac58 100644
+index 58e1b72..4d6ae43 100644
--- a/frontend/libretro_core_options.h
+++ b/frontend/libretro_core_options.h
-@@ -516,7 +516,7 @@ struct retro_core_option_definition option_defs_us[] = {
- { "enabled", NULL },
- { NULL, NULL },
- },
--#if defined HAVE_LIBNX || defined _3DS
-+#if defined HAVE_LIBNX || defined _3DS || defined _TRIMUI
- "disabled",
- #else
- "enabled",
-@@ -541,7 +541,7 @@ struct retro_core_option_definition option_defs_us[] = {
- {
- "pcsx_rearmed_psxclock",
- "PSX CPU Clock",
+@@ -206,7 +206,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
+ #if defined(LIGHTREC)
+ " Currently doesn't work with Lightrec dynarec."
+ #endif
-#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
+#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI)
- "Overclock or underclock the PSX clock. Default is 50",
+ " Default is 50."
#else
- "Overclock or underclock the PSX clock. Default is 57",
-@@ -620,7 +620,7 @@ struct retro_core_option_definition option_defs_us[] = {
+ " Default is 57."
+@@ -288,7 +288,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
{ "100", NULL },
{ NULL, NULL },
},
@@ -101,11 +92,20 @@ index a1b85d4..775ac58 100644
"50",
#else
"57",
+@@ -306,7 +306,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
+ { "enabled", NULL },
+ { NULL, NULL },
+ },
+-#if defined HAVE_LIBNX || defined _3DS
++#if defined HAVE_LIBNX || defined _3DS || defined _TRIMUI
+ "disabled",
+ #else
+ "enabled",
diff --git a/frontend/main.c b/frontend/main.c
-index d3c7d40..7610146 100644
+index fbff0f5..3b2abe4 100644
--- a/frontend/main.c
+++ b/frontend/main.c
-@@ -154,6 +154,6 @@ void emu_set_default_config(void)
+@@ -164,7 +164,7 @@ void emu_set_default_config(void)
spu_config.iVolume = 768;
spu_config.iTempo = 0;
spu_config.iUseThread = 1; // no effect if only 1 core is detected
@@ -113,4 +113,4 @@ index d3c7d40..7610146 100644
+#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) && !defined(_TRIMUI) /* XXX GPH hack */
spu_config.iUseReverb = 0;
spu_config.iUseInterpolation = 0;
-#ifndef(_MIYOO)
+ #ifndef HAVE_LIBRETRO
diff --git a/patches/smsplus-gx/1000-trimui-build.patch b/patches/smsplus-gx/1000-trimui-build.patch
index 2d42b2f..7fc43b0 100644
--- a/patches/smsplus-gx/1000-trimui-build.patch
+++ b/patches/smsplus-gx/1000-trimui-build.patch
@@ -1,11 +1,11 @@
diff --git a/Makefile.libretro b/Makefile.libretro
-index e4575bc..7f96e07 100644
+index 5e52c65..db2761a 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -327,7 +327,21 @@ else ifeq ($(platform), miyoo)
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
CFLAGS += -ffast-math -march=armv5te -mtune=arm926ej-s -fomit-frame-pointer
- ENDIANNESS_DEFINES += -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -DALIGN_LONG
+ ENDIANNESS_DEFINES += -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -DALIGN_DWORD
-
+
+else ifeq ($(platform), trimui)
@@ -20,7 +20,7 @@ index e4575bc..7f96e07 100644
+ ifeq (,$(DEBUG))
+ LDFLAGS += -s
+ endif
-+ ENDIANNESS_DEFINES += -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -DALIGN_LONG
++ ENDIANNESS_DEFINES += -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -DALIGN_DWORD
+
# else ifneq (,$(findstring armv,$(platform)))
# TARGET := $(TARGET_NAME)_libretro.so