Skip to content

Instantly share code, notes, and snippets.

@GrieverV
Created September 17, 2018 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GrieverV/b3d1a8e2c23c295b802f9e33286437c6 to your computer and use it in GitHub Desktop.
Save GrieverV/b3d1a8e2c23c295b802f9e33286437c6 to your computer and use it in GitHub Desktop.
lr-snes9x patches for RetroPie
--- a/lr-snes9x.sh
+++ b/lr-snes9x.sh
@@ -12,11 +12,11 @@
rp_module_id="lr-snes9x"
rp_module_desc="Super Nintendo emu - Snes9x (current) port for libretro"
rp_module_help="ROM Extensions: .bin .smc .sfc .fig .swc .mgd .zip\n\nCopy your SNES roms to $romdir/snes"
-rp_module_licence="NONCOM https://raw.githubusercontent.com/libretro/snes9x/master/docs/snes9x-license.txt"
+rp_module_licence="NONCOM https://raw.githubusercontent.com/snes9xgit/snes9x/master/docs/snes9x-license.txt"
rp_module_section="opt"
function sources_lr-snes9x() {
- gitPullOrClone "$md_build" https://github.com/libretro/snes9x.git
+ gitPullOrClone "$md_build" https://github.com/snes9xgit/snes9x.git
}
function build_lr-snes9x() {
@@ -25,6 +25,9 @@
local platform=""
isPlatform "arm" && platform+="armv"
isPlatform "neon" && platform+="neon"
+ CXXFLAGS+=" -fprofile-dir=/home/pi/pgo/out -fprofile-generate=/home/pi/pgo/out"
+ #CXXFLAGS+=" -fprofile-dir=/home/pi/pgo/out -fprofile-use=/home/pi/pgo/out"
+ LDFLAGS+=" -lgcov"
if [[ -n "$platform" ]]; then
CXXFLAGS+=" -DARM" make platform="$platform"
else
--- a/system.sh
+++ b/system.sh
@@ -34,6 +34,8 @@
__default_cxxflags+=" -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"
fi
+ __default_ldflags+=" -Wl,-O1,--sort-common,--as-needed"
+
# set location of binary downloads
__binary_host="files.retropie.org.uk"
[[ "$__has_binaries" -eq 1 ]] && __binary_url="https://$__binary_host/binaries/$__os_codename/$__platform"
@@ -45,6 +47,7 @@
[[ -z "${CFLAGS}" ]] && export CFLAGS="${__default_cflags}"
[[ -z "${CXXFLAGS}" ]] && export CXXFLAGS="${__default_cxxflags}"
+ [[ -z "${LDFLAGS}" ]] && export LDFLAGS="${__default_ldflags}"
[[ -z "${ASFLAGS}" ]] && export ASFLAGS="${__default_asflags}"
[[ -z "${MAKEFLAGS}" ]] && export MAKEFLAGS="${__default_makeflags}"
@@ -280,7 +283,7 @@
# note the rpi3 currently uses the rpi2 binaries - for ease of maintenance - rebuilding from source
# could improve performance with the compiler options below but needs further testing
function platform_rpi3() {
- __default_cflags="-O2 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ftree-vectorize -funsafe-math-optimizations"
+ __default_cflags="-O2 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ftree-vectorize -funsafe-math-optimizations -funroll-loops -funswitch-loops"
__default_asflags=""
__default_makeflags="-j2"
__platform_flags="arm armv8 neon rpi gles"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment