(From Atari Ace)

The attached patch adjusts most conditional logging in MAME to use the
idiom "do { if (VERBOSE) logerror x; } while (0)".   This has the
benefit that the compiler checks the syntax of the logging even in the
case it will be eliminated, and in fact a number of cases here needed
adjustments to compile because of this.
This commit is contained in:
Aaron Giles 2007-12-31 02:04:39 +00:00
parent 3f6e8e1abf
commit 460437f8d1
99 changed files with 497 additions and 1092 deletions

View File

@ -107,11 +107,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
#ifndef true #ifndef true
#define true 1 #define true 1
@ -571,7 +567,7 @@ static void set_irq_line(int irqline, int state)
{ {
if (hd6309.nmi_state == state) return; if (hd6309.nmi_state == state) return;
hd6309.nmi_state = state; 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( state == CLEAR_LINE ) return;
/* if the stack was not yet initialized */ /* if the stack was not yet initialized */
@ -610,7 +606,7 @@ static void set_irq_line(int irqline, int state)
} }
else if (irqline < 2) 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; hd6309.irq_state[irqline] = state;
if (state == CLEAR_LINE) return; if (state == CLEAR_LINE) return;
CHECK_IRQ_LINES(); CHECK_IRQ_LINES();

View File

@ -68,11 +68,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
//Prototypes //Prototypes

View File

@ -120,18 +120,14 @@
/*int survival_prot = 0; */ /*int survival_prot = 0; */
#define VERBOSE 0
#include "debugger.h" #include "debugger.h"
#include "i8085.h" #include "i8085.h"
#include "i8085cpu.h" #include "i8085cpu.h"
#include "i8085daa.h" #include "i8085daa.h"
#if VERBOSE #define VERBOSE 0
#define LOG(x) logerror x
#else #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x)
#endif
#define I8085_INTR 0xff #define I8085_INTR 0xff

View File

@ -7,6 +7,9 @@
#include "debugger.h" #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 */ /* All post-i286 CPUs have a 16MB address space */
#define AMASK I.amask #define AMASK I.amask
@ -219,12 +222,7 @@ static int i80286_execute(int num_cycles)
/* run until we're out */ /* run until we're out */
while(i80286_ICount>0) while(i80286_ICount>0)
{ {
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));
//#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
CALL_MAME_DEBUG; CALL_MAME_DEBUG;
seg_prefix=FALSE; seg_prefix=FALSE;

View File

@ -14,6 +14,9 @@
extern int i386_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, int mode); 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 */ /* All pre-i286 CPUs have a 1MB address space */
#define AMASK 0xfffff #define AMASK 0xfffff
@ -237,12 +240,9 @@ static int i8086_execute(int num_cycles)
/* run until we're out */ /* run until we're out */
while (i8086_ICount > 0) while (i8086_ICount > 0)
{ {
//#define VERBOSE_DEBUG LOG(("[%04x:%04x]=%02x\tF:%04x\tAX=%04x\tBX=%04x\tCX=%04x\tDX=%04x %d%d%d%d%d%d%d%d%d\n",
#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",
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.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); 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
CALL_MAME_DEBUG; CALL_MAME_DEBUG;
seg_prefix = FALSE; seg_prefix = FALSE;
@ -296,10 +296,8 @@ static int i80186_execute(int num_cycles)
/* run until we're out */ /* run until we're out */
while (i8086_ICount > 0) while (i8086_ICount > 0)
{ {
#ifdef VERBOSE_DEBUG 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],
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]));
I.regs.w[BX], I.regs.w[CX], I.regs.w[DX]);
#endif
CALL_MAME_DEBUG; CALL_MAME_DEBUG;
seg_prefix = FALSE; seg_prefix = FALSE;

View File

@ -39,12 +39,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/* Konami Registers */ /* Konami Registers */
typedef struct typedef struct

View File

@ -26,11 +26,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
enum { enum {
LH5801_T=1, LH5801_T=1,

View File

@ -117,11 +117,7 @@ z: xxxx address bits a19 .. a16 for memory accesses with a15 1 ?
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
typedef struct { 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 */ P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD); PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1); 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 */ /* call back the cpuintrf to let it clear the line */
if (m4510.irq_callback) (*m4510.irq_callback)(0); if (m4510.irq_callback) (*m4510.irq_callback)(0);
CHANGE_PC; CHANGE_PC;
@ -276,16 +272,16 @@ static int m4510_execute(int cycles)
/* check if the I flag was just reset (interrupts enabled) */ /* check if the I flag was just reset (interrupts enabled) */
if( m4510.after_cli ) 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; m4510.after_cli = 0;
if (m4510.irq_state != CLEAR_LINE) 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; m4510.pending_irq = 1;
} }
else else
{ {
LOG((errorlog,": irq line is clear\n")); LOG((": irq line is clear\n"));
} }
} }
else else
@ -305,7 +301,7 @@ static void m4510_set_irq_line(int irqline, int state)
m4510.nmi_state = state; m4510.nmi_state = state;
if( state != CLEAR_LINE ) 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; EAD = M4510_NMI_VEC;
m4510_ICount -= 7; m4510_ICount -= 7;
PUSH(PCH); 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 */ P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD); PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1); 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; CHANGE_PC;
} }
} }
@ -323,7 +319,7 @@ static void m4510_set_irq_line(int irqline, int state)
m4510.irq_state = state; m4510.irq_state = state;
if( state != CLEAR_LINE ) 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; m4510.pending_irq = 1;
} }
} }

View File

@ -45,11 +45,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif

View File

@ -53,11 +53,7 @@ addresses take place.
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
typedef struct { typedef struct {

View File

@ -45,11 +45,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/* Layout of the registers in the debugger */ /* Layout of the registers in the debugger */

View File

@ -78,11 +78,7 @@ TODO:
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
#if 0 #if 0
/* CPU subtypes, needed for extra insn after TAP/CLI/SEI */ /* CPU subtypes, needed for extra insn after TAP/CLI/SEI */

View File

@ -80,11 +80,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
extern offs_t m6809_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); extern offs_t m6809_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);

View File

@ -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_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_EXTEND_SW: pdp1.extend_sw = info->i ? 1 : 0; break;
case CPUINFO_INT_REGISTER + PDP1_RUN: pdp1.run = 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: if (LOG) logerror("pdp1_set_reg to cycle flip-flop ignored\n");/* no way!*/ break;
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: if (LOG) logerror("pdp1_set_reg to defer 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: if (LOG) logerror("pdp1_set_reg to break counter 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_RIM: pdp1.rim = info->i ? 1 : 0; 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_SBM: pdp1.sbm = info->i ? 1 : 0; break;
case CPUINFO_INT_REGISTER + PDP1_EXD: EXD = (pdp1.extend_support && 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: if (LOG) logerror("pdp1_set_reg to ioc flip-flop ignored\n");/* no way!*/ break;
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: if (LOG) logerror("pdp1_set_reg to ioh 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: if (LOG) logerror("pdp1_set_reg to ios 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_START_CLEAR: pulse_start_clear(); break; case CPUINFO_INT_REGISTER + PDP1_START_CLEAR: pulse_start_clear(); break;
case CPUINFO_INT_REGISTER + PDP1_IO_COMPLETE: pdp1.ios = 1; break; case CPUINFO_INT_REGISTER + PDP1_IO_COMPLETE: pdp1.ios = 1; break;
} }

View File

@ -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_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_RUN: tx0.run = info->i ? 1 : 0; break;
case CPUINFO_INT_REGISTER + TX0_RIM: tx0.rim = 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: if (LOG) logerror("tx0_set_reg to cycle counter ignored\n");/* no way!*/ break;
case CPUINFO_INT_REGISTER + TX0_CYCLE: 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_IOH: 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_IOS: logerror("tx0_set_reg to ios flip-flop ignored\n");/* no way!*/ break;
#endif
case CPUINFO_INT_REGISTER + TX0_RESET: pulse_reset(); break; case CPUINFO_INT_REGISTER + TX0_RESET: pulse_reset(); break;
case CPUINFO_INT_REGISTER + TX0_IO_COMPLETE:tx0.ios = 1; break; case CPUINFO_INT_REGISTER + TX0_IO_COMPLETE:tx0.ios = 1; break;
} }

View File

@ -19,11 +19,7 @@
/* define this to have some interrupt information logged */ /* define this to have some interrupt information logged */
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/* define this to expand all EA calculations inline */ /* define this to expand all EA calculations inline */
#define INLINE_EA 1 #define INLINE_EA 1

View File

@ -49,11 +49,7 @@ typedef union {
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/**************************************************************************** /****************************************************************************

View File

@ -35,12 +35,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/**************************************************************************** /****************************************************************************
* The 61860 registers. * The 61860 registers.

View File

@ -108,11 +108,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
typedef struct 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) static void set_irq_line(int irqline, int state)
{ {
if (irqline == INPUT_LINE_NMI) if (irqline == INPUT_LINE_NMI)
{ {
if (sh2.nmi_line_state == state) if (sh2.nmi_line_state == state)
return; return;
sh2.nmi_line_state = state; sh2.nmi_line_state = state;
if( state == CLEAR_LINE ) if( state == CLEAR_LINE )
{
LOG(("SH-2 #%d cleared nmi\n", cpu_getactivecpu())); LOG(("SH-2 #%d cleared nmi\n", cpu_getactivecpu()));
}
else else
{ {
LOG(("SH-2 #%d assert nmi\n", cpu_getactivecpu())); LOG(("SH-2 #%d assert nmi\n", cpu_getactivecpu()));
sh2_exception("sh2_set_irq_line/nmi", 16); sh2_exception("sh2_set_irq_line/nmi", 16);
} }
} }
else else
{ {

View File

@ -34,11 +34,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
#define EXPPRI(pl,po,p,n) (((4-(pl)) << 24) | ((15-(po)) << 16) | ((p) << 8) | (255-(n))) #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) #define NMIPRI() EXPPRI(3,0,16,SH4_INTC_NMI)

View File

@ -9,11 +9,8 @@
#ifndef RECURSIVE_INCLUDE #ifndef RECURSIVE_INCLUDE
#if LOG_GRAPHICS_OPS #define LOG_GFX_OPS 0
#define LOGGFX(x) do { if (input_code_pressed(KEYCODE_L)) logerror x ; } while (0) #define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(KEYCODE_L)) logerror x; } while (0)
#else
#define LOGGFX(x)
#endif
/* Graphics Instructions */ /* Graphics Instructions */

View File

@ -24,12 +24,7 @@
#define LOG_CONTROL_REGS 0 #define LOG_CONTROL_REGS 0
#define LOG_GRAPHICS_OPS 0 #define LOG_GRAPHICS_OPS 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/*************************************************************************** /***************************************************************************
CORE STATE CORE STATE

View File

@ -34,11 +34,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/* Private prototypes */ /* Private prototypes */
@ -565,8 +561,8 @@ static void tms7000_service_timer1( void )
{ {
tms7000.t1_decrementer = tms7000.pf[2]; /* Reload decrementer (8 bit) */ tms7000.t1_decrementer = tms7000.pf[2]; /* Reload decrementer (8 bit) */
cpunum_set_input_line( cpu_getactivecpu(), TMS7000_IRQ2_LINE, HOLD_LINE); 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) ); //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() ); //tick = activecpu_gettotalcycles() );
/* Also, cascade out to timer 2 - timer 2 unimplemented */ /* Also, cascade out to timer 2 - timer 2 unimplemented */
} }
} }

View File

@ -51,11 +51,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/* execute main opcodes inside a big switch statement */ /* execute main opcodes inside a big switch statement */
#ifndef BIG_SWITCH #ifndef BIG_SWITCH

View File

@ -99,11 +99,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/* execute main opcodes inside a big switch statement */ /* execute main opcodes inside a big switch statement */
#ifndef BIG_SWITCH #ifndef BIG_SWITCH

View File

@ -51,11 +51,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/* opcode execution table */ /* opcode execution table */
Z8000_exec *z8000_exec = NULL; Z8000_exec *z8000_exec = NULL;

View File

@ -29,11 +29,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
@ -1373,7 +1369,7 @@ static void compute_perfect_interleave(void)
if (perfect_interleave.attoseconds == ATTOSECONDS_PER_SECOND - 1) if (perfect_interleave.attoseconds == ATTOSECONDS_PER_SECOND - 1)
perfect_interleave.attoseconds = attoseconds_per_cycle[0]; 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)));
} }

View File

@ -24,11 +24,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif

View File

@ -213,11 +213,7 @@ void minx_get_info(UINT32 state, cpuinfo *info);
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif

View File

@ -34,13 +34,8 @@
DEBUGGING DEBUGGING
***************************************************************************/ ***************************************************************************/
//#define VERBOSE #define VERBOSE 0
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#ifdef VERBOSE
#define TRACE(x) do {x;} while (0)
#else
#define TRACE(x)
#endif

View File

@ -325,9 +325,8 @@ void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int d
stable->db = db; stable->db = db;
stable->noclip = noclip; stable->noclip = noclip;
#if VERBOSE if (VERBOSE)
popmessage("shadow %d recalc %d %d %d %02x", mode, dr, dg, db, noclip); popmessage("shadow %d recalc %d %d %d %02x", mode, dr, dg, db, noclip);
#endif
/* regenerate the table */ /* regenerate the table */
for (i = 0; i < 32768; i++) 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(palette->format != BITMAP_FORMAT_INDEXED16);
assert(stable->base != NULL); assert(stable->base != NULL);
#if VERBOSE
popmessage("shadow %d recalc %d %d %d %02x", mode, dr, dg, db, noclip);
#endif
/* regenerate the table */ /* regenerate the table */
for (i = 0; i < 32768; i++) for (i = 0; i < 32768; i++)
{ {

View File

@ -10,11 +10,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif

View File

@ -41,11 +41,7 @@
#define PTMVERBOSE 0 #define PTMVERBOSE 0
#endif #endif
#if PTMVERBOSE #define PLOG(x) do { if (PTMVERBOSE) logerror x; } while (0)
#define PLOG(x) logerror x
#else
#define PLOG(x)
#endif
#define PTM_6840_CTRL1 0 #define PTM_6840_CTRL1 0
#define PTM_6840_CTRL2 1 #define PTM_6840_CTRL2 1
@ -96,7 +92,6 @@ static TIMER_CALLBACK( ptm6840_t3_timeout );
static ptm6840 ptm[PTM_6840_MAX]; static ptm6840 ptm[PTM_6840_MAX];
#if PTMVERBOSE
static const char *const opmode[] = static const char *const opmode[] =
{ {
"000 continous mode", "000 continous mode",
@ -108,7 +103,6 @@ static const char *const opmode[] =
"110 single shot mode", "110 single shot mode",
"111 pulse width comparison mode" "111 pulse width comparison mode"
}; };
#endif
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// // // //

View File

@ -2,6 +2,7 @@
#include "eeprom.h" #include "eeprom.h"
#define VERBOSE 0 #define VERBOSE 0
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define SERIAL_BUFFER_LENGTH 40 #define SERIAL_BUFFER_LENGTH 40
#define MEMORY_SIZE 1024 #define MEMORY_SIZE 1024
@ -160,13 +161,11 @@ void EEPROM_init(const struct EEPROM_interface *interface)
static void EEPROM_write(int bit) static void EEPROM_write(int bit)
{ {
#if VERBOSE LOG(("EEPROM write bit %d\n",bit));
logerror("EEPROM write bit %d\n",bit);
#endif
if (serial_count >= SERIAL_BUFFER_LENGTH-1) if (serial_count >= SERIAL_BUFFER_LENGTH-1)
{ {
logerror("error: EEPROM serial buffer overflow\n"); logerror("error: EEPROM serial buffer overflow\n");
return; return;
} }
@ -279,9 +278,7 @@ if (serial_count)
void EEPROM_write_bit(int bit) void EEPROM_write_bit(int bit)
{ {
#if VERBOSE LOG(("write bit %d\n",bit));
logerror("write bit %d\n",bit);
#endif
latch = bit; latch = bit;
} }
@ -303,18 +300,14 @@ int EEPROM_read_bit(void)
res = 1; res = 1;
} }
#if VERBOSE LOG(("read bit %d\n",res));
logerror("read bit %d\n",res);
#endif
return res; return res;
} }
void EEPROM_set_cs_line(int state) void EEPROM_set_cs_line(int state)
{ {
#if VERBOSE LOG(("set reset line %d\n",state));
logerror("set reset line %d\n",state);
#endif
reset_line = state; reset_line = state;
if (reset_line != CLEAR_LINE) if (reset_line != CLEAR_LINE)
@ -323,9 +316,7 @@ logerror("set reset line %d\n",state);
void EEPROM_set_clock_line(int state) void EEPROM_set_clock_line(int state)
{ {
#if VERBOSE LOG(("set clock line %d\n",state));
logerror("set clock line %d\n",state);
#endif
if (state == PULSE_LINE || (clock_line == CLEAR_LINE && state != CLEAR_LINE)) if (state == PULSE_LINE || (clock_line == CLEAR_LINE && state != CLEAR_LINE))
{ {
if (reset_line == CLEAR_LINE) if (reset_line == CLEAR_LINE)

View File

@ -19,19 +19,9 @@
#define PRINTF_IDE_COMMANDS 0 #define PRINTF_IDE_COMMANDS 0
#define PRINTF_IDE_PASSWORD 0 #define PRINTF_IDE_PASSWORD 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(X)
#endif
#if (VERBOSE && PRINTF_IDE_COMMANDS) #define LOGPRINT(x) do { if (VERBOSE) logerror x; if (PRINTF_IDE_COMMANDS) mame_printf_debug x; } while (0)
#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

View File

@ -24,11 +24,7 @@
#define PRINTF_COMMANDS 1 #define PRINTF_COMMANDS 1
#if PRINTF_COMMANDS #define CMDPRINTF(x) do { if (PRINTF_COMMANDS) mame_printf_debug x; } while (0)
#define CMDPRINTF(x) mame_printf_debug x
#else
#define CMDPRINTF(x)
#endif

View File

@ -33,16 +33,8 @@
#define MAX_TIMER 3 #define MAX_TIMER 3
#define VERBOSE 0 #define VERBOSE 0
#if (VERBOSE == 2) #define LOG1(msg) do { if (VERBOSE >= 1) logerror msg; } while (0)
#define LOG1(msg) logerror msg #define LOG2(msg) do { if (VERBOSE >= 2) logerror msg; } while (0)
#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 TIMER_TIME_NEVER ((UINT64) -1) #define TIMER_TIME_NEVER ((UINT64) -1)

View File

@ -16,6 +16,7 @@
#include "wd33c93.h" #include "wd33c93.h"
#define VERBOSE 0 #define VERBOSE 0
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
static SCSIInstance *devices[8]; // SCSI IDs 0-7 static SCSIInstance *devices[8]; // SCSI IDs 0-7
static const struct WD33C93interface *intf; static const struct WD33C93interface *intf;
@ -525,9 +526,7 @@ WRITE8_HANDLER(wd33c93_w)
case 1: case 1:
{ {
#if VERBOSE LOG(( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", safe_activecpu_get_pc(), scsi_data.sasr, data ));
logerror( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", safe_activecpu_get_pc(), scsi_data.sasr, data );
#endif
/* update the register */ /* update the register */
scsi_data.regs[scsi_data.sasr] = data; 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 we receive a command, schedule to process it */
if ( scsi_data.sasr == WD_COMMAND ) if ( scsi_data.sasr == WD_COMMAND )
{ {
#if VERBOSE LOG(( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", safe_activecpu_get_pc(), data, wd33c93_getunit() ));
logerror( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", safe_activecpu_get_pc(), data, wd33c93_getunit() );
#endif
/* signal we're processing it */ /* signal we're processing it */
scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP; scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP;
@ -688,9 +685,7 @@ READ8_HANDLER(wd33c93_r)
intf->irq_callback(0); intf->irq_callback(0);
} }
#if VERBOSE LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_SCSI_STATUS] ));
logerror( "WD33C93: PC=%08x - Status read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_SCSI_STATUS] );
#endif
} }
else if ( scsi_data.sasr == WD_DATA ) else if ( scsi_data.sasr == WD_DATA )
{ {
@ -759,9 +754,7 @@ READ8_HANDLER(wd33c93_r)
} }
} }
#if VERBOSE LOG(( "WD33C93: PC=%08x - Data read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_DATA] ));
logerror( "WD33C93: PC=%08x - Data read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_DATA] );
#endif
/* get the register value */ /* get the register value */
ret = scsi_data.regs[scsi_data.sasr]; ret = scsi_data.regs[scsi_data.sasr];

View File

@ -22,11 +22,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define VPRINTF(x) do { if (VERBOSE) logerror x; } while (0)
#define VPRINTF(x) logerror x
#else
#define VPRINTF(x)
#endif
@ -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 we're waiting for a trigger, start the timer */
if ((ctc->mode[ch] & WAITING_FOR_TRIG) && (ctc->mode[ch] & MODE) == MODE_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<<ch))) if (!(ctc->notimer & (1<<ch)))
{ {
attotime period = ((ctc->mode[ch] & PRESCALER) == PRESCALER_16) ? ctc->period16 : ctc->period256; attotime period = ((ctc->mode[ch] & PRESCALER) == PRESCALER_16) ? ctc->period16 : ctc->period256;
period = attotime_mul(period, ctc->tconst[ch]); 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); timer_adjust(ctc->timer[ch], period, (which << 2) + ch, period);
} }
else else
{
VPRINTF(("CTC disabled\n"));
timer_adjust(ctc->timer[ch], attotime_never, 0, attotime_never); timer_adjust(ctc->timer[ch], attotime_never, 0, attotime_never);
}
} }
/* we're no longer waiting */ /* we're no longer waiting */

View File

@ -22,11 +22,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define VPRINTF(x) do { if (VERBOSE) logerror x; } while (0)
#define VPRINTF(x) logerror x
#else
#define VPRINTF(x)
#endif

View File

@ -20,11 +20,7 @@
#define VERBOSE 1 #define VERBOSE 1
#if VERBOSE #define VPRINTF(x) do { if (VERBOSE) logerror x; } while (0)
#define VPRINTF(x) logerror x
#else
#define VPRINTF(x)
#endif

View File

@ -102,11 +102,7 @@
#define ALLOW_ONLY_AUTO_MALLOC_BANKS 0 #define ALLOW_ONLY_AUTO_MALLOC_BANKS 0
#if VERBOSE #define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0)
#define VPRINTF(x) mame_printf_debug x
#else
#define VPRINTF(x)
#endif

View File

@ -26,11 +26,7 @@
#define VERBOSE (0) #define VERBOSE (0)
#if VERBOSE #define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0)
#define VPRINTF(x) mame_printf_debug x
#else
#define VPRINTF(x)
#endif

View File

@ -24,11 +24,7 @@
#define VERBOSE (0) #define VERBOSE (0)
#if VERBOSE #define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0)
#define VPRINTF(x) mame_printf_debug x
#else
#define VPRINTF(x)
#endif

View File

@ -19,6 +19,7 @@
#include "c352.h" #include "c352.h"
#define VERBOSE (0) #define VERBOSE (0)
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
// flags // flags
@ -420,83 +421,63 @@ static void c352_write_reg16(struct c352_info *info, unsigned long address, unsi
if (chan > 31) if (chan > 31)
{ {
#if VERBOSE LOG(("C352 CTRL %08lx %04x\n", address, val));
logerror("C352 CTRL %08x %04x\n", address, val);
#endif
return; return;
} }
switch(address & 0xf) switch(address & 0xf)
{ {
case 0x0: case 0x0:
// volumes (output 1) // volumes (output 1)
#if VERBOSE LOG(("CH %02ld LVOL %02x RVOL %02x\n", chan, val & 0xff, val >> 8));
logerror("CH %02d LVOL %02x RVOL %02x\n", chan, val & 0xff, val >> 8);
#endif
info->c352_ch[chan].vol_l = val & 0xff; info->c352_ch[chan].vol_l = val & 0xff;
info->c352_ch[chan].vol_r = val >> 8; info->c352_ch[chan].vol_r = val >> 8;
break; break;
case 0x2: case 0x2:
// volumes (output 2) // volumes (output 2)
#if VERBOSE LOG(("CH %02ld RLVOL %02x RRVOL %02x\n", chan, val & 0xff, val >> 8));
logerror("CH %02d RLVOL %02x RRVOL %02x\n", chan, val & 0xff, val >> 8);
#endif
info->c352_ch[chan].vol_l2 = val & 0xff; info->c352_ch[chan].vol_l2 = val & 0xff;
info->c352_ch[chan].vol_r2 = val >> 8; info->c352_ch[chan].vol_r2 = val >> 8;
break; break;
case 0x4: case 0x4:
// pitch // pitch
#if VERBOSE LOG(("CH %02ld PITCH %04x\n", chan, val));
logerror("CH %02d PITCH %04x\n", chan, val);
#endif
info->c352_ch[chan].pitch = val; info->c352_ch[chan].pitch = val;
break; break;
case 0x6: case 0x6:
// flags // flags
#if VERBOSE LOG(("CH %02ld FLAG %02x\n", chan, val));
logerror("CH %02d FLAG %02x\n", chan, val);
#endif
info->c352_ch[chan].flag = val; info->c352_ch[chan].flag = val;
break; break;
case 0x8: case 0x8:
// bank (bits 16-31 of address); // bank (bits 16-31 of address);
info->c352_ch[chan].bank = val & 0xff; info->c352_ch[chan].bank = val & 0xff;
#if VERBOSE LOG(("CH %02ld BANK %02x", chan, info->c352_ch[chan].bank));
logerror("CH %02d BANK %02x", chan, info->c352_ch[chan].bank);
#endif
break; break;
case 0xa: case 0xa:
// start address // start address
#if VERBOSE LOG(("CH %02ld SADDR %04x\n", chan, val));
logerror("CH %02d SADDR %04x\n", chan, val);
#endif
info->c352_ch[chan].start_addr = val; info->c352_ch[chan].start_addr = val;
break; break;
case 0xc: case 0xc:
// end address // end address
#if VERBOSE LOG(("CH %02ld EADDR %04x\n", chan, val));
logerror("CH %02d EADDR %04x\n", chan, val);
#endif
info->c352_ch[chan].end_addr = val; info->c352_ch[chan].end_addr = val;
break; break;
case 0xe: case 0xe:
// loop address // loop address
#if VERBOSE LOG(("CH %02ld LADDR %04x\n", chan, val));
logerror("CH %02d LADDR %04x\n", chan, val);
#endif
info->c352_ch[chan].repeat_addr = val; info->c352_ch[chan].repeat_addr = val;
break; break;
default: default:
#if VERBOSE LOG(("CH %02ld UNKN %01lx %04x", chan, address & 0xf, val));
logerror("CH %02d UNKN %01x %04x", chan, address & 0xf, val);
#endif
break; break;
} }
} }

View File

@ -19,12 +19,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
/************************************* /*************************************
@ -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));
} }

View File

@ -684,7 +684,7 @@ static INT32 LFO_PM; /* runtime LFO calculations helper */
#define LOG_LEVEL LOG_INF #define LOG_LEVEL LOG_INF
#ifndef __RAINE__ #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 #endif
/* limitter */ /* limitter */

View File

@ -34,13 +34,16 @@ Registers per channel:
***************************************************************************/ ***************************************************************************/
#include "sndintrf.h" #include "sndintrf.h"
#include "cpuintrf.h"
#include "streams.h" #include "streams.h"
#include "gaelco.h" #include "gaelco.h"
#include "wavwrite.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 LOG_WAVE 1
//#define ALT_MIX //#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]--; gaelco_sndregs[base_offset + 3]--;
} }
} else { } else {
#ifdef LOG_SOUND 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]));
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
channel->active = 0; channel->active = 0;
} }
@ -191,9 +192,7 @@ static void gaelco_update(void *param, stream_sample_t **inputs, stream_sample_t
READ16_HANDLER( gaelcosnd_r ) READ16_HANDLER( gaelcosnd_r )
{ {
#ifdef LOG_READ_WRITES LOG_READ_WRITES(("%06x: (GAE1): read from %04x\n", activecpu_get_pc(), offset));
logerror("%06x: (GAE1): read from %04x\n", activecpu_get_pc(), offset);
#endif
return gaelco_sndregs[offset]; return gaelco_sndregs[offset];
} }
@ -207,9 +206,7 @@ WRITE16_HANDLER( gaelcosnd_w )
struct GAELCOSND *info = sndti_token(chip_type, 0); struct GAELCOSND *info = sndti_token(chip_type, 0);
struct gaelcosnd_channel *channel = &info->channel[offset >> 3]; struct gaelcosnd_channel *channel = &info->channel[offset >> 3];
#ifdef LOG_READ_WRITES LOG_READ_WRITES(("%06x: (GAE1): write %04x to %04x\n", activecpu_get_pc(), data, offset));
logerror("%06x: (GAE1): write %04x to %04x\n", activecpu_get_pc(), data, offset);
#endif
/* first update the stream to this point in time */ /* first update the stream to this point in time */
stream_update(info->stream); stream_update(info->stream);
@ -224,9 +221,7 @@ WRITE16_HANDLER( gaelcosnd_w )
channel->active = 1; channel->active = 1;
channel->chunkNum = 0; channel->chunkNum = 0;
channel->loop = 0; channel->loop = 0;
#ifdef LOG_SOUND 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));
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
} }
} else { } else {
channel->active = 0; channel->active = 0;
@ -236,9 +231,7 @@ WRITE16_HANDLER( gaelcosnd_w )
case 0x07: /* enable/disable looping */ case 0x07: /* enable/disable looping */
if ((gaelco_sndregs[offset - 1] != 0) && (data != 0)){ if ((gaelco_sndregs[offset - 1] != 0) && (data != 0)){
#ifdef LOG_SOUND 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));
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
channel->loop = 1; channel->loop = 1;
} else { } else {
channel->loop = 0; channel->loop = 0;

View File

@ -1,6 +1,3 @@
#define CHANNEL_DEBUG 0
#define VERBOSE 0
/********************************************************* /*********************************************************
Konami 054539 PCM Sound Chip Konami 054539 PCM Sound Chip
@ -25,6 +22,10 @@ CHANNEL_DEBUG enables the following keys:
#include "k054539.h" #include "k054539.h"
#include <math.h> #include <math.h>
#define CHANNEL_DEBUG 0
#define VERBOSE 0
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
/* Registers: /* Registers:
00..ff: 20 bytes/channel, 8 channels 00..ff: 20 bytes/channel, 8 channels
00..02: pitch (lsb, mid, msb) 00..02: pitch (lsb, mid, msb)
@ -333,9 +334,7 @@ else
break; break;
} }
default: default:
#if VERBOSE LOG(("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch));
logerror("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch);
#endif
break; break;
} }
chan->pos = cur_pos; chan->pos = cur_pos;
@ -573,7 +572,7 @@ static void K054539_w(int chip, offs_t offset, UINT8 data) //*
break; break;
default: default:
#if VERBOSE #if 0
if(regbase[offset] != data) { if(regbase[offset] != data) {
if((offset & 0xff00) == 0) { if((offset & 0xff00) == 0) {
chanoff = offset & 0x1f; chanoff = offset & 0x1f;
@ -619,9 +618,7 @@ static UINT8 K054539_r(int chip, offs_t offset)
case 0x22c: case 0x22c:
break; break;
default: default:
#if VERBOSE LOG(("K054539 read %03x\n", offset));
logerror("K054539 read %03x\n", offset);
#endif
break; break;
} }
return info->regs[offset]; return info->regs[offset];

View File

@ -86,35 +86,15 @@
#define VERBOSE_POLY 0 #define VERBOSE_POLY 0
#define VERBOSE_RAND 0 #define VERBOSE_RAND 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
#if VERBOSE_SOUND #define LOG_SOUND(x) do { if (VERBOSE_SOUND) logerror x; } while (0)
#define LOG_SOUND(x) logerror x
#else
#define LOG_SOUND(x)
#endif
#if VERBOSE_TIMER #define LOG_TIMER(x) do { if (VERBOSE_TIMER) logerror x; } while (0)
#define LOG_TIMER(x) logerror x
#else
#define LOG_TIMER(x)
#endif
#if VERBOSE_POLY #define LOG_POLY(x) do { if (VERBOSE_POLY) logerror x; } while (0)
#define LOG_POLY(x) logerror x
#else
#define LOG_POLY(x)
#endif
#if VERBOSE_RAND #define LOG_RAND(x) do { if (VERBOSE_RAND) logerror x; } while (0)
#define LOG_RAND(x) logerror x
#else
#define LOG_RAND(x)
#endif
#define CHAN1 0 #define CHAN1 0
#define CHAN2 1 #define CHAN2 1
@ -721,7 +701,6 @@ static TIMER_CALLBACK( pokey_timer_expire )
} }
} }
#if VERBOSE_SOUND
static char *audc2str(int val) static char *audc2str(int val)
{ {
static char buff[80]; static char buff[80];
@ -771,7 +750,6 @@ static char *audctl2str(int val)
strcat(buff,"+clk15"); strcat(buff,"+clk15");
return buff; return buff;
} }
#endif
static TIMER_CALLBACK( pokey_serin_ready ) static TIMER_CALLBACK( pokey_serin_ready )
{ {

View File

@ -40,7 +40,8 @@
Debug defines Debug defines
*/ */
#define LOG_WAVE 0 #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 */ /* 8 bit source ROM samples */
typedef INT8 QSOUND_SRC_SAMPLE; 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)); chip->pan_table[i]=(int)((256/sqrt(32)) * sqrt(i));
} }
#if LOG_QSOUND LOG(("Pan table\n"));
logerror("Pan table\n");
for (i=0; i<33; i++) for (i=0; i<33; i++)
logerror("%02x ", chip->pan_table[i]); LOG(("%02x ", chip->pan_table[i]));
#endif
{ {
/* Allocate stream */ /* Allocate stream */
chip->stream = stream_create( chip->stream = stream_create(
@ -307,9 +307,7 @@ static void qsound_set_command(struct qsound_info *chip, int data, int value)
*/ */
break; break;
} }
#if LOG_QSOUND LOG(("QSOUND WRITE %02x CH%02d-R%02d =%04x\n", data, ch, reg, value));
logerror("QSOUND WRITE %02x CH%02d-R%02d =%04x\n", data, ch, reg, value);
#endif
} }

View File

@ -66,11 +66,7 @@
#define LOG_WAV_FILE_NAME "sn76477_%d.wav" #define LOG_WAV_FILE_NAME "sn76477_%d.wav"
#if VERBOSE #define LOG(n,x) do { if (VERBOSE >= (n)) logerror x; } while (0)
#define LOG(n,x) if (VERBOSE >= (n)) logerror x
#else
#define LOG(n,x)
#endif
#define CHECK_CHIP_NUM assert(sn != NULL) #define CHECK_CHIP_NUM assert(sn != NULL)
#define CHECK_CHIP_NUM_AND_BOOLEAN CHECK_CHIP_NUM; assert((data & 0x01) == data) #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) static void log_enable_line(struct SN76477 *sn)
{ {
#if VERBOSE
static const char *const desc[] = static const char *const desc[] =
{ {
"Enabled", "Inhibited" "Enabled", "Inhibited"
}; };
#endif
LOG(1, ("SN76477 #%d: Enable line (9): %d [%s]\n", sn->index, sn->enable, desc[sn->enable])); 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) static void log_mixer_mode(struct SN76477 *sn)
{ {
#if VERBOSE
const char *desc[] = const char *desc[] =
{ {
"VCO", "SLF", "Noise", "VCO/Noise", "VCO", "SLF", "Noise", "VCO/Noise",
"SLF/Noise", "SLF/VCO/Noise", "SLF/VCO", "Inhibit" "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])); 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) static void log_envelope_mode(struct SN76477 *sn)
{ {
#if VERBOSE
const char *desc[] = const char *desc[] =
{ {
"VCO", "One-Shot", "Mixer Only", "VCO with Alternating Polarity" "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])); 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) static void log_vco_mode(struct SN76477 *sn)
{ {
#if VERBOSE
const char *desc[] = const char *desc[] =
{ {
"External (Pin 16)", "Internal (SLF)" "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])); LOG(1, ("SN76477 #%d: VCO mode (22): %d [%s]\n", sn->index, sn->vco_mode, desc[sn->vco_mode]));
} }

View File

@ -50,17 +50,9 @@
#define VERBOSE 0 #define VERBOSE 0
#define DEBUG_FIFO 0 #define DEBUG_FIFO 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
#ifdef DEBUG_FIFO #define LOG_FIFO(x) do { if (DEBUG_FIFO) logerror x; } while (0)
#define LOG_FIFO(x) logerror x
#else
#define LOG_FIFO(x)
#endif
#define SET_SBY(line_state) { \ #define SET_SBY(line_state) { \
if( sp->sby_line != line_state ) \ if( sp->sby_line != line_state ) \

View File

@ -10,6 +10,7 @@
#include "st0016.h" #include "st0016.h"
#define VERBOSE (0) #define VERBOSE (0)
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
UINT8 *st0016_sound_regs; UINT8 *st0016_sound_regs;
@ -26,9 +27,7 @@ WRITE8_HANDLER(st0016_snd_w)
int voice = offset/32; int voice = offset/32;
int reg = offset & 0x1f; int reg = offset & 0x1f;
int oldreg = st0016_sound_regs[offset]; int oldreg = st0016_sound_regs[offset];
#if VERBOSE
int vbase = offset & ~0x1f; int vbase = offset & ~0x1f;
#endif
st0016_sound_regs[offset] = data; st0016_sound_regs[offset] = data;
@ -38,15 +37,13 @@ WRITE8_HANDLER(st0016_snd_w)
{ {
info->vpos[voice] = info->frac[voice] = info->lponce[voice] = 0; info->vpos[voice] = info->frac[voice] = info->lponce[voice] = 0;
#if VERBOSE LOG(("Key on V%02d: st %06x-%06x lp %06x-%06x frq %x flg %x\n", voice,
logerror("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+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+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+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+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+0x11]<<8 | st0016_sound_regs[vbase+0x10],
st0016_sound_regs[vbase+0x16]); st0016_sound_regs[vbase+0x16]));
#endif
} }
} }
} }

View File

@ -4,11 +4,7 @@
#define VERBOSE 1 #define VERBOSE 1
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
#define VMIN 0x0000 #define VMIN 0x0000
#define VMAX 0x7fff #define VMAX 0x7fff
@ -465,7 +461,7 @@ static void tms3617_enable(struct TMS36XX *tms, int enable)
if (enable & (1 << i)) if (enable & (1 << i))
{ {
bits += 2; /* each voice has two instances */ bits += 2; /* each voice has two instances */
#if VERBOSE
switch (i) switch (i)
{ {
case 0: LOG((" 16'")); break; 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 4: LOG((" 2 2/3'")); break;
case 5: LOG((" 2'")); break; case 5: LOG((" 2'")); break;
} }
#endif
} }
} }
/* set the enable mask and number of active voices */ /* set the enable mask and number of active voices */

View File

@ -53,19 +53,21 @@ Hardcoded Values:
***************************************************************************/ ***************************************************************************/
#include "sndintrf.h" #include "sndintrf.h"
#include "cpuintrf.h"
#include "streams.h" #include "streams.h"
#include "x1_010.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 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 FREQ_BASE_BITS 8 // Frequency fixed decimal shift bits
#define ENV_BASE_BITS 16 // wave form envelope 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 #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; if( freq == 0 ) freq = 4;
smp_step = (UINT32)((float)info->base_clock/8192.0 smp_step = (UINT32)((float)info->base_clock/8192.0
*freq*(1<<FREQ_BASE_BITS)/(float)info->rate); *freq*(1<<FREQ_BASE_BITS)/(float)info->rate);
#if LOG_SOUND
if( smp_offs == 0 ) { if( smp_offs == 0 ) {
logerror( "Play sample %06X - %06X, channel %X volume %d freq %X step %X offset %X\n", LOG_SOUND(( "Play sample %p - %p, channel %X volume %d:%d freq %X step %X offset %X\n",
start, end, ch, vol, freq, smp_step, smp_offs ); start, end, ch, volL, volR, freq, smp_step, smp_offs ));
} }
#endif
for( i = 0; i < length; i++ ) { for( i = 0; i < length; i++ ) {
delta = smp_offs>>FREQ_BASE_BITS; delta = smp_offs>>FREQ_BASE_BITS;
// sample ended? // 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 = (UINT8 *)&(info->reg[reg->end*128]);
env_offs = info->env_offset[ch]; env_offs = info->env_offset[ch];
env_step = (UINT32)((float)info->base_clock/128.0/1024.0/4.0*reg->start*(1<<ENV_BASE_BITS)/(float)info->rate); env_step = (UINT32)((float)info->base_clock/128.0/1024.0/4.0*reg->start*(1<<ENV_BASE_BITS)/(float)info->rate);
#if LOG_SOUND /* Print some more debug info */
/* Print some more debug info */
if( smp_offs == 0 ) { if( smp_offs == 0 ) {
logerror( "Play waveform %X, channel %X volume %X freq %4X step %X offset %X\n", 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 ); reg->volume, ch, reg->end, freq, smp_step, smp_offs ));
} }
#endif
for( i = 0; i < length; i++ ) { for( i = 0; i < length; i++ ) {
int vol; int vol;
delta = env_offs>>ENV_BASE_BITS; 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->smp_offset[i] = 0;
info->env_offset[i] = 0; info->env_offset[i] = 0;
} }
#if LOG_SOUND
/* Print some more debug info */ /* Print some more debug info */
logerror("masterclock = %d rate = %d\n", master_clock, info->rate ); LOG_SOUND(("masterclock = %d rate = %d\n", clock, info->rate ));
#endif
/* get stream channels */ /* get stream channels */
info->stream = stream_create(0,2,info->rate,info,seta_update); 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->smp_offset[channel] = 0;
info->env_offset[channel] = 0; info->env_offset[channel] = 0;
} }
#if LOG_REGISTER_WRITE LOG_REGISTER_WRITE(("PC: %06X : offset %6X : data %2X\n", activecpu_get_pc(), offset, data ));
logerror("PC: %06X : offset %6X : data %2X\n", activecpu_get_pc(), offset, data );
#endif
info->reg[offset] = data; info->reg[offset] = data;
} }
@ -276,9 +271,7 @@ READ16_HANDLER( seta_sound_word_r )
ret = info->HI_WORD_BUF[offset]<<8; ret = info->HI_WORD_BUF[offset]<<8;
ret += (seta_sound_r( offset )&0xff); ret += (seta_sound_r( offset )&0xff);
#if LOG_REGISTER_READ LOG_REGISTER_READ(( "Read X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, ret ));
logerror( "Read X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, ret );
#endif
return ret; return ret;
} }
@ -287,9 +280,7 @@ WRITE16_HANDLER( seta_sound_word_w )
struct x1_010_info *info = sndti_token(SOUND_X1_010, 0); struct x1_010_info *info = sndti_token(SOUND_X1_010, 0);
info->HI_WORD_BUF[offset] = (data>>8)&0xff; info->HI_WORD_BUF[offset] = (data>>8)&0xff;
seta_sound_w( offset, data&0xff ); seta_sound_w( offset, data&0xff );
#if LOG_REGISTER_WRITE LOG_REGISTER_WRITE(( "Write X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, data ));
logerror( "Write X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, data );
#endif
} }

View File

@ -63,7 +63,8 @@
#include "cpuintrf.h" #include "cpuintrf.h"
#include "ymf278b.h" #include "ymf278b.h"
#undef VERBOSE #define VERBOSE 0
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
typedef struct typedef struct
{ {
@ -183,9 +184,7 @@ static void ymf278b_envelope_next(YMF278BSlot *slot)
// Attack // Attack
slot->env_vol = (256U << 23) - 1; slot->env_vol = (256U << 23) - 1;
slot->env_vol_lim = 256U<<23; slot->env_vol_lim = 256U<<23;
#ifdef VERBOSE LOG(("YMF278B: Skipping attack (rate = %d)\n", slot->AR));
logerror("YMF278B: Skipping attack (rate = %d)\n", slot->AR);
#endif
slot->env_step++; slot->env_step++;
} }
if(slot->env_step == 1) if(slot->env_step == 1)
@ -196,9 +195,8 @@ static void ymf278b_envelope_next(YMF278BSlot *slot)
if(slot->DL) if(slot->DL)
{ {
int rate = ymf278b_compute_rate(slot, slot->D1R); int rate = ymf278b_compute_rate(slot, slot->D1R);
#ifdef VERBOSE 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));
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
if(rate<4) if(rate<4)
slot->env_vol_step = 0; slot->env_vol_step = 0;
else else
@ -211,9 +209,8 @@ static void ymf278b_envelope_next(YMF278BSlot *slot)
{ {
// Decay 2 // Decay 2
int rate = ymf278b_compute_rate(slot, slot->D2R); 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); 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));
#endif
if(rate<4) if(rate<4)
slot->env_vol_step = 0; slot->env_vol_step = 0;
else else
@ -225,9 +222,7 @@ static void ymf278b_envelope_next(YMF278BSlot *slot)
if(slot->env_step == 3) if(slot->env_step == 3)
{ {
// Decay 2 reached -96dB // Decay 2 reached -96dB
#ifdef VERBOSE LOG(("YMF278B: Voice cleared because of decay 2\n"));
logerror("YMF278B: Voice cleared because of decay 2\n");
#endif
slot->env_vol = 256U<<23; slot->env_vol = 256U<<23;
slot->env_vol_step = 0; slot->env_vol_step = 0;
slot->env_vol_lim = 0; slot->env_vol_lim = 0;
@ -238,9 +233,8 @@ static void ymf278b_envelope_next(YMF278BSlot *slot)
{ {
// Release // Release
int rate = ymf278b_compute_rate(slot, slot->RR); 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); LOG(("YMF278B: Release, val = %d, rate = %d, delay = %g\n", slot->RR, rate, ymf278_compute_decay_rate(rate)*1000.0));
#endif
if(rate<4) if(rate<4)
slot->env_vol_step = 0; slot->env_vol_step = 0;
else else
@ -252,9 +246,7 @@ static void ymf278b_envelope_next(YMF278BSlot *slot)
if(slot->env_step == 5) if(slot->env_step == 5)
{ {
// Release reached -96dB // Release reached -96dB
#ifdef VERBOSE LOG(("YMF278B: Release ends\n"));
logerror("YMF278B: Release ends\n");
#endif
slot->env_vol = 256U<<23; slot->env_vol = 256U<<23;
slot->env_vol_step = 0; slot->env_vol_step = 0;
slot->env_vol_lim = 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); ymf278b_envelope_next(slot);
#ifdef VERBOSE 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,
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));
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));
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
} }
else else
{ {
#ifdef VERBOSE LOG(("YMF278B: slot %2d off\n", snum));
logerror("YMF278B: slot %2d off\n", snum);
#endif
if(slot->active) if(slot->active)
{ {
slot->env_step = 4; slot->env_step = 4;

View File

@ -30,13 +30,9 @@
DEBUGGING DEBUGGING
***************************************************************************/ ***************************************************************************/
#define VERBOSE #define VERBOSE 0
#ifdef VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define TRACE(x) do {x;} while (0)
#else
#define TRACE(x)
#endif
@ -746,12 +742,12 @@ int state_save_save_begin(mame_file *file)
if (ss_illegal_regs > 0) if (ss_illegal_regs > 0)
return 1; return 1;
TRACE(logerror("Beginning save\n")); LOG(("Beginning save\n"));
ss_dump_file = file; ss_dump_file = file;
/* compute the total dump size and the offsets of each element */ /* compute the total dump size and the offsets of each element */
ss_dump_size = compute_size_and_offsets(); 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 */ /* allocate memory for the array */
ss_dump_array = malloc_or_die(ss_dump_size); ss_dump_array = malloc_or_die(ss_dump_size);
@ -769,22 +765,22 @@ void state_save_save_continue(void)
ss_entry *entry; ss_entry *entry;
int count; int count;
TRACE(logerror("Saving tag %d\n", ss_current_tag)); LOG(("Saving tag %d\n", ss_current_tag));
/* call the pre-save functions */ /* 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); 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 */ /* then copy in all the data */
TRACE(logerror(" copying data\n")); LOG((" copying data\n"));
/* iterate over entries with matching tags */ /* iterate over entries with matching tags */
for (entry = ss_registry; entry; entry = entry->next) for (entry = ss_registry; entry; entry = entry->next)
if (entry->tag == ss_current_tag) if (entry->tag == ss_current_tag)
{ {
memcpy(ss_dump_array + entry->offset, entry->data, entry->typesize * entry->typecount); 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; UINT32 signature;
UINT8 flags = 0; UINT8 flags = 0;
TRACE(logerror("Finishing save\n")); LOG(("Finishing save\n"));
/* compute the flags */ /* compute the flags */
#ifndef LSB_FIRST #ifndef LSB_FIRST
@ -840,7 +836,7 @@ void state_save_save_finish(void)
int state_save_load_begin(mame_file *file) int state_save_load_begin(mame_file *file)
{ {
TRACE(logerror("Beginning load\n")); LOG(("Beginning load\n"));
/* read the file into memory */ /* read the file into memory */
ss_dump_size = mame_fsize(file); 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; need_convert = (ss_dump_array[9] & SS_MSB_FIRST) == 0;
#endif #endif
TRACE(logerror("Loading tag %d\n", ss_current_tag)); LOG(("Loading tag %d\n", ss_current_tag));
TRACE(logerror(" copying data\n")); LOG((" copying data\n"));
/* iterate over entries with matching tags */ /* iterate over entries with matching tags */
for (entry = ss_registry; entry; entry = entry->next) 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); memcpy(entry->data, ss_dump_array + entry->offset, entry->typesize * entry->typecount);
if (need_convert && ss_conv[entry->typesize]) if (need_convert && ss_conv[entry->typesize])
(*ss_conv[entry->typesize])(entry->data, entry->typecount); (*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 */ /* 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); 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) void state_save_load_finish(void)
{ {
TRACE(logerror("Finishing load\n")); LOG(("Finishing load\n"));
/* free memory and reset the global states */ /* free memory and reset the global states */
free(ss_dump_array); 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) void state_save_dump_registry(void)
{ {
#ifdef VERBOSE
ss_entry *entry; ss_entry *entry;
for (entry = ss_registry; entry; entry=entry->next) for (entry = ss_registry; entry; entry=entry->next)
logerror("%s: %d x %d\n", astring_c(entry->name), entry->typesize, entry->typecount); LOG(("%s: %d x %d\n", astring_c(entry->name), entry->typesize, entry->typecount));
#endif
} }

View File

@ -55,11 +55,7 @@
#define VERBOSE (0) #define VERBOSE (0)
#if VERBOSE #define VPRINTF(x) do { if (VERBOSE) mame_printf_debug x; } while (0)
#define VPRINTF(x) mame_printf_debug x
#else
#define VPRINTF(x)
#endif

View File

@ -22,11 +22,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) do { logerror x; } while (0)
#else
#define LOG(x)
#endif
@ -304,7 +300,7 @@ void timer_set_global_time(attotime newbase)
/* set the new global offset */ /* set the new global offset */
global_basetime = newbase; 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 */ /* now process any timers that are overdue */
while (attotime_compare(timer_head->expire, global_basetime) <= 0) while (attotime_compare(timer_head->expire, global_basetime) <= 0)

View File

@ -28,7 +28,8 @@
***************************************************************************/ ***************************************************************************/
#define LOG_THROTTLE (0) #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)

View File

@ -24,8 +24,9 @@
***************************************************************************/ ***************************************************************************/
#define VERBOSE (0) #define VERBOSE (0)
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
void CLIB_DECL logerror(const char *text,...);
/*************************************************************************** /***************************************************************************
TYPE DEFINITIONS TYPE DEFINITIONS
@ -123,9 +124,7 @@ cdrom_file *cdrom_open(chd_file *chd)
return NULL; return NULL;
} }
#if VERBOSE LOG(("CD has %d tracks\n", file->cdtoc.numtrks));
logerror("CD has %d tracks\n", file->cdtoc.numtrks);
#endif
/* calculate the starting frame for each track, keeping in mind that CHDMAN /* calculate the starting frame for each track, keeping in mind that CHDMAN
pads tracks out with extra frames to fit hunk size boundries 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].frames;
chdofs += file->cdtoc.tracks[i].extraframes; chdofs += file->cdtoc.tracks[i].extraframes;
#if VERBOSE LOG(("Track %02d is format %d subtype %d datasize %d subsize %d frames %d extraframes %d physofs %d chdofs %d\n", i+1,
logerror("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].trktype,
file->cdtoc.tracks[i].subtype, file->cdtoc.tracks[i].subtype,
file->cdtoc.tracks[i].datasize, 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].frames,
file->cdtoc.tracks[i].extraframes, file->cdtoc.tracks[i].extraframes,
file->cdtoc.tracks[i].physframeofs, file->cdtoc.tracks[i].physframeofs,
file->cdtoc.tracks[i].chdframeofs); file->cdtoc.tracks[i].chdframeofs));
#endif
} }
/* fill out dummy entries for the last track to help our search */ /* 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; return 1;
} }
#if VERBOSE LOG(("CDROM: Conversion from type %d to type %d not supported!\n", tracktype, datatype));
logerror("CDROM: Conversion from type %d to type %d not supported!\n", tracktype, datatype);
#endif
return 0; return 0;
} }
return 1; return 1;

View File

@ -20,8 +20,8 @@
* *
*************************************/ *************************************/
#define LOG(x) #define VERBOSE 0
//#define LOG(x) logerror x #define LOG(x) do { if (VERBOSE) logerror x; } while (0)

View File

@ -31,11 +31,7 @@
#define MINFREQ (139-139/3) #define MINFREQ (139-139/3)
#define MAXFREQ (139+139/3) #define MAXFREQ (139+139/3)
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
static emu_timer *lfotimer = NULL; static emu_timer *lfotimer = NULL;
static INT32 freq = MAXFREQ; static INT32 freq = MAXFREQ;

View File

@ -17,8 +17,8 @@
#include "segasnd.h" #include "segasnd.h"
#include <math.h> #include <math.h>
#define VERBOSE 0
#define LOG(x) /* logerror x */ #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
/*************************************************************************** /***************************************************************************

View File

@ -163,15 +163,16 @@ Adder hardware:
#include "slots.lh" #include "slots.lh"
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
#define LOG_SERIAL(x) logerror x // log serial communication between mainboard (scorpion2) and videoboard (adder2) #define VERBOSE 1
#define UART_LOG(x) logerror x //enable UART data logging
#define LOG(x) logerror x
#else #else
#define LOG_SERIAL(x) #define VERBOSE 0
#define UART_LOG(x)
#define LOG(x)
#endif #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 /////////////////////////////////////////////////////// // local prototypes ///////////////////////////////////////////////////////
static int get_scorpion2_uart_status(void); // retrieve status of uart on scorpion2 board static int get_scorpion2_uart_status(void); // retrieve status of uart on scorpion2 board

View File

@ -94,8 +94,6 @@
* *
*/ */
#define GX_DEBUG 0
#include "driver.h" #include "driver.h"
#include "video/konamiic.h" #include "video/konamiic.h"
@ -106,6 +104,8 @@
#include "machine/konamigx.h" #include "machine/konamigx.h"
#include "machine/adc083x.h" #include "machine/adc083x.h"
#define GX_DEBUG 0
VIDEO_START(konamigx_5bpp); VIDEO_START(konamigx_5bpp);
VIDEO_START(konamigx_6bpp); VIDEO_START(konamigx_6bpp);
VIDEO_START(konamigx_6bpp_2); VIDEO_START(konamigx_6bpp_2);

View File

@ -255,19 +255,17 @@ TODO: - Fix lamp timing, MAME doesn't update fast enough to see everything
#include "machine/meters.h" #include "machine/meters.h"
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
#define LOG(x)logerror x #define VERBOSE 1
#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
#else #else
#define LOG(x) #define VERBOSE 0
#define LOG_CHR(x)
#define LOG_CHR_FULL(x)
#define LOG_IC3(x)
#define LOG_IC8(x)
#endif #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 #ifndef AWP_VIDEO //Defined for fruit machines with mechanical reels
#define draw_reel(x) #define draw_reel(x)
#else #else

View File

@ -182,11 +182,13 @@ TODO: - Confirm that MC6850 emulation is sufficient.
#include "video/crtc6845.h" #include "video/crtc6845.h"
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
#define LOGSTUFF(x)logerror x #define VERBOSE 1
#else #else
#define LOGSTUFF(x) #define VERBOSE 0
#endif #endif
#define LOGSTUFF(x) do { if (VERBOSE) logerror x; } while (0)
#define VIDEO_MASTER_CLOCK (10000000) #define VIDEO_MASTER_CLOCK (10000000)
static UINT8 m6840_irq_state; static UINT8 m6840_irq_state;

View File

@ -473,7 +473,8 @@ struct _cop_state
static cop_state cop_data; 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)

View File

@ -76,7 +76,8 @@ static UINT16 *sprram, *sprram_old;
static int brightness; 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 = 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 case 0x5e/2: // bank switch, used by ROM check
#if SRMP6_VERBOSE LOG(("%x\n",data));
printf("%x\n",data);
#endif
memory_set_bankptr(1,(UINT16 *)(memory_region(REGION_USER2) + (data & 0x0f)*0x200000)); memory_set_bankptr(1,(UINT16 *)(memory_region(REGION_USER2) + (data & 0x0f)*0x200000));
break; break;
@ -461,8 +460,7 @@ static WRITE16_HANDLER(srmp6_dma_w)
int tempidx=0; int tempidx=0;
/* show params */ /* show params */
#if SRMP6_VERBOSE LOG(("DMA! %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n",
printf("DMA! %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n",
dmaram[0x00/2], dmaram[0x00/2],
dmaram[0x02/2], dmaram[0x02/2],
dmaram[0x04/2], dmaram[0x04/2],
@ -476,8 +474,7 @@ static WRITE16_HANDLER(srmp6_dma_w)
dmaram[0x14/2], dmaram[0x14/2],
dmaram[0x16/2], dmaram[0x16/2],
dmaram[0x18/2], dmaram[0x18/2],
dmaram[0x1a/2]); dmaram[0x1a/2]));
#endif
destl=dmaram[9]*0x40000; destl=dmaram[9]*0x40000;
@ -513,9 +510,7 @@ static WRITE16_HANDLER(srmp6_dma_w)
if(tempidx>=len) if(tempidx>=len)
{ {
#if SRMP6_VERBOSE LOG(("%x\n",srcdata));
printf("%x\n",srcdata);
#endif
return; return;
} }
} }

View File

@ -5,8 +5,6 @@
*************************************************************************/ *************************************************************************/
#define VERBOSE (0)
#define NEOGEO_MASTER_CLOCK (24000000) #define NEOGEO_MASTER_CLOCK (24000000)
#define NEOGEO_MAIN_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 2) #define NEOGEO_MAIN_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 2)
#define NEOGEO_AUDIO_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 6) #define NEOGEO_AUDIO_CPU_CLOCK (NEOGEO_MASTER_CLOCK / 6)

View File

@ -1065,9 +1065,8 @@ READ16_HANDLER( amiga_cia_r )
/* handle the reads */ /* handle the reads */
data = cia_read(which, offset >> 7); data = cia_read(which, offset >> 7);
#if LOG_CIA 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); 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
return data << shift; return data << shift;
} }
@ -1084,9 +1083,8 @@ WRITE16_HANDLER( amiga_cia_w )
{ {
int which; int which;
#if LOG_CIA 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); logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask ^ 0xffff);
#endif
/* offsets 0000-07ff reference CIA B, and are accessed via the MSB */ /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
if ((offset & 0x0800) == 0) if ((offset & 0x0800) == 0)
@ -1251,9 +1249,8 @@ READ16_HANDLER( amiga_custom_r )
break; break;
} }
#if LOG_CUSTOM if (LOG_CUSTOM)
logerror("%06X:read from custom %s\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff]); logerror("%06X:read from custom %s\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff]);
#endif
return 0xffff; return 0xffff;
} }
@ -1281,9 +1278,8 @@ WRITE16_HANDLER( amiga_custom_w )
UINT16 temp; UINT16 temp;
offset &= 0xff; offset &= 0xff;
#if LOG_CUSTOM if (LOG_CUSTOM)
logerror("%06X:write to custom %s = %04X\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff], data); logerror("%06X:write to custom %s = %04X\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff], data);
#endif
switch (offset) switch (offset)
{ {

View File

@ -194,15 +194,9 @@ TO DO (2006.09.12) :
*/ */
#if ARKANOID_BOOTLEG_VERBOSE #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_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 if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n",activecpu_get_pc(),data,arkanoid_bootleg_cmd);
#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 if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_d008_val);
#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
static UINT8 arkanoid_bootleg_cmd; static UINT8 arkanoid_bootleg_cmd;

View File

@ -42,28 +42,31 @@ static void pokey_reset(running_machine *machine);
void atari_interrupt_cb(int mask) void atari_interrupt_cb(int mask)
{ {
#if VERBOSE_POKEY if (VERBOSE_POKEY)
{
if (mask & 0x80) if (mask & 0x80)
logerror("atari interrupt_cb BREAK\n"); logerror("atari interrupt_cb BREAK\n");
if (mask & 0x40) if (mask & 0x40)
logerror("atari interrupt_cb KBCOD\n"); logerror("atari interrupt_cb KBCOD\n");
#endif }
#if VERBOSE_SERIAL if (VERBOSE_SERIAL)
{
if (mask & 0x20) if (mask & 0x20)
logerror("atari interrupt_cb SERIN\n"); logerror("atari interrupt_cb SERIN\n");
if (mask & 0x10) if (mask & 0x10)
logerror("atari interrupt_cb SEROR\n"); logerror("atari interrupt_cb SEROR\n");
if (mask & 0x08) if (mask & 0x08)
logerror("atari interrupt_cb SEROC\n"); logerror("atari interrupt_cb SEROC\n");
#endif }
#if VERBOSE_TIMERS if (VERBOSE_TIMERS)
{
if (mask & 0x04) if (mask & 0x04)
logerror("atari interrupt_cb TIMR4\n"); logerror("atari interrupt_cb TIMR4\n");
if (mask & 0x02) if (mask & 0x02)
logerror("atari interrupt_cb TIMR2\n"); logerror("atari interrupt_cb TIMR2\n");
if (mask & 0x01) if (mask & 0x01)
logerror("atari interrupt_cb TIMR1\n"); logerror("atari interrupt_cb TIMR1\n");
#endif }
cpunum_set_input_line(0, 0, HOLD_LINE); cpunum_set_input_line(0, 0, HOLD_LINE);
} }

View File

@ -291,7 +291,6 @@ WRITE8_HANDLER( decocass_reset_w )
cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 ); cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 );
} }
#ifdef MAME_DEBUG
static const char *dirnm(int speed) static const char *dirnm(int speed)
{ {
if (speed < -1) return "fast rewind"; if (speed < -1) return "fast rewind";
@ -300,7 +299,6 @@ static const char *dirnm(int speed)
if (speed == 1) return "forward"; if (speed == 1) return "forward";
return "fast forward"; return "fast forward";
} }
#endif
static void tape_crc16(UINT8 data) static void tape_crc16(UINT8 data)
{ {

View File

@ -3,10 +3,10 @@
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
#define LOGLEVEL 3 #define LOGLEVEL 3
#define LOG(n,x) if (LOGLEVEL >= n) logerror x
#else #else
#define LOG(n,x) #define LOGLEVEL 0
#endif #endif
#define LOG(n,x) do { if (LOGLEVEL >= n) logerror x; } while (0)
extern WRITE8_HANDLER( decocass_coin_counter_w ); extern WRITE8_HANDLER( decocass_coin_counter_w );
extern WRITE8_HANDLER( decocass_sound_command_w ); extern WRITE8_HANDLER( decocass_sound_command_w );

View File

@ -1,6 +1,3 @@
#define VERBOSE 0
#define GX_DEBUG 0
/************************************************************************** /**************************************************************************
* *
* machine/konamigx.c - contains various System GX hardware abstractions * machine/konamigx.c - contains various System GX hardware abstractions
@ -14,6 +11,8 @@
#include "machine/konamigx.h" #include "machine/konamigx.h"
#include <math.h> #include <math.h>
#define GX_DEBUG 0
static struct static struct
{ {

View File

@ -15,7 +15,8 @@ Memo:
#include "cpu/m68000/m68000.h" #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 // TMP68301 System Memory Map
@ -147,90 +148,70 @@ static UINT16 tmp68301_timer[0x50];
READ16_HANDLER( tmp68301_address_decoder_r ) READ16_HANDLER( tmp68301_address_decoder_r )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_address_decoder_r (%08X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2))));
logerror("PC %08X: TMP68301_address_decoder_r (%08X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)));
#endif
return tmp68301_address_decoder[offset]; return tmp68301_address_decoder[offset];
} }
WRITE16_HANDLER( tmp68301_address_decoder_w ) WRITE16_HANDLER( tmp68301_address_decoder_w )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)), data));
logerror("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)), data);
#endif
tmp68301_address_decoder[offset] = data; tmp68301_address_decoder[offset] = data;
} }
READ16_HANDLER( tmp68301_interrupt_controller_r ) READ16_HANDLER( tmp68301_interrupt_controller_r )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2))));
logerror("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)));
#endif
return tmp68301_interrupt_controller[offset]; return tmp68301_interrupt_controller[offset];
} }
WRITE16_HANDLER( tmp68301_interrupt_controller_w ) WRITE16_HANDLER( tmp68301_interrupt_controller_w )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)), data));
logerror("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)), data);
#endif
tmp68301_interrupt_controller[offset] = data; tmp68301_interrupt_controller[offset] = data;
} }
READ16_HANDLER( tmp68301_parallel_interface_r ) READ16_HANDLER( tmp68301_parallel_interface_r )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_parallel_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2))));
logerror("PC %08X: TMP68301_parallel_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)));
#endif
return tmp68301_parallel_interface[offset]; return tmp68301_parallel_interface[offset];
} }
WRITE16_HANDLER( tmp68301_parallel_interface_w ) WRITE16_HANDLER( tmp68301_parallel_interface_w )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)), data));
logerror("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)), data);
#endif
tmp68301_parallel_interface[offset] = data; tmp68301_parallel_interface[offset] = data;
} }
READ16_HANDLER( tmp68301_serial_interface_r ) READ16_HANDLER( tmp68301_serial_interface_r )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_serial_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2))));
logerror("PC %08X: TMP68301_serial_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)));
#endif
return tmp68301_serial_interface[offset]; return tmp68301_serial_interface[offset];
} }
WRITE16_HANDLER( tmp68301_serial_interface_w ) WRITE16_HANDLER( tmp68301_serial_interface_w )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)), data));
logerror("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)), data);
#endif
tmp68301_serial_interface[offset] = data; tmp68301_serial_interface[offset] = data;
} }
READ16_HANDLER( tmp68301_timer_r ) READ16_HANDLER( tmp68301_timer_r )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_timer_r (%08X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2))));
logerror("PC %08X: TMP68301_timer_r (%08X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)));
#endif
return tmp68301_timer[offset]; return tmp68301_timer[offset];
} }
WRITE16_HANDLER( tmp68301_timer_w ) WRITE16_HANDLER( tmp68301_timer_w )
{ {
#if TMP68301_DEBUG LOG(("PC %08X: TMP68301_timer_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)), data));
logerror("PC %08X: TMP68301_timer_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)), data);
#endif
tmp68301_timer[offset] = data; tmp68301_timer[offset] = data;
} }

View File

@ -35,7 +35,9 @@ static s16 mb_result = 0;
#define REGf mb_reg [0x0f] #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 ) WRITE8_HANDLER( mb_go_w )
{ {
@ -43,9 +45,7 @@ WRITE8_HANDLER( mb_go_w )
s16 mb_q; /* temp used in division */ s16 mb_q; /* temp used in division */
int msb; int msb;
#ifdef MB_TEST LOG(("math box command %02x data %02x ", offset, data));
logerror("math box command %02x data %02x ", offset, data);
#endif
switch (offset) switch (offset)
{ {
@ -149,9 +149,7 @@ WRITE8_HANDLER( mb_go_w )
/* fall into command 13 */ /* fall into command 13 */
case 0x13: case 0x13:
#ifdef MB_TEST LOG(("\nR7: %04x R8: %04x R9: %04x\n", REG7, REG8, REG9));
logerror("\nR7: %04x R8: %04x R9: %04x\n", REG7, REG8, REG9);
#endif
REGc = REG9; REGc = REG9;
mb_q = REG8; mb_q = REG8;
@ -258,9 +256,7 @@ WRITE8_HANDLER( mb_go_w )
break; break;
} }
#ifdef MB_TEST LOG((" result %04x\n", mb_result & 0xffff));
logerror(" result %04x\n", mb_result & 0xffff);
#endif
} }
READ8_HANDLER( mb_status_r ) READ8_HANDLER( mb_status_r )

View File

@ -15,8 +15,8 @@
#include "cpu/z80/z80daisy.h" #include "cpu/z80/z80daisy.h"
#include "mcr.h" #include "mcr.h"
#define VERBOSE 1
#define LOG(x) logerror x #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
/************************************* /*************************************

View File

@ -140,6 +140,7 @@ TODO:
#define VERBOSE 0 #define VERBOSE 0
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
struct namcoio struct namcoio
{ {
@ -186,9 +187,7 @@ static void namcoio_51XX_write(int chip,int data)
{ {
data &= 0x07; data &= 0x07;
#if VERBOSE LOG(("%04x: custom 51XX write %02x\n",activecpu_get_pc(),data));
logerror("%04x: custom 51XX write %02x\n",activecpu_get_pc(),data);
#endif
if (io[chip].coincred_mode) if (io[chip].coincred_mode)
{ {
@ -284,9 +283,7 @@ static const int joy_map[16] =
static UINT8 namcoio_51XX_read(int chip) static UINT8 namcoio_51XX_read(int chip)
{ {
#if VERBOSE LOG(("%04x: custom 51XX read\n",activecpu_get_pc()));
logerror("%04x: custom 51XX read\n",activecpu_get_pc());
#endif
if (io[chip].mode == 0) /* switch mode */ 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) static void namco_customio_56XX_run(int chip)
{ {
#if VERBOSE LOG(("execute 56XX %d mode %d\n",chip,IORAM_READ(8)));
logerror("execute 56XX %d mode %d\n",chip,IORAM_READ(8));
#endif
switch (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) static void namco_customio_59XX_run(int chip)
{ {
#if VERBOSE LOG(("execute 59XX %d mode %d\n",chip,IORAM_READ(8)));
logerror("execute 59XX %d mode %d\n",chip,IORAM_READ(8));
#endif
switch (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) static void namco_customio_58XX_run(int chip)
{ {
#if VERBOSE LOG(("execute 58XX %d mode %d\n",chip,IORAM_READ(8)));
logerror("execute 58XX %d mode %d\n",chip,IORAM_READ(8));
#endif
switch (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 // RAM is 4-bit wide; Pac & Pal requires the | 0xf0 otherwise Easter egg doesn't work
offset &= 0x3f; offset &= 0x3f;
#if VERBOSE 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));
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
return 0xf0 | namcoio_ram[offset]; return 0xf0 | namcoio_ram[offset];
} }
@ -749,9 +738,7 @@ WRITE8_HANDLER( namcoio_w )
offset &= 0x3f; offset &= 0x3f;
data &= 0x0f; // RAM is 4-bit wide data &= 0x0f; // RAM is 4-bit wide
#if VERBOSE LOG(("%04x: I/O write %d: offset %d = %02x\n", activecpu_get_pc(), offset / 16, offset & 0x0f, data));
logerror("%04x: I/O write %d: offset %d = %02x\n", activecpu_get_pc(), offset / 16, offset & 0x0f, data);
#endif
namcoio_ram[offset] = 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 (!cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
{ {
#if VERBOSE LOG(("NMI cpu %d\n",nmi_cpu[param]));
logerror("NMI cpu %d\n",nmi_cpu[param]);
#endif
cpunum_set_input_line(nmi_cpu[param], INPUT_LINE_NMI, PULSE_LINE); cpunum_set_input_line(nmi_cpu[param], INPUT_LINE_NMI, PULSE_LINE);
} }
#if VERBOSE
else else
logerror("NMI not generated because cpu %d is suspended\n",nmi_cpu[param]); LOG(("NMI not generated because cpu %d is suspended\n",nmi_cpu[param]));
#endif
} }
static UINT8 customio_command[MAX_06XX]; 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) static UINT8 namcoio_53XX_digdug_read(int chip)
{ {
#if VERBOSE LOG(("%04x: custom 53XX read\n",activecpu_get_pc()));
logerror("%04x: custom 53XX read\n",activecpu_get_pc());
#endif
switch ((io[chip].in_count++) % 2) 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) static UINT8 namcoio_53XX_polepos_read(int chip)
{ {
#if VERBOSE LOG(("%04x: custom 53XX read\n",activecpu_get_pc()));
logerror("%04x: custom 53XX read\n",activecpu_get_pc());
#endif
switch ((io[chip].in_count++) % 8) 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) static UINT8 namco_06xx_data_read(int chipnum)
{ {
#if VERBOSE LOG(("forwarding read to chip %d\n",chipnum%3));
logerror("forwarding read to chip %d\n",chipnum%3);
#endif
switch (io[chipnum].type) 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) static void namco_06xx_data_write(int chipnum,UINT8 data)
{ {
#if VERBOSE LOG(("forwarding write to chip %d\n",chipnum%3));
logerror("forwarding write to chip %d\n",chipnum%3);
#endif
switch (io[chipnum].type) 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) static void namco_06xx_read_request(int chipnum)
{ {
#if VERBOSE LOG(("requesting read to chip %d\n",chipnum%3));
logerror("requesting read to chip %d\n",chipnum%3);
#endif
switch (io[chipnum].type) 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) static UINT8 namco_06xx_data_r(int chip,int offset)
{ {
#if VERBOSE LOG(("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset));
logerror("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset);
#endif
if (!(customio_command[chip] & 0x10)) 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) static void namco_06xx_data_w(int chip,int offset,int data)
{ {
#if VERBOSE LOG(("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data));
logerror("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data);
#endif
if (customio_command[chip] & 0x10) 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) static UINT8 namco_06xx_ctrl_r(int chip)
{ {
#if VERBOSE LOG(("%04x: 06XX #%d ctrl_r\n",activecpu_get_pc(),chip));
logerror("%04x: 06XX #%d ctrl_r\n",activecpu_get_pc(),chip);
#endif
return customio_command[chip]; return customio_command[chip];
} }
static void namco_06xx_ctrl_w(int chip,int data) static void namco_06xx_ctrl_w(int chip,int data)
{ {
#if VERBOSE LOG(("%04x: 06XX #%d command %02x\n",activecpu_get_pc(),chip,data));
logerror("%04x: 06XX #%d command %02x\n",activecpu_get_pc(),chip,data);
#endif
customio_command[chip] = data; customio_command[chip] = data;
if ((customio_command[chip] & 0x0f) == 0) if ((customio_command[chip] & 0x0f) == 0)
{ {
#if VERBOSE LOG(("disabling nmi generate timer\n"));
logerror("disabling nmi generate timer\n");
#endif
timer_adjust(nmi_timer[chip], attotime_never, chip, attotime_never); timer_adjust(nmi_timer[chip], attotime_never, chip, attotime_never);
} }
else else
{ {
#if VERBOSE LOG(("setting nmi generate timer to 200us\n"));
logerror("setting nmi generate timer to 200us\n");
#endif
// this timing is critical. Due to a bug, Bosconian will stop responding to // this timing is critical. Due to a bug, Bosconian will stop responding to
// inputs if a transfer terminates at the wrong time. // inputs if a transfer terminates at the wrong time.
// On the other hand, the time cannot be too short otherwise the 54XX will // On the other hand, the time cannot be too short otherwise the 54XX will

View File

@ -53,22 +53,12 @@
#endif /* MESS */ #endif /* MESS */
#define VERBOSE_DBG 0 /* general debug messages */ #define VERBOSE_DBG 0 /* general debug messages */
#if VERBOSE_DBG
#define DBG_LOG(N,M,A) \ #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; } 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) */ #define VERBOSE_JOY 0 /* JOY (joystick port) */
#if VERBOSE_JOY
#define LOG(LEVEL,N,M,A) \
#define JOY_LOG(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; } 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 #define FDC_DMA 2

View File

@ -10,7 +10,8 @@ Taito 8741 emulation
#include "driver.h" #include "driver.h"
#include "tait8741.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]; sst = &taito8741[st->connect];
/* transfer data */ /* transfer data */
taito8741_serial_rx(sst,st->txd); taito8741_serial_rx(sst,st->txd);
#if __log__ LOG(("8741-%d Serial data TX to %d\n",num,st->connect));
logerror("8741-%d Serial data TX to %d\n",num,st->connect);
#endif
if( sst->mode==TAITO8741_SLAVE) if( sst->mode==TAITO8741_SLAVE)
sst->serial_out = 1; sst->serial_out = 1;
} }
@ -276,9 +275,7 @@ static int I8741_status_r(int num)
{ {
I8741 *st = &taito8741[num]; I8741 *st = &taito8741[num];
taito8741_update(num); taito8741_update(num);
#if __log__ LOG(("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc()));
logerror("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc());
#endif
return st->status; return st->status;
} }
@ -288,9 +285,8 @@ static int I8741_data_r(int num)
I8741 *st = &taito8741[num]; I8741 *st = &taito8741[num];
int ret = st->toData; int ret = st->toData;
st->status &= 0xfe; st->status &= 0xfe;
#if __log__ LOG(("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc()));
logerror("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc());
#endif
/* update chip */ /* update chip */
taito8741_update(num); taito8741_update(num);
@ -307,9 +303,7 @@ static int I8741_data_r(int num)
static void I8741_data_w(int num, int data) static void I8741_data_w(int num, int data)
{ {
I8741 *st = &taito8741[num]; I8741 *st = &taito8741[num];
#if __log__ LOG(("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc()));
logerror("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc());
#endif
st->fromData = data; st->fromData = data;
st->status |= 0x02; st->status |= 0x02;
/* update chip */ /* update chip */
@ -320,9 +314,7 @@ static void I8741_data_w(int num, int data)
static void I8741_command_w(int num, int data) static void I8741_command_w(int num, int data)
{ {
I8741 *st = &taito8741[num]; I8741 *st = &taito8741[num];
#if __log__ LOG(("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc()));
logerror("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc());
#endif
st->fromCmd = data; st->fromCmd = data;
st->status |= 0x04; st->status |= 0x04;
/* update chip */ /* 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]; JV8741 *mcu = &i8741[num];
if(offset==1) if(offset==1)
{ {
#if __log__ LOG(("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data));
if(log)
logerror("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data);
#endif
/* read pointer */ /* read pointer */
mcu->cmd = data; mcu->cmd = data;
@ -496,10 +485,7 @@ if(log)
else else
{ {
/* data */ /* data */
#if __log__ LOG(("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data));
if(log)
logerror("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data);
#endif
mcu->txd = data^0x40; /* parity reverce ? */ mcu->txd = data^0x40; /* parity reverce ? */
mcu->sts |= 0x02; /* TXD busy */ mcu->sts |= 0x02; /* TXD busy */
@ -518,7 +504,7 @@ if(log)
josvolly_8741_do(num); 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]; JV8741 *mcu = &i8741[num];
int ret; int ret;
@ -528,26 +514,20 @@ static INT8 josvolly_8741_r(int num,int offset,int log)
if(mcu->rst) if(mcu->rst)
mcu->rxd = (mcu->initReadPort)(0); /* port in */ mcu->rxd = (mcu->initReadPort)(0); /* port in */
ret = mcu->sts; ret = mcu->sts;
#if __log__ LOG(("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret));
if(log)
logerror("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret);
#endif
} }
else else
{ {
/* clear status port */ /* clear status port */
mcu->sts &= ~0x01; /* RD ready */ mcu->sts &= ~0x01; /* RD ready */
ret = mcu->rxd; ret = mcu->rxd;
#if __log__ LOG(("PC=%04X 8741[%d] DR %02X\n",activecpu_get_pc(),num,ret));
if(log)
logerror("PC=%04X 8741[%d] DR %02X\n",activecpu_get_pc(),num,ret);
#endif
mcu->rst = 0; mcu->rst = 0;
} }
return ret; return ret;
} }
WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(0,offset,data,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,1); } READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(0,offset); }
WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(1,offset,data,1); } WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(1,offset,data); }
READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(1,offset,1); } READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(1,offset); }

View File

@ -11,7 +11,8 @@
#include "cpu/m6805/m6805.h" #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; static UINT8 fromz80,toz80;
@ -87,24 +88,18 @@ WRITE8_HANDLER( taitosj_bankswitch_w )
***************************************************************************/ ***************************************************************************/
READ8_HANDLER( taitosj_fake_data_r ) READ8_HANDLER( taitosj_fake_data_r )
{ {
#if DEBUG_MCU LOG(("%04x: protection read\n",activecpu_get_pc()));
logerror("%04x: protection read\n",activecpu_get_pc());
#endif
return 0; return 0;
} }
WRITE8_HANDLER( taitosj_fake_data_w ) WRITE8_HANDLER( taitosj_fake_data_w )
{ {
#if DEBUG_MCU LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data));
logerror("%04x: protection write %02x\n",activecpu_get_pc(),data);
#endif
} }
READ8_HANDLER( taitosj_fake_status_r ) READ8_HANDLER( taitosj_fake_status_r )
{ {
#if DEBUG_MCU LOG(("%04x: protection status read\n",activecpu_get_pc()));
logerror("%04x: protection status read\n",activecpu_get_pc());
#endif
return 0xff; return 0xff;
} }
@ -112,9 +107,7 @@ logerror("%04x: protection status read\n",activecpu_get_pc());
/* timer callback : */ /* timer callback : */
READ8_HANDLER( taitosj_mcu_data_r ) READ8_HANDLER( taitosj_mcu_data_r )
{ {
#if DEBUG_MCU LOG(("%04x: protection read %02x\n",activecpu_get_pc(),toz80));
logerror("%04x: protection read %02x\n",activecpu_get_pc(),toz80);
#endif
zaccept = 1; zaccept = 1;
return toz80; return toz80;
} }
@ -129,9 +122,7 @@ static TIMER_CALLBACK( taitosj_mcu_real_data_w )
WRITE8_HANDLER( taitosj_mcu_data_w ) WRITE8_HANDLER( taitosj_mcu_data_w )
{ {
#if DEBUG_MCU LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data));
logerror("%04x: protection write %02x\n",activecpu_get_pc(),data);
#endif
timer_call_after_resynch(NULL, data,taitosj_mcu_real_data_w); timer_call_after_resynch(NULL, data,taitosj_mcu_real_data_w);
/* temporarily boost the interleave to sync things up */ /* temporarily boost the interleave to sync things up */
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(10)); 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 ) READ8_HANDLER( taitosj_68705_portA_r )
{ {
#if DEBUG_MCU LOG(("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in));
logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in);
#endif
return portA_in; return portA_in;
} }
WRITE8_HANDLER( taitosj_68705_portA_w ) WRITE8_HANDLER( taitosj_68705_portA_w )
{ {
#if DEBUG_MCU LOG(("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data));
logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data);
#endif
portA_out = data; portA_out = data;
} }
@ -205,15 +192,11 @@ static TIMER_CALLBACK( taitosj_mcu_status_real_w )
WRITE8_HANDLER( taitosj_68705_portB_w ) WRITE8_HANDLER( taitosj_68705_portB_w )
{ {
#if DEBUG_MCU LOG(("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data));
logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data);
#endif
if (~data & 0x01) if (~data & 0x01)
{ {
#if DEBUG_MCU LOG(("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc()));
logerror("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc());
#endif
} }
if (~data & 0x02) 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); timer_call_after_resynch(NULL, 0,taitosj_mcu_data_real_r);
cpunum_set_input_line(2,0,CLEAR_LINE); cpunum_set_input_line(2,0,CLEAR_LINE);
portA_in = fromz80; portA_in = fromz80;
#if DEBUG_MCU LOG(("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in));
logerror("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in);
#endif
} }
if (~data & 0x08) if (~data & 0x08)
busreq = 1; busreq = 1;
@ -231,17 +212,15 @@ logerror("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in);
busreq = 0; busreq = 0;
if (~data & 0x04) if (~data & 0x04)
{ {
#if DEBUG_MCU LOG(("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out));
logerror("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out);
#endif
/* 68705 is writing data for the Z80 */ /* 68705 is writing data for the Z80 */
timer_call_after_resynch(NULL, portA_out,taitosj_mcu_status_real_w); timer_call_after_resynch(NULL, portA_out,taitosj_mcu_status_real_w);
} }
if (~data & 0x10) if (~data & 0x10)
{ {
#if DEBUG_MCU LOG(("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address));
logerror("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address);
#endif
memory_set_context(0); memory_set_context(0);
program_write_byte(address, portA_out); program_write_byte(address, portA_out);
memory_set_context(2); 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); memory_set_context(0);
portA_in = program_read_byte(address); portA_in = program_read_byte(address);
memory_set_context(2); memory_set_context(2);
#if DEBUG_MCU LOG(("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),portA_in,address));
logerror("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),portA_in,address);
#endif
} }
if (~data & 0x40) if (~data & 0x40)
{ {
#if DEBUG_MCU LOG(("%04x: 68705 address low %02x\n",activecpu_get_pc(),portA_out));
logerror("%04x: 68705 address low %02x\n",activecpu_get_pc(),portA_out);
#endif
address = (address & 0xff00) | portA_out; address = (address & 0xff00) | portA_out;
} }
if (~data & 0x80) if (~data & 0x80)
{ {
#if DEBUG_MCU LOG(("%04x: 68705 address high %02x\n",activecpu_get_pc(),portA_out));
logerror("%04x: 68705 address high %02x\n",activecpu_get_pc(),portA_out);
#endif
address = (address & 0x00ff) | (portA_out << 8); address = (address & 0x00ff) | (portA_out << 8);
} }
} }
@ -289,9 +262,7 @@ READ8_HANDLER( taitosj_68705_portC_r )
int res; int res;
res = (zready << 0) | (zaccept << 1) | ((busreq^1) << 2); res = (zready << 0) | (zaccept << 1) | ((busreq^1) << 2);
#if DEBUG_MCU LOG(("%04x: 68705 port C read %02x\n",activecpu_get_pc(),res));
logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),res);
#endif
return res; return res;
} }

View File

@ -13,7 +13,8 @@
#include "driver.h" #include "driver.h"
#include "machine/ticket.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 #define MAX_DISPENSERS 2
@ -70,17 +71,13 @@ READ8_HANDLER( ticket_dispenser_r )
READ8_HANDLER( ticket_dispenser_0_r ) READ8_HANDLER( ticket_dispenser_0_r )
{ {
#ifdef DEBUG_TICKET LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[0].status));
logerror("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), status);
#endif
return dispenser[0].status; return dispenser[0].status;
} }
READ8_HANDLER( ticket_dispenser_1_r ) READ8_HANDLER( ticket_dispenser_1_r )
{ {
#ifdef DEBUG_TICKET LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[1].status));
logerror("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), status);
#endif
return dispenser[1].status; return dispenser[1].status;
} }
@ -99,9 +96,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w )
{ {
if (!dispenser[0].power) if (!dispenser[0].power)
{ {
#ifdef DEBUG_TICKET LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc()));
logerror("PC: %04X Ticket Power On\n", activecpu_get_pc());
#endif
timer_adjust(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); timer_adjust(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
dispenser[0].power = 1; dispenser[0].power = 1;
@ -112,9 +107,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w )
{ {
if (dispenser[0].power) if (dispenser[0].power)
{ {
#ifdef DEBUG_TICKET LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc()));
logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc());
#endif
timer_adjust(dispenser[0].timer, attotime_never, 0, attotime_never); timer_adjust(dispenser[0].timer, attotime_never, 0, attotime_never);
set_led_status(2,0); set_led_status(2,0);
dispenser[0].power = 0; dispenser[0].power = 0;
@ -129,9 +122,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w )
{ {
if (!dispenser[1].power) if (!dispenser[1].power)
{ {
#ifdef DEBUG_TICKET LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc()));
logerror("PC: %04X Ticket Power On\n", activecpu_get_pc());
#endif
timer_adjust(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); timer_adjust(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
dispenser[1].power = 1; dispenser[1].power = 1;
@ -142,9 +133,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w )
{ {
if (dispenser[1].power) if (dispenser[1].power)
{ {
#ifdef DEBUG_TICKET LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc()));
logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc());
#endif
timer_adjust(dispenser[1].timer, attotime_never, 0, attotime_never); timer_adjust(dispenser[1].timer, attotime_never, 0, attotime_never);
set_led_status(2,0); set_led_status(2,0);
dispenser[1].power = 0; dispenser[1].power = 0;
@ -168,9 +157,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle )
if (dispenser->power) if (dispenser->power)
{ {
dispenser->status ^= active_bit; dispenser->status ^= active_bit;
#ifdef DEBUG_TICKET LOG(("Ticket Status Changed to %02X\n", dispenser->status));
logerror("Ticket Status Changed to %02X\n", status);
#endif
timer_adjust(dispenser->timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); 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); set_led_status(2,1);
dispensed_tickets++; dispensed_tickets++;
#ifdef DEBUG_TICKET LOG(("Ticket Dispensed\n"));
logerror("Ticket Dispensed\n");
#endif
} }
else else
{ {

View File

@ -10,6 +10,7 @@
#define LOG_DSP_CALLS 0 #define LOG_DSP_CALLS 0
#define LOG(x) do { if (LOG_DSP_CALLS) logerror x; } while (0)
#define CLEAR 0 #define CLEAR 0
#define ASSERT 1 #define ASSERT 1
@ -23,9 +24,7 @@ static int fsharkbt_8741;
static int dsp_execute; static int dsp_execute;
static UINT32 dsp_addr_w, main_ram_seg; static UINT32 dsp_addr_w, main_ram_seg;
#if LOG_DSP_CALLS
static const int toaplan_port_type[2] = { 0x7800c, 0x5c }; static const int toaplan_port_type[2] = { 0x7800c, 0x5c };
#endif
UINT8 *twincobr_sharedram; UINT8 *twincobr_sharedram;
@ -61,9 +60,7 @@ WRITE16_HANDLER( twincobr_dsp_addrsel_w )
main_ram_seg = ((data & 0xe000) << 3); main_ram_seg = ((data & 0xe000) << 3);
dsp_addr_w = ((data & 0x1fff) << 1); dsp_addr_w = ((data & 0x1fff) << 1);
#if LOG_DSP_CALLS LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w));
logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w);
#endif
} }
READ16_HANDLER( twincobr_dsp_r ) READ16_HANDLER( twincobr_dsp_r )
@ -79,9 +76,7 @@ READ16_HANDLER( twincobr_dsp_r )
cpuintrf_pop_context(); break; 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; 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 LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w));
logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w);
#endif
return input_data; return input_data;
} }
@ -97,9 +92,7 @@ WRITE16_HANDLER( twincobr_dsp_w )
cpuintrf_pop_context(); break; 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; 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 LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w));
logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w);
#endif
} }
WRITE16_HANDLER( wardner_dsp_addrsel_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 (main_ram_seg == 0x6000) main_ram_seg = 0x7000;
#if LOG_DSP_CALLS LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w));
logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w);
#endif
} }
READ16_HANDLER( wardner_dsp_r ) READ16_HANDLER( wardner_dsp_r )
@ -133,9 +124,7 @@ READ16_HANDLER( wardner_dsp_r )
cpuintrf_pop_context(); break; 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; 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 LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w));
logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w);
#endif
return input_data; return input_data;
} }
@ -152,9 +141,7 @@ WRITE16_HANDLER( wardner_dsp_w )
cpuintrf_pop_context(); break; 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; 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 LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w));
logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w);
#endif
} }
WRITE16_HANDLER( twincobr_dsp_bio_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 */ /* Actually only DSP data bit 15 controls this */
/* data 0x0000 means set DSP BIO line active and disable */ /* data 0x0000 means set DSP BIO line active and disable */
/* communication to main processor*/ /* communication to main processor*/
#if LOG_DSP_CALLS LOG(("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data));
logerror("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data);
#endif
if (data & 0x8000) { if (data & 0x8000) {
twincobr_dsp_BIO = CLEAR_LINE; twincobr_dsp_BIO = CLEAR_LINE;
} }
if (data == 0) { if (data == 0) {
if (dsp_execute) { if (dsp_execute) {
#if LOG_DSP_CALLS LOG(("Turning the main CPU on\n"));
logerror("Turning the main CPU on\n");
#endif
cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE);
dsp_execute = 0; dsp_execute = 0;
} }
@ -189,9 +172,7 @@ READ16_HANDLER( fsharkbt_dsp_r )
/* Port is read three times during startup. First and last data */ /* Port is read three times during startup. First and last data */
/* read must equal, but second data read must be different */ /* read must equal, but second data read must be different */
fsharkbt_8741 += 1; fsharkbt_8741 += 1;
#if LOG_DSP_CALLS LOG(("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",activecpu_get_previouspc(),(fsharkbt_8741 & 0x08)));
logerror("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",activecpu_get_previouspc(),(fsharkbt_8741 & 0x08));
#endif
return (fsharkbt_8741 & 1); return (fsharkbt_8741 & 1);
} }
@ -213,17 +194,13 @@ static void twincobr_dsp(int enable)
{ {
twincobr_dsp_on = enable; twincobr_dsp_on = enable;
if (enable) { if (enable) {
#if LOG_DSP_CALLS LOG(("Turning DSP on and main CPU off\n"));
logerror("Turning DSP on and main CPU off\n");
#endif
cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE);
cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */
cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE);
} }
else { else {
#if LOG_DSP_CALLS LOG(("Turning DSP off\n"));
logerror("Turning DSP off\n");
#endif
cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */
cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); 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) static void toaplan0_control_w(int offset, int data)
{ {
#if LOG_DSP_CALLS LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset));
logerror("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset);
#endif
if (toaplan_main_cpu == 1) { if (toaplan_main_cpu == 1) {
if (data == 0x0c) { data = 0x1c; wardner_sprite_hack=0; } /* Z80 ? */ 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) static void toaplan0_coin_dsp_w(int offset, int data)
{ {
#if LOG_DSP_CALLS
if (data > 1) if (data > 1)
logerror("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset); LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset));
#endif
switch (data) { switch (data) {
case 0x08: coin_counter_w(0,0); break; case 0x08: coin_counter_w(0,0); break;
case 0x09: coin_counter_w(0,1); 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; case 0x0f: coin_lockout_w(1,0); break;
/****** The following apply to Flying Shark/Wardner only ******/ /****** The following apply to Flying Shark/Wardner only ******/
case 0x00: /* This means assert the INT line to the DSP */ case 0x00: /* This means assert the INT line to the DSP */
#if LOG_DSP_CALLS LOG(("Turning DSP on and main CPU off\n"));
logerror("Turning DSP on and main CPU off\n");
#endif
cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE);
cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */
cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE);
break; break;
case 0x01: /* This means inhibit the INT line to the DSP */ case 0x01: /* This means inhibit the INT line to the DSP */
#if LOG_DSP_CALLS LOG(("Turning DSP off\n"));
logerror("Turning DSP off\n");
#endif
cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */
cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE);
break; break;

View File

@ -16,11 +16,7 @@
#define VERBOSE 0 #define VERBOSE 0
#endif #endif
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x) /* x */
#endif
ANTIC antic; ANTIC antic;

View File

@ -18,11 +18,7 @@
#define VERBOSE 0 #define VERBOSE 0
#if VERBOSE #define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#define LOG(x) logerror x
#else
#define LOG(x) /* x */
#endif
char atari_frame_message[64+1]; char atari_frame_message[64+1];
int atari_frame_counter; 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); draw_scanline8(tmpbitmap, 12, y, sizeof(scanline), (const UINT8 *) scanline, Machine->pens, -1);
} }
#if VERBOSE
static int cycle(void) static int cycle(void)
{ {
return video_screen_get_hpos(0) * CYCLES_PER_LINE / Machine->screen[0].width; 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) static void after(int cycles, timer_callback function, const char *funcname)
{ {

View File

@ -97,11 +97,13 @@ E000-FFFF | R | D D D D D D D D | 8K ROM
#include "rendlay.h" #include "rendlay.h"
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
#define LOG_CTRL(x) logerror x // show UART information #define VERBOSE 1
#else #else
#define LOG_CTRL(x) #define VERBOSE 0
#endif #endif
#define LOG_CTRL(x) do { if (VERBOSE) logerror x; } while (0)
// local vars ///////////////////////////////////////////////////////////// // local vars /////////////////////////////////////////////////////////////
#define SL_DISPLAY 0x02 // displayed Adder screen, 1=screen1 0=screen0 #define SL_DISPLAY 0x02 // displayed Adder screen, 1=screen1 0=screen0

View File

@ -517,9 +517,7 @@ INLINE UINT16 *cps1_base(int offset,int boundary)
READ16_HANDLER( cps1_output_r ) READ16_HANDLER( cps1_output_r )
{ {
#if VERBOSE if (VERBOSE && offset >= 0x18/2) logerror("PC %06x: read output port %02x\n",activecpu_get_pc(),offset*2);
if (offset >= 0x18/2) logerror("PC %06x: read output port %02x\n",activecpu_get_pc(),offset*2);
#endif
/* Some games interrogate a couple of registers on bootup. */ /* Some games interrogate a couple of registers on bootup. */
/* These are CPS1 board B self test checks. They wander from game to */ /* 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) if (cps1_game_config->control_reg && offset == cps1_game_config->control_reg/2 && data != 0x3f)
logerror("control_reg = %04x",data); logerror("control_reg = %04x",data);
#endif #endif
#if VERBOSE if (VERBOSE)
{
if (offset > 0x22/2 && if (offset > 0x22/2 &&
offset != cps1_game_config->layer_control/2 && offset != cps1_game_config->layer_control/2 &&
offset != cps1_game_config->priority[0]/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) if (cps1_game_config->priority[0] && offset == cps1_game_config->priority[0]/2 && data != 0x00)
popmessage("priority0 %04x",data); popmessage("priority0 %04x",data);
#endif #endif
#endif }
} }

View File

@ -22,6 +22,7 @@
// Log Blitter // Log Blitter
#define VERBOSE 0 #define VERBOSE 0
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
/* 0 B01234 G01234 R01234 */ /* 0 B01234 G01234 R01234 */
@ -98,16 +99,12 @@ WRITE8_HANDLER( dynax_extra_scrolly_w )
WRITE8_HANDLER( dynax_blit_pen_w ) WRITE8_HANDLER( dynax_blit_pen_w )
{ {
dynax_blit_pen = data; dynax_blit_pen = data;
#if VERBOSE LOG(("P=%02X ",data));
logerror("P=%02X ",data);
#endif
} }
WRITE8_HANDLER( dynax_blit2_pen_w ) WRITE8_HANDLER( dynax_blit2_pen_w )
{ {
dynax_blit2_pen = data; dynax_blit2_pen = data;
#if VERBOSE LOG(("P'=%02X ",data));
logerror("P'=%02X ",data);
#endif
} }
/* Destination Layers */ /* Destination Layers */
@ -117,16 +114,12 @@ WRITE8_HANDLER( dynax_blit_dest_w )
if (layer_layout == LAYOUT_HNORIDUR) if (layer_layout == LAYOUT_HNORIDUR)
dynax_blit_dest = BITSWAP8(dynax_blit_dest ^ 0x0f, 7,6,5,4, 0,1,2,3); dynax_blit_dest = BITSWAP8(dynax_blit_dest ^ 0x0f, 7,6,5,4, 0,1,2,3);
#if VERBOSE LOG(("D=%02X ",data));
logerror("D=%02X ",data);
#endif
} }
WRITE8_HANDLER( dynax_blit2_dest_w ) WRITE8_HANDLER( dynax_blit2_dest_w )
{ {
dynax_blit2_dest = data; dynax_blit2_dest = data;
#if VERBOSE LOG(("D'=%02X ",data));
logerror("D'=%02X ",data);
#endif
} }
WRITE8_HANDLER( tenkai_blit_dest_w ) WRITE8_HANDLER( tenkai_blit_dest_w )
{ {
@ -137,9 +130,7 @@ WRITE8_HANDLER( tenkai_blit_dest_w )
WRITE8_HANDLER( dynax_blit_backpen_w ) WRITE8_HANDLER( dynax_blit_backpen_w )
{ {
dynax_blit_backpen = data; dynax_blit_backpen = data;
#if VERBOSE LOG(("B=%02X ",data));
logerror("B=%02X ",data);
#endif
} }
/* Layers 0&1 Palettes (Low Bits) */ /* 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); dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | ((data&0x0f)<<12) | ((data&0xf0)<<4);
else else
dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | data; dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | data;
#if VERBOSE LOG(("P01=%02X ",data));
logerror("P01=%02X ",data);
#endif
} }
WRITE8_HANDLER( tenkai_blit_palette01_w ) WRITE8_HANDLER( tenkai_blit_palette01_w )
{ {
dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | data; dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | data;
#if VERBOSE LOG(("P01=%02X ",data));
logerror("P01=%02X ",data);
#endif
} }
/* Layers 4&5 Palettes (Low Bits) */ /* 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); dynax_blit2_palettes = (dynax_blit2_palettes & 0x00ff) | ((data&0x0f)<<12) | ((data&0xf0)<<4);
else else
dynax_blit2_palettes = (dynax_blit2_palettes & 0xff00) | data; dynax_blit2_palettes = (dynax_blit2_palettes & 0xff00) | data;
#if VERBOSE LOG(("P45=%02X ",data));
logerror("P45=%02X ",data);
#endif
} }
/* Layer 2&3 Palettes (Low Bits) */ /* 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); dynax_blit_palettes = (dynax_blit_palettes & 0xff00) | ((data&0x0f)<<4) | ((data&0xf0)>>4);
else else
dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | (data<<8); dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | (data<<8);
#if VERBOSE LOG(("P23=%02X ",data));
logerror("P23=%02X ",data);
#endif
} }
WRITE8_HANDLER( tenkai_blit_palette23_w ) WRITE8_HANDLER( tenkai_blit_palette23_w )
{ {
dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | ((data&0x0f)<<12) | ((data&0xf0)<<4); dynax_blit_palettes = (dynax_blit_palettes & 0x00ff) | ((data&0x0f)<<12) | ((data&0xf0)<<4);
#if VERBOSE LOG(("P23=%02X ",data));
logerror("P23=%02X ",data);
#endif
} }
/* Layer 6&7 Palettes (Low Bits) */ /* Layer 6&7 Palettes (Low Bits) */
WRITE8_HANDLER( dynax_blit_palette67_w ) 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); dynax_blit2_palettes = (dynax_blit2_palettes & 0xff00) | ((data&0x0f)<<4) | ((data&0xf0)>>4);
else else
dynax_blit2_palettes = (dynax_blit2_palettes & 0x00ff) | (data<<8); dynax_blit2_palettes = (dynax_blit2_palettes & 0x00ff) | (data<<8);
#if VERBOSE LOG(("P67=%02X ",data));
logerror("P67=%02X ",data);
#endif
} }
@ -209,34 +188,26 @@ WRITE8_HANDLER( dynax_blit_palette67_w )
WRITE8_HANDLER( dynax_blit_palbank_w ) WRITE8_HANDLER( dynax_blit_palbank_w )
{ {
dynax_blit_palbank = data; dynax_blit_palbank = data;
#if VERBOSE LOG(("PB=%02X ",data));
logerror("PB=%02X ",data);
#endif
} }
WRITE8_HANDLER( dynax_blit2_palbank_w ) WRITE8_HANDLER( dynax_blit2_palbank_w )
{ {
dynax_blit2_palbank = data; dynax_blit2_palbank = data;
#if VERBOSE LOG(("PB'=%02X ",data));
logerror("PB'=%02X ",data);
#endif
} }
/* Which half of the layers to write two (interleaved games only) */ /* Which half of the layers to write two (interleaved games only) */
WRITE8_HANDLER( hanamai_layer_half_w ) WRITE8_HANDLER( hanamai_layer_half_w )
{ {
hanamai_layer_half = (~data) & 1; hanamai_layer_half = (~data) & 1;
#if VERBOSE LOG(("H=%02X ",data));
logerror("H=%02X ",data);
#endif
} }
/* Write to both halves of the layers (interleaved games only) */ /* Write to both halves of the layers (interleaved games only) */
WRITE8_HANDLER( hnoridur_layer_half2_w ) WRITE8_HANDLER( hnoridur_layer_half2_w )
{ {
hnoridur_layer_half2 = (~data) & 1; hnoridur_layer_half2 = (~data) & 1;
#if VERBOSE LOG(("H2=%02X ",data));
logerror("H2=%02X ",data);
#endif
} }
WRITE8_HANDLER( mjdialq2_blit_dest_w ) WRITE8_HANDLER( mjdialq2_blit_dest_w )
@ -251,9 +222,7 @@ WRITE8_HANDLER( mjdialq2_blit_dest_w )
WRITE8_HANDLER( dynax_layer_enable_w ) WRITE8_HANDLER( dynax_layer_enable_w )
{ {
dynax_layer_enable = data; dynax_layer_enable = data;
#if VERBOSE LOG(("E=%02X ",data));
logerror("E=%02X ",data);
#endif
} }
WRITE8_HANDLER( jantouki_layer_enable_w ) WRITE8_HANDLER( jantouki_layer_enable_w )
@ -277,26 +246,20 @@ WRITE8_HANDLER( dynax_flipscreen_w )
flipscreen = data & 1; flipscreen = data & 1;
if (data & ~1) if (data & ~1)
logerror("CPU#0 PC %06X: Warning, flip screen <- %02X\n", activecpu_get_pc(), data); logerror("CPU#0 PC %06X: Warning, flip screen <- %02X\n", activecpu_get_pc(), data);
#if VERBOSE LOG(("F=%02X ",data));
logerror("F=%02X ",data);
#endif
} }
WRITE8_HANDLER( dynax_blit_romregion_w ) WRITE8_HANDLER( dynax_blit_romregion_w )
{ {
dynax_blit_romregion = REGION_GFX1 + data; dynax_blit_romregion = REGION_GFX1 + data;
#if VERBOSE LOG(("GFX%X ",data+1));
logerror("GFX%X ",data+1);
#endif
} }
WRITE8_HANDLER( dynax_blit2_romregion_w ) WRITE8_HANDLER( dynax_blit2_romregion_w )
{ {
dynax_blit2_romregion = REGION_GFX2 + data; dynax_blit2_romregion = REGION_GFX2 + data;
#if VERBOSE LOG(("GFX%X' ",data+2));
logerror("GFX%X' ",data+2);
#endif
} }
/*************************************************************************** /***************************************************************************
@ -544,9 +507,7 @@ static void dynax_blitter_start(int flags)
{ {
int blit_newsrc; int blit_newsrc;
#if VERBOSE LOG(("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags));
logerror("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags);
#endif
blit_newsrc = blit_newsrc =
blitter_drawgfx( blitter_drawgfx(
@ -575,9 +536,7 @@ static void jantouki_blitter_start(int flags)
{ {
int blit_newsrc; int blit_newsrc;
#if VERBOSE LOG(("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags));
logerror("XY=%X,%X SRC=%X BLIT=%X\n",blit_x,blit_y,blit_src,flags);
#endif
blit_newsrc = blit_newsrc =
blitter_drawgfx( blitter_drawgfx(
@ -606,9 +565,7 @@ static void jantouki_blitter2_start(int flags)
{ {
int blit2_newsrc; int blit2_newsrc;
#if VERBOSE LOG(("XY'=%X,%X SRC'=%X BLIT'=%02X\n",blit2_x,blit2_y,blit2_src,flags));
logerror("XY'=%X,%X SRC'=%X BLIT'=%02X\n",blit2_x,blit2_y,blit2_src,flags);
#endif
blit2_newsrc = blit2_newsrc =
blitter_drawgfx( blitter_drawgfx(
@ -640,20 +597,14 @@ static WRITE8_HANDLER( dynax_blit_scroll_w )
switch( blit_src & 0xc00000 ) switch( blit_src & 0xc00000 )
{ {
case 0x000000: dynax_blit_scroll_x = data; case 0x000000: dynax_blit_scroll_x = data;
#if VERBOSE LOG(("SX=%02X ",data));
logerror("SX=%02X ",data);
#endif
break; break;
case 0x400000: dynax_blit_scroll_y = data; case 0x400000: dynax_blit_scroll_y = data;
#if VERBOSE LOG(("SY=%02X ",data));
logerror("SY=%02X ",data);
#endif
break; break;
case 0x800000: case 0x800000:
case 0xc00000: dynax_blit_wrap_enable = data; case 0xc00000: dynax_blit_wrap_enable = data;
#if VERBOSE LOG(("WE=%02X ",data));
logerror("WE=%02X ",data);
#endif
break; break;
} }
} }
@ -664,20 +615,14 @@ static WRITE8_HANDLER( tenkai_blit_scroll_w )
switch( blit_src & 0xc00000 ) switch( blit_src & 0xc00000 )
{ {
case 0x000000: dynax_blit_scroll_x = ((data ^ 0xff) + 1) & 0xff; case 0x000000: dynax_blit_scroll_x = ((data ^ 0xff) + 1) & 0xff;
#if VERBOSE LOG(("SX=%02X ",data));
logerror("SX=%02X ",data);
#endif
break; break;
case 0x400000: dynax_blit_scroll_y = data ^ 0xff; case 0x400000: dynax_blit_scroll_y = data ^ 0xff;
#if VERBOSE LOG(("SY=%02X ",data));
logerror("SY=%02X ",data);
#endif
break; break;
case 0x800000: case 0x800000:
case 0xc00000: dynax_blit_wrap_enable = data; case 0xc00000: dynax_blit_wrap_enable = data;
#if VERBOSE LOG(("WE=%02X ",data));
logerror("WE=%02X ",data);
#endif
break; break;
} }
} }
@ -687,20 +632,14 @@ static WRITE8_HANDLER( dynax_blit2_scroll_w )
switch( blit2_src & 0xc00000 ) switch( blit2_src & 0xc00000 )
{ {
case 0x000000: dynax_blit2_scroll_x = data; case 0x000000: dynax_blit2_scroll_x = data;
#if VERBOSE LOG(("SX'=%02X ",data));
logerror("SX'=%02X ",data);
#endif
break; break;
case 0x400000: dynax_blit2_scroll_y = data; case 0x400000: dynax_blit2_scroll_y = data;
#if VERBOSE LOG(("SY'=%02X ",data));
logerror("SY'=%02X ",data);
#endif
break; break;
case 0x800000: case 0x800000:
case 0xc00000: dynax_blit2_wrap_enable = data; case 0xc00000: dynax_blit2_wrap_enable = data;
#if VERBOSE LOG(("WE'=%02X ",data));
logerror("WE'=%02X ",data);
#endif
break; break;
} }
} }

View File

@ -193,11 +193,12 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags)
/* don't blit if pointer bad */ /* don't blit if pointer bad */
if (!a1_base_mem || !a2_base_mem) if (!a1_base_mem || !a2_base_mem)
{ {
#if LOG_BAD_BLITS if (LOG_BAD_BLITS)
{
logerror("%08X:Blit!\n", activecpu_get_previouspc()); logerror("%08X:Blit!\n", activecpu_get_previouspc());
logerror(" a1_base = %08X\n", a1_base); logerror(" a1_base = %08X\n", a1_base);
logerror(" a2_base = %08X\n", a2_base); logerror(" a2_base = %08X\n", a2_base);
#endif }
return; return;
} }
@ -272,7 +273,8 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags)
adest_xmask = (COMMAND & 0x00000800) ? a2_xmask : a1_xmask; adest_xmask = (COMMAND & 0x00000800) ? a2_xmask : a1_xmask;
adest_ymask = (COMMAND & 0x00000800) ? a2_ymask : a1_ymask; adest_ymask = (COMMAND & 0x00000800) ? a2_ymask : a1_ymask;
#if LOG_BLITS if (LOG_BLITS)
{
logerror("%08X:Blit!\n", activecpu_get_previouspc()); logerror("%08X:Blit!\n", activecpu_get_previouspc());
logerror(" a1_base = %08X\n", a1_base); logerror(" a1_base = %08X\n", a1_base);
logerror(" a1_pitch = %d\n", a1_pitch); 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(" count = %d x %d\n", inner_count, outer_count);
logerror(" command = %08X\n", COMMAND); logerror(" command = %08X\n", COMMAND);
#endif }
#if LOG_UNHANDLED_BLITS
/* check for unhandled command bits */ /* check for unhandled command bits */
if (COMMAND & 0x24003000) if (LOG_UNHANDLED_BLITS && (COMMAND & 0x24003000))
logerror("Blitter unhandled: these command bits: %08X\n", COMMAND & 0x24003000); logerror("Blitter unhandled: these command bits: %08X\n", COMMAND & 0x24003000);
#endif /* LOG_UNHANDLED_BLITS */
/* top of the outer loop */ /* top of the outer loop */
outer = outer_count; outer = outer_count;

View File

@ -601,9 +601,8 @@ WRITE32_HANDLER( jaguar_blitter_w )
if (offset == B_CMD) if (offset == B_CMD)
blitter_run(); 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); logerror("%08X:Blitter write register @ F022%02X = %08X\n", activecpu_get_previouspc(), offset * 4, data);
#endif
} }

View File

@ -1,5 +1,3 @@
#define VERBOSE 0
/* /*
* video/konamigx.c - Konami GX video hardware (here there be dragons) * video/konamigx.c - Konami GX video hardware (here there be dragons)
* *
@ -9,6 +7,8 @@
#include "video/konamiic.h" #include "video/konamiic.h"
#include "machine/konamigx.h" #include "machine/konamigx.h"
#define VERBOSE 0
static int layer_colorbase[4]; static int layer_colorbase[4];
static INT32 gx_tilebanks[8], gx_oldbanks[8]; static INT32 gx_tilebanks[8], gx_oldbanks[8];
static int gx_tilemode, gx_rozenable, psac_colorbase, last_psac_colorbase; 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) */ /* save mixcode and mark tile alpha (unimplemented) */
*code = 0; *code = 0;
#if VERBOSE if (VERBOSE)
popmessage("skipped alpha tile(layer=%d mix=%d)", layer, mixcode); popmessage("skipped alpha tile(layer=%d mix=%d)", layer, mixcode);
#endif
} }
} }

View File

@ -1,5 +1,3 @@
#define VERBOSE 0
/*************************************************************************** /***************************************************************************
TODO: TODO:
@ -1153,6 +1151,9 @@ Registers (word-wise):
#include "driver.h" #include "driver.h"
#include "video/konamiic.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 This recursive function doesn't use additional memory
(it could be easily converted into an iterative one). (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 else
machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
#if VERBOSE if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS"); popmessage("driver should use VIDEO_HAS_SHADOWS");
#endif
/* prepare shadow draw table */ /* prepare shadow draw table */
gfx_drawmode_table[0] = DRAWMODE_NONE; 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 else
machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
#if VERBOSE if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS"); popmessage("driver should use VIDEO_HAS_SHADOWS");
#endif
/* prepare shadow draw table */ /* prepare shadow draw table */
gfx_drawmode_table[0] = DRAWMODE_NONE; 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 else
machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; 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->screen[0].format == BITMAP_FORMAT_RGB32)
{ {
if ((machine->drv->video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS) 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)) if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS"); popmessage("driver should use VIDEO_HAS_SHADOWS");
} }
#endif }
/* prepare shadow draw table */ /* prepare shadow draw table */
gfx_drawmode_table[0] = DRAWMODE_NONE; gfx_drawmode_table[0] = DRAWMODE_NONE;
@ -3863,10 +3862,8 @@ void K055673_vh_start(running_machine *machine, int gfx_memory_region, int layou
else else
machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16; machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
#if VERBOSE if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS"); popmessage("driver should use VIDEO_HAS_SHADOWS");
#endif
/* prepare shadow draw table */ /* prepare shadow draw table */
c = machine->gfx[gfx_index]->color_granularity-1; c = machine->gfx[gfx_index]->color_granularity-1;
@ -3994,9 +3991,7 @@ READ16_HANDLER( K055673_rom_word_r ) // 5bpp
return ROM8[romofs]; return ROM8[romofs];
break; break;
default: default:
#if VERBOSE LOG(("55673_rom_word_r: Unknown read offset %x\n", offset));
logerror("55673_rom_word_r: Unknown read offset %x\n", offset);
#endif
break; break;
} }
@ -4036,9 +4031,7 @@ READ16_HANDLER( K055673_GX6bpp_rom_word_r )
return ROM[romofs+2]; return ROM[romofs+2];
break; break;
default: default:
#if VERBOSE LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, activecpu_get_pc()));
logerror("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, activecpu_get_pc());
#endif
break; 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 = (K053246_regs[6] << 17) | (K053246_regs[7] << 9) | (K053246_regs[4] << 1) | ((offset & 1) ^ 1);
addr &= memory_region_length(K053247_memory_region)-1; addr &= memory_region_length(K053247_memory_region)-1;
#if VERBOSE if (VERBOSE)
popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset,addr); popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset,addr);
#endif
return memory_region(K053247_memory_region)[addr]; return memory_region(K053247_memory_region)[addr];
} }
else else
{ {
#if VERBOSE LOG(("%04x: read from unknown 053246 address %x\n",activecpu_get_pc(),offset));
logerror("%04x: read from unknown 053246 address %x\n",activecpu_get_pc(),offset);
#endif
return 0; return 0;
} }
} }
@ -5833,9 +5823,7 @@ READ16_HANDLER( K056832_5bpp_rom_word_r )
} }
else else
{ {
#if VERBOSE LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask));
logerror("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask);
#endif
} }
return 0; return 0;
} }
@ -5860,9 +5848,7 @@ READ32_HANDLER( K056832_5bpp_rom_long_r )
} }
else else
{ {
#if VERBOSE LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask));
logerror("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask);
#endif
} }
return 0; return 0;
} }
@ -5887,9 +5873,7 @@ READ32_HANDLER( K056832_6bpp_rom_long_r )
} }
else else
{ {
#if VERBOSE LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask));
logerror("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask);
#endif
} }
return 0; return 0;
} }
@ -7100,7 +7084,6 @@ void K055555_vh_start(void)
void K055555_write_reg(UINT8 regnum, UINT8 regdat) void K055555_write_reg(UINT8 regnum, UINT8 regdat)
{ {
#if VERBOSE
static const char *const rnames[46] = static const char *const rnames[46] =
{ {
"BGC CBLK", "BGC SET", "COLSET0", "COLSET1", "COLSET2", "COLSET3", "COLCHG ON", "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]) 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; k55555_regs[regnum] = regdat;
} }
@ -7370,9 +7352,8 @@ int K054338_set_alpha_level(int pblend)
mixlv = mixlv<<3 | mixlv>>2; mixlv = mixlv<<3 | mixlv>>2;
alpha_set_level(mixlv); alpha_set_level(mixlv);
#if VERBOSE if (VERBOSE)
popmessage("MIXSET%1d %s addition mode: %02x",pblend,(mixpri)?"dst":"src",mixset&0x1f); popmessage("MIXSET%1d %s addition mode: %02x",pblend,(mixpri)?"dst":"src",mixset&0x1f);
#endif
} }
return(mixlv); return(mixlv);

View File

@ -4,12 +4,7 @@
#define LOG_TGP_VIDEO 0 #define LOG_TGP_VIDEO 0
#if LOG_TGP_VIDEO #define LOG_TGP(x) do { if (LOG_TGP_VIDEO) logerror x; } while (0)
#define LOG_TGP logerror
#else
static void dummy_log(const char *s,...) {}
#define LOG_TGP dummy_log
#endif
UINT16 *model1_display_list0, *model1_display_list1; UINT16 *model1_display_list0, *model1_display_list1;
UINT16 *model1_color_xlat; UINT16 *model1_color_xlat;
@ -256,11 +251,11 @@ static void fill_quad(mame_bitmap *bitmap, const struct quad *q)
if(color < 0) { if(color < 0) {
color = -1-color; 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[0]->s.x, q->p[0]->s.y,
q->p[1]->s.x, q->p[1]->s.y, q->p[1]->s.x, q->p[1]->s.y,
q->p[2]->s.x, q->p[2]->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++) { 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); struct point *(*fclip_point)(struct point *p1, struct point *p2);
if(level == 4) { if(level == 4) {
LOG_TGP("VIDEOCQ %d", level); LOG_TGP(("VIDEOCQ %d", level));
for(i=0; i<4; i++) 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((" (%f, %f, %f)", q->p[i]->x, q->p[i]->y, q->p[i]->z));
LOG_TGP("\n"); LOG_TGP(("\n"));
*quadpt = *q; *quadpt = *q;
quadpt++; quadpt++;
return; return;
@ -617,10 +612,10 @@ static void fclip_push_quad(int level, struct quad *q)
for(i=0; i<4; i++) for(i=0; i<4; i++)
is_out[i] = clipfn[level].isclipped(q->p[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++) 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((" (%f, %f, %f, %d)", q->p[i]->x, q->p[i]->y, q->p[i]->z, is_out[i]));
LOG_TGP("\n"); LOG_TGP(("\n"));
// No clipping // No clipping
if(!is_out[0] && !is_out[1] && !is_out[2] && !is_out[3]) { 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 #endif
if(1) { 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) if(!size)
@ -795,11 +790,11 @@ static void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
for(i=0; i<size; i++) { for(i=0; i<size; i++) {
#if 0 #if 0
LOG_TGP("VIDEO: %08x (%f, %f, %f) (%f, %f, %f) (%f, %f, %f)\n", LOG_TGP(("VIDEO: %08x (%f, %f, %f) (%f, %f, %f) (%f, %f, %f)\n",
*(UINT32 *)(poly_data+poly_adr) & ~(0x01800303), *(UINT32 *)(poly_data+poly_adr) & ~(0x01800303),
poly_data[poly_adr+1], poly_data[poly_adr+2], poly_data[poly_adr+3], poly_data[poly_adr+1], poly_data[poly_adr+2], poly_data[poly_adr+3],
poly_data[poly_adr+4], poly_data[poly_adr+5], poly_data[poly_adr+6], poly_data[poly_adr+4], poly_data[poly_adr+5], poly_data[poly_adr+6],
poly_data[poly_adr+7], poly_data[poly_adr+8], poly_data[poly_adr+9]); poly_data[poly_adr+7], poly_data[poly_adr+8], poly_data[poly_adr+9]));
#endif #endif
flags = *(UINT32 *)(poly_data+poly_adr); flags = *(UINT32 *)(poly_data+poly_adr);
@ -841,21 +836,21 @@ static void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
#if 0 #if 0
if(dump) if(dump)
LOG_TGP("VIDEO: %08x (%f, %f, %f) (%f, %f, %f)\n", LOG_TGP(("VIDEO: %08x (%f, %f, %f) (%f, %f, %f)\n",
*(UINT32 *)(poly_data+poly_adr), *(UINT32 *)(poly_data+poly_adr),
p0->x, p0->y, p0->z, p0->x, p0->y, p0->z,
p1->x, p1->y, p1->z); p1->x, p1->y, p1->z));
#endif #endif
#if 0 #if 0
if(1 || dump) { 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), *(UINT32 *)(poly_data+poly_adr),
old_p0->s.x, old_p0->s.y, old_p0->s.x, old_p0->s.y,
old_p1->s.x, old_p1->s.y, old_p1->s.x, old_p1->s.y,
p0->s.x, p0->s.y, p0->s.x, p0->s.y,
p1->s.x, p1->s.y); p1->s.x, p1->s.y));
} }
#endif #endif
@ -957,10 +952,10 @@ static UINT16 *push_direct(UINT16 *list)
old_p1->y = readf(list+14); old_p1->y = readf(list+14);
old_p1->z = readf(list+16); old_p1->z = readf(list+16);
LOG_TGP("VIDEOD start direct\n"); LOG_TGP(("VIDEOD start direct\n"));
LOG_TGP("VIDEOD (%f, %f, %f) (%f, %f, %f)\n", LOG_TGP(("VIDEOD (%f, %f, %f) (%f, %f, %f)\n",
old_p0->x, old_p0->y, old_p0->z, 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_p0);
// transform_point(old_p1); // transform_point(old_p1);
@ -1000,9 +995,9 @@ static UINT16 *push_direct(UINT16 *list)
p0->y = readf(list+8); p0->y = readf(list+8);
p0->z = readf(list+10); p0->z = readf(list+10);
z = p0->z; z = p0->z;
LOG_TGP("VIDEOD %08x %08x (%f, %f, %f)\n", LOG_TGP(("VIDEOD %08x %08x (%f, %f, %f)\n",
flags, lum, flags, lum,
p0->x, p0->y, p0->z); p0->x, p0->y, p0->z));
*p1 = *p0; *p1 = *p0;
list += 12; list += 12;
} else { } else {
@ -1013,10 +1008,10 @@ static UINT16 *push_direct(UINT16 *list)
p1->y = readf(list+16); p1->y = readf(list+16);
p1->z = readf(list+18); p1->z = readf(list+18);
z = readf(list+12); 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, flags, lum,
p0->x, p0->y, p0->z, p0->x, p0->y, p0->z,
p1->x, p1->y, p1->z); p1->x, p1->y, p1->z));
list += 20; list += 20;
} }
@ -1031,17 +1026,17 @@ static UINT16 *push_direct(UINT16 *list)
#if 1 #if 1
if(old_p0 && old_p1) 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, flags,
old_p0->s.x, old_p0->s.y, old_p0->s.x, old_p0->s.y,
old_p1->s.x, old_p1->s.y, old_p1->s.x, old_p1->s.y,
p0->s.x, p0->s.y, p0->s.x, p0->s.y,
p1->s.x, p1->s.y); p1->s.x, p1->s.y));
else else
LOG_TGP("VIDEOD: %08x (%d, %d) (%d, %d)\n", LOG_TGP(("VIDEOD: %08x (%d, %d) (%d, %d)\n",
flags, flags,
p0->s.x, p0->s.y, p0->s.x, p0->s.y,
p1->s.x, p1->s.y); p1->s.x, p1->s.y));
#endif #endif
@ -1116,7 +1111,7 @@ static UINT16 *skip_direct(UINT16 *list)
static void draw_objects(mame_bitmap *bitmap, const rectangle *cliprect) static void draw_objects(mame_bitmap *bitmap, const rectangle *cliprect)
{ {
if(quadpt != quaddb) { if(quadpt != quaddb) {
LOG_TGP("VIDEO: sort&draw\n"); LOG_TGP(("VIDEO: sort&draw\n"));
sort_quads(); sort_quads();
draw_quads(bitmap, cliprect); draw_quads(bitmap, cliprect);
} }
@ -1129,7 +1124,7 @@ static UINT16 *draw_direct(UINT16 *list, mame_bitmap *bitmap, const rectangle *c
{ {
UINT16 *res; UINT16 *res;
LOG_TGP("VIDEO: draw direct %x\n", readi(list)); LOG_TGP(("VIDEO: draw direct %x\n", readi(list)));
draw_objects(bitmap, cliprect); draw_objects(bitmap, cliprect);
res = push_direct(list); res = push_direct(list);
@ -1172,7 +1167,7 @@ READ16_HANDLER( model1_listctl_r )
WRITE16_HANDLER( model1_listctl_w ) WRITE16_HANDLER( model1_listctl_w )
{ {
COMBINE_DATA(listctl+offset); 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) 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) { if((listctl[1] & 0x1f) == 0x1f) {
UINT16 *list = get_list(); UINT16 *list = get_list();
int zz = 0; 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)); memset(trans_mat, 0, sizeof(trans_mat));
trans_mat[0] = 1.0; 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); list = draw_direct(list+2, bitmap, cliprect);
break; break;
case 3: 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), readi(list+2),
readi16(list+4), readi16(list+6), readi16(list+8), 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); draw_objects(bitmap, cliprect);
@ -1233,7 +1228,7 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect)
int adr = readi(list+2); int adr = readi(list+2);
int len = readi(list+4)+1; int len = readi(list+4)+1;
int i; 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<len; i++) for(i=0; i<len; i++)
tgp_ram[adr-0x40000+i] = list[6+2*i]; tgp_ram[adr-0x40000+i] = list[6+2*i];
list += 6+len*2; list += 6+len*2;
@ -1255,7 +1250,7 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect)
int adr = readi(list+2); int adr = readi(list+2);
int len = readi(list+4); int len = readi(list+4);
int i; int i;
LOG_TGP("VIDEO: upload data, adr=%x, len=%x\n", adr, len); LOG_TGP(("VIDEO: upload data, adr=%x, len=%x\n", adr, len));
for(i=0;i<len;++i) for(i=0;i<len;++i)
{ {
int v=readi(list+6+i*2); int v=readi(list+6+i*2);
@ -1268,16 +1263,16 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect)
break; break;
} }
case 7: case 7:
LOG_TGP("VIDEO: code 7 (%d)\n", readi(list+2)); LOG_TGP(("VIDEO: code 7 (%d)\n", readi(list+2)));
zz++; zz++;
list += 4; list += 4;
break; break;
case 8: case 8:
LOG_TGP("VIDEO: select mode %08x\n", readi(list+2)); LOG_TGP(("VIDEO: select mode %08x\n", readi(list+2)));
list += 4; list += 4;
break; break;
case 9: case 9:
LOG_TGP("VIDEO: zoom (%f, %f)\n", readf(list+2), readf(list+4)); LOG_TGP(("VIDEO: zoom (%f, %f)\n", readf(list+2), readf(list+4)));
view.zoomx = readf(list+2)*4; view.zoomx = readf(list+2)*4;
view.zoomy = readf(list+4)*4; view.zoomy = readf(list+4)*4;
@ -1286,7 +1281,7 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect)
list += 6; list += 6;
break; break;
case 0xa: case 0xa:
LOG_TGP("VIDEO: light vector (%f, %f, %f)\n", readf(list+2), readf(list+4), readf(list+6)); LOG_TGP(("VIDEO: light vector (%f, %f, %f)\n", readf(list+2), readf(list+4), readf(list+6)));
view.light.x = readf(list+2); view.light.x = readf(list+2);
view.light.y = readf(list+4); view.light.y = readf(list+4);
view.light.z = readf(list+6); view.light.z = readf(list+6);
@ -1295,18 +1290,18 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect)
break; break;
case 0xb: { case 0xb: {
int i; int i;
LOG_TGP("VIDEO: matrix (%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f)\n", LOG_TGP(("VIDEO: matrix (%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f)\n",
readf(list+2), readf(list+4), readf(list+6), readf(list+2), readf(list+4), readf(list+6),
readf(list+8), readf(list+10), readf(list+12), readf(list+8), readf(list+10), readf(list+12),
readf(list+14), readf(list+16), readf(list+18), readf(list+14), readf(list+16), readf(list+18),
readf(list+20), readf(list+22), readf(list+24)); readf(list+20), readf(list+22), readf(list+24)));
for(i=0; i<12; i++) for(i=0; i<12; i++)
trans_mat[i] = readf(list+2+2*i); trans_mat[i] = readf(list+2+2*i);
list += 26; list += 26;
break; break;
} }
case 0xc: case 0xc:
LOG_TGP("VIDEO: trans (%f, %f)\n", readf(list+2), readf(list+4)); LOG_TGP(("VIDEO: trans (%f, %f)\n", readf(list+2), readf(list+4)));
view.transx = readf(list+2); view.transx = readf(list+2);
view.transy = readf(list+4); view.transy = readf(list+4);
@ -1318,7 +1313,7 @@ static void tgp_render(mame_bitmap *bitmap, const rectangle *cliprect)
case -1: case -1:
goto end; goto end;
default: default:
LOG_TGP("VIDEO: unknown type %d\n", type); LOG_TGP(("VIDEO: unknown type %d\n", type));
goto end; goto end;
} }
} }
@ -1345,7 +1340,7 @@ static void tgp_scan(void)
if(!render_done && (listctl[1] & 0x1f) == 0x1f) { if(!render_done && (listctl[1] & 0x1f) == 0x1f) {
UINT16 *list = get_list(); UINT16 *list = get_list();
// Skip everything but the data uploads // Skip everything but the data uploads
LOG_TGP("VIDEO: scan list %d\n", get_list_number()); LOG_TGP(("VIDEO: scan list %d\n", get_list_number()));
for(;;) { for(;;) {
int type = (list[1]<<16)|list[0]; int type = (list[1]<<16)|list[0];
switch(type) { switch(type) {
@ -1365,7 +1360,7 @@ static void tgp_scan(void)
int adr = readi(list+2); int adr = readi(list+2);
int len = readi(list+4)+1; int len = readi(list+4)+1;
int i; int i;
LOG_TGP("ZVIDEO: scan color write, adr=%x, len=%x\n", adr, len); LOG_TGP(("ZVIDEO: scan color write, adr=%x, len=%x\n", adr, len));
for(i=0; i<len; i++) for(i=0; i<len; i++)
tgp_ram[adr-0x40000+i] = list[6+2*i]; tgp_ram[adr-0x40000+i] = list[6+2*i];
list += 6+len*2; list += 6+len*2;
@ -1387,7 +1382,7 @@ static void tgp_scan(void)
int adr = readi(list+2); int adr = readi(list+2);
int len = readi(list+4); int len = readi(list+4);
int i; int i;
//LOG_TGP("VIDEO: upload data, adr=%x, len=%x\n", adr, len); //LOG_TGP(("VIDEO: upload data, adr=%x, len=%x\n", adr, len));
for(i=0;i<len;++i) for(i=0;i<len;++i)
{ {
int v=readi(list+6+i*2); int v=readi(list+6+i*2);
@ -1395,7 +1390,7 @@ static void tgp_scan(void)
lightparams[i+adr].a=((float) ((v>>8)&0xff))/255.0; lightparams[i+adr].a=((float) ((v>>8)&0xff))/255.0;
lightparams[i+adr].s=((float) ((v>>16)&0xff))/255.0; lightparams[i+adr].s=((float) ((v>>16)&0xff))/255.0;
lightparams[i+adr].p=(v>>24)&0xff; lightparams[i+adr].p=(v>>24)&0xff;
//LOG_TGP(" %02X\n",v); //LOG_TGP((" %02X\n",v));
} }
list += 6+len*2; list += 6+len*2;
break; break;
@ -1422,7 +1417,7 @@ static void tgp_scan(void)
case -1: case -1:
goto end; goto end;
default: default:
LOG_TGP("VIDEO: unknown type %d\n", type); LOG_TGP(("VIDEO: unknown type %d\n", type));
goto end; goto end;
} }
} }
@ -1531,5 +1526,5 @@ VIDEO_EOF(model1)
{ {
tgp_scan(); tgp_scan();
end_frame(); end_frame();
LOG_TGP("TGP: vsync\n"); LOG_TGP(("TGP: vsync\n"));
} }

View File

@ -545,9 +545,8 @@ VIDEO_UPDATE(dadandrn) /* and gaiapols */
{ {
tilemap_mark_all_tiles_dirty(ult_936_tilemap); tilemap_mark_all_tiles_dirty(ult_936_tilemap);
#if MW_VERBOSE if (MW_VERBOSE)
popmessage("K053936: PSAC colorbase changed"); popmessage("K053936: PSAC colorbase changed");
#endif
} }
konamigx_mixer(machine, bitmap, cliprect, (roz_enable) ? ult_936_tilemap : 0, rozmode, 0, 0, 0); konamigx_mixer(machine, bitmap, cliprect, (roz_enable) ? ult_936_tilemap : 0, rozmode, 0, 0, 0);

View File

@ -11,6 +11,7 @@
#define NUM_PENS (0x1000) #define NUM_PENS (0x1000)
#define VERBOSE (0)
static UINT8 *sprite_gfx; static UINT8 *sprite_gfx;
static UINT32 sprite_gfx_address_mask; static UINT32 sprite_gfx_address_mask;