#!/bin/sh

#
# Automated script to read in disks
#

D="/dev/fd0.0"

fdcontrol -s 18,256,0xff,0x2B,80,300,1,0x50,1,0,+mfm,+2step $D

[ -f dcopy ] || (echo "You need to compile 'dcopy' first" && exit)

for F in `jot 100 1`
do
	FN="disk"$F

	if [ ! -d $FN ]
	then
		echo "Doing disk $F (CTRL-D to continue)"
		cat -

		./dcopy $D image $FN".bin"

		mkdir $FN || exit

		cd $FN || exit

		../dcopy ../$FN."bin" read > ../status_tmp

		cd .. || exit

		cat status_tmp

		echo "-------- $FN ------------------------" >> status
		cat status_tmp >> status

		rm status_tmp

		echo ".done"
	fi
done

