summaryrefslogtreecommitdiff
path: root/blastem.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-05-02 22:21:41 -0700
committerMike Pavone <pavone@retrodev.com>2013-05-02 22:21:41 -0700
commit12e49666b04b43ed77106e05b0f2565f137bda98 (patch)
treeb9a787745bbb227f9c5cee67b2a939600fbf5016 /blastem.c
parent092fbfad1ef2d84b3a9336103d61752f10f29ed1 (diff)
Protect debug prints for busreq/reset regs with appropriate macros
Diffstat (limited to 'blastem.c')
-rw-r--r--blastem.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/blastem.c b/blastem.c
index 9b3ff58..bcca8c7 100644
--- a/blastem.c
+++ b/blastem.c
@@ -136,8 +136,10 @@ uint8_t new_busack = 0;
#ifdef DO_DEBUG_PRINT
#define dprintf printf
+#define dputs puts
#else
#define dprintf
+#define dputs
#endif
void sync_z80(z80_context * z_context, uint32_t mclks)
@@ -390,7 +392,7 @@ m68k_context * io_write(uint32_t location, m68k_context * context, uint8_t value
busack_cycle = CYCLE_NEVER;
}
if (value & 1) {
- puts("bus requesting Z80");
+ dputs("bus requesting Z80");
busreq = 1;
if(!reset) {
busack_cycle = context->current_cycle + Z80_ACK_DELAY;
@@ -398,7 +400,7 @@ m68k_context * io_write(uint32_t location, m68k_context * context, uint8_t value
}
} else {
if (busreq) {
- puts("releasing z80 bus");
+ dputs("releasing z80 bus");
z80_context * z_context = context->next_cpu;
//TODO: Add necessary delay between release of busreq and resumption of execution
z_context->current_cycle = (context->current_cycle * MCLKS_PER_68K) / MCLKS_PER_Z80;
@@ -474,7 +476,7 @@ m68k_context * io_write_w(uint32_t location, m68k_context * context, uint16_t va
busack_cycle = CYCLE_NEVER;
}
if (value & 0x100) {
- printf("bus requesting Z80 @ %d\n", (context->current_cycle * MCLKS_PER_68K) / MCLKS_PER_Z80);
+ dprintf("bus requesting Z80 @ %d\n", (context->current_cycle * MCLKS_PER_68K) / MCLKS_PER_Z80);
busreq = 1;
if(!reset) {
busack_cycle = context->current_cycle + Z80_ACK_DELAY;
@@ -482,7 +484,7 @@ m68k_context * io_write_w(uint32_t location, m68k_context * context, uint16_t va
}
} else {
if (busreq) {
- printf("releasing Z80 bus @ %d\n", (context->current_cycle * MCLKS_PER_68K) / MCLKS_PER_Z80);
+ dprintf("releasing Z80 bus @ %d\n", (context->current_cycle * MCLKS_PER_68K) / MCLKS_PER_Z80);
z80_context * z_context = context->next_cpu;
//TODO: Add necessary delay between release of busreq and resumption of execution
z_context->current_cycle = (context->current_cycle * MCLKS_PER_68K) / MCLKS_PER_Z80;