#!/bin/sh
# Stop the Carousel
until [ `ps | grep -e the64 | wc -l` -eq 1 ]
do
	killall the64
done

# Get ID of the nand chip
#/mnt/PALvsNTSC/nand_rw 50 2176 read_id >/mnt/nand_id.txt

# Mount the European/Argent (VERSION=0) or US/Shield (VERSION=1) of the64 and c64emu.rgl
VERSION=0
mount --bind /mnt/PALvsNTSC/Firmware/1.3.2/payload${VERSION}/usr/bin/the64 /usr/bin/the64
mount --bind /mnt/PALvsNTSC/Firmware/1.3.2/payload${VERSION}/usr/lib/c64emu.rgl /usr/lib/c64emu.rgl

# Switch display mode
/mnt/PALvsNTSC/a10_display HDMI mode $(expr $VERSION + 4)

# Run the64 again

the64 &
