Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From dc4f3c5488deb32faf3dbe079af179eae56787b8 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Wed, 22 Jan 2025 17:17:51 +0100
Subject: [PATCH 1/3] LIBRETRO-usrintrf: disable "UI Cancel" event without osd
menu

otherwise libretro core hangs on return
---
src/usrintrf.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/src/usrintrf.c b/src/usrintrf.c
index 147ee46..83237f7 100644
--- a/src/usrintrf.c
+++ b/src/usrintrf.c
@@ -3450,8 +3450,10 @@ if (Machine->gamedrv->flags & GAME_COMPUTER)

/* if the user pressed ESC, stop the emulation */
/* but don't quit if the setup menu is on screen */
+#ifndef __LIBRETRO__
if (setup_selected == 0 && input_ui_pressed(IPT_UI_CANCEL))
return 1;
+#endif

if (setup_selected == 0 && input_ui_pressed(IPT_UI_CONFIGURE))
{
--
2.45.2.windows.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 5d2c4b5731e646bc1c13a4ec9ebb87d21c411908 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Wed, 22 Jan 2025 19:24:38 +0100
Subject: [PATCH 2/3] Makefile: add miyoo new opt flags

don't use LTO due to buggy uClibc build and bad opt. in musl
---
Makefile | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 1c63c18..d349bf4 100644
--- a/Makefile
+++ b/Makefile
@@ -327,12 +327,12 @@ else ifeq ($(platform), miyoo)
TARGET := $(TARGET_NAME)_libretro.so
CC = /opt/miyoo/usr/bin/arm-linux-gcc
AR = /opt/miyoo/usr/bin/arm-linux-ar
- fpic := -fPIC
+ fpic := -fno-PIC
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined

DISABLE_ERROR_LOGGING := 1
- CFLAGS += -fomit-frame-pointer -ffast-math -march=armv5te -mtune=arm926ej-s
- ARM = 1
+ CFLAGS += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -fdata-sections -ffunction-sections -fsingle-precision-constant
+ ARM = 1
USE_CYCLONE = 1
USE_DRZ80 = 1

@@ -524,8 +524,12 @@ endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
+ifeq ($(platform), miyoo)
+CFLAGS += -Ofast -DNDEBUG
+else
CFLAGS += -O2 -DNDEBUG
endif
+endif

# compiler, linker and utilities
RM = rm -f
--
2.45.2.windows.1

Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
diff --git a/Makefile b/Makefile
index 64d8115..63e27cd 100644
--- a/Makefile
+++ b/Makefile
@@ -327,14 +327,14 @@ else ifeq ($(platform), miyoo)
TARGET := $(TARGET_NAME)_libretro.so
CC = /opt/miyoo/usr/bin/arm-linux-gcc
AR = /opt/miyoo/usr/bin/arm-linux-ar
- fpic := -fPIC
+ fpic :=
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined

DISABLE_ERROR_LOGGING := 1
- CFLAGS += -fomit-frame-pointer -ffast-math -march=armv5te -mtune=arm926ej-s
+ CFLAGS += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -Ofast -fdata-sections -ffunction-sections -fsingle-precision-constant -flto
ARM = 1
- USE_CYCLONE = 1
- USE_DRZ80 = 1
+ USE_CYCLONE = 0
+ USE_DRZ80 = 0

# Windows MSVC 2010 x64
else ifeq ($(platform), windows_msvc2010_x64)
From 7972d983687fa37877301f3f590a041639cda346 Mon Sep 17 00:00:00 2001
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
Date: Wed, 22 Jan 2025 20:02:40 +0100
Subject: [PATCH 3/3] libretro.c: use frameskip & low samplerate by def.

optimize
---
src/libretro/libretro.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/libretro/libretro.c b/src/libretro/libretro.c
index 7fd3662..f9a2794 100644
index 48f079a..4df5d0a 100644
--- a/src/libretro/libretro.c
+++ b/src/libretro/libretro.c
@@ -51,8 +51,8 @@ static scond_t *libretro_cond = NULL;
Expand Down Expand Up @@ -104,3 +91,6 @@ index 7fd3662..f9a2794 100644
{ NULL, NULL },
};
environ_cb = cb;
--
2.45.2.windows.1

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Locally calculated
sha256 e70d596045b9753084329caee49767e0ca1fb2567657a6a1fbeb3b486c594df9 libretro-mame2000-1472da3a39ab14fff8325b1f51a1dfdb8eabb5c8.tar.gz
sha256 e9e39e0153970729a2b81898af140749118db56be2920600bcff29fe13c59658 libretro-mame2000-2ec60f6e1078cf9ba173e80432cc28fd4eea200f.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#
################################################################################

# Commit of 2023/11/01
LIBRETRO_MAME2000_VERSION = 1472da3a39ab14fff8325b1f51a1dfdb8eabb5c8
# Commit of Jul 1, 2024
LIBRETRO_MAME2000_VERSION = 2ec60f6e1078cf9ba173e80432cc28fd4eea200f
LIBRETRO_MAME2000_SITE = $(call github,libretro,mame2000-libretro,$(LIBRETRO_MAME2000_VERSION))
LIBRETRO_MAME2000_LICENSE = MAME
LIBRETRO_MAME2000_LICENSE_FILES = readme.txt
Expand All @@ -18,7 +18,7 @@ define LIBRETRO_MAME2000_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CC="$(TARGET_CC)" -C $(@D) -f Makefile ARM=1 USE_CYCLONE=1 USE_DRZ80=1 platform="$(RETROARCH_LIBRETRO_PLATFORM)"
$(MAKE) CC="$(TARGET_CC)" -C $(@D) -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
$(TARGET_STRIP) --strip-unneeded $(@D)/*_libretro.so
endef

Expand Down