Bug fix - cdrom media emulation only moves drives if of the same type.
authorKevin O'Connor <kevin@koconnor.net>
Wed, 18 Feb 2009 01:40:59 +0000 (20:40 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 18 Feb 2009 01:40:59 +0000 (20:40 -0500)
The bug caused floppies to move when hard drive emulation was in
    effect, and vice-versa.  This patch fixes it.

src/disk.c

index dfaa24fe5f8cbcdfef9128b0408fd357d4ee2d31..9bad1d709219c3d323a60ec4f495825b7041ab12 100644 (file)
@@ -697,11 +697,12 @@ handle_13(struct bregs *regs)
         }
         u16 ebda_seg = get_ebda_seg();
         if (GET_EBDA2(ebda_seg, cdemu.active)) {
-            if (drive == GET_EBDA2(ebda_seg, cdemu.emulated_drive)) {
+            u8 emudrive = GET_EBDA2(ebda_seg, cdemu.emulated_drive);
+            if (drive == emudrive) {
                 cdemu_13(regs);
                 return;
             }
-            if (drive < 0xe0)
+            if (drive < 0xe0 && ((emudrive ^ drive) & 0x80) == 0)
                 drive--;
         }
     }