daeg
Well-known member
After about a year of focusing on other things, I got back to messing around with the FV1. I've been using this Bash script I created to test out code tweaks and someone out there might find it useful or adapt it to their needs. Please note that this is a script for Linux, so if you're using Windows or Mac it will need to be adapted. I can probably help.
What does it do?
Here's the code. Just copy it to a file, name it whatever you like and make it executable (ex. chmod 755).
What does it do?
- Copies the current EEPROM
- Increments Patch 0 to 1, 1 to 2, 2 to 3, etc, all the way to 7, leaving patch 0 empty
- Writes whatever you're working on as patch 0
Bash:
./quickflash.sh myeffect.asm
Here's the code. Just copy it to a file, name it whatever you like and make it executable (ex. chmod 755).
Bash:
# Set Variables
target=${1}
location=/tmp
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Compile new patch
echo "Compiling ${target} as Patch 0"
python3 -m asfv1 -sq -p 0 ${target} ${location}/spinfv1_new.bin
[[ ${?} != 0 ]] && exit 1
# Copy EEPROM Contents
echo "Reading EEPROM"
sudo ${scriptdir}/ch341eeprom -s 24c32 -r ${location}/spinfv1_old.bin
sudo chown ${USER}:${USER} ${location}/spinfv1_old.bin
# Increment old patches by 1
echo "Decompiling patches 0-6 and recompiling as 1-7"
for i in {0..6}; do
python3 -m disfv1 -sq -p ${i} ${location}/spinfv1_old.bin ${location}/spinfv1_temp.asm
python3 -m asfv1 -sq -p $((i+1)) ${location}/spinfv1_temp.asm ${location}/spinfv1_new.bin
done
[[ ${?} != 0 ]] && exit 1
# Flash EEPROM
sudo ${scriptdir}/ch341eeprom -s 24c32 -w ${location}/spinfv1_new.bin
echo "EEPROM flash successful"
# Remove old files
rm ${location}/spinfv1_*