forked from MiyooCFW/buildroot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize retroarch cores: fceumm, mame2000, snes9x2002, tyrquake, prboom
- Loading branch information
Showing
7 changed files
with
220 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/Makefile.libretro b/Makefile.libretro | ||
index 522bd06..152101c 100644 | ||
--- a/Makefile.libretro | ||
+++ b/Makefile.libretro | ||
@@ -458,9 +458,11 @@ 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 | ||
+ fpic := | ||
SHARED := -shared -Wl,--version-script=src/libretro/link.T -Wl,-no-undefined | ||
- PLATFORM_DEFINES += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s | ||
+ PLATFORM_DEFINES += -mcpu=arm926ej-s -Wno-write-strings -Wno-sign-compare -fomit-frame-pointer -fno-builtin -fno-common -fpermissive -Ofast -flto -fomit-frame-pointer -fno-builtin \ | ||
+ -fno-common -Wno-write-strings -Wno-sign-compare -ffast-math -ftree-vectorize \ | ||
+ -funswitch-loops -fno-strict-aliasing | ||
EXTERNAL_ZLIB = 1 | ||
|
||
# Windows MSVC 2017 all architectures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
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) | ||
diff --git a/src/libretro/libretro.c b/src/libretro/libretro.c | ||
index 7fd3662..f9a2794 100644 | ||
--- a/src/libretro/libretro.c | ||
+++ b/src/libretro/libretro.c | ||
@@ -51,8 +51,8 @@ static scond_t *libretro_cond = NULL; | ||
static slock_t *libretro_mutex = NULL; | ||
#endif | ||
|
||
-unsigned frameskip_type = 0; | ||
-unsigned frameskip_threshold = 0; | ||
+unsigned frameskip_type = 2; | ||
+unsigned frameskip_threshold = 50; | ||
unsigned frameskip_counter = 0; | ||
unsigned frameskip_interval = 0; | ||
|
||
@@ -63,10 +63,10 @@ int retro_audio_buff_underrun = false; | ||
unsigned retro_audio_latency = 0; | ||
int update_audio_latency = false; | ||
|
||
-int should_skip_frame = 0; | ||
+int should_skip_frame = 1; | ||
|
||
-static int sample_rate = 22050; | ||
-static int stereo_enabled = true; | ||
+static int sample_rate = 11025; | ||
+static int stereo_enabled = false; | ||
|
||
int game_index = -1; | ||
unsigned short *gp2x_screen15; | ||
@@ -222,7 +222,7 @@ static void update_variables(bool first_run) | ||
var.value = NULL; | ||
|
||
prev_frameskip_type = frameskip_type; | ||
- frameskip_type = 0; | ||
+ frameskip_type = 2; | ||
|
||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) | ||
{ | ||
@@ -235,7 +235,7 @@ static void update_variables(bool first_run) | ||
var.key = "mame2000-frameskip_threshold"; | ||
var.value = NULL; | ||
|
||
- frameskip_threshold = 30; | ||
+ frameskip_threshold = 50; | ||
|
||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) | ||
frameskip_threshold = strtol(var.value, NULL, 10); | ||
@@ -277,7 +277,7 @@ static void update_variables(bool first_run) | ||
var.value = NULL; | ||
var.key = "mame2000-sample_rate"; | ||
|
||
- sample_rate = 22050; | ||
+ sample_rate = 11025; | ||
|
||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) | ||
sample_rate = strtol(var.value, NULL, 10); | ||
@@ -293,7 +293,7 @@ static void update_variables(bool first_run) | ||
stereo_enabled = false; | ||
} | ||
else | ||
- stereo_enabled = true; | ||
+ stereo_enabled = false; | ||
|
||
/* Reinitialise frameskipping, if required */ | ||
if (!first_run && | ||
@@ -304,13 +304,13 @@ static void update_variables(bool first_run) | ||
void retro_set_environment(retro_environment_t cb) | ||
{ | ||
static const struct retro_variable vars[] = { | ||
- { "mame2000-frameskip", "Frameskip ; disabled|auto|threshold" }, | ||
- { "mame2000-frameskip_threshold", "Frameskip Threshold (%); 30|40|50|60" }, | ||
+ { "mame2000-frameskip", "Frameskip ; threshold|disabled|auto" }, | ||
+ { "mame2000-frameskip_threshold", "Frameskip Threshold (%); 50|40|50|60" }, | ||
{ "mame2000-frameskip_interval", "Frameskip Interval; 1|2|3|4|5|6|7|8|9" }, | ||
{ "mame2000-skip_disclaimer", "Skip Disclaimer; enabled|disabled" }, | ||
{ "mame2000-show_gameinfo", "Show Game Information; disabled|enabled" }, | ||
- { "mame2000-sample_rate", "Audio Rate (Restart); 22050|11025|22050|32000|44100" }, | ||
- { "mame2000-stereo", "Stereo (Restart); enabled|disabled" }, | ||
+ { "mame2000-sample_rate", "Audio Rate (Restart); 11025|11025|22050|32000|44100" }, | ||
+ { "mame2000-stereo", "Stereo (Restart); disabled|enabled" }, | ||
{ NULL, NULL }, | ||
}; | ||
environ_cb = cb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/Makefile b/Makefile | ||
index 1322d47..1b57f43 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -368,9 +368,9 @@ 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 | ||
+ fpic := | ||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,-no-undefined | ||
- CFLAGS += -ffast-math -march=armv5te -mtune=arm926ej-s -fomit-frame-pointer | ||
+ CFLAGS += -fomit-frame-pointer -ffast-math -flto -mcpu=arm926ej-s -Ofast | ||
HAVE_LOW_MEMORY = 1 | ||
|
||
# Windows MSVC 2003 Xbox 1 |
59 changes: 59 additions & 0 deletions
59
package/libretro-snes9x2002/0001-optimize-flags-enable-frameskip.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
diff --git a/Makefile b/Makefile | ||
index b6af83f..d6d5d83 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -250,14 +250,19 @@ 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 | ||
+ fpic := | ||
ARM_ASM = 1 | ||
ASM_CPU = 0 | ||
ASM_SPC700 = 0 | ||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined | ||
- CFLAGS += -fomit-frame-pointer -ffast-math -fno-unroll-loops -flto -mcpu=arm926ej-s | ||
- CFLAGS += -DFAST_ALIGNED_LSB_WORD_ACCESS | ||
- | ||
+ CFLAGS += -fomit-frame-pointer -ffast-math -flto -mcpu=arm926ej-s -Ofast | ||
+ CFLAGS += -DFAST_ALIGNED_LSB_WORD_ACCESS \ | ||
+ -DDINGUX \ | ||
+ -DLSB_FIRST \ | ||
+ -DPSS_STYLE=1 \ | ||
+ -DHAVE_ASPRINTF \ | ||
+ -DFRAMESKIP \ | ||
+ -D_REENTRANT | ||
# Windows MSVC 2010 x64 | ||
else ifeq ($(platform), windows_msvc2010_x64) | ||
CC = cl.exe | ||
@@ -396,7 +401,7 @@ LIBRETRO_DIR := ./libretro | ||
ifeq ($(DEBUG), 1) | ||
DEFINES += -O0 -g | ||
else ifneq (,$(findstring msvc,$(platform))) | ||
-DEFINES += -O2 -DNDEBUG=1 | ||
+DEFINES += -O3 -DNDEBUG=1 | ||
else | ||
DEFINES += -O3 -DNDEBUG=1 | ||
endif | ||
diff --git a/libretro/libretro_core_options.h b/libretro/libretro_core_options.h | ||
index ad03eae..455debb 100644 | ||
--- a/libretro/libretro_core_options.h | ||
+++ b/libretro/libretro_core_options.h | ||
@@ -68,7 +68,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { | ||
{ "fixed_interval", "Fixed Interval" }, | ||
{ NULL, NULL }, | ||
}, | ||
- "disabled" | ||
+ "auto" | ||
}, | ||
{ | ||
"snes9x2002_frameskip_threshold", | ||
@@ -133,7 +133,7 @@ struct retro_core_option_v2_definition option_defs_us[] = { | ||
{ "enabled", NULL }, | ||
{ NULL, NULL }, | ||
}, | ||
- "enabled" | ||
+ "disabled" | ||
}, | ||
{ | ||
"snes9x2002_low_pass_filter", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/Makefile b/Makefile | ||
index ef82d42..bb51b40 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -232,9 +232,9 @@ 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=common/libretro-link.T | ||
- CFLAGS += -DDINGUX -D_MIYOO -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s | ||
+ CFLAGS += -DDINGUX -D_MIYOO -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -Ofast -fdata-sections -ffunction-sections -fsingle-precision-constant -flto -marm -DARM | ||
HAVE_NETWORKING=0 | ||
|
||
# Raspberry Pi 1 |