Skip to content

Commit

Permalink
Added newest scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
izzy2fancy authored Feb 6, 2024
1 parent 2d0e6e1 commit 8a5c999
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 24 deletions.
101 changes: 101 additions & 0 deletions packages/bash/build-sm64ex-coop-render96.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/data/data/com.termux/files/usr/bin/bash
RESTART_INSTRUCTIONS="Dropping to shell. To rebuild, swipe from the top of your screen, touch the arrow on the right side of your Termux Notificiation, touch "Exit", then relaunch this app."
if ! ls /storage/emulated/0 >/dev/null 2>&1
then
yes | pkg install termux-am
yes | termux-setup-storage
fi
cat <<EOF
____ ____ ____ ___
| | | | | |__]
|___ |__| |__| |
___ _ _ _ _ ___ ____ ____
|__] | | | | | \ |___ |__/
|__] |__| | |___ |__/ |___ | \\
EOF
# https://stackoverflow.com/questions/34457830/press-any-key-to-abort-in-5-seconds
if read -r -s -n 1 -t 5 -p "Press any key within 5 seconds to cancel build" key #key in a sense has no use at all
then
echo && echo $RESTART_INSTRUCTIONS
exit 0
fi
yes | termux-wake-lock
cp /storage/emulated/0/Download/baserom.us.z64 ~/
cp /storage/emulated/0/baserom.us.z64 ~/
echo 'Autodetecting baserom.us.z64. This can take a long time.'
if [ -f ~/baserom.us.z64 ]
then
BASEROM_PATH=~/baserom.us.z64
else
BASEROM_PATH=$(find /storage/emulated/0 -type f -exec md5sum {} + 2>/dev/null | grep '^20b854b239203baf6c961b850a4a51a2' | head -n1 | cut -d'/' -f2- | xargs -I "%" echo /%)
fi
BLOCKS_FREE=$(awk -F ' ' '{print $4}' <(df | grep emulated))
if (( 7340032 > BLOCKS_FREE ))
then
cat <<EOF
____ _ _ _ _
|___ | | | |
| |__| |___ |___
EOF
echo 'Your device storage needs at least 7 GB free space to continue!'
echo $RESTART_INSTRUCTIONS
exit 1
fi
if [ -z "${BASEROM_PATH}" ]
then
cat <<EOF
_ _ ____ ____ ____ _ _
|\ | | | |__/ | | |\/|
| \| |__| | \ |__| | |
EOF
echo 'Go to https://github.com/sanni/cartreader to learn how to get baserom.us.z64'
echo $RESTART_INSTRUCTIONS
exit 2
else
cp "${BASEROM_PATH}" ~/baserom.us.z64
fi
apt-mark hold bash
yes | pkg upgrade -y
yes | pkg install git wget make python getconf zip apksigner clang binutils libglvnd-dev aapt which netcat-openbsd p7zip
cd
if [ -d "sm64ex-coop" ]
then
cp "${BASEROM_PATH}" sm64ex-coop/baserom.us.z64
cd sm64ex-coop
git reset --hard HEAD
git pull origin android
git submodule update --init --recursive
make distclean
else
git clone --recursive https://github.com/robertkirkman/sm64ex-coop.git
cp "${BASEROM_PATH}" sm64ex-coop/baserom.us.z64
wget https://sm64ex-coopmods.com/wp-content/uploads/2023/01/Render96_Chars.zip
7z x Render96_Chars.zip
mkdir -p /storage/emulated/0/com.owokitty.sm64excoop/dynos/packs/
cp -r Render96_Chars/Render96\ Chars/ /storage/emulated/0/com.owokitty.sm64excoop/dynos/packs/
wget https://github.com/izzy2fancy/RENDER96-HD-TEXTURE-PACK/releases/download/1/gfx.zip
7z x gfx.zip
cp -r gfx/ /storage/emulated/0/com.owokitty.sm64excoop/dynos/packs/
cd sm64ex-coop
fi
make 2>&1 | tee build.log
if ! [ -f build/us_pc/sm64.us.apk ]
then
cat <<EOF
____ ____ _ _ _ _ ____ ____
|___ |__| | | | | |__/ |___
| | | | |___ |__| | \ |___
EOF
cat build.log | nc termbin.com 9999
echo $RESTART_INSTRUCTIONS
exit 3
fi
cp build/us_pc/sm64.us.apk /storage/emulated/0
cat <<EOF
___ ____ _ _ ____
| \ | | |\ | |___
|__/ |__| | \| |___
EOF
echo 'Go to Files and touch sm64.us.apk to install!'
yes | termux-wake-unlock
echo $RESTART_INSTRUCTIONS
11 changes: 11 additions & 0 deletions packages/bash/reset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/data/data/com.termux/files/usr/bin/bash

##
# Resets builder to delete bootstraps
# and packages. Does not erase
# anything in the home directory.
#
# Needed for updates to take effect.
##

yes | termux-reset
67 changes: 43 additions & 24 deletions packages/bash/sm64_menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,70 +16,85 @@ function sm64ex_coop() {
echo ""
}

function sm64ex_coop_render96() {
echo ""
echo "You chose SM64EX Coop Render96 HD this will take awhile depending on your device"
bash /data/data/com.termux/files/usr/bin/build-sm64ex-coop-render96.sh
echo ""
}

function sm64ex_omm() {
echo ""
echo "You chose SM64EX OMM this will take awhile depending on your device "
echo "You chose SM64EX OMM this will take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-sm64ex-omm.sh
echo ""
}

function sm64ex_alo() {
echo ""
echo "You chose SM64EX ALO this will take awhile depending on your device "
echo "You chose SM64EX ALO this will take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-sm64ex-alo.sh
echo ""
}

function sm64ex_60fps_ext() {
echo ""
echo "You chose SM64EX 60fps External Data (Enables Texture Packs *must have access to Android data files*) this will take awhile depending on your device "
echo "You chose SM64EX 60fps External Data (Enables Texture Packs *must have access to Android data files*) this will take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-sm64ex-EXT.sh
echo ""
}

function sm64ex_60fps_int() {
echo ""
echo "You chose SM64EX 60fps Internal Data (No Texture Packs) this will take awhile depending on your device "
echo "You chose SM64EX 60fps Internal Data (No Texture Packs) this will take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-sm64ex-INT.sh
echo ""
}

function sm64ex_60fps_ext_no_t() {
echo ""
echo "You chose SM64EX 60fps External Data (Enables Texture Packs) **No Touch Controls** this will take awhile depending on your device "
echo "You chose SM64EX 60fps External Data (Enables Texture Packs) **No Touch Controls** this will take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-sm64ex-EXTnoTouch.sh
echo ""
}

function sm64ex_60fps_int_no_t() {
echo ""
echo "You chose SM64EX 60fps Internal Data (No Texture Packs) **No Touch Controls** this will take awhile depending on your device "
echo "You chose SM64EX 60fps Internal Data (No Texture Packs) **No Touch Controls** this will take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-sm64ex-INTnoTouch.sh
echo ""
}

function sm64ex_porcino() {
echo ""
echo "You chose SM64EX Porcino this will take awhile depending on your device "
echo "You chose SM64EX Porcino this will take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-sm64ex-porcino.sh
echo ""
}

function starroad_normal() {
echo ""
echo "You chose Star Road normal build version this may take awhile depending on your device "
echo "You chose Star Road normal build version this may take awhile depending on your device"
echo ""
bash /data/data/com.termux/files/usr/bin/build-starroad.sh
echo ""
}

function reset_builder() {
echo ""
echo "You chose to reset the builder. This is necessary for an update to take effect. This will not erase anything in the home directory. It will close the app. You must reopen the app."
echo ""
bash /data/data/com.termux/files/usr/bin/reset.sh
echo ""
}

##
# Color Variables
##
Expand Down Expand Up @@ -112,28 +127,32 @@ menu(){
echo -ne "
$(ColorYellow '====== Super Mario 64 Builder ======')
$(ColorGreen '1)') $(ColorRed 'SM64EX COOP')
$(ColorGreen '2)') $(ColorRed 'SM64EX OMM')
$(ColorGreen '3)') $(ColorRed 'SM64EX ALO')
$(ColorGreen '4)') $(ColorRed 'SM64EX 60fps External')
$(ColorGreen '5)') $(ColorRed 'SM64EX 60fps Internal')
$(ColorGreen '6)') $(ColorRed 'SM64EX 60fps EXT No Touch')
$(ColorGreen '7)') $(ColorRed 'SM64EX 60fps INT No Touch')
$(ColorGreen '8)') $(ColorRed 'SM64EX Porcino')
$(ColorGreen '9)') $(ColorRed 'Star Road')
$(ColorGreen '2)') $(ColorRed 'SM64EX COOP RENDER96 HD')
$(ColorGreen '3)') $(ColorRed 'SM64EX OMM')
$(ColorGreen '4)') $(ColorRed 'SM64EX ALO')
$(ColorGreen '5)') $(ColorRed 'SM64EX 60fps External')
$(ColorGreen '6)') $(ColorRed 'SM64EX 60fps Internal')
$(ColorGreen '7)') $(ColorRed 'SM64EX 60fps EXT No Touch')
$(ColorGreen '8)') $(ColorRed 'SM64EX 60fps INT No Touch')
$(ColorGreen '9)') $(ColorRed 'SM64EX Porcino')
$(ColorGreen '10)') $(ColorRed 'Star Road')
$(ColorGreen '0)') $(ColorRed 'Exit')
$(ColorGreen 'reset)') $(ColorRed 'RESET BUILDER AFTER UPDATE')
$(ColorBlue 'Choose an option:') "
read a
case $a in
1) sm64ex_coop ; menu ;;
2) sm64ex_omm ; menu ;;
3) sm64ex_alo ; menu ;;
4) sm64ex_60fps_ext ; menu ;;
5) sm64ex_60fps_int ; menu ;;
6) sm64ex_60fps_ext_no_t ; menu ;;
7) sm64ex_60fps_int_no_t ; menu ;;
8) sm64ex_porcino ; menu ;;
9) starroad_normal ; menu ;;
2) sm64ex_coop_render96 ; menu ;;
3) sm64ex_omm ; menu ;;
4) sm64ex_alo ; menu ;;
5) sm64ex_60fps_ext ; menu ;;
6) sm64ex_60fps_int ; menu ;;
7) sm64ex_60fps_ext_no_t ; menu ;;
8) sm64ex_60fps_int_no_t ; menu ;;
9) sm64ex_porcino ; menu ;;
10) starroad_normal ; menu ;;
0) exit 0 ;;
reset) reset_builder ; ;;
*) echo -e $red"Wrong option."$clear; WrongCommand;;
esac
}
Expand Down

0 comments on commit 8a5c999

Please sign in to comment.