aboutsummaryrefslogtreecommitdiff
path: root/hw/adb.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-24 09:38:16 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-24 09:38:16 +0000
commitea026b2fc32bdddad6df22f7ab952761a29d9e6b (patch)
tree9662eb1daba7272ed35cecfc128c75632ee887b0 /hw/adb.c
parent4017190e2d75882a0e9dbc40f403e584e0ab46c4 (diff)
Improve PPC device debugging
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6126 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/adb.c')
-rw-r--r--hw/adb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/adb.c b/hw/adb.c
index 5c0d6d5fd9..d6b0298b1c 100644
--- a/hw/adb.c
+++ b/hw/adb.c
@@ -25,6 +25,16 @@
#include "ppc_mac.h"
#include "console.h"
+/* debug ADB */
+//#define DEBUG_ADB
+
+#ifdef DEBUG_ADB
+#define ADB_DPRINTF(fmt, args...) \
+do { printf("ADB: " fmt , ##args); } while (0)
+#else
+#define ADB_DPRINTF(fmt, args...)
+#endif
+
/* ADB commands */
#define ADB_BUSRESET 0x00
#define ADB_FLUSH 0x01
@@ -351,6 +361,7 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obuf,
olen = 0;
switch(cmd) {
case ADB_WRITEREG:
+ ADB_DPRINTF("write reg %d val 0x%2.2x\n", reg, buf[1]);
switch(reg) {
case 2:
break;
@@ -383,6 +394,8 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obuf,
olen = 2;
break;
}
+ ADB_DPRINTF("read reg %d obuf[0] 0x%2.2x obuf[1] 0x%2.2x\n", reg,
+ obuf[0], obuf[1]);
break;
}
return olen;