#!/bin/bash function spinner { while [ -d /proc/$1 ]; do echo -ne '\b/'; sleep 0.05 echo -ne '\b-'; sleep 0.05 echo -ne '\b\\'; sleep 0.05 echo -ne '\b|'; sleep 0.05 done } read -p "Please confirm that your filenames have no spaces in them, then press enter" crap echo -n "Patching, please be patient, this may take up to a minute... " cp -r rom temp for file in temp/*.nds; do mkdir temp/files echo " ================================================================= New log entry started: `date` ----------------------------------------------------------------- " >>patch.log wine ndstool.exe -x $file -9 temp/files/arm9.bin -7 temp/files/arm7.bin -y9 temp/files/y9.bin -y7 temp/files/y7.bin -d temp/files/data -y temp/files/overlay -t temp/files/banner.bin -h temp/files/header.bin &>>patch.log & spinner $! echo -ne '\b ' cp -f patch temp/files/data/a/0/2/7 wine ndstool.exe -c `basename $file | sed -e 's/\.nds$/_patched.nds/'` -9 temp/files/arm9.bin -7 temp/files/arm7.bin -y9 temp/files/y9.bin -y7 temp/files/y7.bin -d temp/files/data -y temp/files/overlay -t temp/files/banner.bin -h temp/files/header.bin &>>patch.log & spinner $! echo -ne '\b ' rm -rf temp/files done rm -rf temp echo -e '\b\bdone!'