/* PROBLEM with original PAL design & dual speed drives:
 *
 * when autosniff() sees a pc disk, it *should* go directly to AUTO_PC.
 * but NOOOooo - the dual speed drives forget about their disk in/out
 * state when you change the magic "amiga/pc" pin.  this means if we
 * went directly to the 01 state (pc auto) the amiga would check the
 * drive and see a diskchange.  in mode 01, if the amiga sees a diskchange
 * the hardware automatically reverts to mode 10 (amiga auto).  the  amiga
 * would see another diskchange, sniffer would run again, and the same
 * thing would happen over and over, until the disk is removed.

 * SOLUTION as we discussed:
 *
 * to fix this, the hardware has been modified to allow the amiga to
 * read diskchange and step the head even in state 00 (pc manual).
 * this is potentially hazardous to things operating on the pc disk,
 * since the heads can be moved without the pc knowing it.
 * autosniff() puts the drive in state 00 (flipping the state of the
 * magic pin, and causing the amiga to see a diskchange) and puts the
 * software into this state.  this state waits for the diskchange to
 * appear, and then puts the hardware in state 01 (auto pc) - now the
 * hardware is in the right state, and since the magic pin didn't change
 * state, the drive has the correct idea of disk in/out.

 * FLAW in the above solution:
 *
 * sequence of events:
 *	start at AUTO_AMIGA, no disk in drive.
 *	insert a pc disk.
 *	autosniff() sees pc format, sets hw to state 00 (man pc), sw to
 *		state AUTO_PC_PRE.
 *	trackdisk checks drive, and sees that the disk has been "removed,"
 *		because the dual speed drive's magic pin has changed.
 *	we wait for and receive our diskchange event, and set the hw
 *		to 01, and sw to AUTO_PC.
 *	trackdisk checks drive, and sees that a disk has been inserted.
 *	we receive a diskchange event and sniff the disk again!!!

 * FIX for the above flaw:
 *
 *	don't go to AUTO_PC until we see disk inserted (ie, two disk
 *		changes have passed).	
 *
 * result:
 *	start at AUTO_AMIGA, no disk in drive.
 *	insert a pc disk.
 *	autosniff() sees pc format, sets hw to state 00 (man pc), sw to
 *		state AUTO_PC_PRE.
 *	trackdisk checks drive, and sees that the disk has been "removed,"
 *		because the dual speed drive's magic pin has changed.
 *	we wait for and receive 1st diskchange event.  this event is
 *		a disk removal, so we ignore it.
 *	trackdisk checks drive, and sees that the disk has been "inserted,"
 *		since it was never really removed.
 *	we wait for and receive 2nd diskchange event.  this event is
 *		a disk insertion, so we set the hw to 01, and sw to AUTO_PC.
 *	trackdisk checks drive, and sees that nothing has changed, so
 *		flipper remains unchanged (both hw and sw).

 * FLAW in above FIX:
 *
 *	the normal amiga 880K drives don't have a magic pin, so they won't
 *	forget their diskchange status.  in other words, if an 880K drive
 * 	is being shared, autosniff() should set the hw directly to state
 *	01 and the sw to state AUTO_PC, skipping the AUTO_PC_PRE diskchange
 *	kludge state.

 */
