changeset 271:969ee17471c5

Protect debug prints for busreq/reset regs with appropriate macros
author Mike Pavone <pavone@retrodev.com>
date Thu, 02 May 2013 22:21:41 -0700
parents df5bf4c113dc
children 9b04b57434b5
files blastem.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/blastem.c	Thu May 02 22:18:33 2013 -0700
+++ b/blastem.c	Thu May 02 22:21:41 2013 -0700
@@ -136,8 +136,10 @@
 
 #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 @@
 					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 @@
 					}
 				} 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 @@
 					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 @@
 					}
 				} 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;