floppy: Preserve motor and drive sel bits when resetting the floppy controller

In case of read or write errors, the floppy system is usually reset and the
operation is retried. In that case, the floppy motor state must be preserved
in order to avoid creating jitter and keep the floppy motor spinning smoothly
at a constant speed. Additionally, the drive select bits should probably also
be preserved, because some systems might need a small delay after selecting a
new drive. In that case, the operation would be retried, without changing
the currently selected drive.

In floppy_enable_controller(), the IRQ bit is now enabled first, before the
reset bit is set. I'm not completely sure whether this is necessary. It is
done just in case some hardware introduces a delay between setting this bit
and actually enabling the IRQ, which would cause us to miss the IRQ, sent by
the controller immediately after reset.

Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
1 file changed
tree: 145e5e65e93356fab69e69af25ec01100c124121
  1. docs/
  2. scripts/
  3. src/
  4. vgasrc/
  5. .gitignore
  6. COPYING
  7. COPYING.LESSER
  8. Makefile
  9. README