# Floppy driver

The unit at [drv/pc/fdc.fs] is a wrapper around common Floppy Disk Controllers
and implement [io/drive].

It is hardcoded for a single drive (master) with the FDC chip registers
accessible at base address $3f0. It is also hardcoded for 1.44M floppies.

It's written following the datasheet of the 82077AA, but written with a lowest
common denominator logic. For example, while most machines with a FDC chip have
a 82077AA wired to the Model 30 mode, the machine this driver was written on
seem to be wired to PC/AT mode because SRA and SRB always yield $ff. This means
we can't use them to wait for interrupt.

## Motor control

At this moment, there is no automated motor control. It's all manual. At
initialization, the motor is turned on and kept on. If you want to turn it off,
you call "motoroff", but you have to remember to call "motoron" again before
you access your disk.

## Example usage

  needs drv/pc/fdc
  fdc$ init
  floppy newfatfs const myfat
  0 myfat listdir

## API

### Constants

floppy  A [io/drive] struct wired to the master drive at port $3f0.

### Words

fdc$ ( -- )
  Initialize this unit and the controller. You call this once.

init ( -- )
  Initialize the controller for disk reading. You call this after having
  inserted a floppy in the drive.

fdc? ( -- f )
  Does this system have a FDC?

motoron ( -- )
  Turn drive motor on.

motoroff ( -- )
  Turn drive motor off.
