Minor debugging improvements.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 20:11:49 +0000 (16:11 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 20:11:49 +0000 (16:11 -0400)
src/cdrom.c
src/disk.c
src/util.h

index aa5dfd3becca9615b8f9bcbdf126224a39f0c6bc..bef9b7726275bd5cae921c61d35cd3af486bbd0d 100644 (file)
@@ -527,11 +527,12 @@ cdrom_boot()
             SETBITS_BDA(equipment_list_flags, 0x41);
         else
             SET_EBDA(ata.hdcount, GET_EBDA(ata.hdcount) + 1);
+        // everything is ok, so from now on, the emulation is active
+        SET_EBDA(cdemu.active, 0x01);
     }
 
-    // everything is ok, so from now on, the emulation is active
-    if (GET_EBDA(cdemu.media))
-        SET_EBDA(cdemu.active, 0x01);
+    DEBUGF("cdemu media=%d active=%d\n"
+           , GET_EBDA(cdemu.media), GET_EBDA(cdemu.active));
 
     return 0;
 }
index 99655120153065456d0e9244cf534a4358ef6601..32e4f4bc4e3abc969647f9ac9236a43d5a6434da 100644 (file)
@@ -12,6 +12,9 @@
 #include "util.h" // debug_enter
 #include "ata.h" // ATA_*
 
+#define DEBUGF1(fmt, args...) bprintf(0, fmt , ##args)
+#define DEBUGF(fmt, args...)
+
 
 /****************************************************************
  * Helper functions
index 6938f0da03d3d04688e54f0ccee104c34ee33173..36e9a30594e44c00cc70c7156267ead172a71e88 100644 (file)
@@ -151,8 +151,8 @@ set_code_success(struct bregs *regs)
     } while (0)
 
 #define set_code_fail(regs, code) do {          \
-        (regs)->ah = (code);                    \
         set_fail(regs);                         \
+        (regs)->ah = (code);                    \
     } while (0)
 
 // kbd.c