floppy: report an empty drive as not ready

An empty drive and an unreadable diskette are different failures, and
until the previous patch SeaBIOS could not tell them apart: both ended up
in floppy_media_sense() exhausting the data rates and returning
DISK_RET_EMEDIA (0xC0).  Now that the disk change line identifies an absent
medium, report it as DISK_RET_ETIMEOUT (0x80), which the INT 13h tables
give as "time out, drive not ready".  floppy_media_sense() keeps
DISK_RET_EMEDIA for a medium it cannot read.

Kevin O'Connor traced where 0xC0 came from: Bochs BIOS answers 0x0C here,
"media type not found", and the value was transposed when the code was
brought over at the initial checkin f076a3ee.  Ralf Brown's interrupt list
gives 0x0C as "unsupported track or invalid media" -- so 0xC0 has never
been an INT 13h status code at all.  It does not appear in the classic
tables, and guests treat it accordingly.

Measured on an empty drive, with SeaBIOS patched to return each code in
turn.  The guests here are German-language, so their messages are quoted as
they appear, with the English sense in brackets:

  PC-DOS 7, "dir a:"
    0x80  "Nicht bereit beim Lesen von Laufwerk A"
          [not ready reading drive A]
    0xC0  "Allgemeiner Fehler beim Lesen von Laufwerk A"
          [general failure reading drive A]
    0xAA  same message as 0xC0
    0x99  same message as 0xC0                 <- invented, not a real code
    0x06  no message at all; DOS retries forever

  Windows for Workgroups 3.11, File Manager, drive A:
    0x80  "In Laufwerk A ist kein Datenträger eingelegt.  Legen Sie einen
           Datenträger ein, und versuchen Sie es erneut."  [Wiederholen]
          [there is no disk in drive A; insert one and try again]
    0xC0  "Der Datenträger in Laufwerk A ist nicht formatiert.  Möchten
           Sie, daß der Datenträger jetzt formatiert wird?"  [Ja] [Nein]
          [the disk in drive A is not formatted; format it now?]

DOS gives 0xC0 the same message as the invented code 0x99, which is to say
it does not recognise it.  Windows does recognise it, and offers to format
a diskette that is not there.  Both are correct with 0x80.

OS/2 2.11 and Linux are unaffected: both drive the controller through their
own drivers rather than INT 13h.

Not verified against real hardware -- I have none with a floppy drive.

Signed-off-by: Christian Quante <christian@quante.one>
diff --git a/src/hw/floppy.c b/src/hw/floppy.c
index 0469a79..ebed54f 100644
--- a/src/hw/floppy.c
+++ b/src/hw/floppy.c
@@ -475,7 +475,7 @@
 // just recalibrated, which leaves the head on cylinder 0 and need not step at
 // all, so step to cylinder 1 and look again.
 //
-// Report DISK_RET_EMEDIA only when the drive is known to be empty -- an older
+// Report a missing medium only when the drive is known to be empty -- an older
 // drive without a change line is reported as present, so this can only ever
 // fall back to the previous behaviour.
 static int
@@ -495,7 +495,7 @@
 
     if (inb(PORT_FD_DIR) & FLOPPY_DIR_DSKCHG) {
         dprintf(2, "Floppy_check_media %d: no medium\n", floppyid);
-        return DISK_RET_EMEDIA;
+        return DISK_RET_ETIMEOUT;
     }
 
     // A medium is present.  Put the head back on cylinder 0, where the caller