diff options
author | neonloop | 2022-03-25 21:28:29 +0000 |
---|---|---|
committer | neonloop | 2022-03-25 21:28:29 +0000 |
commit | cb4df55984b07f4ca80a6fcf5ddda85cb9f540af (patch) | |
tree | af00c81dc9f3f7c829d3b0464271c713b2ebd04f /patches | |
parent | e506386fc683b18c2e25a27e8c3f7a220a92e5e1 (diff) | |
download | picoarch-cb4df55984b07f4ca80a6fcf5ddda85cb9f540af.tar.gz picoarch-cb4df55984b07f4ca80a6fcf5ddda85cb9f540af.tar.bz2 picoarch-cb4df55984b07f4ca80a6fcf5ddda85cb9f540af.zip |
Updates patches for upstream changes
Diffstat (limited to 'patches')
-rw-r--r-- | patches/fceumm/1000-trimui-build.patch | 23 | ||||
-rw-r--r-- | patches/gme/0001-fix-sample-size.patch | 26 | ||||
-rw-r--r-- | patches/mame2000/1000-trimui-build.patch | 10 | ||||
-rw-r--r-- | patches/pcsx_rearmed/0001-audio-frameskip.patch | 348 | ||||
-rw-r--r-- | patches/picodrive/1000-trimui-build.patch | 9 | ||||
-rw-r--r-- | patches/snes9x2002/1000-trimui-support.patch | 14 |
6 files changed, 27 insertions, 403 deletions
diff --git a/patches/fceumm/1000-trimui-build.patch b/patches/fceumm/1000-trimui-build.patch index 4d52559..63dc9ad 100644 --- a/patches/fceumm/1000-trimui-build.patch +++ b/patches/fceumm/1000-trimui-build.patch @@ -1,9 +1,9 @@ diff --git a/Makefile.libretro b/Makefile.libretro -index 2f2bb5a..493149f 100644 +index 036c608..4c1cc87 100644 --- a/Makefile.libretro +++ b/Makefile.libretro -@@ -445,6 +445,22 @@ else ifeq ($(platform), retrofw) - PLATFORM_DEFINES += -ffast-math -march=mips32 -mtune=mips32 -mhard-float -fomit-frame-pointer +@@ -461,6 +461,22 @@ else ifeq ($(platform), miyoo) + PLATFORM_DEFINES += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s EXTERNAL_ZLIB = 1 +# TRIMUI @@ -25,27 +25,24 @@ index 2f2bb5a..493149f 100644 # Windows MSVC 2017 all architectures else ifneq (,$(findstring windows_msvc2017,$(platform))) CC = cl.exe -@@ -708,10 +724,23 @@ else +@@ -715,8 +731,20 @@ else CFLAGS += -MT CXXFLAGS += -MT endif + ifneq (,$(OPTIMIZE)) -+ CFLAGS += $(OPTIMIZE) -+ CXXFLAGS += $(OPTIMIZE) ++ CFLAGS += $(OPTIMIZE) ++ CXXFLAGS += $(OPTIMIZE) + else CFLAGS += -O2 -DNDEBUG CXXFLAGS += -O2 -DNDEBUG + endif - endif - ++endif ++ +ifeq ($(PROFILE), GENERATE) + CFLAGS += -fprofile-generate=./profile/fceumm + LDFLAGS += -lgcov +else ifeq ($(PROFILE), APPLY) + CFLAGS += -fprofile-use -fprofile-dir=../profile/fceumm -fbranch-probabilities -+endif -+ -+ + endif + ifneq ($(SANITIZER),) - CFLAGS += -fsanitize=$(SANITIZER) - CXXFLAGS += -fsanitize=$(SANITIZER) diff --git a/patches/gme/0001-fix-sample-size.patch b/patches/gme/0001-fix-sample-size.patch deleted file mode 100644 index 27cc6b1..0000000 --- a/patches/gme/0001-fix-sample-size.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/libretro.c b/src/libretro.c -index 1e2b37f..d393a5a 100644 ---- a/src/libretro.c -+++ b/src/libretro.c -@@ -180,7 +180,7 @@ void retro_run(void) - draw_ui();
- video_cb(framebuffer->pixel_data, framebuffer->width, framebuffer->height, framebuffer->bytes_per_pixel * framebuffer->width);
- //audio handling
-- audio_batch_cb(play(),1470);
-+ audio_batch_cb(play(),735);
- }
-
- // File Loading
-diff --git a/src/player.c b/src/player.c -index 1daf980..e7c69be 100644 ---- a/src/player.c -+++ b/src/player.c -@@ -86,7 +86,7 @@ short *play(void) - is_playing_ = false;
- }
- else
-- gme_play( emu, 2048, audio_buffer );
-+ gme_play( emu, 1470, audio_buffer );
- }
- else
- memset(audio_buffer,0,8192 * sizeof(short));
diff --git a/patches/mame2000/1000-trimui-build.patch b/patches/mame2000/1000-trimui-build.patch index 6368afc..04109b4 100644 --- a/patches/mame2000/1000-trimui-build.patch +++ b/patches/mame2000/1000-trimui-build.patch @@ -1,10 +1,10 @@ diff --git a/Makefile b/Makefile -index 8112d85..8f3555e 100644 +index 4cec012..95e2497 100644 --- a/Makefile +++ b/Makefile -@@ -321,6 +321,26 @@ else ifeq ($(platform), gcw0) - DISABLE_ERROR_LOGGING := 1 - CFLAGS += -march=mips32 -mtune=mips32r2 -mhard-float +@@ -335,6 +335,26 @@ else ifeq ($(platform), miyoo) + USE_CYCLONE = 1 + USE_DRZ80 = 1 +# Trimui +else ifeq ($(platform), trimui) @@ -29,7 +29,7 @@ index 8112d85..8f3555e 100644 # Windows MSVC 2010 x64 else ifeq ($(platform), windows_msvc2010_x64) CC = cl.exe -@@ -508,6 +528,8 @@ endif +@@ -522,6 +542,8 @@ endif ifeq ($(DEBUG), 1) CFLAGS += -O0 -g diff --git a/patches/pcsx_rearmed/0001-audio-frameskip.patch b/patches/pcsx_rearmed/0001-audio-frameskip.patch deleted file mode 100644 index fb2f08c..0000000 --- a/patches/pcsx_rearmed/0001-audio-frameskip.patch +++ /dev/null @@ -1,348 +0,0 @@ -diff --git a/frontend/libretro.c b/frontend/libretro.c -index 59e986e..f3e3c2b 100644 ---- a/frontend/libretro.c -+++ b/frontend/libretro.c -@@ -96,6 +96,18 @@ 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; -+ -+int retro_audio_buff_active = false; -+unsigned retro_audio_buff_occupancy = 0; -+int retro_audio_buff_underrun = false; -+ -+unsigned retro_audio_latency = 0; -+int update_audio_latency = false; -+ - static unsigned previous_width = 0; - static unsigned previous_height = 0; - -@@ -1195,6 +1207,52 @@ static void set_retro_memmap(void) - #endif - } - -+static void retro_audio_buff_status_cb( -+ bool active, unsigned occupancy, bool underrun_likely) -+{ -+ retro_audio_buff_active = active; -+ retro_audio_buff_occupancy = occupancy; -+ retro_audio_buff_underrun = underrun_likely; -+} -+ -+static void retro_set_audio_buff_status_cb(void) -+{ -+ if (frameskip_type > 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; -+ } -+ else -+ { -+ /* Frameskip is enabled - increase frontend -+ * audio latency to minimise potential -+ * buffer underruns */ -+ uint32_t frame_time_usec = 1000000.0 / (is_pal_mode ? 50.0 : 60.0); -+ -+ /* Set latency to 6x current frame time... */ -+ retro_audio_latency = (unsigned)(6 * frame_time_usec / 1000); -+ -+ /* ...then round up to nearest multiple of 32 */ -+ 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; -+} -+ - static void update_variables(bool in_flight); - bool retro_load_game(const struct retro_game_info *info) - { -@@ -1408,6 +1466,7 @@ bool retro_load_game(const struct retro_game_info *info) - emu_on_new_cd(0); - - set_retro_memmap(); -+ retro_set_audio_buff_status_cb(); - - return true; - } -@@ -1478,11 +1537,43 @@ static void update_variables(bool in_flight) - #ifdef GPU_PEOPS - int gpu_peops_fix = 0; - #endif -+ unsigned prev_frameskip_type; -+ -+ var.key = "pcsx_rearmed_frameskip_type"; -+ var.value = NULL; -+ -+ prev_frameskip_type = frameskip_type; -+ frameskip_type = 0; -+ pl_rearmed_cbs.frameskip = 0; - -+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) -+ { -+ if (strcmp(var.value, "auto") == 0) -+ frameskip_type = 1; -+ if (strcmp(var.value, "auto_threshold") == 0) -+ frameskip_type = 2; -+ if (strcmp(var.value, "fixed_interval") == 0) -+ frameskip_type = 3; -+ } -+ -+ if (frameskip_type != 0) -+ pl_rearmed_cbs.frameskip = -1; -+ -+ var.key = "pcsx_rearmed_frameskip_threshold"; - var.value = NULL; -+ -+ frameskip_threshold = 30; -+ -+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) -+ frameskip_threshold = strtol(var.value, NULL, 10); -+ - var.key = "pcsx_rearmed_frameskip"; -+ var.value = NULL; -+ -+ frameskip_interval = 1; -+ - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) -- pl_rearmed_cbs.frameskip = atoi(var.value); -+ frameskip_interval = strtol(var.value, NULL, 10); - - var.value = NULL; - var.key = "pcsx_rearmed_region"; -@@ -2149,6 +2240,10 @@ static void update_variables(bool in_flight) - GPU_open(&gpuDisp, "PCSX", NULL); - } - -+ /* Reinitialise frameskipping, if required */ -+ if (((frameskip_type != prev_frameskip_type))) -+ retro_set_audio_buff_status_cb(); -+ - /* dfinput_activate(); */ - } - else -@@ -2521,6 +2616,46 @@ void retro_run(void) - - print_internal_fps(); - -+ /* Check whether current frame should -+ * be skipped */ -+ pl_rearmed_cbs.fskip_force = 0; -+ pl_rearmed_cbs.fskip_dirty = 0; -+ if ((frameskip_type > 0) && retro_audio_buff_active) -+ { -+ bool skip_frame; -+ -+ switch (frameskip_type) -+ { -+ case 1: /* auto */ -+ skip_frame = retro_audio_buff_underrun; -+ break; -+ case 2: /* threshold */ -+ skip_frame = (retro_audio_buff_occupancy < frameskip_threshold); -+ break; -+ case 3: /* fixed */ -+ skip_frame = true; -+ break; -+ default: -+ skip_frame = false; -+ break; -+ } -+ -+ if (skip_frame && frameskip_counter < frameskip_interval) -+ pl_rearmed_cbs.fskip_force = 1; -+ } -+ -+ /* If frameskip/timing settings have changed, -+ * update frontend audio latency -+ * > Can do this before or after the frameskip -+ * check, but doing it after means we at least -+ * retain the current frame's audio output */ -+ if (update_audio_latency) -+ { -+ environ_cb(RETRO_ENVIRONMENT_SET_MINIMUM_AUDIO_LATENCY, -+ &retro_audio_latency); -+ update_audio_latency = false; -+ } -+ - input_poll_cb(); - - update_input(); -@@ -2532,6 +2667,13 @@ void retro_run(void) - stop = 0; - psxCpu->Execute(); - -+ if (pl_rearmed_cbs.fskip_dirty == 1) { -+ if (frameskip_counter < frameskip_interval) -+ frameskip_counter++; -+ else if (frameskip_counter >= frameskip_interval || !pl_rearmed_cbs.fskip_force) -+ frameskip_counter = 0; -+ } -+ - video_cb((vout_fb_dirty || !vout_can_dupe || !duping_enable) ? vout_buf_ptr : NULL, - vout_width, vout_height, vout_width * 2); - vout_fb_dirty = 0; -@@ -2844,6 +2986,14 @@ void retro_deinit(void) - /* Have to reset disks struct, otherwise - * fnames/flabels will leak memory */ - disk_init(); -+ frameskip_type = 0; -+ frameskip_threshold = 0; -+ frameskip_counter = 0; -+ retro_audio_buff_active = false; -+ retro_audio_buff_occupancy = 0; -+ retro_audio_buff_underrun = false; -+ retro_audio_latency = 0; -+ update_audio_latency = false; - } - - #ifdef VITA -diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h -index 813e30a..a1b85d4 100644 ---- a/frontend/libretro_core_options.h -+++ b/frontend/libretro_core_options.h -@@ -51,17 +51,61 @@ extern "C" { - - struct retro_core_option_definition option_defs_us[] = { - { -- "pcsx_rearmed_frameskip", -+ "pcsx_rearmed_frameskip_type", - "Frameskip", -- "Choose how much frames should be skipped to improve performance at the expense of visual smoothness.", -+ "Skip frames to avoid audio buffer under-run (crackling). Improves performance at the expense of visual smoothness. 'Auto' skips frames when advised by the frontend. 'Auto (Threshold)' utilises the 'Frameskip Threshold (%)' setting. 'Fixed Interval' utilises the 'Frameskip Interval' setting.", - { -- { "0", NULL }, -- { "1", NULL }, -- { "2", NULL }, -- { "3", NULL }, -+ { "disabled", NULL }, -+ { "auto", "Auto" }, -+ { "auto_threshold", "Auto (Threshold)" }, -+ { "fixed_interval", "Fixed Interval" }, - { NULL, NULL }, - }, -- "0", -+ "disabled" -+ }, -+ { -+ "pcsx_rearmed_frameskip_threshold", -+ "Frameskip Threshold (%)", -+ "When 'Frameskip' is set to 'Auto (Threshold)', specifies the audio buffer occupancy threshold (percentage) below which frames will be skipped. Higher values reduce the risk of crackling by causing frames to be dropped more frequently.", -+ { -+ { "15", NULL }, -+ { "18", NULL }, -+ { "21", NULL }, -+ { "24", NULL }, -+ { "27", NULL }, -+ { "30", NULL }, -+ { "33", NULL }, -+ { "36", NULL }, -+ { "39", NULL }, -+ { "42", NULL }, -+ { "45", NULL }, -+ { "48", NULL }, -+ { "51", NULL }, -+ { "54", NULL }, -+ { "57", NULL }, -+ { "60", NULL }, -+ { NULL, NULL }, -+ }, -+ "33" -+ }, -+ { -+ "pcsx_rearmed_frameskip", -+ "Frameskip Interval", -+ "Specifies the maximum number of frames that can be skipped before a new frame is rendered.", -+ { -+ { "1", NULL }, -+ { "2", NULL }, -+ { "3", NULL }, -+ { "4", NULL }, -+ { "5", NULL }, -+ { "6", NULL }, -+ { "7", NULL }, -+ { "8", NULL }, -+ { "9", NULL }, -+ { "10", NULL }, -+ { NULL, NULL }, -+ }, -+ "1" - }, - { - "pcsx_rearmed_bios", -diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h -index 71dfcb5..7caa87c 100644 ---- a/frontend/plugin_lib.h -+++ b/frontend/plugin_lib.h -@@ -70,6 +70,8 @@ struct rearmed_cbs { - // gpu options - int frameskip; - int fskip_advice; -+ int fskip_force; -+ int fskip_dirty; - unsigned int *gpu_frame_count; - unsigned int *gpu_hcnt; - unsigned int flip_cnt; // increment manually if not using pl_vout_flip -diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c -index ed37b71..f89e52d 100644 ---- a/plugins/gpulib/gpu.c -+++ b/plugins/gpulib/gpu.c -@@ -90,6 +90,8 @@ static noinline void update_height(void) - - static noinline void decide_frameskip(void) - { -+ *gpu.frameskip.dirty = 1; -+ - if (gpu.frameskip.active) - gpu.frameskip.cnt++; - else { -@@ -97,7 +99,9 @@ static noinline void decide_frameskip(void) - gpu.frameskip.frame_ready = 1; - } - -- if (!gpu.frameskip.active && *gpu.frameskip.advice) -+ if (*gpu.frameskip.force) -+ gpu.frameskip.active = 1; -+ else if (!gpu.frameskip.active && *gpu.frameskip.advice) - gpu.frameskip.active = 1; - else if (gpu.frameskip.set > 0 && gpu.frameskip.cnt < gpu.frameskip.set) - gpu.frameskip.active = 1; -@@ -805,6 +809,8 @@ void GPUrearmedCallbacks(const struct rearmed_cbs *cbs) - { - gpu.frameskip.set = cbs->frameskip; - gpu.frameskip.advice = &cbs->fskip_advice; -+ gpu.frameskip.force = &cbs->fskip_force; -+ gpu.frameskip.dirty = &cbs->fskip_dirty; - gpu.frameskip.active = 0; - gpu.frameskip.frame_ready = 1; - gpu.state.hcnt = cbs->gpu_hcnt; -diff --git a/plugins/gpulib/gpu.h b/plugins/gpulib/gpu.h -index 64d2eec..d1a3a75 100644 ---- a/plugins/gpulib/gpu.h -+++ b/plugins/gpulib/gpu.h -@@ -90,6 +90,8 @@ struct psx_gpu { - uint32_t allow:1; - uint32_t frame_ready:1; - const int *advice; -+ const int *force; -+ int *dirty; - uint32_t last_flip_frame; - uint32_t pending_fill[3]; - } frameskip; diff --git a/patches/picodrive/1000-trimui-build.patch b/patches/picodrive/1000-trimui-build.patch index 6e21ae7..528019a 100644 --- a/patches/picodrive/1000-trimui-build.patch +++ b/patches/picodrive/1000-trimui-build.patch @@ -1,10 +1,10 @@ diff --git a/Makefile.libretro b/Makefile.libretro -index 919e0c1..e3bcd36 100644 +index 261be5b..5657784 100644 --- a/Makefile.libretro +++ b/Makefile.libretro -@@ -517,6 +517,23 @@ else ifeq ($(platform), miyoo) +@@ -505,7 +505,24 @@ else ifeq ($(platform), miyoo) + HAVE_ARMv6 = 0 LOW_MEMORY = 1 - NO_ARM_ASM = 1 +# TRIMUI +else ifeq ($(platform), trimui) @@ -26,7 +26,8 @@ index 919e0c1..e3bcd36 100644 # Windows MSVC 2017 all architectures else ifneq (,$(findstring windows_msvc2017,$(platform))) NO_GCC := 1 -@@ -720,6 +737,13 @@ else + +@@ -702,6 +719,13 @@ else endif endif diff --git a/patches/snes9x2002/1000-trimui-support.patch b/patches/snes9x2002/1000-trimui-support.patch index 1f7659d..f7084d0 100644 --- a/patches/snes9x2002/1000-trimui-support.patch +++ b/patches/snes9x2002/1000-trimui-support.patch @@ -1,10 +1,10 @@ diff --git a/Makefile b/Makefile -index e42d169..a1f8794 100644 +index a3ef5e2..a7ef5e4 100644 --- a/Makefile +++ b/Makefile -@@ -244,6 +244,23 @@ else ifeq ($(platform), gcw0) - CFLAGS += -fno-builtin -fno-exceptions - CFLAGS += -DPATH_MAX=256 -DFAST_LSB_WORD_ACCESS +@@ -258,6 +258,23 @@ else ifeq ($(platform), miyoo) + CFLAGS += -fomit-frame-pointer -ffast-math -fno-unroll-loops -flto -mcpu=arm926ej-s + CFLAGS += -DFAST_ALIGNED_LSB_WORD_ACCESS +else ifeq ($(platform), trimui) + TARGET := $(TARGET_NAME)_libretro.so @@ -26,7 +26,7 @@ index e42d169..a1f8794 100644 # Windows MSVC 2010 x64 else ifeq ($(platform), windows_msvc2010_x64) CC = cl.exe -@@ -381,12 +398,21 @@ LIBRETRO_DIR := ./libretro +@@ -395,12 +412,21 @@ LIBRETRO_DIR := ./libretro ifeq ($(DEBUG), 1) DEFINES += -O0 -g @@ -39,10 +39,10 @@ index e42d169..a1f8794 100644 endif +ifeq ($(PROFILE), GENERATE) -+ CFLAGS += -fprofile-generate=./profile/snes9x2002 ++ CFLAGS += -fprofile-generate=./profile/$(TARGET_NAME) + LDFLAGS += -lgcov +else ifeq ($(PROFILE), APPLY) -+ CFLAGS += -fprofile-use -fprofile-dir=../profile/snes9x2002 -fbranch-probabilities ++ CFLAGS += -fprofile-use -fprofile-dir=../profile/$(TARGET_NAME) -fbranch-probabilities +endif + ifneq (,$(findstring msvc,$(platform))) |