//#define DEBUG
+#ifdef DEBUG
+# define APM_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
+#else
+# define APM_DPRINTF(format, ...) do { } while (0)
+#endif
+
/* fixed I/O location */
#define APM_CNT_IOPORT 0xb2
#define APM_STS_IOPORT 0xb3
{
APMState *apm = opaque;
addr &= 1;
-#ifdef DEBUG
- printf("apm_ioport_writeb addr=0x%x val=0x%02x\n", addr, val);
-#endif
+ APM_DPRINTF("apm_ioport_writeb addr=0x%x val=0x%02x\n", addr, val);
if (addr == 0) {
apm->apmc = val;
} else {
val = apm->apms;
}
-#ifdef DEBUG
- printf("apm_ioport_readb addr=0x%x val=0x%02x\n", addr, val);
-#endif
+ APM_DPRINTF("apm_ioport_readb addr=0x%x val=0x%02x\n", addr, val);
return val;
}