From fde05e65c03c8102a57cd0df9c199fa557713334 Mon Sep 17 00:00:00 2001 From: Jeffrey Crowell Date: Thu, 22 Sep 2022 07:30:47 -0400 Subject: [PATCH] [macOS] Force native architecture to launch (#1554) --- soh/macosx/soh-macos.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/soh/macosx/soh-macos.sh b/soh/macosx/soh-macos.sh index 790c649fd..72350db71 100755 --- a/soh/macosx/soh-macos.sh +++ b/soh/macosx/soh-macos.sh @@ -29,12 +29,12 @@ while [ ! -e "$DATA_SHARE/oot.otr" ]; do osascript -e 'display dialog "Select ROM to generate OTR" giving up after 5' rm -r "$ASSETDIR" exit - fi + fi done cp "$ASSETDIR"/*.*64 "$ASSETDIR"/tmp/rom.z64 cp -r "$ASSETDIR"/assets/game/ship_of_harkinian "$ASSETDIR"/Extract/assets/ cd "$ASSETDIR" || return - ROMHASH="$(shasum "$ASSETDIR"/tmp/rom.z64 | awk '{ print $1 }')" + ROMHASH="$(shasum "$ASSETDIR"/tmp/rom.z64 | awk '{ print $1 }')" case "$ROMHASH" in cee6bc3c2a634b41728f2af8da54d9bf8cc14099) export ROM=GC_NMQ_D;; @@ -65,5 +65,11 @@ while [ ! -e "$DATA_SHARE/oot.otr" ]; do break done -"$RESPATH"/soh-macos +arch_name="$(uname -m)" +launch_arch="arm64" +if [ "${arch_name}" = "x86_64" ] && [ "$(sysctl -in sysctl.proc_translated)" = "0" ]; then + launch_arch="x86_64" +fi + +arch -${launch_arch} "$RESPATH"/soh-macos exit