diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c index 0c9ff68904e..98063c8e62e 100644 --- a/src/emu/cpu/hd6309/hd6309.c +++ b/src/emu/cpu/hd6309/hd6309.c @@ -107,11 +107,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) #ifndef true #define true 1 @@ -571,7 +567,7 @@ static void set_irq_line(int irqline, int state) { if (hd6309.nmi_state == state) return; hd6309.nmi_state = state; - LOG(("HD6309#%d set_irq_line (NMI) %d (PC=%4.4X)\n", cpu_getactivecpu(), state, pPC)); + LOG(("HD6309#%d set_irq_line (NMI) %d (PC=%4.4X)\n", cpu_getactivecpu(), state, pPC.d)); if( state == CLEAR_LINE ) return; /* if the stack was not yet initialized */ @@ -610,7 +606,7 @@ static void set_irq_line(int irqline, int state) } else if (irqline < 2) { - LOG(("HD6309#%d set_irq_line %d, %d (PC=%4.4X)\n", cpu_getactivecpu(), irqline, state, pPC)); + LOG(("HD6309#%d set_irq_line %d, %d (PC=%4.4X)\n", cpu_getactivecpu(), irqline, state, pPC.d)); hd6309.irq_state[irqline] = state; if (state == CLEAR_LINE) return; CHECK_IRQ_LINES(); diff --git a/src/emu/cpu/i8051/i8051.c b/src/emu/cpu/i8051/i8051.c index 142ee0c2191..d4d856af716 100644 --- a/src/emu/cpu/i8051/i8051.c +++ b/src/emu/cpu/i8051/i8051.c @@ -68,11 +68,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) //Prototypes diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c index db23ae009ea..119b3e907da 100644 --- a/src/emu/cpu/i8085/i8085.c +++ b/src/emu/cpu/i8085/i8085.c @@ -120,18 +120,14 @@ /*int survival_prot = 0; */ -#define VERBOSE 0 - #include "debugger.h" #include "i8085.h" #include "i8085cpu.h" #include "i8085daa.h" -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define VERBOSE 0 + +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) #define I8085_INTR 0xff diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c index f24daa0163b..604d816c949 100644 --- a/src/emu/cpu/i86/i286.c +++ b/src/emu/cpu/i86/i286.c @@ -7,6 +7,9 @@ #include "debugger.h" +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) mame_printf_debug x; } while (0) + /* All post-i286 CPUs have a 16MB address space */ #define AMASK I.amask @@ -219,12 +222,7 @@ static int i80286_execute(int num_cycles) /* run until we're out */ while(i80286_ICount>0) { - -//#define VERBOSE_DEBUG -#ifdef VERBOSE_DEBUG - mame_printf_debug("[%04x:%04x]=%02x\tF:%04x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x %d%d%d%d%d%d%d%d%d\n",I.sregs[CS],I.pc - I.base[CS],ReadByte(I.pc),I.flags,I.regs.w[AX],I.regs.w[BX],I.regs.w[CX],I.regs.w[DX], I.AuxVal?1:0, I.OverVal?1:0, I.SignVal?1:0, I.ZeroVal?1:0, I.CarryVal?1:0, I.ParityVal?1:0,I.TF, I.IF, I.DirVal<0?1:0); -#endif - + LOG(("[%04x:%04x]=%02x\tF:%04x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x %d%d%d%d%d%d%d%d%d\n",I.sregs[CS],I.pc - I.base[CS],ReadByte(I.pc),I.flags,I.regs.w[AX],I.regs.w[BX],I.regs.w[CX],I.regs.w[DX], I.AuxVal?1:0, I.OverVal?1:0, I.SignVal?1:0, I.ZeroVal?1:0, I.CarryVal?1:0, I.ParityVal?1:0,I.TF, I.IF, I.DirVal<0?1:0)); CALL_MAME_DEBUG; seg_prefix=FALSE; diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c index 0c3918a3015..bff09f33d14 100644 --- a/src/emu/cpu/i86/i86.c +++ b/src/emu/cpu/i86/i86.c @@ -14,6 +14,9 @@ extern int i386_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, int mode); +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) mame_printf_debug x; } while (0) + /* All pre-i286 CPUs have a 1MB address space */ #define AMASK 0xfffff @@ -237,12 +240,9 @@ static int i8086_execute(int num_cycles) /* run until we're out */ while (i8086_ICount > 0) { -//#define VERBOSE_DEBUG -#ifdef VERBOSE_DEBUG - logerror("[%04x:%04x]=%02x\tF:%04x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x %d%d%d%d%d%d%d%d%d\n", + LOG(("[%04x:%04x]=%02x\tF:%04x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x %d%d%d%d%d%d%d%d%d\n", I.sregs[CS], I.pc - I.base[CS], ReadByte(I.pc), I.flags, I.regs.w[AX], I.regs.w[BX], I.regs.w[CX], I.regs.w[DX], I.AuxVal ? 1 : 0, I.OverVal ? 1 : 0, - I.SignVal ? 1 : 0, I.ZeroVal ? 1 : 0, I.CarryVal ? 1 : 0, I.ParityVal ? 1 : 0, I.TF, I.IF, I.DirVal < 0 ? 1 : 0); -#endif + I.SignVal ? 1 : 0, I.ZeroVal ? 1 : 0, I.CarryVal ? 1 : 0, I.ParityVal ? 1 : 0, I.TF, I.IF, I.DirVal < 0 ? 1 : 0)); CALL_MAME_DEBUG; seg_prefix = FALSE; @@ -296,10 +296,8 @@ static int i80186_execute(int num_cycles) /* run until we're out */ while (i8086_ICount > 0) { -#ifdef VERBOSE_DEBUG - mame_printf_debug("[%04x:%04x]=%02x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x\n", I.sregs[CS], I.pc, ReadByte(I.pc), I.regs.w[AX], - I.regs.w[BX], I.regs.w[CX], I.regs.w[DX]); -#endif + LOG(("[%04x:%04x]=%02x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x\n", I.sregs[CS], I.pc, ReadByte(I.pc), I.regs.w[AX], + I.regs.w[BX], I.regs.w[CX], I.regs.w[DX])); CALL_MAME_DEBUG; seg_prefix = FALSE; diff --git a/src/emu/cpu/konami/konami.c b/src/emu/cpu/konami/konami.c index 83c71f03f78..cc3be47363e 100644 --- a/src/emu/cpu/konami/konami.c +++ b/src/emu/cpu/konami/konami.c @@ -39,12 +39,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif - +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* Konami Registers */ typedef struct diff --git a/src/emu/cpu/lh5801/lh5801.c b/src/emu/cpu/lh5801/lh5801.c index 223a2dee576..80fa6a8bff5 100644 --- a/src/emu/cpu/lh5801/lh5801.c +++ b/src/emu/cpu/lh5801/lh5801.c @@ -26,11 +26,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) enum { LH5801_T=1, diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c index ae45f9ff382..3fe62889a97 100644 --- a/src/emu/cpu/m6502/m4510.c +++ b/src/emu/cpu/m6502/m4510.c @@ -117,11 +117,7 @@ z: xxxx address bits a19 .. a16 for memory accesses with a15 1 ? #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) typedef struct { @@ -245,7 +241,7 @@ INLINE void m4510_take_irq(void) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG((errorlog,"M4510#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M4510#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); /* call back the cpuintrf to let it clear the line */ if (m4510.irq_callback) (*m4510.irq_callback)(0); CHANGE_PC; @@ -276,16 +272,16 @@ static int m4510_execute(int cycles) /* check if the I flag was just reset (interrupts enabled) */ if( m4510.after_cli ) { - LOG((errorlog,"M4510#%d after_cli was >0", cpu_getactivecpu())); + LOG(("M4510#%d after_cli was >0", cpu_getactivecpu())); m4510.after_cli = 0; if (m4510.irq_state != CLEAR_LINE) { - LOG((errorlog,": irq line is asserted: set pending IRQ\n")); + LOG((": irq line is asserted: set pending IRQ\n")); m4510.pending_irq = 1; } else { - LOG((errorlog,": irq line is clear\n")); + LOG((": irq line is clear\n")); } } else @@ -305,7 +301,7 @@ static void m4510_set_irq_line(int irqline, int state) m4510.nmi_state = state; if( state != CLEAR_LINE ) { - LOG((errorlog, "M4510#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(("M4510#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); EAD = M4510_NMI_VEC; m4510_ICount -= 7; PUSH(PCH); @@ -314,7 +310,7 @@ static void m4510_set_irq_line(int irqline, int state) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG((errorlog,"M4510#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M4510#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); CHANGE_PC; } } @@ -323,7 +319,7 @@ static void m4510_set_irq_line(int irqline, int state) m4510.irq_state = state; if( state != CLEAR_LINE ) { - LOG((errorlog, "M4510#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(("M4510#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); m4510.pending_irq = 1; } } diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c index b97790c5184..b219fd6481a 100644 --- a/src/emu/cpu/m6502/m6502.c +++ b/src/emu/cpu/m6502/m6502.c @@ -45,11 +45,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c index a6a7ad482d3..9cef38e8e81 100644 --- a/src/emu/cpu/m6502/m6509.c +++ b/src/emu/cpu/m6502/m6509.c @@ -53,11 +53,7 @@ addresses take place. #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) typedef struct { diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c index 36d2b0c6928..234c37630df 100644 --- a/src/emu/cpu/m6502/m65ce02.c +++ b/src/emu/cpu/m6502/m65ce02.c @@ -45,11 +45,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* Layout of the registers in the debugger */ diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c index b4a1de2e2d3..59a6994235d 100644 --- a/src/emu/cpu/m6800/m6800.c +++ b/src/emu/cpu/m6800/m6800.c @@ -78,11 +78,7 @@ TODO: #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) #if 0 /* CPU subtypes, needed for extra insn after TAP/CLI/SEI */ diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c index 86bf1503d62..4089a41f36a 100644 --- a/src/emu/cpu/m6809/m6809.c +++ b/src/emu/cpu/m6809/m6809.c @@ -80,11 +80,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) #ifdef MAME_DEBUG extern offs_t m6809_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c index fbe0d9bfe43..dd86985360a 100644 --- a/src/emu/cpu/pdp1/pdp1.c +++ b/src/emu/cpu/pdp1/pdp1.c @@ -918,19 +918,15 @@ static void pdp1_set_info(UINT32 state, cpuinfo *info) case CPUINFO_INT_REGISTER + PDP1_SNGL_INST: pdp1.sngl_inst = info->i ? 1 : 0; break; case CPUINFO_INT_REGISTER + PDP1_EXTEND_SW: pdp1.extend_sw = info->i ? 1 : 0; break; case CPUINFO_INT_REGISTER + PDP1_RUN: pdp1.run = info->i ? 1 : 0; break; -#if LOG - case CPUINFO_INT_REGISTER + PDP1_CYC: logerror("pdp1_set_reg to cycle flip-flop ignored\n");/* no way!*/ break; - case CPUINFO_INT_REGISTER + PDP1_DEFER: logerror("pdp1_set_reg to defer flip-flop ignored\n");/* no way!*/ break; - case CPUINFO_INT_REGISTER + PDP1_BRK_CTR: logerror("pdp1_set_reg to break counter ignored\n");/* no way!*/ break; -#endif + case CPUINFO_INT_REGISTER + PDP1_CYC: if (LOG) logerror("pdp1_set_reg to cycle flip-flop ignored\n");/* no way!*/ break; + case CPUINFO_INT_REGISTER + PDP1_DEFER: if (LOG) logerror("pdp1_set_reg to defer flip-flop ignored\n");/* no way!*/ break; + case CPUINFO_INT_REGISTER + PDP1_BRK_CTR: if (LOG) logerror("pdp1_set_reg to break counter ignored\n");/* no way!*/ break; case CPUINFO_INT_REGISTER + PDP1_RIM: pdp1.rim = info->i ? 1 : 0; break; case CPUINFO_INT_REGISTER + PDP1_SBM: pdp1.sbm = info->i ? 1 : 0; break; case CPUINFO_INT_REGISTER + PDP1_EXD: EXD = (pdp1.extend_support && info->i) ? 1 : 0; break; -#if LOG - case CPUINFO_INT_REGISTER + PDP1_IOC: logerror("pdp1_set_reg to ioc flip-flop ignored\n");/* no way!*/ break; - case CPUINFO_INT_REGISTER + PDP1_IOH: logerror("pdp1_set_reg to ioh flip-flop ignored\n");/* no way!*/ break; - case CPUINFO_INT_REGISTER + PDP1_IOS: logerror("pdp1_set_reg to ios flip-flop ignored\n");/* no way!*/ break; -#endif + case CPUINFO_INT_REGISTER + PDP1_IOC: if (LOG) logerror("pdp1_set_reg to ioc flip-flop ignored\n");/* no way!*/ break; + case CPUINFO_INT_REGISTER + PDP1_IOH: if (LOG) logerror("pdp1_set_reg to ioh flip-flop ignored\n");/* no way!*/ break; + case CPUINFO_INT_REGISTER + PDP1_IOS: if (LOG) logerror("pdp1_set_reg to ios flip-flop ignored\n");/* no way!*/ break; case CPUINFO_INT_REGISTER + PDP1_START_CLEAR: pulse_start_clear(); break; case CPUINFO_INT_REGISTER + PDP1_IO_COMPLETE: pdp1.ios = 1; break; } diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c index c1ffe8b4688..dd68bad696f 100644 --- a/src/emu/cpu/pdp1/tx0.c +++ b/src/emu/cpu/pdp1/tx0.c @@ -432,11 +432,9 @@ static void tx0_set_info(UINT32 state, cpuinfo *info) case CPUINFO_INT_REGISTER + TX0_STOP_CYC1: tx0.stop_cyc1 = info->i ? 1 : 0; break; case CPUINFO_INT_REGISTER + TX0_RUN: tx0.run = info->i ? 1 : 0; break; case CPUINFO_INT_REGISTER + TX0_RIM: tx0.rim = info->i ? 1 : 0; break; -#if LOG - case CPUINFO_INT_REGISTER + TX0_CYCLE: logerror("tx0_set_reg to cycle counter ignored\n");/* no way!*/ break; - case CPUINFO_INT_REGISTER + TX0_IOH: logerror("tx0_set_reg to ioh flip-flop ignored\n");/* no way!*/ break; - case CPUINFO_INT_REGISTER + TX0_IOS: logerror("tx0_set_reg to ios flip-flop ignored\n");/* no way!*/ break; -#endif + case CPUINFO_INT_REGISTER + TX0_CYCLE: if (LOG) logerror("tx0_set_reg to cycle counter ignored\n");/* no way!*/ break; + case CPUINFO_INT_REGISTER + TX0_IOH: if (LOG) logerror("tx0_set_reg to ioh flip-flop ignored\n");/* no way!*/ break; + case CPUINFO_INT_REGISTER + TX0_IOS: if (LOG) logerror("tx0_set_reg to ios flip-flop ignored\n");/* no way!*/ break; case CPUINFO_INT_REGISTER + TX0_RESET: pulse_reset(); break; case CPUINFO_INT_REGISTER + TX0_IO_COMPLETE:tx0.ios = 1; break; } diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c index 3b86dae50ec..eacf6555b5b 100644 --- a/src/emu/cpu/s2650/s2650.c +++ b/src/emu/cpu/s2650/s2650.c @@ -19,11 +19,7 @@ /* define this to have some interrupt information logged */ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* define this to expand all EA calculations inline */ #define INLINE_EA 1 diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c index 6caceb0dda9..dc8fc0f6cf7 100644 --- a/src/emu/cpu/saturn/saturn.c +++ b/src/emu/cpu/saturn/saturn.c @@ -49,11 +49,7 @@ typedef union { #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /**************************************************************************** diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c index 4da083297d9..7eca1e0e760 100644 --- a/src/emu/cpu/sc61860/sc61860.c +++ b/src/emu/cpu/sc61860/sc61860.c @@ -35,12 +35,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif - +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /**************************************************************************** * The 61860 registers. diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c index 57ea7e545c3..702f283f86c 100644 --- a/src/emu/cpu/sh2/sh2.c +++ b/src/emu/cpu/sh2/sh2.c @@ -108,11 +108,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) typedef struct { @@ -2886,18 +2882,20 @@ static void sh2_set_frt_input(int cpunum, int state) static void set_irq_line(int irqline, int state) { if (irqline == INPUT_LINE_NMI) - { + { if (sh2.nmi_line_state == state) return; sh2.nmi_line_state = state; if( state == CLEAR_LINE ) + { LOG(("SH-2 #%d cleared nmi\n", cpu_getactivecpu())); + } else - { + { LOG(("SH-2 #%d assert nmi\n", cpu_getactivecpu())); sh2_exception("sh2_set_irq_line/nmi", 16); - } + } } else { diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c index 61e26701aed..aeae6d7a924 100644 --- a/src/emu/cpu/sh4/sh4.c +++ b/src/emu/cpu/sh4/sh4.c @@ -34,11 +34,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) #define EXPPRI(pl,po,p,n) (((4-(pl)) << 24) | ((15-(po)) << 16) | ((p) << 8) | (255-(n))) #define NMIPRI() EXPPRI(3,0,16,SH4_INTC_NMI) diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c index c4f82421a86..c6d9c8ff2ae 100644 --- a/src/emu/cpu/tms34010/34010gfx.c +++ b/src/emu/cpu/tms34010/34010gfx.c @@ -9,11 +9,8 @@ #ifndef RECURSIVE_INCLUDE -#if LOG_GRAPHICS_OPS -#define LOGGFX(x) do { if (input_code_pressed(KEYCODE_L)) logerror x ; } while (0) -#else -#define LOGGFX(x) -#endif +#define LOG_GFX_OPS 0 +#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(KEYCODE_L)) logerror x; } while (0) /* Graphics Instructions */ diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index dabb1bd58fd..d8b08c578c8 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -24,12 +24,7 @@ #define LOG_CONTROL_REGS 0 #define LOG_GRAPHICS_OPS 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif - +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /*************************************************************************** CORE STATE diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index ad099dae1eb..a52351d0e09 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -34,11 +34,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* Private prototypes */ @@ -565,8 +561,8 @@ static void tms7000_service_timer1( void ) { tms7000.t1_decrementer = tms7000.pf[2]; /* Reload decrementer (8 bit) */ cpunum_set_input_line( cpu_getactivecpu(), TMS7000_IRQ2_LINE, HOLD_LINE); - LOG( ("tms7000: trigger int2 (cycles: %d)\t%d\tdelta %d\n", activecpu_gettotalcycles(), activecpu_gettotalcycles() - tick, tms7000_cycles_per_INT2-(activecpu_gettotalcycles() - tick) ); - tick = activecpu_gettotalcycles() ); + //LOG( ("tms7000: trigger int2 (cycles: %d)\t%d\tdelta %d\n", activecpu_gettotalcycles(), activecpu_gettotalcycles() - tick, tms7000_cycles_per_INT2-(activecpu_gettotalcycles() - tick) ); + //tick = activecpu_gettotalcycles() ); /* Also, cascade out to timer 2 - timer 2 unimplemented */ } } diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c index d9ea75f3ff9..597fd1db96a 100644 --- a/src/emu/cpu/z180/z180.c +++ b/src/emu/cpu/z180/z180.c @@ -51,11 +51,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* execute main opcodes inside a big switch statement */ #ifndef BIG_SWITCH diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c index ee65c4c868c..5180d7d7ffb 100644 --- a/src/emu/cpu/z80/z80.c +++ b/src/emu/cpu/z80/z80.c @@ -99,11 +99,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* execute main opcodes inside a big switch statement */ #ifndef BIG_SWITCH diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c index 0a3e089e19b..5bdc578a7cd 100644 --- a/src/emu/cpu/z8000/z8000.c +++ b/src/emu/cpu/z8000/z8000.c @@ -51,11 +51,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* opcode execution table */ Z8000_exec *z8000_exec = NULL; diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c index 2159ddcf230..eebe6a89398 100644 --- a/src/emu/cpuexec.c +++ b/src/emu/cpuexec.c @@ -29,11 +29,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) @@ -1373,7 +1369,7 @@ static void compute_perfect_interleave(void) if (perfect_interleave.attoseconds == ATTOSECONDS_PER_SECOND - 1) perfect_interleave.attoseconds = attoseconds_per_cycle[0]; - LOG(("Perfect interleave = %s, smallest = %.9f\n", attotime_string(perfect_interleave), ATTOSECONDS_TO_DOUBLE(smallest))); + LOG(("Perfect interleave = %s, smallest = %.9f\n", attotime_string(perfect_interleave, 9), ATTOSECONDS_TO_DOUBLE(smallest))); } diff --git a/src/emu/cpuint.c b/src/emu/cpuint.c index 5ce2795752f..cc5d7b20656 100644 --- a/src/emu/cpuint.c +++ b/src/emu/cpuint.c @@ -24,11 +24,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/emu/cpuintrf.c b/src/emu/cpuintrf.c index 945aaaa6793..570b7ef9133 100644 --- a/src/emu/cpuintrf.c +++ b/src/emu/cpuintrf.c @@ -213,11 +213,7 @@ void minx_get_info(UINT32 state, cpuinfo *info); #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/emu/debug/debugcmt.c b/src/emu/debug/debugcmt.c index fd532f1d904..2324ee71c41 100644 --- a/src/emu/debug/debugcmt.c +++ b/src/emu/debug/debugcmt.c @@ -34,13 +34,8 @@ DEBUGGING ***************************************************************************/ -//#define VERBOSE - -#ifdef VERBOSE -#define TRACE(x) do {x;} while (0) -#else -#define TRACE(x) -#endif +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/emu/emupal.c b/src/emu/emupal.c index 44ace94bba9..624d05323b3 100644 --- a/src/emu/emupal.c +++ b/src/emu/emupal.c @@ -325,9 +325,8 @@ void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int d stable->db = db; stable->noclip = noclip; - #if VERBOSE + if (VERBOSE) popmessage("shadow %d recalc %d %d %d %02x", mode, dr, dg, db, noclip); - #endif /* regenerate the table */ for (i = 0; i < 32768; i++) @@ -775,10 +774,6 @@ static void configure_rgb_shadows(running_machine *machine, int mode, float fact assert(palette->format != BITMAP_FORMAT_INDEXED16); assert(stable->base != NULL); - #if VERBOSE - popmessage("shadow %d recalc %d %d %d %02x", mode, dr, dg, db, noclip); - #endif - /* regenerate the table */ for (i = 0; i < 32768; i++) { diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c index 0985ff68391..e2c0d8801e3 100644 --- a/src/emu/machine/6821pia.c +++ b/src/emu/machine/6821pia.c @@ -10,11 +10,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c index 5ba50449134..fccff6b6eb9 100644 --- a/src/emu/machine/6840ptm.c +++ b/src/emu/machine/6840ptm.c @@ -41,11 +41,7 @@ #define PTMVERBOSE 0 #endif -#if PTMVERBOSE -#define PLOG(x) logerror x -#else -#define PLOG(x) -#endif +#define PLOG(x) do { if (PTMVERBOSE) logerror x; } while (0) #define PTM_6840_CTRL1 0 #define PTM_6840_CTRL2 1 @@ -96,7 +92,6 @@ static TIMER_CALLBACK( ptm6840_t3_timeout ); static ptm6840 ptm[PTM_6840_MAX]; -#if PTMVERBOSE static const char *const opmode[] = { "000 continous mode", @@ -108,7 +103,6 @@ static const char *const opmode[] = "110 single shot mode", "111 pulse width comparison mode" }; -#endif /////////////////////////////////////////////////////////////////////////// // // diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c index 07d8cd6a183..a7f1756ead3 100644 --- a/src/emu/machine/eeprom.c +++ b/src/emu/machine/eeprom.c @@ -2,6 +2,7 @@ #include "eeprom.h" #define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) #define SERIAL_BUFFER_LENGTH 40 #define MEMORY_SIZE 1024 @@ -160,13 +161,11 @@ void EEPROM_init(const struct EEPROM_interface *interface) static void EEPROM_write(int bit) { -#if VERBOSE -logerror("EEPROM write bit %d\n",bit); -#endif + LOG(("EEPROM write bit %d\n",bit)); if (serial_count >= SERIAL_BUFFER_LENGTH-1) { -logerror("error: EEPROM serial buffer overflow\n"); + logerror("error: EEPROM serial buffer overflow\n"); return; } @@ -279,9 +278,7 @@ if (serial_count) void EEPROM_write_bit(int bit) { -#if VERBOSE -logerror("write bit %d\n",bit); -#endif + LOG(("write bit %d\n",bit)); latch = bit; } @@ -303,18 +300,14 @@ int EEPROM_read_bit(void) res = 1; } -#if VERBOSE -logerror("read bit %d\n",res); -#endif + LOG(("read bit %d\n",res)); return res; } void EEPROM_set_cs_line(int state) { -#if VERBOSE -logerror("set reset line %d\n",state); -#endif + LOG(("set reset line %d\n",state)); reset_line = state; if (reset_line != CLEAR_LINE) @@ -323,9 +316,7 @@ logerror("set reset line %d\n",state); void EEPROM_set_clock_line(int state) { -#if VERBOSE -logerror("set clock line %d\n",state); -#endif + LOG(("set clock line %d\n",state)); if (state == PULSE_LINE || (clock_line == CLEAR_LINE && state != CLEAR_LINE)) { if (reset_line == CLEAR_LINE) diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index a0a746cb92f..9cb2e3c9057 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -19,19 +19,9 @@ #define PRINTF_IDE_COMMANDS 0 #define PRINTF_IDE_PASSWORD 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(X) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) -#if (VERBOSE && PRINTF_IDE_COMMANDS) -#define LOGPRINT(x) logerror x; mame_printf_debug x -#elif PRINTF_IDE_COMMANDS -#define LOGPRINT(x) mame_printf_debug x -#else -#define LOGPRINT(X) -#endif +#define LOGPRINT(x) do { if (VERBOSE) logerror x; if (PRINTF_IDE_COMMANDS) mame_printf_debug x; } while (0) diff --git a/src/emu/machine/laserdsc.c b/src/emu/machine/laserdsc.c index e1b224602e3..9289cb57824 100644 --- a/src/emu/machine/laserdsc.c +++ b/src/emu/machine/laserdsc.c @@ -24,11 +24,7 @@ #define PRINTF_COMMANDS 1 -#if PRINTF_COMMANDS -#define CMDPRINTF(x) mame_printf_debug x -#else -#define CMDPRINTF(x) -#endif +#define CMDPRINTF(x) do { if (PRINTF_COMMANDS) mame_printf_debug x; } while (0) diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c index dd0967dc626..189be768589 100644 --- a/src/emu/machine/pit8253.c +++ b/src/emu/machine/pit8253.c @@ -33,16 +33,8 @@ #define MAX_TIMER 3 #define VERBOSE 0 -#if (VERBOSE == 2) -#define LOG1(msg) logerror msg -#define LOG2(msg) logerror msg -#elif (VERBOSE == 1) -#define LOG1(msg) logerror msg -#define LOG2(msg) (void)(0) -#else -#define LOG1(msg) (void)(0) -#define LOG2(msg) (void)(0) -#endif +#define LOG1(msg) do { if (VERBOSE >= 1) logerror msg; } while (0) +#define LOG2(msg) do { if (VERBOSE >= 2) logerror msg; } while (0) #define TIMER_TIME_NEVER ((UINT64) -1) diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c index f93f1190bf8..31d3cf76e0d 100644 --- a/src/emu/machine/wd33c93.c +++ b/src/emu/machine/wd33c93.c @@ -16,6 +16,7 @@ #include "wd33c93.h" #define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) static SCSIInstance *devices[8]; // SCSI IDs 0-7 static const struct WD33C93interface *intf; @@ -525,9 +526,7 @@ WRITE8_HANDLER(wd33c93_w) case 1: { -#if VERBOSE - logerror( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", safe_activecpu_get_pc(), scsi_data.sasr, data ); -#endif + LOG(( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", safe_activecpu_get_pc(), scsi_data.sasr, data )); /* update the register */ scsi_data.regs[scsi_data.sasr] = data; @@ -535,9 +534,7 @@ WRITE8_HANDLER(wd33c93_w) /* if we receive a command, schedule to process it */ if ( scsi_data.sasr == WD_COMMAND ) { -#if VERBOSE - logerror( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", safe_activecpu_get_pc(), data, wd33c93_getunit() ); -#endif + LOG(( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", safe_activecpu_get_pc(), data, wd33c93_getunit() )); /* signal we're processing it */ scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP; @@ -688,9 +685,7 @@ READ8_HANDLER(wd33c93_r) intf->irq_callback(0); } -#if VERBOSE - logerror( "WD33C93: PC=%08x - Status read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_SCSI_STATUS] ); -#endif + LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_SCSI_STATUS] )); } else if ( scsi_data.sasr == WD_DATA ) { @@ -759,9 +754,7 @@ READ8_HANDLER(wd33c93_r) } } -#if VERBOSE - logerror( "WD33C93: PC=%08x - Data read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_DATA] ); -#endif + LOG(( "WD33C93: PC=%08x - Data read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_DATA] )); /* get the register value */ ret = scsi_data.regs[scsi_data.sasr]; diff --git a/src/emu/machine/z80ctc.c b/src/emu/machine/z80ctc.c index 47af23bf417..90ad89b6335 100644 --- a/src/emu/machine/z80ctc.c +++ b/src/emu/machine/z80ctc.c @@ -22,11 +22,7 @@ #define VERBOSE 0 -#if VERBOSE -#define VPRINTF(x) logerror x -#else -#define VPRINTF(x) -#endif +#define VPRINTF(x) do { if (VERBOSE) logerror x; } while (0) @@ -368,17 +364,20 @@ void z80ctc_trg_w(int which, int ch, UINT8 data) /* if we're waiting for a trigger, start the timer */ if ((ctc->mode[ch] & WAITING_FOR_TRIG) && (ctc->mode[ch] & MODE) == MODE_TIMER) { - VPRINTF(("CTC clock %f\n",1.0/clock)); - if (!(ctc->notimer & (1<mode[ch] & PRESCALER) == PRESCALER_16) ? ctc->period16 : ctc->period256; period = attotime_mul(period, ctc->tconst[ch]); + VPRINTF(("CTC period %s\n", attotime_string(period, 9))); timer_adjust(ctc->timer[ch], period, (which << 2) + ch, period); } else + { + VPRINTF(("CTC disabled\n")); + timer_adjust(ctc->timer[ch], attotime_never, 0, attotime_never); + } } /* we're no longer waiting */ diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c index aa893e027f7..76ca4886973 100644 --- a/src/emu/machine/z80pio.c +++ b/src/emu/machine/z80pio.c @@ -22,11 +22,7 @@ #define VERBOSE 0 -#if VERBOSE -#define VPRINTF(x) logerror x -#else -#define VPRINTF(x) -#endif +#define VPRINTF(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c index 5ea9459f467..5ac9e212455 100644 --- a/src/emu/machine/z80sio.c +++ b/src/emu/machine/z80sio.c @@ -20,11 +20,7 @@ #define VERBOSE 1 -#if VERBOSE -#define VPRINTF(x) logerror x -#else -#define VPRINTF(x) -#endif +#define VPRINTF(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/emu/memory.c b/src/emu/memory.c index 90e027382e2..5f844cfb61e 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -102,11 +102,7 @@ #define ALLOW_ONLY_AUTO_MALLOC_BANKS 0 -#if VERBOSE -#define VPRINTF(x) mame_printf_debug x -#else -#define VPRINTF(x) -#endif +#define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0) diff --git a/src/emu/sndintrf.c b/src/emu/sndintrf.c index 52f426c64a6..04c25cb9267 100644 --- a/src/emu/sndintrf.c +++ b/src/emu/sndintrf.c @@ -26,11 +26,7 @@ #define VERBOSE (0) -#if VERBOSE -#define VPRINTF(x) mame_printf_debug x -#else -#define VPRINTF(x) -#endif +#define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0) diff --git a/src/emu/sound.c b/src/emu/sound.c index 8c0ffc5cbca..4b6caca5d58 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -24,11 +24,7 @@ #define VERBOSE (0) -#if VERBOSE -#define VPRINTF(x) mame_printf_debug x -#else -#define VPRINTF(x) -#endif +#define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0) diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c index 572fd4db3ff..38c62efcb33 100644 --- a/src/emu/sound/c352.c +++ b/src/emu/sound/c352.c @@ -19,6 +19,7 @@ #include "c352.h" #define VERBOSE (0) +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) // flags @@ -420,83 +421,63 @@ static void c352_write_reg16(struct c352_info *info, unsigned long address, unsi if (chan > 31) { - #if VERBOSE - logerror("C352 CTRL %08x %04x\n", address, val); - #endif + LOG(("C352 CTRL %08lx %04x\n", address, val)); return; } switch(address & 0xf) { case 0x0: // volumes (output 1) - #if VERBOSE - logerror("CH %02d LVOL %02x RVOL %02x\n", chan, val & 0xff, val >> 8); - #endif + LOG(("CH %02ld LVOL %02x RVOL %02x\n", chan, val & 0xff, val >> 8)); info->c352_ch[chan].vol_l = val & 0xff; info->c352_ch[chan].vol_r = val >> 8; break; case 0x2: // volumes (output 2) - #if VERBOSE - logerror("CH %02d RLVOL %02x RRVOL %02x\n", chan, val & 0xff, val >> 8); - #endif + LOG(("CH %02ld RLVOL %02x RRVOL %02x\n", chan, val & 0xff, val >> 8)); info->c352_ch[chan].vol_l2 = val & 0xff; info->c352_ch[chan].vol_r2 = val >> 8; break; case 0x4: // pitch - #if VERBOSE - logerror("CH %02d PITCH %04x\n", chan, val); - #endif + LOG(("CH %02ld PITCH %04x\n", chan, val)); info->c352_ch[chan].pitch = val; break; case 0x6: // flags - #if VERBOSE - logerror("CH %02d FLAG %02x\n", chan, val); - #endif + LOG(("CH %02ld FLAG %02x\n", chan, val)); info->c352_ch[chan].flag = val; break; case 0x8: // bank (bits 16-31 of address); info->c352_ch[chan].bank = val & 0xff; - #if VERBOSE - logerror("CH %02d BANK %02x", chan, info->c352_ch[chan].bank); - #endif + LOG(("CH %02ld BANK %02x", chan, info->c352_ch[chan].bank)); break; case 0xa: // start address - #if VERBOSE - logerror("CH %02d SADDR %04x\n", chan, val); - #endif + LOG(("CH %02ld SADDR %04x\n", chan, val)); info->c352_ch[chan].start_addr = val; break; case 0xc: // end address - #if VERBOSE - logerror("CH %02d EADDR %04x\n", chan, val); - #endif + LOG(("CH %02ld EADDR %04x\n", chan, val)); info->c352_ch[chan].end_addr = val; break; case 0xe: // loop address - #if VERBOSE - logerror("CH %02d LADDR %04x\n", chan, val); - #endif + LOG(("CH %02ld LADDR %04x\n", chan, val)); info->c352_ch[chan].repeat_addr = val; break; default: - #if VERBOSE - logerror("CH %02d UNKN %01x %04x", chan, address & 0xf, val); - #endif + LOG(("CH %02ld UNKN %01lx %04x", chan, address & 0xf, val)); break; } } diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c index 0fcf8a9ef50..b3288cd876e 100644 --- a/src/emu/sound/dmadac.c +++ b/src/emu/sound/dmadac.c @@ -19,12 +19,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif - +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /************************************* @@ -167,7 +162,7 @@ void dmadac_transfer(UINT8 first_channel, UINT8 num_channels, offs_t channel_spa } } - LOG(("dmadac_transfer - %d samples, %d effective, %d in buffer\n", total_frames, (int)(total_frames * (double)DEFAULT_SAMPLE_RATE / dmadac[first_channel].frequency), dmadac[first_channel].curinpos - dmadac[first_channel].curoutpos)); + //LOG(("dmadac_transfer - %d samples, %d effective, %d in buffer\n", total_frames, (int)(total_frames * (double)DEFAULT_SAMPLE_RATE / dmadac[first_channel].frequency), dmadac[first_channel].curinpos - dmadac[first_channel].curoutpos)); } diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c index 8f02e1f26fd..fd45350109b 100644 --- a/src/emu/sound/fm.c +++ b/src/emu/sound/fm.c @@ -684,7 +684,7 @@ static INT32 LFO_PM; /* runtime LFO calculations helper */ #define LOG_LEVEL LOG_INF #ifndef __RAINE__ -#define LOG(n,x) if( (n)>=LOG_LEVEL ) logerror x +#define LOG(n,x) do { if( (n)>=LOG_LEVEL ) logerror x; } while (0) #endif /* limitter */ diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index 5077dc52d90..f068ec0d805 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -34,13 +34,16 @@ Registers per channel: ***************************************************************************/ #include "sndintrf.h" +#include "cpuintrf.h" #include "streams.h" #include "gaelco.h" #include "wavwrite.h" +#define VERBOSE_SOUND 0 +#define VERBOSE_READ_WRITES 0 +#define LOG_SOUND(x) do { if (VERBOSE_SOUND) logerror x; } while (0) +#define LOG_READ_WRITES(x) do { if (VERBOSE_READ_WRITES) logerror x; } while (0) -//#define LOG_SOUND 1 -//#define LOG_READ_WRITES 1 //#define LOG_WAVE 1 //#define ALT_MIX @@ -137,9 +140,7 @@ static void gaelco_update(void *param, stream_sample_t **inputs, stream_sample_t gaelco_sndregs[base_offset + 3]--; } } else { -#ifdef LOG_SOUND - logerror("(GAE1) Playing unknown sample format in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", ch, type, bank, end_pos, gaelco_sndregs[base_offset + 3]); -#endif + LOG_SOUND(("(GAE1) Playing unknown sample format in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", ch, type, bank, end_pos, gaelco_sndregs[base_offset + 3])); channel->active = 0; } @@ -191,9 +192,7 @@ static void gaelco_update(void *param, stream_sample_t **inputs, stream_sample_t READ16_HANDLER( gaelcosnd_r ) { -#ifdef LOG_READ_WRITES - logerror("%06x: (GAE1): read from %04x\n", activecpu_get_pc(), offset); -#endif + LOG_READ_WRITES(("%06x: (GAE1): read from %04x\n", activecpu_get_pc(), offset)); return gaelco_sndregs[offset]; } @@ -207,9 +206,7 @@ WRITE16_HANDLER( gaelcosnd_w ) struct GAELCOSND *info = sndti_token(chip_type, 0); struct gaelcosnd_channel *channel = &info->channel[offset >> 3]; -#ifdef LOG_READ_WRITES - logerror("%06x: (GAE1): write %04x to %04x\n", activecpu_get_pc(), data, offset); -#endif + LOG_READ_WRITES(("%06x: (GAE1): write %04x to %04x\n", activecpu_get_pc(), data, offset)); /* first update the stream to this point in time */ stream_update(info->stream); @@ -224,9 +221,7 @@ WRITE16_HANDLER( gaelcosnd_w ) channel->active = 1; channel->chunkNum = 0; channel->loop = 0; -#ifdef LOG_SOUND - logerror("(GAE1) Playing sample channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (gaelco_sndregs[offset - 2] >> 4) & 0x0f, gaelco_sndregs[offset - 2] & 0x03, gaelco_sndregs[offset - 1] << 8, data); -#endif + LOG_SOUND(("(GAE1) Playing sample channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (gaelco_sndregs[offset - 2] >> 4) & 0x0f, gaelco_sndregs[offset - 2] & 0x03, gaelco_sndregs[offset - 1] << 8, data)); } } else { channel->active = 0; @@ -236,9 +231,7 @@ WRITE16_HANDLER( gaelcosnd_w ) case 0x07: /* enable/disable looping */ if ((gaelco_sndregs[offset - 1] != 0) && (data != 0)){ -#ifdef LOG_SOUND - logerror("(GAE1) Looping in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (gaelco_sndregs[offset - 2] >> 4) & 0x0f, gaelco_sndregs[offset - 2] & 0x03, gaelco_sndregs[offset - 1] << 8, data); -#endif + LOG_SOUND(("(GAE1) Looping in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (gaelco_sndregs[offset - 2] >> 4) & 0x0f, gaelco_sndregs[offset - 2] & 0x03, gaelco_sndregs[offset - 1] << 8, data)); channel->loop = 1; } else { channel->loop = 0; diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c index 1677ed3085b..9900c06912c 100644 --- a/src/emu/sound/k054539.c +++ b/src/emu/sound/k054539.c @@ -1,6 +1,3 @@ -#define CHANNEL_DEBUG 0 -#define VERBOSE 0 - /********************************************************* Konami 054539 PCM Sound Chip @@ -25,6 +22,10 @@ CHANNEL_DEBUG enables the following keys: #include "k054539.h" #include +#define CHANNEL_DEBUG 0 +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) + /* Registers: 00..ff: 20 bytes/channel, 8 channels 00..02: pitch (lsb, mid, msb) @@ -333,9 +334,7 @@ else break; } default: -#if VERBOSE - logerror("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch); -#endif + LOG(("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch)); break; } chan->pos = cur_pos; @@ -573,7 +572,7 @@ static void K054539_w(int chip, offs_t offset, UINT8 data) //* break; default: -#if VERBOSE +#if 0 if(regbase[offset] != data) { if((offset & 0xff00) == 0) { chanoff = offset & 0x1f; @@ -619,9 +618,7 @@ static UINT8 K054539_r(int chip, offs_t offset) case 0x22c: break; default: -#if VERBOSE - logerror("K054539 read %03x\n", offset); -#endif + LOG(("K054539 read %03x\n", offset)); break; } return info->regs[offset]; diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index 8a557067edc..f91a0d586d1 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -86,35 +86,15 @@ #define VERBOSE_POLY 0 #define VERBOSE_RAND 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) -#if VERBOSE_SOUND -#define LOG_SOUND(x) logerror x -#else -#define LOG_SOUND(x) -#endif +#define LOG_SOUND(x) do { if (VERBOSE_SOUND) logerror x; } while (0) -#if VERBOSE_TIMER -#define LOG_TIMER(x) logerror x -#else -#define LOG_TIMER(x) -#endif +#define LOG_TIMER(x) do { if (VERBOSE_TIMER) logerror x; } while (0) -#if VERBOSE_POLY -#define LOG_POLY(x) logerror x -#else -#define LOG_POLY(x) -#endif +#define LOG_POLY(x) do { if (VERBOSE_POLY) logerror x; } while (0) -#if VERBOSE_RAND -#define LOG_RAND(x) logerror x -#else -#define LOG_RAND(x) -#endif +#define LOG_RAND(x) do { if (VERBOSE_RAND) logerror x; } while (0) #define CHAN1 0 #define CHAN2 1 @@ -721,7 +701,6 @@ static TIMER_CALLBACK( pokey_timer_expire ) } } -#if VERBOSE_SOUND static char *audc2str(int val) { static char buff[80]; @@ -771,7 +750,6 @@ static char *audctl2str(int val) strcat(buff,"+clk15"); return buff; } -#endif static TIMER_CALLBACK( pokey_serin_ready ) { diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c index b95181ba827..e9b023a872b 100644 --- a/src/emu/sound/qsound.c +++ b/src/emu/sound/qsound.c @@ -40,7 +40,8 @@ Debug defines */ #define LOG_WAVE 0 -#define LOG_QSOUND 0 +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* 8 bit source ROM samples */ typedef INT8 QSOUND_SRC_SAMPLE; @@ -117,11 +118,10 @@ static void *qsound_start(int sndindex, int clock, const void *config) chip->pan_table[i]=(int)((256/sqrt(32)) * sqrt(i)); } -#if LOG_QSOUND - logerror("Pan table\n"); + LOG(("Pan table\n")); for (i=0; i<33; i++) - logerror("%02x ", chip->pan_table[i]); -#endif + LOG(("%02x ", chip->pan_table[i])); + { /* Allocate stream */ chip->stream = stream_create( @@ -307,9 +307,7 @@ static void qsound_set_command(struct qsound_info *chip, int data, int value) */ break; } -#if LOG_QSOUND - logerror("QSOUND WRITE %02x CH%02d-R%02d =%04x\n", data, ch, reg, value); -#endif + LOG(("QSOUND WRITE %02x CH%02d-R%02d =%04x\n", data, ch, reg, value)); } diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c index a9a25eac9f3..029167b8d52 100644 --- a/src/emu/sound/sn76477.c +++ b/src/emu/sound/sn76477.c @@ -66,11 +66,7 @@ #define LOG_WAV_FILE_NAME "sn76477_%d.wav" -#if VERBOSE -#define LOG(n,x) if (VERBOSE >= (n)) logerror x -#else -#define LOG(n,x) -#endif +#define LOG(n,x) do { if (VERBOSE >= (n)) logerror x; } while (0) #define CHECK_CHIP_NUM assert(sn != NULL) #define CHECK_CHIP_NUM_AND_BOOLEAN CHECK_CHIP_NUM; assert((data & 0x01) == data) @@ -642,12 +638,10 @@ static double compute_center_to_peak_voltage_out(struct SN76477 *sn) static void log_enable_line(struct SN76477 *sn) { -#if VERBOSE static const char *const desc[] = { "Enabled", "Inhibited" }; -#endif LOG(1, ("SN76477 #%d: Enable line (9): %d [%s]\n", sn->index, sn->enable, desc[sn->enable])); } @@ -655,13 +649,11 @@ static void log_enable_line(struct SN76477 *sn) static void log_mixer_mode(struct SN76477 *sn) { -#if VERBOSE const char *desc[] = { "VCO", "SLF", "Noise", "VCO/Noise", "SLF/Noise", "SLF/VCO/Noise", "SLF/VCO", "Inhibit" }; -#endif LOG(1, ("SN76477 #%d: Mixer mode (25-27): %d [%s]\n", sn->index, sn->mixer_mode, desc[sn->mixer_mode])); } @@ -669,12 +661,10 @@ static void log_mixer_mode(struct SN76477 *sn) static void log_envelope_mode(struct SN76477 *sn) { -#if VERBOSE const char *desc[] = { "VCO", "One-Shot", "Mixer Only", "VCO with Alternating Polarity" }; -#endif LOG(1, ("SN76477 #%d: Envelope mode (1,28): %d [%s]\n", sn->index, sn->envelope_mode, desc[sn->envelope_mode])); } @@ -682,12 +672,10 @@ static void log_envelope_mode(struct SN76477 *sn) static void log_vco_mode(struct SN76477 *sn) { -#if VERBOSE const char *desc[] = { "External (Pin 16)", "Internal (SLF)" }; -#endif LOG(1, ("SN76477 #%d: VCO mode (22): %d [%s]\n", sn->index, sn->vco_mode, desc[sn->vco_mode])); } diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c index f7d315fd306..67f75baeb00 100644 --- a/src/emu/sound/sp0256.c +++ b/src/emu/sound/sp0256.c @@ -50,17 +50,9 @@ #define VERBOSE 0 #define DEBUG_FIFO 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) -#ifdef DEBUG_FIFO -#define LOG_FIFO(x) logerror x -#else -#define LOG_FIFO(x) -#endif +#define LOG_FIFO(x) do { if (DEBUG_FIFO) logerror x; } while (0) #define SET_SBY(line_state) { \ if( sp->sby_line != line_state ) \ diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c index c1c121fa5f3..0b5f5ac9d2b 100644 --- a/src/emu/sound/st0016.c +++ b/src/emu/sound/st0016.c @@ -10,6 +10,7 @@ #include "st0016.h" #define VERBOSE (0) +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) UINT8 *st0016_sound_regs; @@ -26,9 +27,7 @@ WRITE8_HANDLER(st0016_snd_w) int voice = offset/32; int reg = offset & 0x1f; int oldreg = st0016_sound_regs[offset]; -#if VERBOSE int vbase = offset & ~0x1f; -#endif st0016_sound_regs[offset] = data; @@ -38,15 +37,13 @@ WRITE8_HANDLER(st0016_snd_w) { info->vpos[voice] = info->frac[voice] = info->lponce[voice] = 0; -#if VERBOSE - logerror("Key on V%02d: st %06x-%06x lp %06x-%06x frq %x flg %x\n", voice, + LOG(("Key on V%02d: st %06x-%06x lp %06x-%06x frq %x flg %x\n", voice, st0016_sound_regs[vbase+2]<<16 | st0016_sound_regs[vbase+1]<<8 | st0016_sound_regs[vbase+2], st0016_sound_regs[vbase+0xe]<<16 | st0016_sound_regs[vbase+0xd]<<8 | st0016_sound_regs[vbase+0xc], st0016_sound_regs[vbase+6]<<16 | st0016_sound_regs[vbase+5]<<8 | st0016_sound_regs[vbase+4], st0016_sound_regs[vbase+0xa]<<16 | st0016_sound_regs[vbase+0x9]<<8 | st0016_sound_regs[vbase+0x8], st0016_sound_regs[vbase+0x11]<<8 | st0016_sound_regs[vbase+0x10], - st0016_sound_regs[vbase+0x16]); -#endif + st0016_sound_regs[vbase+0x16])); } } } diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c index 250634bb826..9d250d85e4a 100644 --- a/src/emu/sound/tms36xx.c +++ b/src/emu/sound/tms36xx.c @@ -4,11 +4,7 @@ #define VERBOSE 1 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) #define VMIN 0x0000 #define VMAX 0x7fff @@ -465,7 +461,7 @@ static void tms3617_enable(struct TMS36XX *tms, int enable) if (enable & (1 << i)) { bits += 2; /* each voice has two instances */ -#if VERBOSE + switch (i) { case 0: LOG((" 16'")); break; @@ -475,7 +471,6 @@ static void tms3617_enable(struct TMS36XX *tms, int enable) case 4: LOG((" 2 2/3'")); break; case 5: LOG((" 2'")); break; } -#endif } } /* set the enable mask and number of active voices */ diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c index b9df5e5884c..bbe8e757371 100644 --- a/src/emu/sound/x1_010.c +++ b/src/emu/sound/x1_010.c @@ -53,19 +53,21 @@ Hardcoded Values: ***************************************************************************/ #include "sndintrf.h" +#include "cpuintrf.h" #include "streams.h" #include "x1_010.h" +#define VERBOSE_SOUND 0 +#define VERBOSE_REGISTER_WRITE 0 +#define VERBOSE_REGISTER_READ 0 -#define LOG_SOUND 0 +#define LOG_SOUND(x) do { if (VERBOSE_SOUND) logerror x; } while (0) +#define LOG_REGISTER_WRITE(x) do { if (VERBOSE_REGISTER_WRITE) logerror x; } while (0) +#define LOG_REGISTER_READ(x) do { if (VERBOSE_REGISTER_READ) logerror x; } while (0) #define SETA_NUM_CHANNELS 16 - -#define LOG_REGISTER_WRITE 0 -#define LOG_REGISTER_READ 0 - #define FREQ_BASE_BITS 8 // Frequency fixed decimal shift bits #define ENV_BASE_BITS 16 // wave form envelope fixed decimal shift bits #define VOL_BASE (2*32*256/30) // Volume base @@ -134,12 +136,10 @@ static void seta_update( void *param, stream_sample_t **inputs, stream_sample_t if( freq == 0 ) freq = 4; smp_step = (UINT32)((float)info->base_clock/8192.0 *freq*(1<rate); -#if LOG_SOUND if( smp_offs == 0 ) { - logerror( "Play sample %06X - %06X, channel %X volume %d freq %X step %X offset %X\n", - start, end, ch, vol, freq, smp_step, smp_offs ); + LOG_SOUND(( "Play sample %p - %p, channel %X volume %d:%d freq %X step %X offset %X\n", + start, end, ch, volL, volR, freq, smp_step, smp_offs )); } -#endif for( i = 0; i < length; i++ ) { delta = smp_offs>>FREQ_BASE_BITS; // sample ended? @@ -162,13 +162,11 @@ static void seta_update( void *param, stream_sample_t **inputs, stream_sample_t env = (UINT8 *)&(info->reg[reg->end*128]); env_offs = info->env_offset[ch]; env_step = (UINT32)((float)info->base_clock/128.0/1024.0/4.0*reg->start*(1<rate); -#if LOG_SOUND -/* Print some more debug info */ + /* Print some more debug info */ if( smp_offs == 0 ) { - logerror( "Play waveform %X, channel %X volume %X freq %4X step %X offset %X\n", - reg->volume, ch, reg->end, freq, smp_step, smp_offs ); + LOG_SOUND(( "Play waveform %X, channel %X volume %X freq %4X step %X offset %X\n", + reg->volume, ch, reg->end, freq, smp_step, smp_offs )); } -#endif for( i = 0; i < length; i++ ) { int vol; delta = env_offs>>ENV_BASE_BITS; @@ -212,10 +210,9 @@ static void *x1_010_start(int sndindex, int clock, const void *config) info->smp_offset[i] = 0; info->env_offset[i] = 0; } -#if LOG_SOUND /* Print some more debug info */ - logerror("masterclock = %d rate = %d\n", master_clock, info->rate ); -#endif + LOG_SOUND(("masterclock = %d rate = %d\n", clock, info->rate )); + /* get stream channels */ info->stream = stream_create(0,2,info->rate,info,seta_update); @@ -258,9 +255,7 @@ WRITE8_HANDLER( seta_sound_w ) info->smp_offset[channel] = 0; info->env_offset[channel] = 0; } -#if LOG_REGISTER_WRITE - logerror("PC: %06X : offset %6X : data %2X\n", activecpu_get_pc(), offset, data ); -#endif + LOG_REGISTER_WRITE(("PC: %06X : offset %6X : data %2X\n", activecpu_get_pc(), offset, data )); info->reg[offset] = data; } @@ -276,9 +271,7 @@ READ16_HANDLER( seta_sound_word_r ) ret = info->HI_WORD_BUF[offset]<<8; ret += (seta_sound_r( offset )&0xff); -#if LOG_REGISTER_READ - logerror( "Read X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, ret ); -#endif + LOG_REGISTER_READ(( "Read X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, ret )); return ret; } @@ -287,9 +280,7 @@ WRITE16_HANDLER( seta_sound_word_w ) struct x1_010_info *info = sndti_token(SOUND_X1_010, 0); info->HI_WORD_BUF[offset] = (data>>8)&0xff; seta_sound_w( offset, data&0xff ); -#if LOG_REGISTER_WRITE - logerror( "Write X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, data ); -#endif + LOG_REGISTER_WRITE(( "Write X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, data )); } diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c index 25abb08cbf1..339e189be08 100644 --- a/src/emu/sound/ymf278b.c +++ b/src/emu/sound/ymf278b.c @@ -63,7 +63,8 @@ #include "cpuintrf.h" #include "ymf278b.h" -#undef VERBOSE +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) typedef struct { @@ -183,9 +184,7 @@ static void ymf278b_envelope_next(YMF278BSlot *slot) // Attack slot->env_vol = (256U << 23) - 1; slot->env_vol_lim = 256U<<23; -#ifdef VERBOSE - logerror("YMF278B: Skipping attack (rate = %d)\n", slot->AR); -#endif + LOG(("YMF278B: Skipping attack (rate = %d)\n", slot->AR)); slot->env_step++; } if(slot->env_step == 1) @@ -196,9 +195,8 @@ static void ymf278b_envelope_next(YMF278BSlot *slot) if(slot->DL) { int rate = ymf278b_compute_rate(slot, slot->D1R); -#ifdef VERBOSE - logerror("YMF278B: Decay step 1, dl=%d, val = %d rate = %d, delay = %g\n", slot->DL, slot->D1R, rate, ymf278_compute_decay_rate(rate)*1000.0); -#endif + LOG(("YMF278B: Decay step 1, dl=%d, val = %d rate = %d, delay = %g\n", slot->DL, slot->D1R, rate, ymf278_compute_decay_rate(rate)*1000.0)); + if(rate<4) slot->env_vol_step = 0; else @@ -211,9 +209,8 @@ static void ymf278b_envelope_next(YMF278BSlot *slot) { // Decay 2 int rate = ymf278b_compute_rate(slot, slot->D2R); -#ifdef VERBOSE - logerror("YMF278B: Decay step 2, val = %d, rate = %d, delay = %g, current vol = %d\n", slot->D2R, rate, ymf278_compute_decay_rate(rate)*1000.0, slot->env_vol >> 23); -#endif + + LOG(("YMF278B: Decay step 2, val = %d, rate = %d, delay = %g, current vol = %d\n", slot->D2R, rate, ymf278_compute_decay_rate(rate)*1000.0, slot->env_vol >> 23)); if(rate<4) slot->env_vol_step = 0; else @@ -225,9 +222,7 @@ static void ymf278b_envelope_next(YMF278BSlot *slot) if(slot->env_step == 3) { // Decay 2 reached -96dB -#ifdef VERBOSE - logerror("YMF278B: Voice cleared because of decay 2\n"); -#endif + LOG(("YMF278B: Voice cleared because of decay 2\n")); slot->env_vol = 256U<<23; slot->env_vol_step = 0; slot->env_vol_lim = 0; @@ -238,9 +233,8 @@ static void ymf278b_envelope_next(YMF278BSlot *slot) { // Release int rate = ymf278b_compute_rate(slot, slot->RR); -#ifdef VERBOSE - logerror("YMF278B: Release, val = %d, rate = %d, delay = %g\n", slot->RR, rate, ymf278_compute_decay_rate(rate)*1000.0); -#endif + + LOG(("YMF278B: Release, val = %d, rate = %d, delay = %g\n", slot->RR, rate, ymf278_compute_decay_rate(rate)*1000.0)); if(rate<4) slot->env_vol_step = 0; else @@ -252,9 +246,7 @@ static void ymf278b_envelope_next(YMF278BSlot *slot) if(slot->env_step == 5) { // Release reached -96dB -#ifdef VERBOSE - logerror("YMF278B: Release ends\n"); -#endif + LOG(("YMF278B: Release ends\n")); slot->env_vol = 256U<<23; slot->env_vol_step = 0; slot->env_vol_lim = 0; @@ -533,17 +525,13 @@ static void ymf278b_C_w(YMF278BChip *chip, UINT8 reg, UINT8 data) ymf278b_envelope_next(slot); -#ifdef VERBOSE - logerror("YMF278B: slot %2d wave %3d lfo=%d vib=%d ar=%d d1r=%d dl=%d d2r=%d rc=%d rr=%d am=%d\n", snum, slot->wave, - slot->lfo, slot->vib, slot->AR, slot->D1R, slot->DL, slot->D2R, slot->RC, slot->RR, slot->AM); - logerror(" b=%d, start=%x, loop=%x, end=%x, oct=%d, fn=%d, step=%x\n", slot->bits, slot->startaddr, slot->loopaddr>>16, slot->endaddr>>16, oct, slot->FN, slot->step); -#endif + LOG(("YMF278B: slot %2d wave %3d lfo=%d vib=%d ar=%d d1r=%d dl=%d d2r=%d rc=%d rr=%d am=%d\n", snum, slot->wave, + slot->lfo, slot->vib, slot->AR, slot->D1R, slot->DL, slot->D2R, slot->RC, slot->RR, slot->AM)); + LOG((" b=%d, start=%x, loop=%x, end=%x, oct=%d, fn=%d, step=%x\n", slot->bits, slot->startaddr, slot->loopaddr>>16, slot->endaddr>>16, oct, slot->FN, slot->step)); } else { -#ifdef VERBOSE - logerror("YMF278B: slot %2d off\n", snum); -#endif + LOG(("YMF278B: slot %2d off\n", snum)); if(slot->active) { slot->env_step = 4; diff --git a/src/emu/state.c b/src/emu/state.c index a0c7073e9e0..7cd6fc75b61 100644 --- a/src/emu/state.c +++ b/src/emu/state.c @@ -30,13 +30,9 @@ DEBUGGING ***************************************************************************/ -#define VERBOSE +#define VERBOSE 0 -#ifdef VERBOSE -#define TRACE(x) do {x;} while (0) -#else -#define TRACE(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) @@ -746,12 +742,12 @@ int state_save_save_begin(mame_file *file) if (ss_illegal_regs > 0) return 1; - TRACE(logerror("Beginning save\n")); + LOG(("Beginning save\n")); ss_dump_file = file; /* compute the total dump size and the offsets of each element */ ss_dump_size = compute_size_and_offsets(); - TRACE(logerror(" total size %u\n", ss_dump_size)); + LOG((" total size %u\n", ss_dump_size)); /* allocate memory for the array */ ss_dump_array = malloc_or_die(ss_dump_size); @@ -769,22 +765,22 @@ void state_save_save_continue(void) ss_entry *entry; int count; - TRACE(logerror("Saving tag %d\n", ss_current_tag)); + LOG(("Saving tag %d\n", ss_current_tag)); /* call the pre-save functions */ - TRACE(logerror(" calling pre-save functions\n")); + LOG((" calling pre-save functions\n")); count = call_hook_functions(ss_prefunc_reg); - TRACE(logerror(" %d functions called\n", count)); + LOG((" %d functions called\n", count)); /* then copy in all the data */ - TRACE(logerror(" copying data\n")); + LOG((" copying data\n")); /* iterate over entries with matching tags */ for (entry = ss_registry; entry; entry = entry->next) if (entry->tag == ss_current_tag) { memcpy(ss_dump_array + entry->offset, entry->data, entry->typesize * entry->typecount); - TRACE(logerror(" %s: %x..%x\n", astring_c(entry->name), entry->offset, entry->offset + entry->typesize * entry->typecount - 1)); + LOG((" %s: %x..%x\n", astring_c(entry->name), entry->offset, entry->offset + entry->typesize * entry->typecount - 1)); } } @@ -799,7 +795,7 @@ void state_save_save_finish(void) UINT32 signature; UINT8 flags = 0; - TRACE(logerror("Finishing save\n")); + LOG(("Finishing save\n")); /* compute the flags */ #ifndef LSB_FIRST @@ -840,7 +836,7 @@ void state_save_save_finish(void) int state_save_load_begin(mame_file *file) { - TRACE(logerror("Beginning load\n")); + LOG(("Beginning load\n")); /* read the file into memory */ ss_dump_size = mame_fsize(file); @@ -882,8 +878,8 @@ void state_save_load_continue(void) need_convert = (ss_dump_array[9] & SS_MSB_FIRST) == 0; #endif - TRACE(logerror("Loading tag %d\n", ss_current_tag)); - TRACE(logerror(" copying data\n")); + LOG(("Loading tag %d\n", ss_current_tag)); + LOG((" copying data\n")); /* iterate over entries with matching tags */ for (entry = ss_registry; entry; entry = entry->next) @@ -892,13 +888,13 @@ void state_save_load_continue(void) memcpy(entry->data, ss_dump_array + entry->offset, entry->typesize * entry->typecount); if (need_convert && ss_conv[entry->typesize]) (*ss_conv[entry->typesize])(entry->data, entry->typecount); - TRACE(logerror(" %s: %x..%x\n", astring_c(entry->name), entry->offset, entry->offset + entry->typesize * entry->typecount - 1)); + LOG((" %s: %x..%x\n", astring_c(entry->name), entry->offset, entry->offset + entry->typesize * entry->typecount - 1)); } /* call the post-load functions */ - TRACE(logerror(" calling post-load functions\n")); + LOG((" calling post-load functions\n")); count = call_hook_functions(ss_postfunc_reg); - TRACE(logerror(" %d functions called\n", count)); + LOG((" %d functions called\n", count)); } @@ -909,7 +905,7 @@ void state_save_load_continue(void) void state_save_load_finish(void) { - TRACE(logerror("Finishing load\n")); + LOG(("Finishing load\n")); /* free memory and reset the global states */ free(ss_dump_array); @@ -956,11 +952,9 @@ const char *state_save_get_indexed_item(int index, void **base, UINT32 *valsize, void state_save_dump_registry(void) { -#ifdef VERBOSE ss_entry *entry; for (entry = ss_registry; entry; entry=entry->next) - logerror("%s: %d x %d\n", astring_c(entry->name), entry->typesize, entry->typecount); -#endif + LOG(("%s: %d x %d\n", astring_c(entry->name), entry->typesize, entry->typecount)); } diff --git a/src/emu/streams.c b/src/emu/streams.c index e8b5d753f7f..c08fc7dac14 100644 --- a/src/emu/streams.c +++ b/src/emu/streams.c @@ -55,11 +55,7 @@ #define VERBOSE (0) -#if VERBOSE -#define VPRINTF(x) mame_printf_debug x -#else -#define VPRINTF(x) -#endif +#define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0) diff --git a/src/emu/timer.c b/src/emu/timer.c index 3cd4abb5008..aa90d6cacd9 100644 --- a/src/emu/timer.c +++ b/src/emu/timer.c @@ -22,11 +22,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) do { logerror x; } while (0) -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) @@ -304,7 +300,7 @@ void timer_set_global_time(attotime newbase) /* set the new global offset */ global_basetime = newbase; - LOG(("timer_set_global_time: new=%s head->expire=%s\n", attotime_string(newbase), attotime_string(timer_head->expire))); + LOG(("timer_set_global_time: new=%s head->expire=%s\n", attotime_string(newbase, 9), attotime_string(timer_head->expire, 9))); /* now process any timers that are overdue */ while (attotime_compare(timer_head->expire, global_basetime) <= 0) diff --git a/src/emu/video.c b/src/emu/video.c index fd7324c785c..408a91af7f7 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -28,7 +28,8 @@ ***************************************************************************/ #define LOG_THROTTLE (0) -#define LOG_PARTIAL_UPDATES(x) /* logerror x */ +#define VERBOSE (0) +#define LOG_PARTIAL_UPDATES(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c index 82287ad30eb..865fcd31286 100644 --- a/src/lib/util/cdrom.c +++ b/src/lib/util/cdrom.c @@ -24,8 +24,9 @@ ***************************************************************************/ #define VERBOSE (0) +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) - +void CLIB_DECL logerror(const char *text,...); /*************************************************************************** TYPE DEFINITIONS @@ -123,9 +124,7 @@ cdrom_file *cdrom_open(chd_file *chd) return NULL; } - #if VERBOSE - logerror("CD has %d tracks\n", file->cdtoc.numtrks); - #endif + LOG(("CD has %d tracks\n", file->cdtoc.numtrks)); /* calculate the starting frame for each track, keeping in mind that CHDMAN pads tracks out with extra frames to fit hunk size boundries @@ -140,8 +139,7 @@ cdrom_file *cdrom_open(chd_file *chd) chdofs += file->cdtoc.tracks[i].frames; chdofs += file->cdtoc.tracks[i].extraframes; - #if VERBOSE - logerror("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d physofs %d chdofs %d\n", i+1, + LOG(("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d physofs %d chdofs %d\n", i+1, file->cdtoc.tracks[i].trktype, file->cdtoc.tracks[i].subtype, file->cdtoc.tracks[i].datasize, @@ -149,8 +147,7 @@ cdrom_file *cdrom_open(chd_file *chd) file->cdtoc.tracks[i].frames, file->cdtoc.tracks[i].extraframes, file->cdtoc.tracks[i].physframeofs, - file->cdtoc.tracks[i].chdframeofs); - #endif + file->cdtoc.tracks[i].chdframeofs)); } /* fill out dummy entries for the last track to help our search */ @@ -237,9 +234,7 @@ UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 return 1; } - #if VERBOSE - logerror("CDROM: Conversion from type %d to type %d not supported!\n", tracktype, datatype); - #endif + LOG(("CDROM: Conversion from type %d to type %d not supported!\n", tracktype, datatype)); return 0; } return 1; diff --git a/src/mame/audio/amiga.c b/src/mame/audio/amiga.c index 0d257a3e1cf..14ef5e116f9 100644 --- a/src/mame/audio/amiga.c +++ b/src/mame/audio/amiga.c @@ -20,8 +20,8 @@ * *************************************/ -#define LOG(x) -//#define LOG(x) logerror x +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/mame/audio/galaxian.c b/src/mame/audio/galaxian.c index ff1dfe2e6c3..697e3df8a39 100644 --- a/src/mame/audio/galaxian.c +++ b/src/mame/audio/galaxian.c @@ -31,11 +31,7 @@ #define MINFREQ (139-139/3) #define MAXFREQ (139+139/3) -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) static emu_timer *lfotimer = NULL; static INT32 freq = MAXFREQ; diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c index fede97adc14..63299115228 100644 --- a/src/mame/audio/segasnd.c +++ b/src/mame/audio/segasnd.c @@ -17,8 +17,8 @@ #include "segasnd.h" #include - -#define LOG(x) /* logerror x */ +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /*************************************************************************** diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c index 46c6294a23e..f4f82acbd2a 100644 --- a/src/mame/drivers/bfm_sc2.c +++ b/src/mame/drivers/bfm_sc2.c @@ -163,15 +163,16 @@ Adder hardware: #include "slots.lh" #ifdef MAME_DEBUG -#define LOG_SERIAL(x) logerror x // log serial communication between mainboard (scorpion2) and videoboard (adder2) -#define UART_LOG(x) logerror x //enable UART data logging -#define LOG(x) logerror x +#define VERBOSE 1 #else -#define LOG_SERIAL(x) -#define UART_LOG(x) -#define LOG(x) +#define VERBOSE 0 #endif +// log serial communication between mainboard (scorpion2) and videoboard (adder2) +#define LOG_SERIAL(x) do { if (VERBOSE) logerror x; } while (0) +#define UART_LOG(x) do { if (VERBOSE) logerror x; } while (0) +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) + // local prototypes /////////////////////////////////////////////////////// static int get_scorpion2_uart_status(void); // retrieve status of uart on scorpion2 board diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c index 8b6fd2f8ccb..e64c38abc67 100644 --- a/src/mame/drivers/konamigx.c +++ b/src/mame/drivers/konamigx.c @@ -94,8 +94,6 @@ * */ -#define GX_DEBUG 0 - #include "driver.h" #include "video/konamiic.h" @@ -106,6 +104,8 @@ #include "machine/konamigx.h" #include "machine/adc083x.h" +#define GX_DEBUG 0 + VIDEO_START(konamigx_5bpp); VIDEO_START(konamigx_6bpp); VIDEO_START(konamigx_6bpp_2); diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index 1673628b498..a546ffffe4b 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -255,19 +255,17 @@ TODO: - Fix lamp timing, MAME doesn't update fast enough to see everything #include "machine/meters.h" #ifdef MAME_DEBUG -#define LOG(x)logerror x -#define LOG_CHR(x)logerror x -#define LOG_CHR_FULL(x)logerror x -#define LOG_IC3(x)logerror x -#define LOG_IC8(x)logerror x +#define VERBOSE 1 #else -#define LOG(x) -#define LOG_CHR(x) -#define LOG_CHR_FULL(x) -#define LOG_IC3(x) -#define LOG_IC8(x) +#define VERBOSE 0 #endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) +#define LOG_CHR(x) do { if (VERBOSE) logerror x; } while (0) +#define LOG_CHR_FULL(x) do { if (VERBOSE) logerror x; } while (0) +#define LOG_IC3(x) do { if (VERBOSE) logerror x; } while (0) +#define LOG_IC8(x) do { if (VERBOSE) logerror x; } while (0) + #ifndef AWP_VIDEO //Defined for fruit machines with mechanical reels #define draw_reel(x) #else diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index 391ff4ee3a7..b6ec553be22 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -182,11 +182,13 @@ TODO: - Confirm that MC6850 emulation is sufficient. #include "video/crtc6845.h" #ifdef MAME_DEBUG -#define LOGSTUFF(x)logerror x +#define VERBOSE 1 #else -#define LOGSTUFF(x) +#define VERBOSE 0 #endif +#define LOGSTUFF(x) do { if (VERBOSE) logerror x; } while (0) + #define VIDEO_MASTER_CLOCK (10000000) static UINT8 m6840_irq_state; diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c index 52f20e276c6..77fef5f9f9f 100644 --- a/src/mame/drivers/raiden2.c +++ b/src/mame/drivers/raiden2.c @@ -473,7 +473,8 @@ struct _cop_state static cop_state cop_data; -#define COP_LOG(x) logerror x +#define VERBOSE 1 +#define COP_LOG(x) do { if (VERBOSE) logerror x; } while (0) diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c index 47f5e2e834f..fc978bdae77 100644 --- a/src/mame/drivers/srmp6.c +++ b/src/mame/drivers/srmp6.c @@ -76,7 +76,8 @@ static UINT16 *sprram, *sprram_old; static int brightness; -#define SRMP6_VERBOSE 0 +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) static const gfx_layout tiles8x8_layout = { @@ -368,9 +369,7 @@ static WRITE16_HANDLER( video_regs_w ) { case 0x5e/2: // bank switch, used by ROM check -#if SRMP6_VERBOSE - printf("%x\n",data); -#endif + LOG(("%x\n",data)); memory_set_bankptr(1,(UINT16 *)(memory_region(REGION_USER2) + (data & 0x0f)*0x200000)); break; @@ -461,8 +460,7 @@ static WRITE16_HANDLER(srmp6_dma_w) int tempidx=0; /* show params */ -#if SRMP6_VERBOSE - printf("DMA! %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n", + LOG(("DMA! %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n", dmaram[0x00/2], dmaram[0x02/2], dmaram[0x04/2], @@ -476,8 +474,7 @@ static WRITE16_HANDLER(srmp6_dma_w) dmaram[0x14/2], dmaram[0x16/2], dmaram[0x18/2], - dmaram[0x1a/2]); -#endif + dmaram[0x1a/2])); destl=dmaram[9]*0x40000; @@ -513,9 +510,7 @@ static WRITE16_HANDLER(srmp6_dma_w) if(tempidx>=len) { -#if SRMP6_VERBOSE - printf("%x\n",srcdata); -#endif + LOG(("%x\n",srcdata)); return; } } diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 33935de1b6d..ee8b077eb62 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -5,8 +5,6 @@ *************************************************************************/ -#define VERBOSE (0) - #define NEOGEO_MASTER_CLOCK (24000000) #define NEOGEO_MAIN_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 2) #define NEOGEO_AUDIO_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 6) diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index e1979afdd15..a5854c89adb 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -1065,9 +1065,8 @@ READ16_HANDLER( amiga_cia_r ) /* handle the reads */ data = cia_read(which, offset >> 7); -#if LOG_CIA - logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask ^ 0xffff); -#endif + if (LOG_CIA) + logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask ^ 0xffff); return data << shift; } @@ -1084,9 +1083,8 @@ WRITE16_HANDLER( amiga_cia_w ) { int which; -#if LOG_CIA - logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask ^ 0xffff); -#endif + if (LOG_CIA) + logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask ^ 0xffff); /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */ if ((offset & 0x0800) == 0) @@ -1251,9 +1249,8 @@ READ16_HANDLER( amiga_custom_r ) break; } -#if LOG_CUSTOM - logerror("%06X:read from custom %s\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff]); -#endif + if (LOG_CUSTOM) + logerror("%06X:read from custom %s\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff]); return 0xffff; } @@ -1281,9 +1278,8 @@ WRITE16_HANDLER( amiga_custom_w ) UINT16 temp; offset &= 0xff; -#if LOG_CUSTOM - logerror("%06X:write to custom %s = %04X\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff], data); -#endif + if (LOG_CUSTOM) + logerror("%06X:write to custom %s = %04X\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff], data); switch (offset) { diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c index 7219739021d..4d27facdefa 100644 --- a/src/mame/machine/arkanoid.c +++ b/src/mame/machine/arkanoid.c @@ -194,15 +194,9 @@ TO DO (2006.09.12) : */ -#if ARKANOID_BOOTLEG_VERBOSE -#define LOG_F002_R logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_cmd,arkanoid_bootleg_val); -#define LOG_D018_W logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n",activecpu_get_pc(),data,arkanoid_bootleg_cmd); -#define LOG_D008_R logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_d008_val); -#else -#define LOG_F002_R -#define LOG_D018_W -#define LOG_D008_R -#endif +#define LOG_F002_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_cmd,arkanoid_bootleg_val); +#define LOG_D018_W if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n",activecpu_get_pc(),data,arkanoid_bootleg_cmd); +#define LOG_D008_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_d008_val); static UINT8 arkanoid_bootleg_cmd; diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c index 47c92e0415f..ff1a4e248b6 100644 --- a/src/mame/machine/atari.c +++ b/src/mame/machine/atari.c @@ -42,28 +42,31 @@ static void pokey_reset(running_machine *machine); void atari_interrupt_cb(int mask) { -#if VERBOSE_POKEY + if (VERBOSE_POKEY) + { if (mask & 0x80) logerror("atari interrupt_cb BREAK\n"); if (mask & 0x40) logerror("atari interrupt_cb KBCOD\n"); -#endif -#if VERBOSE_SERIAL + } + if (VERBOSE_SERIAL) + { if (mask & 0x20) logerror("atari interrupt_cb SERIN\n"); if (mask & 0x10) logerror("atari interrupt_cb SEROR\n"); if (mask & 0x08) logerror("atari interrupt_cb SEROC\n"); -#endif -#if VERBOSE_TIMERS + } + if (VERBOSE_TIMERS) + { if (mask & 0x04) logerror("atari interrupt_cb TIMR4\n"); if (mask & 0x02) logerror("atari interrupt_cb TIMR2\n"); if (mask & 0x01) logerror("atari interrupt_cb TIMR1\n"); -#endif + } cpunum_set_input_line(0, 0, HOLD_LINE); } diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c index 141629de08c..fc266ed6c2e 100644 --- a/src/mame/machine/decocass.c +++ b/src/mame/machine/decocass.c @@ -291,7 +291,6 @@ WRITE8_HANDLER( decocass_reset_w ) cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 ); } -#ifdef MAME_DEBUG static const char *dirnm(int speed) { if (speed < -1) return "fast rewind"; @@ -300,7 +299,6 @@ static const char *dirnm(int speed) if (speed == 1) return "forward"; return "fast forward"; } -#endif static void tape_crc16(UINT8 data) { diff --git a/src/mame/machine/decocass.h b/src/mame/machine/decocass.h index d6429e8a22e..fad121318d2 100644 --- a/src/mame/machine/decocass.h +++ b/src/mame/machine/decocass.h @@ -3,10 +3,10 @@ #ifdef MAME_DEBUG #define LOGLEVEL 3 -#define LOG(n,x) if (LOGLEVEL >= n) logerror x #else -#define LOG(n,x) +#define LOGLEVEL 0 #endif +#define LOG(n,x) do { if (LOGLEVEL >= n) logerror x; } while (0) extern WRITE8_HANDLER( decocass_coin_counter_w ); extern WRITE8_HANDLER( decocass_sound_command_w ); diff --git a/src/mame/machine/konamigx.c b/src/mame/machine/konamigx.c index 8781f534d23..bd97ede682c 100644 --- a/src/mame/machine/konamigx.c +++ b/src/mame/machine/konamigx.c @@ -1,6 +1,3 @@ -#define VERBOSE 0 -#define GX_DEBUG 0 - /************************************************************************** * * machine/konamigx.c - contains various System GX hardware abstractions @@ -14,6 +11,8 @@ #include "machine/konamigx.h" #include +#define GX_DEBUG 0 + static struct { diff --git a/src/mame/machine/m68kfmly.c b/src/mame/machine/m68kfmly.c index ce980e328fc..4d6d47ece56 100644 --- a/src/mame/machine/m68kfmly.c +++ b/src/mame/machine/m68kfmly.c @@ -15,7 +15,8 @@ Memo: #include "cpu/m68000/m68000.h" -#define TMP68301_DEBUG 0 +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) // TMP68301 System Memory Map @@ -147,90 +148,70 @@ static UINT16 tmp68301_timer[0x50]; READ16_HANDLER( tmp68301_address_decoder_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_address_decoder_r (%08X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_address_decoder_r (%08X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)))); return tmp68301_address_decoder[offset]; } WRITE16_HANDLER( tmp68301_address_decoder_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)), data)); tmp68301_address_decoder[offset] = data; } READ16_HANDLER( tmp68301_interrupt_controller_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)))); return tmp68301_interrupt_controller[offset]; } WRITE16_HANDLER( tmp68301_interrupt_controller_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)), data)); tmp68301_interrupt_controller[offset] = data; } READ16_HANDLER( tmp68301_parallel_interface_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_parallel_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_parallel_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)))); return tmp68301_parallel_interface[offset]; } WRITE16_HANDLER( tmp68301_parallel_interface_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)), data)); tmp68301_parallel_interface[offset] = data; } READ16_HANDLER( tmp68301_serial_interface_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_serial_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_serial_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)))); return tmp68301_serial_interface[offset]; } WRITE16_HANDLER( tmp68301_serial_interface_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)), data)); tmp68301_serial_interface[offset] = data; } READ16_HANDLER( tmp68301_timer_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_timer_r (%08X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_timer_r (%08X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)))); return tmp68301_timer[offset]; } WRITE16_HANDLER( tmp68301_timer_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_timer_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_timer_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)), data)); tmp68301_timer[offset] = data; } diff --git a/src/mame/machine/mathbox.c b/src/mame/machine/mathbox.c index ada570c25ea..4eaf9c3c22d 100644 --- a/src/mame/machine/mathbox.c +++ b/src/mame/machine/mathbox.c @@ -35,7 +35,9 @@ static s16 mb_result = 0; #define REGf mb_reg [0x0f] -/*define MB_TEST*/ +#define MB_TEST 0 +#define LOG(x) do { if (MB_TEST) logerror x; } while (0) + WRITE8_HANDLER( mb_go_w ) { @@ -43,9 +45,7 @@ WRITE8_HANDLER( mb_go_w ) s16 mb_q; /* temp used in division */ int msb; -#ifdef MB_TEST - logerror("math box command %02x data %02x ", offset, data); -#endif + LOG(("math box command %02x data %02x ", offset, data)); switch (offset) { @@ -149,9 +149,7 @@ WRITE8_HANDLER( mb_go_w ) /* fall into command 13 */ case 0x13: -#ifdef MB_TEST - logerror("\nR7: %04x R8: %04x R9: %04x\n", REG7, REG8, REG9); -#endif + LOG(("\nR7: %04x R8: %04x R9: %04x\n", REG7, REG8, REG9)); REGc = REG9; mb_q = REG8; @@ -258,9 +256,7 @@ WRITE8_HANDLER( mb_go_w ) break; } -#ifdef MB_TEST - logerror(" result %04x\n", mb_result & 0xffff); -#endif + LOG((" result %04x\n", mb_result & 0xffff)); } READ8_HANDLER( mb_status_r ) diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c index 5e2b20dca3a..91b91f09c1b 100644 --- a/src/mame/machine/mcr.c +++ b/src/mame/machine/mcr.c @@ -15,8 +15,8 @@ #include "cpu/z80/z80daisy.h" #include "mcr.h" - -#define LOG(x) logerror x +#define VERBOSE 1 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /************************************* diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c index 5f6c3fe7748..dee4e3a4dc4 100644 --- a/src/mame/machine/namcoio.c +++ b/src/mame/machine/namcoio.c @@ -140,6 +140,7 @@ TODO: #define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) struct namcoio { @@ -186,9 +187,7 @@ static void namcoio_51XX_write(int chip,int data) { data &= 0x07; -#if VERBOSE - logerror("%04x: custom 51XX write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: custom 51XX write %02x\n",activecpu_get_pc(),data)); if (io[chip].coincred_mode) { @@ -284,9 +283,7 @@ static const int joy_map[16] = static UINT8 namcoio_51XX_read(int chip) { -#if VERBOSE - logerror("%04x: custom 51XX read\n",activecpu_get_pc()); -#endif + LOG(("%04x: custom 51XX read\n",activecpu_get_pc())); if (io[chip].mode == 0) /* switch mode */ { @@ -518,9 +515,7 @@ static void handle_coins(int chip,int swap) static void namco_customio_56XX_run(int chip) { -#if VERBOSE - logerror("execute 56XX %d mode %d\n",chip,IORAM_READ(8)); -#endif + LOG(("execute 56XX %d mode %d\n",chip,IORAM_READ(8))); switch (IORAM_READ(8)) { @@ -600,9 +595,7 @@ static void namco_customio_56XX_run(int chip) static void namco_customio_59XX_run(int chip) { -#if VERBOSE - logerror("execute 59XX %d mode %d\n",chip,IORAM_READ(8)); -#endif + LOG(("execute 59XX %d mode %d\n",chip,IORAM_READ(8))); switch (IORAM_READ(8)) { @@ -625,9 +618,7 @@ static void namco_customio_59XX_run(int chip) static void namco_customio_58XX_run(int chip) { -#if VERBOSE - logerror("execute 58XX %d mode %d\n",chip,IORAM_READ(8)); -#endif + LOG(("execute 58XX %d mode %d\n",chip,IORAM_READ(8))); switch (IORAM_READ(8)) { @@ -737,9 +728,7 @@ READ8_HANDLER( namcoio_r ) // RAM is 4-bit wide; Pac & Pal requires the | 0xf0 otherwise Easter egg doesn't work offset &= 0x3f; -#if VERBOSE - logerror("%04x: I/O read %d: mode %d, offset %d = %02x\n", activecpu_get_pc(), offset / 16, namcoio_ram[(offset & 0x30) + 8], offset & 0x0f, namcoio_ram[offset]&0x0f); -#endif + LOG(("%04x: I/O read %d: mode %d, offset %d = %02x\n", activecpu_get_pc(), offset / 16, namcoio_ram[(offset & 0x30) + 8], offset & 0x0f, namcoio_ram[offset]&0x0f)); return 0xf0 | namcoio_ram[offset]; } @@ -749,9 +738,7 @@ WRITE8_HANDLER( namcoio_w ) offset &= 0x3f; data &= 0x0f; // RAM is 4-bit wide -#if VERBOSE - logerror("%04x: I/O write %d: offset %d = %02x\n", activecpu_get_pc(), offset / 16, offset & 0x0f, data); -#endif + LOG(("%04x: I/O write %d: offset %d = %02x\n", activecpu_get_pc(), offset / 16, offset & 0x0f, data)); namcoio_ram[offset] = data; } @@ -841,16 +828,12 @@ static TIMER_CALLBACK( nmi_generate ) { if (!cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { -#if VERBOSE - logerror("NMI cpu %d\n",nmi_cpu[param]); -#endif + LOG(("NMI cpu %d\n",nmi_cpu[param])); cpunum_set_input_line(nmi_cpu[param], INPUT_LINE_NMI, PULSE_LINE); } -#if VERBOSE else - logerror("NMI not generated because cpu %d is suspended\n",nmi_cpu[param]); -#endif + LOG(("NMI not generated because cpu %d is suspended\n",nmi_cpu[param])); } static UINT8 customio_command[MAX_06XX]; @@ -885,9 +868,7 @@ void namco_06xx_init(int chipnum, int cpu, static UINT8 namcoio_53XX_digdug_read(int chip) { -#if VERBOSE - logerror("%04x: custom 53XX read\n",activecpu_get_pc()); -#endif + LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); switch ((io[chip].in_count++) % 2) { @@ -900,9 +881,7 @@ static UINT8 namcoio_53XX_digdug_read(int chip) static UINT8 namcoio_53XX_polepos_read(int chip) { -#if VERBOSE - logerror("%04x: custom 53XX read\n",activecpu_get_pc()); -#endif + LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); switch ((io[chip].in_count++) % 8) { @@ -915,9 +894,7 @@ static UINT8 namcoio_53XX_polepos_read(int chip) static UINT8 namco_06xx_data_read(int chipnum) { -#if VERBOSE - logerror("forwarding read to chip %d\n",chipnum%3); -#endif + LOG(("forwarding read to chip %d\n",chipnum%3)); switch (io[chipnum].type) { @@ -935,9 +912,7 @@ static UINT8 namco_06xx_data_read(int chipnum) static void namco_06xx_data_write(int chipnum,UINT8 data) { -#if VERBOSE - logerror("forwarding write to chip %d\n",chipnum%3); -#endif + LOG(("forwarding write to chip %d\n",chipnum%3)); switch (io[chipnum].type) { @@ -955,9 +930,7 @@ static void namco_06xx_data_write(int chipnum,UINT8 data) static void namco_06xx_read_request(int chipnum) { -#if VERBOSE - logerror("requesting read to chip %d\n",chipnum%3); -#endif + LOG(("requesting read to chip %d\n",chipnum%3)); switch (io[chipnum].type) { @@ -972,9 +945,7 @@ static void namco_06xx_read_request(int chipnum) static UINT8 namco_06xx_data_r(int chip,int offset) { -#if VERBOSE - logerror("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset); -#endif + LOG(("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset)); if (!(customio_command[chip] & 0x10)) { @@ -997,9 +968,7 @@ static UINT8 namco_06xx_data_r(int chip,int offset) static void namco_06xx_data_w(int chip,int offset,int data) { -#if VERBOSE - logerror("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data); -#endif + LOG(("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data)); if (customio_command[chip] & 0x10) { @@ -1022,32 +991,25 @@ static void namco_06xx_data_w(int chip,int offset,int data) static UINT8 namco_06xx_ctrl_r(int chip) { -#if VERBOSE - logerror("%04x: 06XX #%d ctrl_r\n",activecpu_get_pc(),chip); -#endif + LOG(("%04x: 06XX #%d ctrl_r\n",activecpu_get_pc(),chip)); return customio_command[chip]; } static void namco_06xx_ctrl_w(int chip,int data) { -#if VERBOSE - logerror("%04x: 06XX #%d command %02x\n",activecpu_get_pc(),chip,data); -#endif + LOG(("%04x: 06XX #%d command %02x\n",activecpu_get_pc(),chip,data)); customio_command[chip] = data; if ((customio_command[chip] & 0x0f) == 0) { -#if VERBOSE - logerror("disabling nmi generate timer\n"); -#endif + LOG(("disabling nmi generate timer\n")); timer_adjust(nmi_timer[chip], attotime_never, chip, attotime_never); } else { -#if VERBOSE - logerror("setting nmi generate timer to 200us\n"); -#endif + LOG(("setting nmi generate timer to 200us\n")); + // this timing is critical. Due to a bug, Bosconian will stop responding to // inputs if a transfer terminates at the wrong time. // On the other hand, the time cannot be too short otherwise the 54XX will diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c index c0f91d84d0f..80ded0754de 100644 --- a/src/mame/machine/pcshare.c +++ b/src/mame/machine/pcshare.c @@ -53,22 +53,12 @@ #endif /* MESS */ #define VERBOSE_DBG 0 /* general debug messages */ -#if VERBOSE_DBG #define DBG_LOG(N,M,A) \ if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time()),(char*)M ); logerror A; } -#else -#define DBG_LOG(n,m,a) -#endif #define VERBOSE_JOY 0 /* JOY (joystick port) */ - -#if VERBOSE_JOY -#define LOG(LEVEL,N,M,A) \ #define JOY_LOG(N,M,A) \ if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time()),(char*)M ); logerror A; } -#else -#define JOY_LOG(n,m,a) -#endif #define FDC_DMA 2 diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c index 87537278b72..f12cbfad355 100644 --- a/src/mame/machine/tait8741.c +++ b/src/mame/machine/tait8741.c @@ -10,7 +10,8 @@ Taito 8741 emulation #include "driver.h" #include "tait8741.h" -#define __log__ 0 +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /**************************************************************************** @@ -99,9 +100,7 @@ static TIMER_CALLBACK( taito8741_serial_tx ) sst = &taito8741[st->connect]; /* transfer data */ taito8741_serial_rx(sst,st->txd); -#if __log__ - logerror("8741-%d Serial data TX to %d\n",num,st->connect); -#endif + LOG(("8741-%d Serial data TX to %d\n",num,st->connect)); if( sst->mode==TAITO8741_SLAVE) sst->serial_out = 1; } @@ -276,9 +275,7 @@ static int I8741_status_r(int num) { I8741 *st = &taito8741[num]; taito8741_update(num); -#if __log__ - logerror("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc()); -#endif + LOG(("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc())); return st->status; } @@ -288,9 +285,8 @@ static int I8741_data_r(int num) I8741 *st = &taito8741[num]; int ret = st->toData; st->status &= 0xfe; -#if __log__ - logerror("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc()); -#endif + LOG(("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc())); + /* update chip */ taito8741_update(num); @@ -307,9 +303,7 @@ static int I8741_data_r(int num) static void I8741_data_w(int num, int data) { I8741 *st = &taito8741[num]; -#if __log__ - logerror("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc()); -#endif + LOG(("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc())); st->fromData = data; st->status |= 0x02; /* update chip */ @@ -320,9 +314,7 @@ static void I8741_data_w(int num, int data) static void I8741_command_w(int num, int data) { I8741 *st = &taito8741[num]; -#if __log__ - logerror("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc()); -#endif + LOG(("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc())); st->fromCmd = data; st->status |= 0x04; /* update chip */ @@ -449,16 +441,13 @@ static void josvolly_8741_do(int num) } } -static void josvolly_8741_w(int num,int offset,int data,int log) +static void josvolly_8741_w(int num,int offset,int data) { JV8741 *mcu = &i8741[num]; if(offset==1) { -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data); -#endif + LOG(("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data)); /* read pointer */ mcu->cmd = data; @@ -496,10 +485,7 @@ if(log) else { /* data */ -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data); -#endif + LOG(("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data)); mcu->txd = data^0x40; /* parity reverce ? */ mcu->sts |= 0x02; /* TXD busy */ @@ -518,7 +504,7 @@ if(log) josvolly_8741_do(num); } -static INT8 josvolly_8741_r(int num,int offset,int log) +static INT8 josvolly_8741_r(int num,int offset) { JV8741 *mcu = &i8741[num]; int ret; @@ -528,26 +514,20 @@ static INT8 josvolly_8741_r(int num,int offset,int log) if(mcu->rst) mcu->rxd = (mcu->initReadPort)(0); /* port in */ ret = mcu->sts; -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret); -#endif + LOG(("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret)); } else { /* clear status port */ mcu->sts &= ~0x01; /* RD ready */ ret = mcu->rxd; -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] DR %02X\n",activecpu_get_pc(),num,ret); -#endif + LOG(("PC=%04X 8741[%d] DR %02X\n",activecpu_get_pc(),num,ret)); mcu->rst = 0; } return ret; } -WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(0,offset,data,1); } -READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(0,offset,1); } -WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(1,offset,data,1); } -READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(1,offset,1); } +WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(0,offset,data); } +READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(0,offset); } +WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(1,offset,data); } +READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(1,offset); } diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c index 5940061dc6b..814e6a72546 100644 --- a/src/mame/machine/taitosj.c +++ b/src/mame/machine/taitosj.c @@ -11,7 +11,8 @@ #include "cpu/m6805/m6805.h" -#define DEBUG_MCU 1 +#define VERBOSE 1 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) static UINT8 fromz80,toz80; @@ -87,24 +88,18 @@ WRITE8_HANDLER( taitosj_bankswitch_w ) ***************************************************************************/ READ8_HANDLER( taitosj_fake_data_r ) { -#if DEBUG_MCU -logerror("%04x: protection read\n",activecpu_get_pc()); -#endif + LOG(("%04x: protection read\n",activecpu_get_pc())); return 0; } WRITE8_HANDLER( taitosj_fake_data_w ) { -#if DEBUG_MCU -logerror("%04x: protection write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data)); } READ8_HANDLER( taitosj_fake_status_r ) { -#if DEBUG_MCU -logerror("%04x: protection status read\n",activecpu_get_pc()); -#endif + LOG(("%04x: protection status read\n",activecpu_get_pc())); return 0xff; } @@ -112,9 +107,7 @@ logerror("%04x: protection status read\n",activecpu_get_pc()); /* timer callback : */ READ8_HANDLER( taitosj_mcu_data_r ) { -#if DEBUG_MCU -logerror("%04x: protection read %02x\n",activecpu_get_pc(),toz80); -#endif + LOG(("%04x: protection read %02x\n",activecpu_get_pc(),toz80)); zaccept = 1; return toz80; } @@ -129,9 +122,7 @@ static TIMER_CALLBACK( taitosj_mcu_real_data_w ) WRITE8_HANDLER( taitosj_mcu_data_w ) { -#if DEBUG_MCU -logerror("%04x: protection write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data)); timer_call_after_resynch(NULL, data,taitosj_mcu_real_data_w); /* temporarily boost the interleave to sync things up */ cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(10)); @@ -149,17 +140,13 @@ READ8_HANDLER( taitosj_mcu_status_r ) READ8_HANDLER( taitosj_68705_portA_r ) { -#if DEBUG_MCU -logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); -#endif + LOG(("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in)); return portA_in; } WRITE8_HANDLER( taitosj_68705_portA_w ) { -#if DEBUG_MCU -logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data)); portA_out = data; } @@ -205,15 +192,11 @@ static TIMER_CALLBACK( taitosj_mcu_status_real_w ) WRITE8_HANDLER( taitosj_68705_portB_w ) { -#if DEBUG_MCU -logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data)); if (~data & 0x01) { -#if DEBUG_MCU -logerror("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc()); -#endif + LOG(("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc())); } if (~data & 0x02) { @@ -221,9 +204,7 @@ logerror("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc()); timer_call_after_resynch(NULL, 0,taitosj_mcu_data_real_r); cpunum_set_input_line(2,0,CLEAR_LINE); portA_in = fromz80; -#if DEBUG_MCU -logerror("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in); -#endif + LOG(("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in)); } if (~data & 0x08) busreq = 1; @@ -231,17 +212,15 @@ logerror("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in); busreq = 0; if (~data & 0x04) { -#if DEBUG_MCU -logerror("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out); -#endif + LOG(("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out)); + /* 68705 is writing data for the Z80 */ timer_call_after_resynch(NULL, portA_out,taitosj_mcu_status_real_w); } if (~data & 0x10) { -#if DEBUG_MCU -logerror("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address); -#endif + LOG(("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address)); + memory_set_context(0); program_write_byte(address, portA_out); memory_set_context(2); @@ -254,22 +233,16 @@ logerror("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out memory_set_context(0); portA_in = program_read_byte(address); memory_set_context(2); -#if DEBUG_MCU -logerror("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),portA_in,address); -#endif + LOG(("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),portA_in,address)); } if (~data & 0x40) { -#if DEBUG_MCU -logerror("%04x: 68705 address low %02x\n",activecpu_get_pc(),portA_out); -#endif + LOG(("%04x: 68705 address low %02x\n",activecpu_get_pc(),portA_out)); address = (address & 0xff00) | portA_out; } if (~data & 0x80) { -#if DEBUG_MCU -logerror("%04x: 68705 address high %02x\n",activecpu_get_pc(),portA_out); -#endif + LOG(("%04x: 68705 address high %02x\n",activecpu_get_pc(),portA_out)); address = (address & 0x00ff) | (portA_out << 8); } } @@ -289,9 +262,7 @@ READ8_HANDLER( taitosj_68705_portC_r ) int res; res = (zready << 0) | (zaccept << 1) | ((busreq^1) << 2); -#if DEBUG_MCU -logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),res); -#endif + LOG(("%04x: 68705 port C read %02x\n",activecpu_get_pc(),res)); return res; } diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c index ed26aa703f3..12c798c231e 100644 --- a/src/mame/machine/ticket.c +++ b/src/mame/machine/ticket.c @@ -13,7 +13,8 @@ #include "driver.h" #include "machine/ticket.h" -/*#define DEBUG_TICKET*/ +#define DEBUG_TICKET 0 +#define LOG(x) do { if (DEBUG_TICKET) logerror x; } while (0) #define MAX_DISPENSERS 2 @@ -70,17 +71,13 @@ READ8_HANDLER( ticket_dispenser_r ) READ8_HANDLER( ticket_dispenser_0_r ) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), status); -#endif + LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[0].status)); return dispenser[0].status; } READ8_HANDLER( ticket_dispenser_1_r ) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), status); -#endif + LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[1].status)); return dispenser[1].status; } @@ -99,9 +96,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w ) { if (!dispenser[0].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power On\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc())); timer_adjust(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); dispenser[0].power = 1; @@ -112,9 +107,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w ) { if (dispenser[0].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc())); timer_adjust(dispenser[0].timer, attotime_never, 0, attotime_never); set_led_status(2,0); dispenser[0].power = 0; @@ -129,9 +122,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w ) { if (!dispenser[1].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power On\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc())); timer_adjust(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); dispenser[1].power = 1; @@ -142,9 +133,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w ) { if (dispenser[1].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc())); timer_adjust(dispenser[1].timer, attotime_never, 0, attotime_never); set_led_status(2,0); dispenser[1].power = 0; @@ -168,9 +157,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle ) if (dispenser->power) { dispenser->status ^= active_bit; -#ifdef DEBUG_TICKET - logerror("Ticket Status Changed to %02X\n", status); -#endif + LOG(("Ticket Status Changed to %02X\n", dispenser->status)); timer_adjust(dispenser->timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); } @@ -179,9 +166,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle ) set_led_status(2,1); dispensed_tickets++; -#ifdef DEBUG_TICKET - logerror("Ticket Dispensed\n"); -#endif + LOG(("Ticket Dispensed\n")); } else { diff --git a/src/mame/machine/twincobr.c b/src/mame/machine/twincobr.c index 50c45396e44..fb32a6f5791 100644 --- a/src/mame/machine/twincobr.c +++ b/src/mame/machine/twincobr.c @@ -10,6 +10,7 @@ #define LOG_DSP_CALLS 0 +#define LOG(x) do { if (LOG_DSP_CALLS) logerror x; } while (0) #define CLEAR 0 #define ASSERT 1 @@ -23,9 +24,7 @@ static int fsharkbt_8741; static int dsp_execute; static UINT32 dsp_addr_w, main_ram_seg; -#if LOG_DSP_CALLS static const int toaplan_port_type[2] = { 0x7800c, 0x5c }; -#endif UINT8 *twincobr_sharedram; @@ -61,9 +60,7 @@ WRITE16_HANDLER( twincobr_dsp_addrsel_w ) main_ram_seg = ((data & 0xe000) << 3); dsp_addr_w = ((data & 0x1fff) << 1); -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } READ16_HANDLER( twincobr_dsp_r ) @@ -79,9 +76,7 @@ READ16_HANDLER( twincobr_dsp_r ) cpuintrf_pop_context(); break; default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w)); return input_data; } @@ -97,9 +92,7 @@ WRITE16_HANDLER( twincobr_dsp_w ) cpuintrf_pop_context(); break; default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } WRITE16_HANDLER( wardner_dsp_addrsel_w ) @@ -114,9 +107,7 @@ WRITE16_HANDLER( wardner_dsp_addrsel_w ) if (main_ram_seg == 0x6000) main_ram_seg = 0x7000; -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } READ16_HANDLER( wardner_dsp_r ) @@ -133,9 +124,7 @@ READ16_HANDLER( wardner_dsp_r ) cpuintrf_pop_context(); break; default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w)); return input_data; } @@ -152,9 +141,7 @@ WRITE16_HANDLER( wardner_dsp_w ) cpuintrf_pop_context(); break; default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } WRITE16_HANDLER( twincobr_dsp_bio_w ) @@ -164,17 +151,13 @@ WRITE16_HANDLER( twincobr_dsp_bio_w ) /* Actually only DSP data bit 15 controls this */ /* data 0x0000 means set DSP BIO line active and disable */ /* communication to main processor*/ -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data); -#endif + LOG(("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data)); if (data & 0x8000) { twincobr_dsp_BIO = CLEAR_LINE; } if (data == 0) { if (dsp_execute) { -#if LOG_DSP_CALLS - logerror("Turning the main CPU on\n"); -#endif + LOG(("Turning the main CPU on\n")); cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); dsp_execute = 0; } @@ -189,9 +172,7 @@ READ16_HANDLER( fsharkbt_dsp_r ) /* Port is read three times during startup. First and last data */ /* read must equal, but second data read must be different */ fsharkbt_8741 += 1; -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",activecpu_get_previouspc(),(fsharkbt_8741 & 0x08)); -#endif + LOG(("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",activecpu_get_previouspc(),(fsharkbt_8741 & 0x08))); return (fsharkbt_8741 & 1); } @@ -213,17 +194,13 @@ static void twincobr_dsp(int enable) { twincobr_dsp_on = enable; if (enable) { -#if LOG_DSP_CALLS - logerror("Turning DSP on and main CPU off\n"); -#endif + LOG(("Turning DSP on and main CPU off\n")); cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); } else { -#if LOG_DSP_CALLS - logerror("Turning DSP off\n"); -#endif + LOG(("Turning DSP off\n")); cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); } @@ -237,9 +214,7 @@ static void twincobr_restore_dsp(void) static void toaplan0_control_w(int offset, int data) { -#if LOG_DSP_CALLS - logerror("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset); -#endif + LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset)); if (toaplan_main_cpu == 1) { if (data == 0x0c) { data = 0x1c; wardner_sprite_hack=0; } /* Z80 ? */ @@ -292,10 +267,8 @@ WRITE16_HANDLER( twincobr_sharedram_w ) static void toaplan0_coin_dsp_w(int offset, int data) { -#if LOG_DSP_CALLS if (data > 1) - logerror("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset); -#endif + LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset)); switch (data) { case 0x08: coin_counter_w(0,0); break; case 0x09: coin_counter_w(0,1); break; @@ -307,17 +280,13 @@ static void toaplan0_coin_dsp_w(int offset, int data) case 0x0f: coin_lockout_w(1,0); break; /****** The following apply to Flying Shark/Wardner only ******/ case 0x00: /* This means assert the INT line to the DSP */ -#if LOG_DSP_CALLS - logerror("Turning DSP on and main CPU off\n"); -#endif + LOG(("Turning DSP on and main CPU off\n")); cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); break; case 0x01: /* This means inhibit the INT line to the DSP */ -#if LOG_DSP_CALLS - logerror("Turning DSP off\n"); -#endif + LOG(("Turning DSP off\n")); cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); break; diff --git a/src/mame/video/antic.c b/src/mame/video/antic.c index 516c8b2a011..13c03ddc5dd 100644 --- a/src/mame/video/antic.c +++ b/src/mame/video/antic.c @@ -16,11 +16,7 @@ #define VERBOSE 0 #endif -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) /* x */ -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) ANTIC antic; diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c index 5e372abf145..e64c5eae368 100644 --- a/src/mame/video/atari.c +++ b/src/mame/video/atari.c @@ -18,11 +18,7 @@ #define VERBOSE 0 -#if VERBOSE -#define LOG(x) logerror x -#else -#define LOG(x) /* x */ -#endif +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) char atari_frame_message[64+1]; int atari_frame_counter; @@ -1058,12 +1054,10 @@ static void antic_linerefresh(void) draw_scanline8(tmpbitmap, 12, y, sizeof(scanline), (const UINT8 *) scanline, Machine->pens, -1); } -#if VERBOSE static int cycle(void) { return video_screen_get_hpos(0) * CYCLES_PER_LINE / Machine->screen[0].width; } -#endif static void after(int cycles, timer_callback function, const char *funcname) { diff --git a/src/mame/video/bfm_adr2.c b/src/mame/video/bfm_adr2.c index f87515ac077..912908a163c 100644 --- a/src/mame/video/bfm_adr2.c +++ b/src/mame/video/bfm_adr2.c @@ -97,11 +97,13 @@ E000-FFFF | R | D D D D D D D D | 8K ROM #include "rendlay.h" #ifdef MAME_DEBUG -#define LOG_CTRL(x) logerror x // show UART information +#define VERBOSE 1 #else -#define LOG_CTRL(x) +#define VERBOSE 0 #endif +#define LOG_CTRL(x) do { if (VERBOSE) logerror x; } while (0) + // local vars ///////////////////////////////////////////////////////////// #define SL_DISPLAY 0x02 // displayed Adder screen, 1=screen1 0=screen0 diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index 2ffa1fa87a2..37123583022 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -517,9 +517,7 @@ INLINE UINT16 *cps1_base(int offset,int boundary) READ16_HANDLER( cps1_output_r ) { -#if VERBOSE -if (offset >= 0x18/2) logerror("PC %06x: read output port %02x\n",activecpu_get_pc(),offset*2); -#endif + if (VERBOSE && offset >= 0x18/2) logerror("PC %06x: read output port %02x\n",activecpu_get_pc(),offset*2); /* Some games interrogate a couple of registers on bootup. */ /* These are CPS1 board B self test checks. They wander from game to */ @@ -570,7 +568,8 @@ WRITE16_HANDLER( cps1_output_w ) if (cps1_game_config->control_reg && offset == cps1_game_config->control_reg/2 && data != 0x3f) logerror("control_reg = %04x",data); #endif -#if VERBOSE +if (VERBOSE) +{ if (offset > 0x22/2 && offset != cps1_game_config->layer_control/2 && offset != cps1_game_config->priority[0]/2 && @@ -586,7 +585,7 @@ if (offset == 0x22/2 && (data & ~0x8001) != 0x0e) if (cps1_game_config->priority[0] && offset == cps1_game_config->priority[0]/2 && data != 0x00) popmessage("priority0 %04x",data); #endif -#endif +} } diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index 0215ec39338..07c79d5d260 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -22,6 +22,7 @@ // Log Blitter #define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /* 0 B01234 G01234 R01234 */ @@ -98,16 +99,12 @@ WRITE8_HANDLER( dynax_extra_scrolly_w ) WRITE8_HANDLER( dynax_blit_pen_w ) { dynax_blit_pen = data; -#if VERBOSE - logerror("P=%02X ",data); -#endif + LOG(("P=%02X ",data)); } WRITE8_HANDLER( dynax_blit2_pen_w ) { dynax_blit2_pen = data; -#if VERBOSE - logerror("P'=%02X ",data); -#endif + LOG(("P'=%02X ",data)); } /* Destination Layers */ @@ -117,16 +114,12 @@ WRITE8_HANDLER( dynax_blit_dest_w ) if (layer_layout == LAYOUT_HNORIDUR) dynax_blit_dest = BITSWAP8(dynax_blit_dest ^ 0x0f, 7,6,5,4, 0,1,2,3); -#if VERBOSE - logerror("D=%02X ",data); -#endif + LOG(("D=%02X ",data)); } WRITE8_HANDLER( dynax_blit2_dest_w ) { dynax_blit2_dest = data; -#if VERBOSE - logerror("D'=%02X ",data); -#endif + LOG(("D'=%02X ",data)); } WRITE8_HANDLER( tenkai_blit_dest_w ) { @@ -137,9 +130,7 @@ WRITE8_HANDLER( tenkai_blit_dest_w ) WRITE8_HANDLER( dynax_blit_backpen_w ) { dynax_blit_backpen = data; -#if VERBOSE - logerror("B=%02X ",data); -#endif + LOG(("B=%02X ",data)); } /* Layers 0&1 Palettes (Low Bits) */ @@ -149,16 +140,12 @@ WRITE8_HANDLER( dynax_blit_palette01_w ) dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | ((data&0x0f)<<12) | ((data&0xf0)<<4); else dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | data; -#if VERBOSE - logerror("P01=%02X ",data); -#endif + LOG(("P01=%02X ",data)); } WRITE8_HANDLER( tenkai_blit_palette01_w ) { dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | data; -#if VERBOSE - logerror("P01=%02X ",data); -#endif + LOG(("P01=%02X ",data)); } /* Layers 4&5 Palettes (Low Bits) */ @@ -168,9 +155,7 @@ WRITE8_HANDLER( dynax_blit_palette45_w ) dynax_blit2_palettes = (dynax_blit2_palettes & 0x00ff) | ((data&0x0f)<<12) | ((data&0xf0)<<4); else dynax_blit2_palettes = (dynax_blit2_palettes & 0xff00) | data; -#if VERBOSE - logerror("P45=%02X ",data); -#endif + LOG(("P45=%02X ",data)); } /* Layer 2&3 Palettes (Low Bits) */ @@ -180,16 +165,12 @@ WRITE8_HANDLER( dynax_blit_palette23_w ) dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | ((data&0x0f)<<4) | ((data&0xf0)>>4); else dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | (data<<8); -#if VERBOSE - logerror("P23=%02X ",data); -#endif + LOG(("P23=%02X ",data)); } WRITE8_HANDLER( tenkai_blit_palette23_w ) { dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | ((data&0x0f)<<12) | ((data&0xf0)<<4); -#if VERBOSE - logerror("P23=%02X ",data); -#endif + LOG(("P23=%02X ",data)); } /* Layer 6&7 Palettes (Low Bits) */ WRITE8_HANDLER( dynax_blit_palette67_w ) @@ -198,9 +179,7 @@ WRITE8_HANDLER( dynax_blit_palette67_w ) dynax_blit2_palettes = (dynax_blit2_palettes & 0xff00) | ((data&0x0f)<<4) | ((data&0xf0)>>4); else dynax_blit2_palettes = (dynax_blit2_palettes & 0x00ff) | (data<<8); -#if VERBOSE - logerror("P67=%02X ",data); -#endif + LOG(("P67=%02X ",data)); } @@ -209,34 +188,26 @@ WRITE8_HANDLER( dynax_blit_palette67_w ) WRITE8_HANDLER( dynax_blit_palbank_w ) { dynax_blit_palbank = data; -#if VERBOSE - logerror("PB=%02X ",data); -#endif + LOG(("PB=%02X ",data)); } WRITE8_HANDLER( dynax_blit2_palbank_w ) { dynax_blit2_palbank = data; -#if VERBOSE - logerror("PB'=%02X ",data); -#endif + LOG(("PB'=%02X ",data)); } /* Which half of the layers to write two (interleaved games only) */ WRITE8_HANDLER( hanamai_layer_half_w ) { hanamai_layer_half = (~data) & 1; -#if VERBOSE - logerror("H=%02X ",data); -#endif + LOG(("H=%02X ",data)); } /* Write to both halves of the layers (interleaved games only) */ WRITE8_HANDLER( hnoridur_layer_half2_w ) { hnoridur_layer_half2 = (~data) & 1; -#if VERBOSE - logerror("H2=%02X ",data); -#endif + LOG(("H2=%02X ",data)); } WRITE8_HANDLER( mjdialq2_blit_dest_w ) @@ -251,9 +222,7 @@ WRITE8_HANDLER( mjdialq2_blit_dest_w ) WRITE8_HANDLER( dynax_layer_enable_w ) { dynax_layer_enable = data; -#if VERBOSE - logerror("E=%02X ",data); -#endif + LOG(("E=%02X ",data)); } WRITE8_HANDLER( jantouki_layer_enable_w ) @@ -277,26 +246,20 @@ WRITE8_HANDLER( dynax_flipscreen_w ) flipscreen = data & 1; if (data & ~1) logerror("CPU#0 PC %06X: Warning, flip screen <- %02X\n", activecpu_get_pc(), data); -#if VERBOSE - logerror("F=%02X ",data); -#endif + LOG(("F=%02X ",data)); } WRITE8_HANDLER( dynax_blit_romregion_w ) { dynax_blit_romregion = REGION_GFX1 + data; -#if VERBOSE - logerror("GFX%X ",data+1); -#endif + LOG(("GFX%X ",data+1)); } WRITE8_HANDLER( dynax_blit2_romregion_w ) { dynax_blit2_romregion = REGION_GFX2 + data; -#if VERBOSE - logerror("GFX%X' ",data+2); -#endif + LOG(("GFX%X' ",data+2)); } /*************************************************************************** @@ -544,9 +507,7 @@ static void dynax_blitter_start(int flags) { int blit_newsrc; -#if VERBOSE - logerror("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags); -#endif + LOG(("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags)); blit_newsrc = blitter_drawgfx( @@ -575,9 +536,7 @@ static void jantouki_blitter_start(int flags) { int blit_newsrc; -#if VERBOSE - logerror("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags); -#endif + LOG(("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags)); blit_newsrc = blitter_drawgfx( @@ -606,9 +565,7 @@ static void jantouki_blitter2_start(int flags) { int blit2_newsrc; -#if VERBOSE - logerror("XY'=%X,%X SRC'=%X BLIT'=%02X\n",blit2_x,blit2_y,blit2_src,flags); -#endif + LOG(("XY'=%X,%X SRC'=%X BLIT'=%02X\n",blit2_x,blit2_y,blit2_src,flags)); blit2_newsrc = blitter_drawgfx( @@ -640,20 +597,14 @@ static WRITE8_HANDLER( dynax_blit_scroll_w ) switch( blit_src & 0xc00000 ) { case 0x000000: dynax_blit_scroll_x = data; - #if VERBOSE - logerror("SX=%02X ",data); - #endif + LOG(("SX=%02X ",data)); break; case 0x400000: dynax_blit_scroll_y = data; - #if VERBOSE - logerror("SY=%02X ",data); - #endif + LOG(("SY=%02X ",data)); break; case 0x800000: case 0xc00000: dynax_blit_wrap_enable = data; - #if VERBOSE - logerror("WE=%02X ",data); - #endif + LOG(("WE=%02X ",data)); break; } } @@ -664,20 +615,14 @@ static WRITE8_HANDLER( tenkai_blit_scroll_w ) switch( blit_src & 0xc00000 ) { case 0x000000: dynax_blit_scroll_x = ((data ^ 0xff) + 1) & 0xff; - #if VERBOSE - logerror("SX=%02X ",data); - #endif + LOG(("SX=%02X ",data)); break; case 0x400000: dynax_blit_scroll_y = data ^ 0xff; - #if VERBOSE - logerror("SY=%02X ",data); - #endif + LOG(("SY=%02X ",data)); break; case 0x800000: case 0xc00000: dynax_blit_wrap_enable = data; - #if VERBOSE - logerror("WE=%02X ",data); - #endif + LOG(("WE=%02X ",data)); break; } } @@ -687,20 +632,14 @@ static WRITE8_HANDLER( dynax_blit2_scroll_w ) switch( blit2_src & 0xc00000 ) { case 0x000000: dynax_blit2_scroll_x = data; - #if VERBOSE - logerror("SX'=%02X ",data); - #endif + LOG(("SX'=%02X ",data)); break; case 0x400000: dynax_blit2_scroll_y = data; - #if VERBOSE - logerror("SY'=%02X ",data); - #endif + LOG(("SY'=%02X ",data)); break; case 0x800000: case 0xc00000: dynax_blit2_wrap_enable = data; - #if VERBOSE - logerror("WE'=%02X ",data); - #endif + LOG(("WE'=%02X ",data)); break; } } diff --git a/src/mame/video/jagblit.c b/src/mame/video/jagblit.c index ff7cbb40fcf..d1d15bb7f26 100644 --- a/src/mame/video/jagblit.c +++ b/src/mame/video/jagblit.c @@ -193,11 +193,12 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags) /* don't blit if pointer bad */ if (!a1_base_mem || !a2_base_mem) { -#if LOG_BAD_BLITS + if (LOG_BAD_BLITS) + { logerror("%08X:Blit!\n", activecpu_get_previouspc()); logerror(" a1_base = %08X\n", a1_base); logerror(" a2_base = %08X\n", a2_base); -#endif + } return; } @@ -272,7 +273,8 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags) adest_xmask = (COMMAND & 0x00000800) ? a2_xmask : a1_xmask; adest_ymask = (COMMAND & 0x00000800) ? a2_ymask : a1_ymask; -#if LOG_BLITS + if (LOG_BLITS) + { logerror("%08X:Blit!\n", activecpu_get_previouspc()); logerror(" a1_base = %08X\n", a1_base); logerror(" a1_pitch = %d\n", a1_pitch); @@ -298,13 +300,11 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags) logerror(" count = %d x %d\n", inner_count, outer_count); logerror(" command = %08X\n", COMMAND); -#endif + } -#if LOG_UNHANDLED_BLITS /* check for unhandled command bits */ - if (COMMAND & 0x24003000) + if (LOG_UNHANDLED_BLITS && (COMMAND & 0x24003000)) logerror("Blitter unhandled: these command bits: %08X\n", COMMAND & 0x24003000); -#endif /* LOG_UNHANDLED_BLITS */ /* top of the outer loop */ outer = outer_count; diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c index d12762079e9..3452e1c5b39 100644 --- a/src/mame/video/jaguar.c +++ b/src/mame/video/jaguar.c @@ -601,9 +601,8 @@ WRITE32_HANDLER( jaguar_blitter_w ) if (offset == B_CMD) blitter_run(); -#if LOG_BLITTER_WRITE + if (LOG_BLITTER_WRITE) logerror("%08X:Blitter write register @ F022%02X = %08X\n", activecpu_get_previouspc(), offset * 4, data); -#endif } diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index 45f1fd140be..6928d949cec 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -1,5 +1,3 @@ -#define VERBOSE 0 - /* * video/konamigx.c - Konami GX video hardware (here there be dragons) * @@ -9,6 +7,8 @@ #include "video/konamiic.h" #include "machine/konamigx.h" +#define VERBOSE 0 + static int layer_colorbase[4]; static INT32 gx_tilebanks[8], gx_oldbanks[8]; static int gx_tilemode, gx_rozenable, psac_colorbase, last_psac_colorbase; @@ -105,9 +105,8 @@ static void konamigx_alpha_tile_callback(int layer, int *code, int *color, int * /* save mixcode and mark tile alpha (unimplemented) */ *code = 0; - #if VERBOSE + if (VERBOSE) popmessage("skipped alpha tile(layer=%d mix=%d)", layer, mixcode); - #endif } } diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c index 0b9dbab6872..438db7e3cc8 100644 --- a/src/mame/video/konamiic.c +++ b/src/mame/video/konamiic.c @@ -1,5 +1,3 @@ -#define VERBOSE 0 - /*************************************************************************** TODO: @@ -1153,6 +1151,9 @@ Registers (word-wise): #include "driver.h" #include "video/konamiic.h" +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) + /* This recursive function doesn't use additional memory (it could be easily converted into an iterative one). @@ -2461,10 +2462,8 @@ void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane0, else machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; -#if VERBOSE - if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); -#endif /* prepare shadow draw table */ gfx_drawmode_table[0] = DRAWMODE_NONE; @@ -2960,10 +2959,9 @@ void K053245_vh_start(running_machine *machine,int chip, int gfx_memory_region,i else machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; -#if VERBOSE - if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); -#endif + /* prepare shadow draw table */ gfx_drawmode_table[0] = DRAWMODE_NONE; @@ -3707,7 +3705,8 @@ void K053247_vh_start(running_machine *machine, int gfx_memory_region, int dx, i else machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; -#if VERBOSE + if (VERBOSE) + { if (machine->screen[0].format == BITMAP_FORMAT_RGB32) { if ((machine->drv->video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS) @@ -3718,7 +3717,7 @@ void K053247_vh_start(running_machine *machine, int gfx_memory_region, int dx, i if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); } -#endif + } /* prepare shadow draw table */ gfx_drawmode_table[0] = DRAWMODE_NONE; @@ -3863,10 +3862,8 @@ void K055673_vh_start(running_machine *machine, int gfx_memory_region, int layou else machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; -#if VERBOSE - if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); -#endif /* prepare shadow draw table */ c = machine->gfx[gfx_index]->color_granularity-1; @@ -3994,9 +3991,7 @@ READ16_HANDLER( K055673_rom_word_r ) // 5bpp return ROM8[romofs]; break; default: -#if VERBOSE - logerror("55673_rom_word_r: Unknown read offset %x\n", offset); -#endif + LOG(("55673_rom_word_r: Unknown read offset %x\n", offset)); break; } @@ -4036,9 +4031,7 @@ READ16_HANDLER( K055673_GX6bpp_rom_word_r ) return ROM[romofs+2]; break; default: -#if VERBOSE - logerror("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, activecpu_get_pc()); -#endif + LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, activecpu_get_pc())); break; } @@ -4053,16 +4046,13 @@ READ8_HANDLER( K053246_r ) addr = (K053246_regs[6] << 17) | (K053246_regs[7] << 9) | (K053246_regs[4] << 1) | ((offset & 1) ^ 1); addr &= memory_region_length(K053247_memory_region)-1; -#if VERBOSE - popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset,addr); -#endif + if (VERBOSE) + popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset,addr); return memory_region(K053247_memory_region)[addr]; } else { -#if VERBOSE -logerror("%04x: read from unknown 053246 address %x\n",activecpu_get_pc(),offset); -#endif + LOG(("%04x: read from unknown 053246 address %x\n",activecpu_get_pc(),offset)); return 0; } } @@ -5833,9 +5823,7 @@ READ16_HANDLER( K056832_5bpp_rom_word_r ) } else { -#if VERBOSE - logerror("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask); -#endif + LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask)); } return 0; } @@ -5860,9 +5848,7 @@ READ32_HANDLER( K056832_5bpp_rom_long_r ) } else { -#if VERBOSE - logerror("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask); -#endif + LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask)); } return 0; } @@ -5887,9 +5873,7 @@ READ32_HANDLER( K056832_6bpp_rom_long_r ) } else { -#if VERBOSE - logerror("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask); -#endif + LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask)); } return 0; } @@ -7100,7 +7084,6 @@ void K055555_vh_start(void) void K055555_write_reg(UINT8 regnum, UINT8 regdat) { - #if VERBOSE static const char *const rnames[46] = { "BGC CBLK", "BGC SET", "COLSET0", "COLSET1", "COLSET2", "COLSET3", "COLCHG ON", @@ -7113,9 +7096,8 @@ void K055555_write_reg(UINT8 regnum, UINT8 regdat) if (regdat != k55555_regs[regnum]) { - logerror("5^5: %x to reg %x (%s)\n", regdat, regnum, rnames[regnum]); + LOG(("5^5: %x to reg %x (%s)\n", regdat, regnum, rnames[regnum])); } - #endif k55555_regs[regnum] = regdat; } @@ -7370,9 +7352,8 @@ int K054338_set_alpha_level(int pblend) mixlv = mixlv<<3 | mixlv>>2; alpha_set_level(mixlv); - #if VERBOSE + if (VERBOSE) popmessage("MIXSET%1d %s addition mode: %02x",pblend,(mixpri)?"dst":"src",mixset&0x1f); - #endif } return(mixlv); diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c index 161e74c0943..931a8c8626b 100644 --- a/src/mame/video/model1.c +++ b/src/mame/video/model1.c @@ -4,12 +4,7 @@ #define LOG_TGP_VIDEO 0 -#if LOG_TGP_VIDEO -#define LOG_TGP logerror -#else -static void dummy_log(const char *s,...) {} -#define LOG_TGP dummy_log -#endif +#define LOG_TGP(x) do { if (LOG_TGP_VIDEO) logerror x; } while (0) UINT16 *model1_display_list0, *model1_display_list1; UINT16 *model1_color_xlat; @@ -256,11 +251,11 @@ static void fill_quad(mame_bitmap *bitmap, const struct quad *q) if(color < 0) { color = -1-color; - LOG_TGP("VIDEOD: Q (%d, %d)-(%d, %d)-(%d, %d)-(%d, %d)\n", + LOG_TGP(("VIDEOD: Q (%d, %d)-(%d, %d)-(%d, %d)-(%d, %d)\n", q->p[0]->s.x, q->p[0]->s.y, q->p[1]->s.x, q->p[1]->s.y, q->p[2]->s.x, q->p[2]->s.y, - q->p[3]->s.x, q->p[3]->s.y); + q->p[3]->s.x, q->p[3]->s.y)); } for(i=0; i<4; i++) { @@ -605,10 +600,10 @@ static void fclip_push_quad(int level, struct quad *q) struct point *(*fclip_point)(struct point *p1, struct point *p2); if(level == 4) { - LOG_TGP("VIDEOCQ %d", level); + LOG_TGP(("VIDEOCQ %d", level)); for(i=0; i<4; i++) - LOG_TGP(" (%f, %f, %f)", q->p[i]->x, q->p[i]->y, q->p[i]->z); - LOG_TGP("\n"); + LOG_TGP((" (%f, %f, %f)", q->p[i]->x, q->p[i]->y, q->p[i]->z)); + LOG_TGP(("\n")); *quadpt = *q; quadpt++; return; @@ -617,10 +612,10 @@ static void fclip_push_quad(int level, struct quad *q) for(i=0; i<4; i++) is_out[i] = clipfn[level].isclipped(q->p[i]); - LOG_TGP("VIDEOCQ %d", level); + LOG_TGP(("VIDEOCQ %d", level)); for(i=0; i<4; i++) - LOG_TGP(" (%f, %f, %f, %d)", q->p[i]->x, q->p[i]->y, q->p[i]->z, is_out[i]); - LOG_TGP("\n"); + LOG_TGP((" (%f, %f, %f, %d)", q->p[i]->x, q->p[i]->y, q->p[i]->z, is_out[i])); + LOG_TGP(("\n")); // No clipping if(!is_out[0] && !is_out[1] && !is_out[2] && !is_out[3]) { @@ -763,7 +758,7 @@ static void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size) #endif if(1) { - LOG_TGP("XVIDEO: draw object (%x, %x, %x)\n", tex_adr, poly_adr, size); + LOG_TGP(("XVIDEO: draw object (%x, %x, %x)\n", tex_adr, poly_adr, size)); } if(!size) @@ -795,11 +790,11 @@ static void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size) for(i=0; ix, p0->y, p0->z, - p1->x, p1->y, p1->z); + p1->x, p1->y, p1->z)); #endif #if 0 if(1 || dump) { - LOG_TGP("VIDEO: %08x (%d, %d) (%d, %d) (%d, %d) (%d, %d)\n", + LOG_TGP(("VIDEO: %08x (%d, %d) (%d, %d) (%d, %d) (%d, %d)\n", *(UINT32 *)(poly_data+poly_adr), old_p0->s.x, old_p0->s.y, old_p1->s.x, old_p1->s.y, p0->s.x, p0->s.y, - p1->s.x, p1->s.y); + p1->s.x, p1->s.y)); } #endif @@ -957,10 +952,10 @@ static UINT16 *push_direct(UINT16 *list) old_p1->y = readf(list+14); old_p1->z = readf(list+16); - LOG_TGP("VIDEOD start direct\n"); - LOG_TGP("VIDEOD (%f, %f, %f) (%f, %f, %f)\n", + LOG_TGP(("VIDEOD start direct\n")); + LOG_TGP(("VIDEOD (%f, %f, %f) (%f, %f, %f)\n", old_p0->x, old_p0->y, old_p0->z, - old_p1->x, old_p1->y, old_p1->z); + old_p1->x, old_p1->y, old_p1->z)); // transform_point(old_p0); // transform_point(old_p1); @@ -1000,9 +995,9 @@ static UINT16 *push_direct(UINT16 *list) p0->y = readf(list+8); p0->z = readf(list+10); z = p0->z; - LOG_TGP("VIDEOD %08x %08x (%f, %f, %f)\n", + LOG_TGP(("VIDEOD %08x %08x (%f, %f, %f)\n", flags, lum, - p0->x, p0->y, p0->z); + p0->x, p0->y, p0->z)); *p1 = *p0; list += 12; } else { @@ -1013,10 +1008,10 @@ static UINT16 *push_direct(UINT16 *list) p1->y = readf(list+16); p1->z = readf(list+18); z = readf(list+12); - LOG_TGP("VIDEOD %08x %08x (%f, %f, %f) (%f, %f, %f)\n", + LOG_TGP(("VIDEOD %08x %08x (%f, %f, %f) (%f, %f, %f)\n", flags, lum, p0->x, p0->y, p0->z, - p1->x, p1->y, p1->z); + p1->x, p1->y, p1->z)); list += 20; } @@ -1031,17 +1026,17 @@ static UINT16 *push_direct(UINT16 *list) #if 1 if(old_p0 && old_p1) - LOG_TGP("VIDEOD: %08x (%d, %d) (%d, %d) (%d, %d) (%d, %d)\n", + LOG_TGP(("VIDEOD: %08x (%d, %d) (%d, %d) (%d, %d) (%d, %d)\n", flags, old_p0->s.x, old_p0->s.y, old_p1->s.x, old_p1->s.y, p0->s.x, p0->s.y, - p1->s.x, p1->s.y); + p1->s.x, p1->s.y)); else - LOG_TGP("VIDEOD: %08x (%d, %d) (%d, %d)\n", + LOG_TGP(("VIDEOD: %08x (%d, %d) (%d, %d)\n", flags, p0->s.x, p0->s.y, - p1->s.x, p1->s.y); + p1->s.x, p1->s.y)); #endif @@ -1116,7 +1111,7 @@ static UINT16 *skip_direct(UINT16 *list) static void draw_objects(mame_bitmap *bitmap, const rectangle *cliprect) { if(quadpt != quaddb) { - LOG_TGP("VIDEO: sort&draw\n"); + LOG_TGP(("VIDEO: sort&draw\n")); sort_quads(); draw_quads(bitmap, cliprect); } @@ -1129,7 +1124,7 @@ static UINT16 *draw_direct(UINT16 *list, mame_bitmap *bitmap, const rectangle *c { UINT16 *res; - LOG_TGP("VIDEO: draw direct %x\n", readi(list)); + LOG_TGP(("VIDEO: draw direct %x\n", readi(list))); draw_objects(bitmap, cliprect); res = push_direct(list); @@ -1172,7 +1167,7 @@ READ16_HANDLER( model1_listctl_r ) WRITE16_HANDLER( model1_listctl_w ) { COMBINE_DATA(listctl+offset); - LOG_TGP("VIDEO: control=%08x\n", (listctl[1]<<16)|listctl[0]); + LOG_TGP(("VIDEO: control=%08x\n", (listctl[1]<<16)|listctl[0])); } static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect) @@ -1181,7 +1176,7 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect) if((listctl[1] & 0x1f) == 0x1f) { UINT16 *list = get_list(); int zz = 0; - LOG_TGP("VIDEO: render list %d\n", get_list_number()); + LOG_TGP(("VIDEO: render list %d\n", get_list_number())); memset(trans_mat, 0, sizeof(trans_mat)); trans_mat[0] = 1.0; @@ -1211,10 +1206,10 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect) list = draw_direct(list+2, bitmap, cliprect); break; case 3: - LOG_TGP("VIDEO: viewport (%d, %d, %d, %d, %d, %d, %d)\n", + LOG_TGP(("VIDEO: viewport (%d, %d, %d, %d, %d, %d, %d)\n", readi(list+2), readi16(list+4), readi16(list+6), readi16(list+8), - readi16(list+10), readi16(list+12), readi16(list+14)); + readi16(list+10), readi16(list+12), readi16(list+14))); draw_objects(bitmap, cliprect); @@ -1233,7 +1228,7 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect) int adr = readi(list+2); int len = readi(list+4)+1; int i; - LOG_TGP("ZVIDEO: color write, adr=%x, len=%x\n", adr, len); + LOG_TGP(("ZVIDEO: color write, adr=%x, len=%x\n", adr, len)); for(i=0; i>8)&0xff))/255.0; lightparams[i+adr].s=((float) ((v>>16)&0xff))/255.0; lightparams[i+adr].p=(v>>24)&0xff; - //LOG_TGP(" %02X\n",v); + //LOG_TGP((" %02X\n",v)); } list += 6+len*2; break; @@ -1422,7 +1417,7 @@ static void tgp_scan(void) case -1: goto end; default: - LOG_TGP("VIDEO: unknown type %d\n", type); + LOG_TGP(("VIDEO: unknown type %d\n", type)); goto end; } } @@ -1531,5 +1526,5 @@ VIDEO_EOF(model1) { tgp_scan(); end_frame(); - LOG_TGP("TGP: vsync\n"); + LOG_TGP(("TGP: vsync\n")); } diff --git a/src/mame/video/mystwarr.c b/src/mame/video/mystwarr.c index 7fb14946d40..cf6ad78c59d 100644 --- a/src/mame/video/mystwarr.c +++ b/src/mame/video/mystwarr.c @@ -545,9 +545,8 @@ VIDEO_UPDATE(dadandrn) /* and gaiapols */ { tilemap_mark_all_tiles_dirty(ult_936_tilemap); - #if MW_VERBOSE + if (MW_VERBOSE) popmessage("K053936: PSAC colorbase changed"); - #endif } konamigx_mixer(machine, bitmap, cliprect, (roz_enable) ? ult_936_tilemap : 0, rozmode, 0, 0, 0); diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c index 25d8ab0208f..e4ea24d3a12 100644 --- a/src/mame/video/neogeo.c +++ b/src/mame/video/neogeo.c @@ -11,6 +11,7 @@ #define NUM_PENS (0x1000) +#define VERBOSE (0) static UINT8 *sprite_gfx; static UINT32 sprite_gfx_address_mask;