mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Optimize libretro-snes9x2005 core (#88)
This commit is contained in:
69
package/libretro-snes9x2005/0001-optimize-flags.patch
Normal file
69
package/libretro-snes9x2005/0001-optimize-flags.patch
Normal file
@@ -0,0 +1,69 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 07d5368..a64871b 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,8 +1,8 @@
|
||||
DEBUG = 0
|
||||
PERF_TEST = 0
|
||||
-LOAD_FROM_MEMORY = 1
|
||||
+LOAD_FROM_MEMORY = 0
|
||||
USE_BLARGG_APU ?= 0
|
||||
-LAGFIX = 1
|
||||
+LAGFIX = 0
|
||||
USE_OLD_COLOUR_OPS = 0
|
||||
|
||||
SPACE :=
|
||||
@@ -282,11 +282,26 @@ else ifeq ($(platform), miyoo)
|
||||
CC = /opt/miyoo/usr/bin/arm-linux-gcc
|
||||
CXX = /opt/miyoo/usr/bin/arm-linux-g++
|
||||
AR = /opt/miyoo/usr/bin/arm-linux-ar
|
||||
- fpic := -fPIC -nostdlib
|
||||
+ fpic :=
|
||||
SHARED := -shared -Wl,--version-script=link.T
|
||||
LIBM :=
|
||||
- FLAGS += -fomit-frame-pointer -ffast-math -march=armv5te -mtune=arm926ej-s
|
||||
- FLAGS += -DFAST_ALIGNED_LSB_WORD_ACCESS -fno-unroll-loops
|
||||
+ CFLAGS += -fomit-frame-pointer -ffast-math -flto -mcpu=arm926ej-s \
|
||||
+ -Ofast -msoft-float -finline-limit=42 -fno-unroll-loops \
|
||||
+ -fno-ipa-cp -fno-common -fno-stack-protector -fno-guess-branch-probability \
|
||||
+ -fno-caller-saves -fno-regmove -flto=4 -fwhole-program -fuse-linker-plugin \
|
||||
+ -fdata-sections -ffunction-sections -Wl,--gc-sections \
|
||||
+ -fno-stack-protector -fno-ident -fomit-frame-pointer \
|
||||
+ -falign-functions=1 -falign-jumps=1 -falign-loops=1 \
|
||||
+ -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \
|
||||
+ -fmerge-all-constants -fno-math-errno \
|
||||
+ -marm
|
||||
+ CXXFLAGS += $(CFLAGS)
|
||||
+ CPPFLAGS += $(CFLAGS)
|
||||
+ ASFLAGS += $(CFLAGS)
|
||||
+ HAVE_NEON = 0
|
||||
+ ARCH = arm
|
||||
+ USE_DYNAREC = 1
|
||||
+ CFLAGS += -DFAST_ALIGNED_LSB_WORD_ACCESS
|
||||
|
||||
# (armv7 a7, hard point, neon based) ###
|
||||
# NESC, SNESC, C64 mini
|
||||
@@ -578,7 +593,7 @@ endif
|
||||
ifeq ($(DEBUG),1)
|
||||
FLAGS += -O0 -g
|
||||
else
|
||||
- FLAGS += -O2 -DNDEBUG
|
||||
+ FLAGS += -O3 -DNDEBUG
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring msvc,$(platform)))
|
||||
diff --git a/libretro.c b/libretro.c
|
||||
index f64b71c..c62a12e 100644
|
||||
--- a/libretro.c
|
||||
+++ b/libretro.c
|
||||
@@ -71,8 +71,8 @@ static unsigned frameskip_type = 0;
|
||||
static unsigned frameskip_threshold = 0;
|
||||
static uint16_t frameskip_counter = 0;
|
||||
|
||||
-static bool retro_audio_buff_active = false;
|
||||
-static unsigned retro_audio_buff_occupancy = 0;
|
||||
+static bool retro_audio_buff_active = true;
|
||||
+static unsigned retro_audio_buff_occupancy = 64;
|
||||
static bool retro_audio_buff_underrun = false;
|
||||
/* Maximum number of consecutive frames that
|
||||
* can be skipped */
|
@@ -11,24 +11,18 @@ LIBRETRO_SNES9X2005_LICENSE = COPYRIGHT
|
||||
LIBRETRO_SNES9X2005_LICENSE_FILES = copyright
|
||||
LIBRETRO_SNES9X2005_NON_COMMERCIAL = y
|
||||
|
||||
# Dynarec on all boards
|
||||
LIBRETRO_SNES9X2005_SUPP_OPT=USE_DYNAREC=1
|
||||
|
||||
LIBRETRO_SNES9X2005_SUPP_CFLAGS+=-Wa,-mimplicit-it=thumb
|
||||
LIBRETRO_SNES9X2005_SUPP_OPT+=ARCH=arm
|
||||
|
||||
define LIBRETRO_SNES9X2005_BUILD_CMDS
|
||||
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
|
||||
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO) $(LIBRETRO_SNES9X2005_SUPP_CFLAGS)" \
|
||||
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO) $(LIBRETRO_SNES9X2005_SUPP_CFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
|
||||
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_PLATFORM)" $(LIBRETRO_SNES9X2005_SUPP_OPT) USE_BLARGG_APU=1
|
||||
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_PLATFORM)" $(LIBRETRO_SNES9X2005_SUPP_OPT) USE_BLARGG_APU=0
|
||||
$(TARGET_STRIP) --strip-unneeded $(@D)/*_libretro.so
|
||||
endef
|
||||
|
||||
define LIBRETRO_SNES9X2005_INSTALL_TARGET_CMDS
|
||||
mkdir -p "${BINARIES_DIR}/retroarch/cores"
|
||||
$(INSTALL) -D $(@D)/snes9x2005_plus_libretro.so \
|
||||
$(INSTALL) -D $(@D)/snes9x2005_libretro.so \
|
||||
${BINARIES_DIR}/retroarch/cores/snes9x2005_libretro.so
|
||||
endef
|
||||
|
||||
|
Reference in New Issue
Block a user