PKG/BOARD: update libretro-pcsx_rearmed & optimize (#160)

* PKG: libretro-pcsx_rearmed: 
- update to f49a4c
- new optimize patches (adjust core options)
- use D/L submodules
* BOARD: add musl PGO data for `libretro-pcsx_rearmed`
* BOARD: update uclibc PGO data `lr-pcsx_rearmed`
- and change from https to git site method
- rm dubious sed cmd

* PKG: lr-pcsx_rearmed: PATCH add Interlace mode
This commit is contained in:
Apaczer
2025-03-30 21:57:18 +02:00
committed by GitHub
parent a824a196be
commit 529bfbd43e
229 changed files with 229 additions and 4961 deletions

View File

@@ -0,0 +1,55 @@
From 74e0c8c8f675fc9e07a04e15960cbf1ac2f98997 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Thu, 13 Mar 2025 23:12:39 +0100
Subject: [PATCH] Makefile.libretro: add MIYOO optimize flags
with PGO instructions (no LTO cuz we target dynamic linking here), also reduce optimization to -O2 for profiler
---
Makefile.libretro | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/Makefile.libretro b/Makefile.libretro
index 2197946c..1b0f7a2e 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -607,13 +607,35 @@ else ifneq (,$(findstring armv,$(platform)))
else ifeq ($(platform), miyoo)
TARGET := $(TARGET_NAME)_libretro.so
- fpic := -fPIC
- CFLAGS += -mcpu=arm926ej-s -fsingle-precision-constant
+ LIBC ?= $(shell $(CC) -print-file-name=libc.so | grep -q musl && echo "musl" || echo "glibc")
+ifeq ($(LIBC),musl)
+ fpic := -fPIC # brakes otherwise shared object core when profiling with gcc
+else
+ fpic := -fno-PIC
+endif
+ CFLAGS += -mcpu=arm926ej-s -fsingle-precision-constant \
+ -O2 -fdata-sections -ffunction-sections -fsingle-precision-constant
CFLAGS += -DGPU_UNAI_USE_INT_DIV_MULTINV -D_MIYOO
+ CFLAGS += -fno-common -fno-ipa-cp -fno-caller-saves -fno-regmove -finline-limit=42 \
+ -fuse-linker-plugin \
+ -fno-stack-protector -fno-ident -fomit-frame-pointer \
+ -fno-unroll-loops -ffast-math \
+ -marm
+ CXXFLAGS += $(CFLAGS)
+ CPPFLAGS += $(CFLAGS)
+ ASFLAGS += $(CFLAGS)
+ THREAD_RENDERING := 1
ARCH = arm
BUILTIN_GPU = unai
DYNAREC = ari64
HAVE_NEON = 0
+ BASE_ADDR_DYNAMIC := 1
+ifeq ($(PROFILE), YES)
+ CFLAGS += -fprofile-generate=/mnt/profile # rm path if you want dir structure intact at runtime
+ LDFLAGS += -lgcov
+else ifeq ($(PROFILE), APPLY)
+ CFLAGS += -fprofile-use -fbranch-probabilities -Wno-error=coverage-mismatch
+endif
# Emscripten
else ifeq ($(platform), emscripten)
--
2.45.2.windows.1

View File

@@ -0,0 +1,100 @@
From 958a3a4c41917a61dbfb51c3d7e15266110f8a58 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Sat, 15 Mar 2025 13:56:30 +0100
Subject: [PATCH] LIBRETRO: update core_options
- add extra low CPU values (def 40)
- disable dithering
- enable fast_lighting
- enable frameskip (def: auto_threshold 60%)
---
frontend/libretro_core_options.h | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h
index 8c457582..8cb42c0e 100644
--- a/frontend/libretro_core_options.h
+++ b/frontend/libretro_core_options.h
@@ -233,13 +233,33 @@ struct retro_core_option_v2_definition option_defs_us[] = {
#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
" Default is 50."
#else
- " Default is 57."
+ " Default is 40."
#endif
,
NULL,
"system",
{
{ "auto", "Auto" },
+ { "10", NULL },
+ { "11", NULL },
+ { "12", NULL },
+ { "13", NULL },
+ { "14", NULL },
+ { "15", NULL },
+ { "16", NULL },
+ { "17", NULL },
+ { "18", NULL },
+ { "19", NULL },
+ { "20", NULL },
+ { "21", NULL },
+ { "22", NULL },
+ { "23", NULL },
+ { "24", NULL },
+ { "25", NULL },
+ { "26", NULL },
+ { "27", NULL },
+ { "28", NULL },
+ { "29", NULL },
{ "30", NULL },
{ "31", NULL },
{ "32", NULL },
@@ -313,7 +333,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
{ "100", NULL },
{ NULL, NULL },
},
- "auto",
+ "40",
},
{
"pcsx_rearmed_dithering",
@@ -328,7 +348,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
{ "force", "Force" },
{ NULL, NULL },
},
-#if defined(_3DS)
+#if defined(_3DS) || defined(_MIYOO)
"disabled",
#else
"enabled",
@@ -365,7 +385,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
{ "fixed_interval", "Fixed Interval" },
{ NULL, NULL },
},
- "disabled"
+ "auto_threshold"
},
{
"pcsx_rearmed_frameskip_threshold",
@@ -393,7 +413,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
{ "60", NULL },
{ NULL, NULL },
},
- "33"
+ "60"
},
{
"pcsx_rearmed_frameskip_interval",
@@ -793,7 +813,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
{ "enabled", NULL },
{ NULL, NULL},
},
- "disabled",
+ "enabled",
},
{
"pcsx_rearmed_gpu_unai_scale_hires",
--
2.45.2.windows.1

View File

@@ -1,44 +0,0 @@
diff --git a/Makefile.libretro b/Makefile.libretro
index 1169d892..6ea2dfd6 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -4,6 +4,7 @@ DEBUG ?= 0
WANT_ZLIB ?= 1
HAVE_CHD ?= 1
USE_LIBRETRO_VFS ?= 0
+PROFILE ?= 0
# Dynarec options: lightrec, ari64
DYNAREC ?= lightrec
@@ -532,13 +533,29 @@ else ifneq (,$(findstring armv,$(platform)))
else ifeq ($(platform), miyoo)
TARGET := $(TARGET_NAME)_libretro.so
- fpic := -fPIC
- CFLAGS += -mcpu=arm926ej-s -fsingle-precision-constant
+ fpic := -fno-PIC
+ CFLAGS += -mcpu=arm926ej-s -fsingle-precision-constant -Ofast -fdata-sections -ffunction-sections -fsingle-precision-constant
CFLAGS += -DGPU_UNAI_USE_INT_DIV_MULTINV -D_MIYOO
+ CFLAGS += -flto=auto -fno-common -fno-ipa-cp -fno-caller-saves -fno-regmove -finline-limit=42 \
+ -fuse-linker-plugin \
+ -fno-stack-protector -fno-ident -fomit-frame-pointer \
+ -fno-unroll-loops -ffast-math \
+ -marm
+ CXXFLAGS += $(CFLAGS)
+ CPPFLAGS += $(CFLAGS)
+ ASFLAGS += $(CFLAGS)
+ THREAD_RENDERING := 1
ARCH = arm
BUILTIN_GPU = unai_old
DYNAREC = ari64
HAVE_NEON = 0
+ BASE_ADDR_DYNAMIC := 1
+ifeq ($(PROFILE), YES)
+ CFLAGS += -fprofile-generate=$(HOMEPATH)/profile # rm path if you want dir structure intact at runtime
+ LDFLAGS += -lgcov
+else ifeq ($(PROFILE), APPLY)
+ CFLAGS += -fprofile-use -fbranch-probabilities -Wno-error=coverage-mismatch
+endif
# Emscripten
else ifeq ($(platform), emscripten)

View File

@@ -0,0 +1,68 @@
From 01cf6d834eb73d8bfa427b3ae21d7c8bd160161c Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Tue, 18 Mar 2025 14:49:26 +0100
Subject: [PATCH] LIBERTRO: add "Interlace mode" to UNAI options
---
frontend/libretro.c | 12 ++++++++++++
frontend/libretro_core_options.h | 14 ++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/frontend/libretro.c b/frontend/libretro.c
index c67333ab..58f72299 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -923,6 +923,7 @@ static bool update_option_visibility(void)
struct retro_core_option_display option_display;
char gpu_unai_option[][40] = {
"pcsx_rearmed_gpu_unai_blending",
+ "pcsx_rearmed_gpu_unai_interlace",
"pcsx_rearmed_gpu_unai_lighting",
"pcsx_rearmed_gpu_unai_fast_lighting",
"pcsx_rearmed_gpu_unai_scale_hires",
@@ -2655,6 +2656,17 @@ static void update_variables(bool in_flight)
pl_rearmed_cbs.gpu_unai.old_renderer = 0;
}
+ var.key = "pcsx_rearmed_gpu_unai_interlace";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
+ {
+ if (strcmp(var.value, "disabled") == 0)
+ pl_rearmed_cbs.gpu_unai.ilace_force = 0;
+ else if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_unai.ilace_force = 1;
+ }
+
var.key = "pcsx_rearmed_gpu_unai_lighting";
var.value = NULL;
diff --git a/frontend/libretro_core_options.h b/frontend/libretro_core_options.h
index 8cb42c0e..81b28260 100644
--- a/frontend/libretro_core_options.h
+++ b/frontend/libretro_core_options.h
@@ -787,6 +787,20 @@ struct retro_core_option_v2_definition option_defs_us[] = {
},
"enabled",
},
+ {
+ "pcsx_rearmed_gpu_unai_interlace",
+ "(GPU) Interlace mode",
+ "Interlace mode",
+ "Enable simulated interlace mode, which skips every second scanline. Can be enabled to improve performance at the expense of display inaccuracies (artifacts etc.).",
+ NULL,
+ "gpu_unai",
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL},
+ },
+ "disabled",
+ },
{
"pcsx_rearmed_gpu_unai_lighting",
"(GPU) Lighting Effects",
--
2.45.2.windows.1

View File

@@ -1,2 +1,2 @@
# Locally calculated
sha256 b6b7a73117416f6de3c4cda37f49a6516a9d3abf9fa16bc12862af1b776fc3ef libretro-pcsx_rearmed-5ee1c9269d333936eba3e7e3259956f601ff5edd.tar.gz
sha256 cae4fb69d6be8971f967c9de42f3367a235e30ac1becbb9612247da8780520dd libretro-pcsx_rearmed-f49a4c48cb6eb1974505644f2ae76cf55693e9fe-br1.tar.gz

View File

@@ -4,11 +4,13 @@
#
################################################################################
# Commit of 2024/01/08
LIBRETRO_PCSX_REARMED_VERSION = 5ee1c9269d333936eba3e7e3259956f601ff5edd
LIBRETRO_PCSX_REARMED_SITE = $(call github,libretro,pcsx_rearmed,$(LIBRETRO_PCSX_REARMED_VERSION))
# Commit of Mar-3-2025
LIBRETRO_PCSX_REARMED_VERSION = f49a4c48cb6eb1974505644f2ae76cf55693e9fe
LIBRETRO_PCSX_REARMED_SITE = https://github.com/notaz/pcsx_rearmed
LIBRETRO_PCSX_REARMED_SITE_METHOD = git
LIBRETRO_PCSX_REARMED_LICENSE = GPL-2.0
LIBRETRO_PCSX_REARMED_LICENSE_FILES = COPYING
LIBRETRO_PCSX_REARMED_GIT_SUBMODULES = YES
# Optimize build with Profile Guided Optimization (values: 0, YES, APPLY)
LIBRETRO_PCSX_REARMED_PGO ?= APPLY
@@ -19,7 +21,6 @@ endef
endif
define LIBRETRO_PCSX_REARMED_BUILD_CMDS
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \