From c214e7b577f07fe722582e4669d33b1c26d1b6f2 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Tue, 10 Apr 2018 00:37:21 +0200 Subject: [PATCH] (#7) Turns out profiling with Firefox is good enough, no need for legally-dubious ROMs. --- flips.cpp | 2 +- make.sh | 20 +++++++++++++++----- profile/README.txt | 19 ------------------- profile/download.sh | 8 ++++++++ profile/profile.sh | 29 ++--------------------------- 5 files changed, 26 insertions(+), 52 deletions(-) delete mode 100644 profile/README.txt create mode 100755 profile/download.sh diff --git a/flips.cpp b/flips.cpp index 12cf032..21d2f02 100644 --- a/flips.cpp +++ b/flips.cpp @@ -833,7 +833,7 @@ struct errorinfo CreatePatch(LPCWSTR inromname, LPCWSTR outromname, enum patchty if (errinf.level profile/choice; break;; + * ) echo "Please answer yes or no."; exit 1;; + esac + done +fi + #clean up rm flips flips.exe floating.zip obj/* @@ -34,18 +45,17 @@ FLAGS=$FLAGS' -Wl,-z,relro,--as-needed,--hash-style=gnu,--relax' #[ -e flips ] || exit #create linux binary -if [ -e profile/smw.sfc ]; then +if [ -e profile/firefox-45.0esr.tar ]; then echo 'GTK+ (1/3)' -rm flips; make TARGET=gtk OPTFLAGS="$FLAGS -fprofile-generate -lgcov" -[ -e flips ] || exit +rm flips; make TARGET=gtk OPTFLAGS="$FLAGS -fprofile-generate -lgcov" || exit $? +[ -e flips ] || exit 1 echo 'GTK+ (2/3)' profile/profile.sh ./flips echo 'GTK+ (3/3)' rm flips; make TARGET=gtk OPTFLAGS="$FLAGS -fprofile-use" #mv flips '~/bin/flips' else -echo 'Warning: Missing ROMs for profiling, building without' -rm flips; make TARGET=gtk OPTFLAGS="$FLAGS" +rm flips; make TARGET=gtk OPTFLAGS="$FLAGS" || exit $? fi #echo Finishing diff --git a/profile/README.txt b/profile/README.txt deleted file mode 100644 index 4b6e5bf..0000000 --- a/profile/README.txt +++ /dev/null @@ -1,19 +0,0 @@ -To optimally profile Floating IPS, you must provide the following files: - -sha1 filename source -c4f257b372f08c6be7e11e234bf1699cd8a34998 langrisser-eng.ups https://www.zophar.net/translations/snes/english/der-langrisser.html -5b24fa7e8fbe9e5148bd9993087ea66ff2e02f4c sm64-star.bps https://smwc.me/s/13353 -adcee2237f7e84bcba0dfa036e59001144109114 smw-2dland.bps https://smwc.me/s/6068 -466c44839b35adff8f168ddd35f7e0b0cd8a980a smw-kamek.bps https://smwc.me/s/12161 -61d14f13f66c5dadb6d9eb970888e4ec617a6447 smw-senate.bps https://smwc.me/s/6161 -5213560235ac8ae2390b4ee3f280567779ae4994 smw-smwcp.bps https://smwc.me/s/5420 -2680805f7a5c16dfa1c22b3f59eab388b700134c smw-tll.bps https://smwc.me/s/6410 -e2cb4935cfb5b442928ecad43da8b59ee5b159e4 langrisser.sfc Langrisser, Der (Japan).sfc -9bef1128717f958171a4afac3ed78ee2bb4e86ce sm64.z64 Super Mario 64 (USA).z64 -6b47bb75d16514b6a476aa0c73a683a2a4c18765 smw.sfc Super Mario World (USA).sfc - -As a convenience, the patches are available (with the expected names) at . -The ROMs (the last three files) are not, you'll have to track them down yourself. - -I'd prefer if I had a set of files that I can freely redistribute that train Flips as well as these, -but I wasn't able to find anything suitable. diff --git a/profile/download.sh b/profile/download.sh new file mode 100755 index 0000000..3f8fd1b --- /dev/null +++ b/profile/download.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +FX45=https://ftp.mozilla.org/pub/firefox/releases/45.0esr/linux-x86_64/en-US/firefox-45.0esr.tar.bz2 +FX52=https://ftp.mozilla.org/pub/firefox/releases/52.0esr/linux-x86_64/en-US/firefox-52.0esr.tar.bz2 + +wget $FX45 -O- | bzcat > profile/firefox-45.0esr.tar || exit $? +wget $FX52 -O- | bzcat > profile/firefox-52.0esr.tar || exit $? +echo y > profile/choice diff --git a/profile/profile.sh b/profile/profile.sh index 25cbbfc..78e62df 100755 --- a/profile/profile.sh +++ b/profile/profile.sh @@ -3,30 +3,5 @@ #profiling plus threading tends to act weirdly, disable it export OMP_NUM_THREADS=1 -FLIPS=$1 -TEMP=$(mktemp) - -profile_one() -{ -echo "$1/7" -SRC=$2 -$FLIPS --apply $3 $SRC $TEMP -$FLIPS --create --bps-delta $SRC $TEMP $TEMP -$FLIPS --apply $TEMP $SRC $TEMP -$FLIPS --create --bps-delta-moremem $SRC $TEMP $TEMP -$FLIPS --apply $TEMP $SRC $TEMP -$FLIPS --create --bps-linear $SRC $TEMP $TEMP -$FLIPS --apply $TEMP $SRC $TEMP -$FLIPS --create --ips $SRC $TEMP $TEMP -$FLIPS --apply $TEMP $SRC $TEMP -} - -profile_one 1 profile/smw.sfc profile/smw-2dland.bps -profile_one 2 profile/smw.sfc profile/smw-kamek.bps -profile_one 3 profile/smw.sfc profile/smw-senate.bps -profile_one 4 profile/smw.sfc profile/smw-smwcp.bps -profile_one 5 profile/smw.sfc profile/smw-tll.bps -profile_one 6 profile/langrisser.sfc profile/langrisser-eng.ups -profile_one 7 profile/sm64.z64 profile/sm64-star.bps - -rm $TEMP +$1 --create --bps-delta profile/firefox-45.0esr.tar profile/firefox-52.0esr.tar /dev/null +$1 --create --bps-delta-moremem profile/firefox-45.0esr.tar profile/firefox-52.0esr.tar /dev/null