1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-06-17 02:29:29 +00:00

Bus access debugging can be enabled run-time via boolean.

This commit is contained in:
Radosław Kujawa 2017-02-28 10:49:57 +01:00
parent 0735487ed0
commit a1785ae68d
2 changed files with 9 additions and 2 deletions

View File

@ -89,7 +89,9 @@ bus_read_1(bus_t *t, uint16_t addr)
else
val = d->read_1(d, off);
printf("bus READ @ %x (off %x) value %x\n", addr, off, val);
if (t->access_debug)
printf("bus READ @ %x (off %x) value %x\n", addr, off, val);
return val;
}
@ -101,7 +103,9 @@ bus_write_1(bus_t *t, uint16_t addr, uint8_t val)
bus_access_device(t, addr, &d, &off);
printf("bus WRITE @ %x (off %x) value %x\n", addr, off, val);
if (t->access_debug)
printf("bus WRITE @ %x (off %x) value %x\n", addr, off, val);
d->write_1(d, off, val);
}
@ -111,6 +115,7 @@ bus_init()
bus_t t;
t.dm_head = NULL;
t.access_debug = false;
return t;
}

View File

@ -10,6 +10,8 @@
struct bus_tag {
device_mapping_t *dm_head;
bool access_debug;
};
typedef struct bus_tag bus_t;