From e906f29a386011790278ad7fc273a724d2d36420 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 13 Jul 2017 12:53:45 -0400 Subject: Make machine().describe_context() a const function returning a std::string (nw) As part of this change (because std::string is not printf-compatible), several devices have been updated to use the modern logmacro.h logging system. --- src/devices/cpu/lc8670/lc8670.cpp | 4 +- src/devices/machine/53c7xx.cpp | 44 +++------ src/devices/machine/ataintf.cpp | 20 ++-- src/devices/machine/k033906.cpp | 4 +- src/devices/machine/ldv1000.cpp | 51 +++++----- src/devices/machine/mcf5206e.cpp | 190 +++++++++++++++++------------------ src/devices/sound/es5506.cpp | 203 ++++++++++++-------------------------- src/devices/sound/es5506.h | 2 - src/devices/video/mc6847.cpp | 10 +- src/devices/video/mc6847.h | 4 +- src/emu/machine.cpp | 8 +- src/emu/machine.h | 3 +- src/mame/drivers/amust.cpp | 2 +- src/mame/drivers/bfm_sc5.cpp | 18 ++-- src/mame/drivers/cedar_magnet.cpp | 78 +++++++-------- src/mame/drivers/fp1100.cpp | 16 +-- src/mame/drivers/gamecstl.cpp | 8 +- src/mame/drivers/naomi.cpp | 2 +- src/mame/drivers/statriv2.cpp | 4 +- src/mame/drivers/vidbrain.cpp | 4 +- src/mame/drivers/viper.cpp | 14 +-- src/mame/machine/cammu.cpp | 14 +-- src/mame/machine/dc.cpp | 4 +- src/mame/machine/iteagle_fpga.cpp | 8 +- src/mame/machine/slapstic.cpp | 2 +- src/mame/machine/tx1.cpp | 4 +- 26 files changed, 308 insertions(+), 413 deletions(-) diff --git a/src/devices/cpu/lc8670/lc8670.cpp b/src/devices/cpu/lc8670/lc8670.cpp index 0e851db758c..c78a0acd4c8 100644 --- a/src/devices/cpu/lc8670/lc8670.cpp +++ b/src/devices/cpu/lc8670/lc8670.cpp @@ -1006,7 +1006,7 @@ WRITE8_MEMBER(lc8670_cpu_device::regs_w) break; case 0x07: if (data & HOLD_MODE) - fatalerror("%s: unemulated HOLD mode\n", machine().describe_context()); + fatalerror("%s: unemulated HOLD mode\n", machine().describe_context().c_str()); break; case 0x10: if (!(data & 0x80)) @@ -1144,7 +1144,7 @@ inline uint16_t lc8670_cpu_device::get_addr() else if (mode > 0x03 && mode <= 0x07) addr = read_data(GET_RI | ((REG_PSW>>1) & 0x0c)) | ((GET_RI & 0x02) ? 0x100 : 0x00); else - fatalerror("%s: invalid get_addr in mode %x\n", machine().describe_context(), mode); + fatalerror("%s: invalid get_addr in mode %x\n", machine().describe_context().c_str(), mode); return addr; } diff --git a/src/devices/machine/53c7xx.cpp b/src/devices/machine/53c7xx.cpp index 2d215f198b0..737731ad251 100644 --- a/src/devices/machine/53c7xx.cpp +++ b/src/devices/machine/53c7xx.cpp @@ -23,29 +23,13 @@ // DEBUGGERY //************************************************************************** -#define DEBUG_LOG 1 -#define DEBUG_LEVEL 0 +#define LOG_UNHANDLED (1U << 0) +#define LOG_HOST (1U << 1) +#define LOG_STATE (1U << 2) +#define LOG_SCRIPTS (1U << 3) +#define VERBOSE (0) -#if DEBUG_LOG - #define VERBOSE_LOG(machine, level, ...) verbose_log(machine, level, __VA_ARGS__) -#else - #define VERBOSE_LOG(machine, level, ...) -#endif - -static void ATTR_PRINTF(3,4) verbose_log(running_machine &machine, int level, const char* format, ...) -{ - if (level <= DEBUG_LEVEL) - { - char buffer[32768]; - va_list v; - - va_start(v, format); - vsprintf(buffer, format, v); - va_end(v); - - printf("53C7XX (%s): %s", machine.describe_context(), buffer); - } -} +#include "logmacro.h" //************************************************************************** @@ -230,7 +214,7 @@ void ncr53c7xx_device::device_reset() READ32_MEMBER( ncr53c7xx_device::read ) { - VERBOSE_LOG(machine(), 1, "REG R: [%x] (%08X)\n", offset, mem_mask); + LOGMASKED(LOG_HOST, "%s: REG R: [%x] (%08X)\n", machine().describe_context(), offset, mem_mask); uint32_t ret = 0; @@ -459,7 +443,7 @@ READ32_MEMBER( ncr53c7xx_device::read ) default: { - VERBOSE_LOG(machine(), 0, "Unhandled register access"); + LOGMASKED(LOG_UNHANDLED, "%s: Unhandled register access", machine().describe_context()); } } @@ -473,7 +457,7 @@ READ32_MEMBER( ncr53c7xx_device::read ) WRITE32_MEMBER( ncr53c7xx_device::write ) { - VERBOSE_LOG(machine(), 1, "REG W: [%x] (%08X) %x\n", offset, mem_mask, data); + LOGMASKED(LOG_HOST, "%s: REG W: [%x] (%08X) %x\n", offset, mem_mask, data, machine().describe_context()); switch (offset) { @@ -672,7 +656,7 @@ WRITE32_MEMBER( ncr53c7xx_device::write ) default: { - VERBOSE_LOG(machine(), 0, "Unhandled register access"); + LOGMASKED(LOG_UNHANDLED, "%s: Unhandled register access", machine().describe_context()); } } } @@ -707,7 +691,7 @@ void ncr53c7xx_device::update_irqs() void ncr53c7xx_device::set_scsi_state(int state) { - VERBOSE_LOG(machine(), 2, "SCSI state change: %x to %x\n", m_scsi_state, state); + LOGMASKED(LOG_STATE, "SCSI state change: %x to %x\n", m_scsi_state, state); m_scsi_state = state; } @@ -790,7 +774,7 @@ void ncr53c7xx_device::step(bool timeout) uint32_t ctrl = scsi_bus->ctrl_r(); uint32_t data = scsi_bus->data_r(); - VERBOSE_LOG(machine(), 2, "Step: CTRL:%x DATA:%x (%d.%d) Timeout:%d\n", ctrl, data, m_scsi_state & STATE_MASK, m_scsi_state >> SUB_SHIFT, timeout); + LOGMASKED(LOG_STATE, "Step: CTRL:%x DATA:%x (%d.%d) Timeout:%d\n", ctrl, data, m_scsi_state & STATE_MASK, m_scsi_state >> SUB_SHIFT, timeout); // Check for disconnect from target if (!(m_scntl[0] & SCNTL0_TRG) && m_connected && !(ctrl & S_BSY)) @@ -1210,7 +1194,7 @@ void ncr53c7xx_device::execute_run() illegal(); } - VERBOSE_LOG(machine(), 3, "%s", disassemble_scripts()); + LOGMASKED(LOG_SCRIPTS, "%s", disassemble_scripts()); break; } @@ -1432,7 +1416,7 @@ void ncr53c7xx_device::bm_i_wmov() { if (m_dbc == 0) { - VERBOSE_LOG(machine(), 0, "DBC should not be 0\n"); + LOGMASKED(LOG_UNHANDLED, "DBC should not be 0\n"); illegal(); } diff --git a/src/devices/machine/ataintf.cpp b/src/devices/machine/ataintf.cpp index eaebc4c3663..1527014f166 100644 --- a/src/devices/machine/ataintf.cpp +++ b/src/devices/machine/ataintf.cpp @@ -19,21 +19,21 @@ void ata_interface_device::set_irq(int state) { -// printf( "%s: irq %d\n", machine().describe_context(), state ); +// logerror( "%s: irq %d\n", machine().describe_context(), state ); m_irq_handler(state); } void ata_interface_device::set_dmarq(int state) { -// printf( "%s: dmarq %d\n", machine().describe_context(), state ); +// logerror( "%s: dmarq %d\n", machine().describe_context(), state ); m_dmarq_handler(state); } void ata_interface_device::set_dasp(int state) { -// printf( "%s: dasp %d\n", machine().describe_context(), state ); +// logerror( "%s: dasp %d\n", machine().describe_context(), state ); m_dasp_handler(state); } @@ -132,7 +132,7 @@ uint16_t ata_interface_device::read_dma() if (elem->dev() != nullptr) result &= elem->dev()->read_dma(); -// printf( "%s: read_dma %04x\n", machine().describe_context(), result ); +// logerror( "%s: read_dma %04x\n", machine().describe_context(), result ); return result; } @@ -145,7 +145,7 @@ READ16_MEMBER( ata_interface_device::read_cs0 ) // { static int last_status = -1; if (offset == 7 ) { if( result == last_status ) return last_status; last_status = result; } else last_status = -1; } -// printf( "%s: read cs0 %04x %04x %04x\n", machine().describe_context(), offset, result, mem_mask ); +// logerror( "%s: read cs0 %04x %04x %04x\n", machine().describe_context(), offset, result, mem_mask ); return result; } @@ -157,7 +157,7 @@ READ16_MEMBER( ata_interface_device::read_cs1 ) if (elem->dev() != nullptr) result &= elem->dev()->read_cs1(space, offset, mem_mask); -// printf( "%s: read cs1 %04x %04x %04x\n", machine().describe_context(), offset, result, mem_mask ); +// logerror( "%s: read cs1 %04x %04x %04x\n", machine().describe_context(), offset, result, mem_mask ); return result; } @@ -171,7 +171,7 @@ READ16_MEMBER( ata_interface_device::read_cs1 ) void ata_interface_device::write_dma( uint16_t data ) { -// printf( "%s: write_dma %04x\n", machine().describe_context(), data ); +// logerror( "%s: write_dma %04x\n", machine().describe_context(), data ); for (auto & elem : m_slot) if (elem->dev() != nullptr) @@ -180,7 +180,7 @@ void ata_interface_device::write_dma( uint16_t data ) WRITE16_MEMBER( ata_interface_device::write_cs0 ) { -// printf( "%s: write cs0 %04x %04x %04x\n", machine().describe_context(), offset, data, mem_mask ); +// logerror( "%s: write cs0 %04x %04x %04x\n", machine().describe_context(), offset, data, mem_mask ); for (auto & elem : m_slot) if (elem->dev() != nullptr) @@ -189,7 +189,7 @@ WRITE16_MEMBER( ata_interface_device::write_cs0 ) WRITE16_MEMBER( ata_interface_device::write_cs1 ) { -// printf( "%s: write cs1 %04x %04x %04x\n", machine().describe_context(), offset, data, mem_mask ); +// logerror( "%s: write cs1 %04x %04x %04x\n", machine().describe_context(), offset, data, mem_mask ); for (auto & elem : m_slot) if (elem->dev() != nullptr) @@ -198,7 +198,7 @@ WRITE16_MEMBER( ata_interface_device::write_cs1 ) WRITE_LINE_MEMBER( ata_interface_device::write_dmack ) { -// printf( "%s: write_dmack %04x\n", machine().describe_context(), state ); +// logerror( "%s: write_dmack %04x\n", machine().describe_context(), state ); for (auto & elem : m_slot) if (elem->dev() != nullptr) diff --git a/src/devices/machine/k033906.cpp b/src/devices/machine/k033906.cpp index 4942e7339f1..c4401f3513e 100644 --- a/src/devices/machine/k033906.cpp +++ b/src/devices/machine/k033906.cpp @@ -57,7 +57,7 @@ uint32_t k033906_device::reg_r(int reg) case 0x0f: return m_reg[0x0f]; // interrupt_line, interrupt_pin, min_gnt, max_lat default: - fatalerror("%s: k033906_reg_r: %08X\n", machine().describe_context(), reg); + fatalerror("%s: k033906_reg_r: %08X\n", machine().describe_context().c_str(), reg); } // never executed //return 0; @@ -106,7 +106,7 @@ void k033906_device::reg_w(int reg, uint32_t data) break; default: - fatalerror("%s:K033906_w: %08X, %08X\n", machine().describe_context(), data, reg); + fatalerror("%s:K033906_w: %08X, %08X\n", machine().describe_context().c_str(), data, reg); } } diff --git a/src/devices/machine/ldv1000.cpp b/src/devices/machine/ldv1000.cpp index 899bc7684cc..581b2ddf87c 100644 --- a/src/devices/machine/ldv1000.cpp +++ b/src/devices/machine/ldv1000.cpp @@ -130,7 +130,7 @@ void pioneer_ldv1000_device::data_w(uint8_t data) { m_command = data; if (LOG_COMMANDS) - printf("-> COMMAND = %02X (%s)\n", data, (m_portc1 & 0x10) ? "valid" : "invalid"); + logerror("-> COMMAND = %02X (%s)\n", data, (m_portc1 & 0x10) ? "valid" : "invalid"); } @@ -326,7 +326,7 @@ int32_t pioneer_ldv1000_device::player_update(const vbi_metadata &vbi, int field if (LOG_FRAMES_SEEN) { int frame = frame_from_metadata(vbi); - if (frame != FRAME_NOT_PRESENT) printf("== %d\n", frame); + if (frame != FRAME_NOT_PRESENT) logerror("== %d\n", frame); } return fieldnum; } @@ -417,7 +417,7 @@ READ8_MEMBER( pioneer_ldv1000_device::z80_controller_r ) WRITE8_MEMBER( pioneer_ldv1000_device::z80_controller_w ) { if (LOG_STATUS_CHANGES && data != m_status) - printf("%04X:CONTROLLER.W=%02X\n", space.device().safe_pc(), data); + logerror("%04X:CONTROLLER.W=%02X\n", space.device().safe_pc(), data); m_status = data; } @@ -431,7 +431,7 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi0_porta_w ) { m_counter_start = data; if (LOG_PORT_IO) - printf("%s:PORTA.0=%02X\n", machine().describe_context(), data); + logerror("%s:PORTA.0=%02X\n", machine().describe_context(), data); } @@ -488,11 +488,10 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi0_portc_w ) m_portc0 = data; if (LOG_PORT_IO && ((data ^ prev) & 0x0f) != 0) { - printf("%s:PORTC.0=%02X", machine().describe_context(), data); - if (data & 0x01) printf(" PRELOAD"); - if (!(data & 0x02)) printf(" /MULTIJUMP"); - if (data & 0x04) printf(" SCANMODE"); - printf("\n"); + logerror("%s:PORTC.0=%02X%s%s%s\n", machine().describe_context(), data, + (data & 0x01) ? " PRELOAD" : "", + !(data & 0x02) ? " /MULTIJUMP" : "", + (data & 0x04) ? " SCANMODE" : ""); } // on the rising edge of bit 0, clock the down counter load @@ -578,14 +577,13 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi1_portb_w ) m_portb1 = data; if (LOG_PORT_IO && ((data ^ prev) & 0xff) != 0) { - printf("%s:PORTB.1=%02X:", machine().describe_context(), data); - if (!(data & 0x01)) printf(" FOCSON"); - if (!(data & 0x02)) printf(" SPDLRUN"); - if (!(data & 0x04)) printf(" JUMPTRIG"); - if (!(data & 0x08)) printf(" SCANA (%c %c)", (data & 0x10) ? 'L' : 'H', (data & 0x20) ? 'F' : 'R'); - if ( (data & 0x40)) printf(" LASERON"); - if (!(data & 0x80)) printf(" SYNCST0"); - printf("\n"); + logerror("%s:PORTB.1=%02X: %s%s%s%s%s%s\n", machine().describe_context(), data, + !(data & 0x01) ? " FOCSON" : "", + !(data & 0x02) ? " SPDLRUN" : "", + !(data & 0x04) ? " JUMPTRIG" : "", + !(data & 0x08) ? string_format(" SCANA (%c %c)", (data & 0x10) ? 'L' : 'H', (data & 0x20) ? 'F' : 'R') : "", + (data & 0x40) ? " LASERON" : "", + !(data & 0x80) ? " SYNCST0" : ""); } // bit 5 selects the direction of slider movement for JUMP TRG and scanning @@ -632,16 +630,15 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi1_portc_w ) m_portc1 = data; if (LOG_PORT_IO && ((data ^ prev) & 0xcf) != 0) { - printf("%s:PORTC.1=%02X", machine().describe_context(), data); - if (data & 0x01) printf(" AUD1"); - if (data & 0x02) printf(" AUD2"); - if (data & 0x04) printf(" AUDEN"); - if (!(data & 0x08)) printf(" VIDEOSQ"); - if (data & 0x10) printf(" COMMAND"); - if (data & 0x20) printf(" STATUS"); - if (data & 0x40) printf(" SIZE8"); - if (!(data & 0x80)) printf(" CAV"); - printf("\n"); + logerror("%s:PORTC.1=%02X%s%s%s%s%s%s%s%s\n", machine().describe_context(), data, + (data & 0x01) ? " AUD1" : "", + (data & 0x02) ? " AUD2" : "", + (data & 0x04) ? " AUDEN" : "", + !(data & 0x08) ? " VIDEOSQ" : "", + (data & 0x10) ? " COMMAND" : "", + (data & 0x20) ? " STATUS" : "", + (data & 0x40) ? " SIZE8" : "", + !(data & 0x80) ? " CAV" : ""); } // bit 4 sends a command strobe signal to Host CPU diff --git a/src/devices/machine/mcf5206e.cpp b/src/devices/machine/mcf5206e.cpp index e7604dd132a..99d28a484ca 100644 --- a/src/devices/machine/mcf5206e.cpp +++ b/src/devices/machine/mcf5206e.cpp @@ -7,17 +7,11 @@ #include "emu.h" #include "mcf5206e.h" -static void CLIB_DECL ATTR_PRINTF(1,2) nolog(const char *format, ...) {} +#define LOG_DEBUG (0U << 0) +#define LOG_INVALID (0U << 1) +#define LOG_TIMER (0U << 2) -//#define debuglog printf -#define debuglog logerror - -#define invalidlog printf -//#define invalidlog logerror - -//#define debuglogtimer printf -//#define debuglogtimer logerror -#define debuglogtimer nolog +#include "logmacro.h" static ADDRESS_MAP_START( coldfire_regs_map, 0, 32, mcf5206e_peripheral_device ) @@ -80,16 +74,16 @@ READ8_MEMBER( mcf5206e_peripheral_device::ICR1_ICR2_ICR3_ICR4_r ) switch (offset) { case 0: // 0x014 - debuglog("%s: (External IRQ1/IPL1 Interrupt Vector) ICR1_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (External IRQ1/IPL1 Interrupt Vector) ICR1_r\n", this->machine().describe_context()); return m_ICR[ICR1]; case 1: // 0x015 - debuglog("%s: (External IPL2 Interrupt Vector) ICR2_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (External IPL2 Interrupt Vector) ICR2_r\n", this->machine().describe_context()); return m_ICR[ICR2]; case 2: // 0x016 - debuglog("%s: (External IPL3 Interrupt Vector) ICR3_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (External IPL3 Interrupt Vector) ICR3_r\n", this->machine().describe_context()); return m_ICR[ICR3]; case 3: // 0x017 - debuglog("%s: (External IRQ4/IPL4 Interrupt Vector) ICR4_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (External IRQ4/IPL4 Interrupt Vector) ICR4_r\n", this->machine().describe_context()); return m_ICR[ICR4]; } @@ -102,22 +96,22 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::ICR1_ICR2_ICR3_ICR4_w ) { case 0: // 0x014 m_ICR[ICR1] = data; - debuglog("%s: (External IRQ1/IPL1 Interrupt Vector) ICR1_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (External IRQ1/IPL1 Interrupt Vector) ICR1_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR1]); break; case 1: // 0x015 m_ICR[ICR2] = data; - debuglog("%s: (External IPL2 Interrupt Vector) ICR2_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (External IPL2 Interrupt Vector) ICR2_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR2]); break; case 2: // 0x016 m_ICR[ICR3] = data; - debuglog("%s: (External IPL3 Interrupt Vector) ICR3_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (External IPL3 Interrupt Vector) ICR3_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR3]); break; case 3: // 0x017 m_ICR[ICR4] = data; - debuglog("%s: (External IRQ4/IPL4 Interrupt Vector) ICR4_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (External IRQ4/IPL4 Interrupt Vector) ICR4_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR4]); break; } @@ -128,16 +122,16 @@ READ8_MEMBER( mcf5206e_peripheral_device::ICR9_ICR10_ICR11_ICR12_r ) switch (offset) { case 0: // 0x01c - debuglog("%s: (Timer 1 Interrupt Vector) ICR9_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (Timer 1 Interrupt Vector) ICR9_r\n", this->machine().describe_context()); return m_ICR[ICR9]; case 1: // 0x01d - debuglog("%s: (Timer 2 Interrupt Vector) ICR10_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (Timer 2 Interrupt Vector) ICR10_r\n", this->machine().describe_context()); return m_ICR[ICR10]; case 2: // 0x01e - debuglog("%s: (MBUS Interrupt Vector) ICR11_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (MBUS Interrupt Vector) ICR11_r\n", this->machine().describe_context()); return m_ICR[ICR11]; case 3: // 0x01f - debuglog("%s: (UART1 Interrupt Vector) ICR12_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (UART1 Interrupt Vector) ICR12_r\n", this->machine().describe_context()); return m_ICR[ICR12]; } @@ -150,22 +144,22 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::ICR9_ICR10_ICR11_ICR12_w ) { case 0: // 0x01c m_ICR[ICR9] = data; - debuglog("%s: (Timer 1 Interrupt Vector) ICR9_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (Timer 1 Interrupt Vector) ICR9_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR9]); break; case 1: // 0x01d m_ICR[ICR10] = data; - debuglog("%s: (Timer 2 Interrupt Vector) ICR10_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (Timer 2 Interrupt Vector) ICR10_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR10]); break; case 2: // 0x01e m_ICR[ICR11] = data; - debuglog("%s: (MBUS Interrupt Vector) ICR11_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (MBUS Interrupt Vector) ICR11_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR11]); break; case 3: // 0x01f m_ICR[ICR12] = data; - debuglog("%s: (UART1 Interrupt Vector) ICR12_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (UART1 Interrupt Vector) ICR12_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR12]); break; } @@ -176,12 +170,12 @@ READ8_MEMBER( mcf5206e_peripheral_device::ICR13_r ) switch (offset) { case 0: // 0x020 - debuglog("%s: (UART2 Interrupt Vector) ICR13_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (UART2 Interrupt Vector) ICR13_r\n", this->machine().describe_context()); return m_ICR[ICR13]; case 1: case 2: case 3: - invalidlog("%s: invalid ICR13_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid ICR13_r %d\n", this->machine().describe_context(), offset); return 0; } @@ -194,13 +188,13 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::ICR13_w ) { case 0: // 0x020 m_ICR[ICR13] = data; - debuglog("%s: (UART2 Interrupt Vector) ICR13_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (UART2 Interrupt Vector) ICR13_w %02x\n", this->machine().describe_context(), data); ICR_info(m_ICR[ICR13]); break; case 1: case 2: case 3: - invalidlog("%s: invalid ICR13_w %d, %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid ICR13_w %d, %02x\n", this->machine().describe_context(), offset, data); break; } } @@ -210,12 +204,12 @@ inline uint16_t mcf5206e_peripheral_device::CSAR_r(int which, int offset, uint16 { if (offset==0) { - debuglog("%s: CSAR%d_r\n", this->machine().describe_context(), which); + LOGMASKED(LOG_DEBUG, "%s: CSAR%d_r\n", this->machine().describe_context(), which); return m_CSAR[which]; } else { - invalidlog("%s: invalid CSAR%d_r with offset %d\n", this->machine().describe_context(), which, offset); + LOGMASKED(LOG_INVALID, "%s: invalid CSAR%d_r with offset %d\n", this->machine().describe_context(), which, offset); return 0; } } @@ -225,36 +219,36 @@ inline void mcf5206e_peripheral_device::CSAR_w(int which, int offset, uint16_t d if (offset==0) { COMBINE_DATA( &m_CSAR[which] ); - debuglog("%s: CSAR%d_w %04x\n", this->machine().describe_context(), which, data); + LOGMASKED(LOG_DEBUG, "%s: CSAR%d_w %04x\n", this->machine().describe_context(), which, data); } else { - invalidlog("%s: invalid CSAR%d_w with offset %d %04x\n", this->machine().describe_context(), which, offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid CSAR%d_w with offset %d %04x\n", this->machine().describe_context(), which, offset, data); } } inline uint32_t mcf5206e_peripheral_device::CSMR_r(int which, uint32_t mem_mask) { - debuglog("%s: CSMR%d_r\n", this->machine().describe_context(), which); + LOGMASKED(LOG_DEBUG, "%s: CSMR%d_r\n", this->machine().describe_context(), which); return m_CSMR[0]; } inline void mcf5206e_peripheral_device::CSMR_w(int which, uint32_t data, uint32_t mem_mask) { COMBINE_DATA( &m_CSMR[0] ); - debuglog("%s: CSMR%d_w %08x\n", this->machine().describe_context(), which, data); + LOGMASKED(LOG_DEBUG, "%s: CSMR%d_w %08x\n", this->machine().describe_context(), which, data); } inline uint16_t mcf5206e_peripheral_device::CSCR_r(int which, int offset, uint16_t mem_mask) { if (offset==1) { - debuglog("%s: CSCR%d_r\n", this->machine().describe_context(), which); + LOGMASKED(LOG_DEBUG, "%s: CSCR%d_r\n", this->machine().describe_context(), which); return m_CSCR[which]; } else { - invalidlog("%s: invalid CSCR%d_r with offset %d\n", this->machine().describe_context(), which, offset); + LOGMASKED(LOG_INVALID, "%s: invalid CSCR%d_r with offset %d\n", this->machine().describe_context(), which, offset); return 0; } } @@ -264,11 +258,11 @@ inline void mcf5206e_peripheral_device::CSCR_w(int which, int offset, uint16_t d if (offset==1) { COMBINE_DATA( &m_CSCR[which] ); - debuglog("%s: CSCR%d_w %04x\n", this->machine().describe_context(), which, data); + LOGMASKED(LOG_DEBUG, "%s: CSCR%d_w %04x\n", this->machine().describe_context(), which, data); } else { - invalidlog("%s: invalid CSCR%d_r with offset %d %04x\n", this->machine().describe_context(), which, offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid CSCR%d_r with offset %d %04x\n", this->machine().describe_context(), which, offset, data); } } @@ -337,10 +331,10 @@ READ16_MEMBER( mcf5206e_peripheral_device::DMCR_r) switch (offset) { case 1: - debuglog("%s: DMCR_r %04x\n", this->machine().describe_context(), mem_mask); + LOGMASKED(LOG_DEBUG, "%s: DMCR_r %04x\n", this->machine().describe_context(), mem_mask); return m_DMCR; case 0: - invalidlog("%s: invalid DMCR_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid DMCR_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); return 0; } @@ -353,10 +347,10 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::DMCR_w) { case 1: COMBINE_DATA(&m_DMCR); - debuglog("%s: DMCR_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); + LOGMASKED(LOG_DEBUG, "%s: DMCR_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); break; case 0: - invalidlog("%s: invalid DMCR_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid DMCR_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); break; } @@ -368,10 +362,10 @@ READ16_MEMBER( mcf5206e_peripheral_device::PAR_r) switch (offset) { case 1: - debuglog("%s: PAR_r %04x\n", this->machine().describe_context(), mem_mask); + LOGMASKED(LOG_DEBUG, "%s: PAR_r %04x\n", this->machine().describe_context(), mem_mask); return m_PAR; case 0: - invalidlog("%s: invalid PAR_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid PAR_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); return 0; } @@ -384,10 +378,10 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::PAR_w) { case 1: COMBINE_DATA(&m_PAR); - debuglog("%s: PAR_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); + LOGMASKED(LOG_DEBUG, "%s: PAR_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); break; case 0: - invalidlog("%s: invalid PAR_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid PAR_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); break; } @@ -402,10 +396,10 @@ READ8_MEMBER( mcf5206e_peripheral_device::PPDDR_r) case 0: case 2: case 3: - invalidlog("%s: invalid PPDDR_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid PPDDR_r %d\n", this->machine().describe_context(), offset); return 0; case 1: // '$1C5' - debuglog("%s: (Port A Data Direction Register) PPDDR_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (Port A Data Direction Register) PPDDR_r\n", this->machine().describe_context()); return m_PPDDR; } @@ -419,11 +413,11 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::PPDDR_w) case 0: case 2: case 3: - invalidlog("%s: invalid PPDDR_w %d %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid PPDDR_w %d %02x\n", this->machine().describe_context(), offset, data); break; case 1: // '$1C5' m_PPDDR = data; - debuglog("%s: (Port A Data Direction Register) PPDDR_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (Port A Data Direction Register) PPDDR_w %02x\n", this->machine().describe_context(), data); break; } } @@ -435,10 +429,10 @@ READ8_MEMBER( mcf5206e_peripheral_device::PPDAT_r) case 0: case 2: case 3: - invalidlog("%s: invalid PPDAT_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid PPDAT_r %d\n", this->machine().describe_context(), offset); return 0; case 1: // '$1C9' - debuglog("%s: (Port A Data Register) PPDAT_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (Port A Data Register) PPDAT_r\n", this->machine().describe_context()); return m_PPDAT; // should use a callback. } @@ -452,11 +446,11 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::PPDAT_w) case 0: case 2: case 3: - invalidlog("%s: invalid PPDAT_w %d, %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid PPDAT_w %d, %02x\n", this->machine().describe_context(), offset, data); break; case 1: // '$1C9' m_PPDAT = data; // should use a callback. - debuglog("%s: (Port A Data Register) PPDAT_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (Port A Data Register) PPDAT_w %02x\n", this->machine().describe_context(), data); break; } @@ -468,12 +462,12 @@ READ8_MEMBER( mcf5206e_peripheral_device::MBCR_r) switch (offset) { case 0: - debuglog("%s: (M-Bus Control Register) MBCR_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Control Register) MBCR_r\n", this->machine().describe_context()); return m_MBCR; case 1: case 2: case 3: - invalidlog("%s: invalid MBCR_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid MBCR_r %d\n", this->machine().describe_context(), offset); return 0; } @@ -486,12 +480,12 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::MBCR_w) { case 0: m_MBCR = data; - debuglog("%s: (M-Bus Control Register) MBCR_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Control Register) MBCR_w %02x\n", this->machine().describe_context(), data); break; case 1: case 2: case 3: - invalidlog("%s: invalid MBCR_w %d, %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid MBCR_w %d, %02x\n", this->machine().describe_context(), offset, data); break; } @@ -502,12 +496,12 @@ READ8_MEMBER( mcf5206e_peripheral_device::MFDR_r) switch (offset) { case 0: - debuglog("%s: (M-Bus Frequency Divider Register) MFDR_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Frequency Divider Register) MFDR_r\n", this->machine().describe_context()); return m_MFDR; case 1: case 2: case 3: - invalidlog("%s: invalid MFDR_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid MFDR_r %d\n", this->machine().describe_context(), offset); return 0; } @@ -520,12 +514,12 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::MFDR_w) { case 0: m_MFDR = data; - debuglog("%s: (M-Bus Frequency Divider Register) MFDR_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Frequency Divider Register) MFDR_w %02x\n", this->machine().describe_context(), data); break; case 1: case 2: case 3: - invalidlog("%s: invalid MFDR_w %d, %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid MFDR_w %d, %02x\n", this->machine().describe_context(), offset, data); break; } @@ -545,13 +539,13 @@ READ8_MEMBER( mcf5206e_peripheral_device::MBSR_r) case 0: { hack ^= (machine().rand()&0xff); - debuglog("%s: (M-Bus Status Register) MBSR_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Status Register) MBSR_r\n", this->machine().describe_context()); return m_MBSR ^ hack; // will loop on this after a while } case 1: case 2: case 3: - invalidlog("%s: invalid MBSR_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid MBSR_r %d\n", this->machine().describe_context(), offset); return 0; } @@ -564,12 +558,12 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::MBSR_w) { case 0: m_MBSR = data; - debuglog("%s: (M-Bus Status Register) MBSR_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Status Register) MBSR_w %02x\n", this->machine().describe_context(), data); break; case 1: case 2: case 3: - invalidlog("%s: invalid MBSR_w %d, %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid MBSR_w %d, %02x\n", this->machine().describe_context(), offset, data); break; } @@ -587,13 +581,13 @@ READ8_MEMBER( mcf5206e_peripheral_device::MBDR_r) case 0: { hack ^= (machine().rand()&0xff); - debuglog("%s: (M-Bus Data I/O Register) MBDR_r\n", this->machine().describe_context()); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Data I/O Register) MBDR_r\n", this->machine().describe_context()); return m_MBDR ^ hack; } case 1: case 2: case 3: - invalidlog("%s: invalid MBDR_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid MBDR_r %d\n", this->machine().describe_context(), offset); return 0; } @@ -606,12 +600,12 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::MBDR_w) { case 0: m_MBDR = data; - debuglog("%s: (M-Bus Data I/O Register) MBDR_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_DEBUG, "%s: (M-Bus Data I/O Register) MBDR_w %02x\n", this->machine().describe_context(), data); break; case 1: case 2: case 3: - invalidlog("%s: invalid MBDR_w %d, %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid MBDR_w %d, %02x\n", this->machine().describe_context(), offset, data); break; } @@ -624,10 +618,10 @@ READ16_MEMBER( mcf5206e_peripheral_device::IMR_r) switch (offset) { case 1: - debuglog("%s: (Interrupt Mask Register) IMR_r %04x\n", this->machine().describe_context(), mem_mask); + LOGMASKED(LOG_DEBUG, "%s: (Interrupt Mask Register) IMR_r %04x\n", this->machine().describe_context(), mem_mask); return m_IMR; case 0: - invalidlog("%s: invalid IMR_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid IMR_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); return 0; } @@ -640,10 +634,10 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::IMR_w) { case 1: COMBINE_DATA(&m_IMR); - debuglog("%s: (Interrupt Mask Register) IMR_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); + LOGMASKED(LOG_DEBUG, "%s: (Interrupt Mask Register) IMR_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); break; case 0: - invalidlog("%s: invalid IMR_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid IMR_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); break; } @@ -651,10 +645,10 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::IMR_w) void mcf5206e_peripheral_device::ICR_info(uint8_t ICR) { - debuglog(" (AutoVector) AVEC : %01x | ", (ICR&0x80)>>7); - debuglog("(Interrupt Level) IL : %01x | ", (ICR&0x1c)>>2); // if autovector (AVEC) is used then the vectors referenced are at +24 (+0x18) + IL, ie the standard 68k autovectors, otherwise vector must be provided by device - debuglog("(Interrupt Priority) IP : %01x |", (ICR&0x03)>>0); - debuglog("(Unused bits) : %01x\n", (ICR&0x60)>>5); + LOGMASKED(LOG_DEBUG, " (AutoVector) AVEC : %01x | ", (ICR&0x80)>>7); + LOGMASKED(LOG_DEBUG, "(Interrupt Level) IL : %01x | ", (ICR&0x1c)>>2); // if autovector (AVEC) is used then the vectors referenced are at +24 (+0x18) + IL, ie the standard 68k autovectors, otherwise vector must be provided by device + LOGMASKED(LOG_DEBUG, "(Interrupt Priority) IP : %01x |", (ICR&0x03)>>0); + LOGMASKED(LOG_DEBUG, "(Unused bits) : %01x\n", (ICR&0x60)>>5); } @@ -669,7 +663,7 @@ TIMER_CALLBACK_MEMBER(mcf5206e_peripheral_device::timer1_callback) if (!(m_IMR & 0x0200)) m_cpu->set_input_line((ICR&0x1c)>>2, HOLD_LINE); } - debuglogtimer("timer1_callback\n"); + LOGMASKED(LOG_TIMER, "timer1_callback\n"); m_TER1 |= 0x02; m_timer1->adjust(attotime::from_msec(10)); // completely made up value just to fire our timers for now @@ -681,10 +675,10 @@ READ16_MEMBER( mcf5206e_peripheral_device::TMR1_r) switch (offset) { case 0: - debuglogtimer("%s: (Timer 1 Mode Register) TMR1_r %04x\n", this->machine().describe_context(), mem_mask); + LOGMASKED(LOG_TIMER, "%s: (Timer 1 Mode Register) TMR1_r %04x\n", this->machine().describe_context(), mem_mask); return m_TMR1; case 1: - invalidlog("%s: invalid TMR1_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid TMR1_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); return 0; } @@ -697,9 +691,9 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::TMR1_w) { case 0: COMBINE_DATA(&m_TMR1); - debuglogtimer("%s: (Timer 1 Mode Register) TMR1_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); + LOGMASKED(LOG_TIMER, "%s: (Timer 1 Mode Register) TMR1_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); - debuglogtimer(" (Prescale) PS : %02x (Capture Edge/Interrupt) CE : %01x (Output Mode) OM : %01x (Output Reference Interrupt En) ORI : %01x Free Run (FRR) : %01x Input Clock Source (ICLK) : %01x (Reset Timer) RST : %01x \n", (m_TMR1 & 0xff00)>>8, (m_TMR1 & 0x00c0)>>6, (m_TMR1 & 0x0020)>>5, (m_TMR1 & 0x0010)>>4, (m_TMR1 & 0x0008)>>3, (m_TMR1 & 0x0006)>>1, (m_TMR1 & 0x0001)>>0); + LOGMASKED(LOG_TIMER, " (Prescale) PS : %02x (Capture Edge/Interrupt) CE : %01x (Output Mode) OM : %01x (Output Reference Interrupt En) ORI : %01x Free Run (FRR) : %01x Input Clock Source (ICLK) : %01x (Reset Timer) RST : %01x \n", (m_TMR1 & 0xff00)>>8, (m_TMR1 & 0x00c0)>>6, (m_TMR1 & 0x0020)>>5, (m_TMR1 & 0x0010)>>4, (m_TMR1 & 0x0008)>>3, (m_TMR1 & 0x0006)>>1, (m_TMR1 & 0x0001)>>0); if (m_TMR1 & 0x0001) { @@ -713,7 +707,7 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::TMR1_w) break; case 1: - invalidlog("%s: invalid TMR1_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid TMR1_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); break; } @@ -724,10 +718,10 @@ READ16_MEMBER( mcf5206e_peripheral_device::TRR1_r) switch (offset) { case 0: - debuglogtimer("%s: (Timer 1 Reference Register) TRR1_r %04x\n", this->machine().describe_context(), mem_mask); + LOGMASKED(LOG_TIMER, "%s: (Timer 1 Reference Register) TRR1_r %04x\n", this->machine().describe_context(), mem_mask); return m_TRR1; case 1: - invalidlog("%s: invalid TRR1_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid TRR1_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); return 0; } @@ -740,10 +734,10 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::TRR1_w) { case 0: COMBINE_DATA(&m_TRR1); - debuglogtimer("%s: (Timer 1 Reference Register) TRR1_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); + LOGMASKED(LOG_TIMER, "%s: (Timer 1 Reference Register) TRR1_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); break; case 1: - debuglog("%s: invalid TRR1_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); + LOGMASKED(LOG_DEBUG, "%s: invalid TRR1_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); break; } @@ -756,12 +750,12 @@ READ8_MEMBER( mcf5206e_peripheral_device::TER1_r) switch (offset) { case 1: - debuglogtimer("%s: TER1_r\n", this->machine().describe_context()); + LOGMASKED(LOG_TIMER, "%s: TER1_r\n", this->machine().describe_context()); return m_TER1; // set on timer events, cleared by writing below case 0: case 2: case 3: - invalidlog("%s: invalid TER1_r %d\n", this->machine().describe_context(), offset); + LOGMASKED(LOG_INVALID, "%s: invalid TER1_r %d\n", this->machine().describe_context(), offset); return 0; } @@ -774,12 +768,12 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::TER1_w) { case 1: m_TER1 &= ~data; // writes should clear the bits.. - debuglogtimer("%s: TER1_w %02x\n", this->machine().describe_context(), data); + LOGMASKED(LOG_TIMER, "%s: TER1_w %02x\n", this->machine().describe_context(), data); break; case 0: case 2: case 3: - invalidlog("%s: invalid TER1_w %d, %02x\n", this->machine().describe_context(), offset, data); + LOGMASKED(LOG_INVALID, "%s: invalid TER1_w %d, %02x\n", this->machine().describe_context(), offset, data); break; } @@ -790,11 +784,11 @@ READ16_MEMBER( mcf5206e_peripheral_device::TCN1_r) switch (offset) { case 0: - debuglogtimer("%s: (Timer 1 Counter) TCN1_r %04x\n", this->machine().describe_context(), mem_mask); + LOGMASKED(LOG_TIMER, "%s: (Timer 1 Counter) TCN1_r %04x\n", this->machine().describe_context(), mem_mask); // return 0x9c40; return 0x8ca0 -1;// m_TCN1; // this should be the counter, code has a hardcoded >= check against 8ca0. case 1: - invalidlog("%s: invalid TCN1_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid TCN1_r %d %04x\n", this->machine().describe_context(), offset, mem_mask); return 0; } @@ -807,10 +801,10 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::TCN1_w) { case 0: COMBINE_DATA(&m_TCN1); - debuglogtimer("%s: (Timer 1 Counter) TCN1_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); + LOGMASKED(LOG_TIMER, "%s: (Timer 1 Counter) TCN1_w %04x %04x\n", this->machine().describe_context(), data, mem_mask); break; case 1: - invalidlog("%s: invalid TCN1_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); + LOGMASKED(LOG_INVALID, "%s: invalid TCN1_w %d, %04x %04x\n", this->machine().describe_context(), offset, data, mem_mask); break; } diff --git a/src/devices/sound/es5506.cpp b/src/devices/sound/es5506.cpp index 9c3b548e8a9..4a00a38741e 100644 --- a/src/devices/sound/es5506.cpp +++ b/src/devices/sound/es5506.cpp @@ -96,7 +96,9 @@ Ensoniq OTIS - ES5505 Ensoniq OTTO - ***********************************************************************************************/ -#define LOG_COMMANDS 0 +#define VERBOSE 0 +#include "logmacro.h" + #define RAINE_CHECK 0 @@ -148,7 +150,6 @@ es550x_device::es550x_device(const machine_config &mconfig, device_type type, co #if ES5506_MAKE_WAVS m_wavraw(nullptr), #endif - m_eslog(nullptr), m_region0(nullptr), m_region1(nullptr), m_region2(nullptr), @@ -187,10 +188,6 @@ void es5506_device::device_start() if (1 <= m_channels && m_channels <= 6) channels = m_channels; - /* debugging */ - if (LOG_COMMANDS && !m_eslog) - m_eslog = fopen("es.log", "w"); - /* create the stream */ m_stream = machine().sound().stream_alloc(*this, 0, 2 * channels, clock() / (16*32)); @@ -317,13 +314,6 @@ void es550x_device::device_reset() void es550x_device::device_stop() { - /* debugging */ - if (LOG_COMMANDS && m_eslog) - { - fclose(m_eslog); - m_eslog = nullptr; - } - #if ES5506_MAKE_WAVS { int i; @@ -358,10 +348,6 @@ void es5505_device::device_start() if (1 <= m_channels && m_channels <= 4) channels = m_channels; - /* debugging */ - if (LOG_COMMANDS && !m_eslog) - m_eslog = fopen("es.log", "w"); - /* create the stream */ m_stream = machine().sound().stream_alloc(*this, 0, 2 * channels, clock() / (16*32)); @@ -1159,69 +1145,58 @@ inline void es5506_device::reg_write_low(es550x_voice *voice, offs_t offset, uin { case 0x00/8: /* CR */ voice->control = data & 0xffff; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, control=%04x\n", m_current_page & 0x1f, voice->control); + LOG("voice %d, control=%04x\n", m_current_page & 0x1f, voice->control); break; case 0x08/8: /* FC */ voice->freqcount = data & 0x1ffff; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, freq count=%08x\n", m_current_page & 0x1f, voice->freqcount); + LOG("voice %d, freq count=%08x\n", m_current_page & 0x1f, voice->freqcount); break; case 0x10/8: /* LVOL */ voice->lvol = data & 0xffff; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, left vol=%04x\n", m_current_page & 0x1f, voice->lvol); + LOG("voice %d, left vol=%04x\n", m_current_page & 0x1f, voice->lvol); break; case 0x18/8: /* LVRAMP */ voice->lvramp = (data & 0xff00) >> 8; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, left vol ramp=%04x\n", m_current_page & 0x1f, voice->lvramp); + LOG("voice %d, left vol ramp=%04x\n", m_current_page & 0x1f, voice->lvramp); break; case 0x20/8: /* RVOL */ voice->rvol = data & 0xffff; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, right vol=%04x\n", m_current_page & 0x1f, voice->rvol); + LOG("voice %d, right vol=%04x\n", m_current_page & 0x1f, voice->rvol); break; case 0x28/8: /* RVRAMP */ voice->rvramp = (data & 0xff00) >> 8; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, right vol ramp=%04x\n", m_current_page & 0x1f, voice->rvramp); + LOG("voice %d, right vol ramp=%04x\n", m_current_page & 0x1f, voice->rvramp); break; case 0x30/8: /* ECOUNT */ voice->ecount = data & 0x1ff; voice->filtcount = 0; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, envelope count=%04x\n", m_current_page & 0x1f, voice->ecount); + LOG("voice %d, envelope count=%04x\n", m_current_page & 0x1f, voice->ecount); break; case 0x38/8: /* K2 */ voice->k2 = data & 0xffff; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, K2=%04x\n", m_current_page & 0x1f, voice->k2); + LOG("voice %d, K2=%04x\n", m_current_page & 0x1f, voice->k2); break; case 0x40/8: /* K2RAMP */ voice->k2ramp = ((data & 0xff00) >> 8) | ((data & 0x0001) << 31); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, K2 ramp=%04x\n", m_current_page & 0x1f, voice->k2ramp); + LOG("voice %d, K2 ramp=%04x\n", m_current_page & 0x1f, voice->k2ramp); break; case 0x48/8: /* K1 */ voice->k1 = data & 0xffff; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, K1=%04x\n", m_current_page & 0x1f, voice->k1); + LOG("voice %d, K1=%04x\n", m_current_page & 0x1f, voice->k1); break; case 0x50/8: /* K1RAMP */ voice->k1ramp = ((data & 0xff00) >> 8) | ((data & 0x0001) << 31); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, K1 ramp=%04x\n", m_current_page & 0x1f, voice->k1ramp); + LOG("voice %d, K1 ramp=%04x\n", m_current_page & 0x1f, voice->k1ramp); break; case 0x58/8: /* ACTV */ @@ -1230,8 +1205,7 @@ inline void es5506_device::reg_write_low(es550x_voice *voice, offs_t offset, uin m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); + LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); break; } @@ -1255,62 +1229,52 @@ inline void es5506_device::reg_write_high(es550x_voice *voice, offs_t offset, ui { case 0x00/8: /* CR */ voice->control = data & 0xffff; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, control=%04x\n", m_current_page & 0x1f, voice->control); + LOG("voice %d, control=%04x\n", m_current_page & 0x1f, voice->control); break; case 0x08/8: /* START */ voice->start = data & 0xfffff800; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, loop start=%08x\n", m_current_page & 0x1f, voice->start); + LOG("voice %d, loop start=%08x\n", m_current_page & 0x1f, voice->start); break; case 0x10/8: /* END */ voice->end = data & 0xffffff80; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, loop end=%08x\n", m_current_page & 0x1f, voice->end); + LOG("voice %d, loop end=%08x\n", m_current_page & 0x1f, voice->end); break; case 0x18/8: /* ACCUM */ voice->accum = data; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, accum=%08x\n", m_current_page & 0x1f, voice->accum); + LOG("voice %d, accum=%08x\n", m_current_page & 0x1f, voice->accum); break; case 0x20/8: /* O4(n-1) */ voice->o4n1 = (int32_t)(data << 14) >> 14; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, O4(n-1)=%05x\n", m_current_page & 0x1f, voice->o4n1 & 0x3ffff); + LOG("voice %d, O4(n-1)=%05x\n", m_current_page & 0x1f, voice->o4n1 & 0x3ffff); break; case 0x28/8: /* O3(n-1) */ voice->o3n1 = (int32_t)(data << 14) >> 14; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, O3(n-1)=%05x\n", m_current_page & 0x1f, voice->o3n1 & 0x3ffff); + LOG("voice %d, O3(n-1)=%05x\n", m_current_page & 0x1f, voice->o3n1 & 0x3ffff); break; case 0x30/8: /* O3(n-2) */ voice->o3n2 = (int32_t)(data << 14) >> 14; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, O3(n-2)=%05x\n", m_current_page & 0x1f, voice->o3n2 & 0x3ffff); + LOG("voice %d, O3(n-2)=%05x\n", m_current_page & 0x1f, voice->o3n2 & 0x3ffff); break; case 0x38/8: /* O2(n-1) */ voice->o2n1 = (int32_t)(data << 14) >> 14; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, O2(n-1)=%05x\n", m_current_page & 0x1f, voice->o2n1 & 0x3ffff); + LOG("voice %d, O2(n-1)=%05x\n", m_current_page & 0x1f, voice->o2n1 & 0x3ffff); break; case 0x40/8: /* O2(n-2) */ voice->o2n2 = (int32_t)(data << 14) >> 14; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, O2(n-2)=%05x\n", m_current_page & 0x1f, voice->o2n2 & 0x3ffff); + LOG("voice %d, O2(n-2)=%05x\n", m_current_page & 0x1f, voice->o2n2 & 0x3ffff); break; case 0x48/8: /* O1(n-1) */ voice->o1n1 = (int32_t)(data << 14) >> 14; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "voice %d, O1(n-1)=%05x\n", m_current_page & 0x1f, voice->o1n1 & 0x3ffff); + LOG("voice %d, O1(n-1)=%05x\n", m_current_page & 0x1f, voice->o1n1 & 0x3ffff); break; case 0x50/8: /* W_ST */ @@ -1340,68 +1304,55 @@ inline void es5506_device::reg_write_test(es550x_voice *voice, offs_t offset, ui switch (offset) { case 0x00/8: /* CHANNEL 0 LEFT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 0 left test write %08x\n", data); + LOG("Channel 0 left test write %08x\n", data); break; case 0x08/8: /* CHANNEL 0 RIGHT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 0 right test write %08x\n", data); + LOG("Channel 0 right test write %08x\n", data); break; case 0x10/8: /* CHANNEL 1 LEFT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 1 left test write %08x\n", data); + LOG("Channel 1 left test write %08x\n", data); break; case 0x18/8: /* CHANNEL 1 RIGHT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 1 right test write %08x\n", data); + LOG("Channel 1 right test write %08x\n", data); break; case 0x20/8: /* CHANNEL 2 LEFT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 2 left test write %08x\n", data); + LOG("Channel 2 left test write %08x\n", data); break; case 0x28/8: /* CHANNEL 2 RIGHT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 2 right test write %08x\n", data); + LOG("Channel 2 right test write %08x\n", data); break; case 0x30/8: /* CHANNEL 3 LEFT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 3 left test write %08x\n", data); + LOG("Channel 3 left test write %08x\n", data); break; case 0x38/8: /* CHANNEL 3 RIGHT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 3 right test write %08x\n", data); + LOG("Channel 3 right test write %08x\n", data); break; case 0x40/8: /* CHANNEL 4 LEFT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 4 left test write %08x\n", data); + LOG("Channel 4 left test write %08x\n", data); break; case 0x48/8: /* CHANNEL 4 RIGHT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 4 right test write %08x\n", data); + LOG("Channel 4 right test write %08x\n", data); break; case 0x50/8: /* CHANNEL 5 LEFT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 5 left test write %08x\n", data); + LOG("Channel 5 left test write %08x\n", data); break; case 0x58/8: /* CHANNEL 6 RIGHT */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Channel 5 right test write %08x\n", data); + LOG("Channel 5 right test write %08x\n", data); break; case 0x60/8: /* EMPTY */ - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "Test write EMPTY %08x\n", data); + LOG("Test write EMPTY %08x\n", data); break; case 0x68/8: /* PAR - read only */ @@ -1630,8 +1581,7 @@ READ8_MEMBER( es5506_device::read ) if (shift != 0) return m_read_latch >> (24 - shift); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "read from %02x/%02x -> ", m_current_page, offset / 4 * 8); + LOG("read from %02x/%02x -> ", m_current_page, offset / 4 * 8); /* force an update */ m_stream->update(); @@ -1644,8 +1594,7 @@ READ8_MEMBER( es5506_device::read ) else m_read_latch = reg_read_test(voice, offset / 4); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%08x\n", m_read_latch); + LOG("%08x\n", m_read_latch); /* return the high byte */ return m_read_latch >> 24; @@ -1687,8 +1636,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin ((data << 2) & (CONTROL_CA0 | CONTROL_CA1)); } - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine().describe_context(), m_current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff); + LOG("%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine().describe_context(), m_current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff); break; case 0x01: /* FC */ @@ -1696,8 +1644,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin voice->freqcount = (voice->freqcount & ~0x001fe) | ((data & 0x00ff) << 1); if (ACCESSING_BITS_8_15) voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, freq count=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->freqcount); + LOG("%s:voice %d, freq count=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->freqcount); break; case 0x02: /* STRT (hi) */ @@ -1705,8 +1652,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin voice->start = (voice->start & ~0x03fc0000) | ((data & 0x00ff) << 18); if (ACCESSING_BITS_8_15) voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, loop start=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->start); + LOG("%s:voice %d, loop start=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->start); break; case 0x03: /* STRT (lo) */ @@ -1714,8 +1660,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin voice->start = (voice->start & ~0x00000380) | ((data & 0x00e0) << 2); if (ACCESSING_BITS_8_15) voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, loop start=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->start); + LOG("%s:voice %d, loop start=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->start); break; case 0x04: /* END (hi) */ @@ -1726,8 +1671,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin #if RAINE_CHECK voice->control |= CONTROL_STOP0; #endif - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, loop end=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->end); + LOG("%s:voice %d, loop end=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->end); break; case 0x05: /* END (lo) */ @@ -1738,8 +1682,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin #if RAINE_CHECK voice->control |= CONTROL_STOP0; #endif - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, loop end=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->end); + LOG("%s:voice %d, loop end=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->end); break; case 0x06: /* K2 */ @@ -1747,8 +1690,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin voice->k2 = (voice->k2 & ~0x00f0) | (data & 0x00f0); if (ACCESSING_BITS_8_15) voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, K2=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->k2); + LOG("%s:voice %d, K2=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->k2); break; case 0x07: /* K1 */ @@ -1756,22 +1698,19 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin voice->k1 = (voice->k1 & ~0x00f0) | (data & 0x00f0); if (ACCESSING_BITS_8_15) voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, K1=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->k1); + LOG("%s:voice %d, K1=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->k1); break; case 0x08: /* LVOL */ if (ACCESSING_BITS_8_15) voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, left vol=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->lvol); + LOG("%s:voice %d, left vol=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->lvol); break; case 0x09: /* RVOL */ if (ACCESSING_BITS_8_15) voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, right vol=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->rvol); + LOG("%s:voice %d, right vol=%04x\n", machine().describe_context(), m_current_page & 0x1f, voice->rvol); break; case 0x0a: /* ACC (hi) */ @@ -1779,8 +1718,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin voice->accum = (voice->accum & ~0x03fc0000) | ((data & 0x00ff) << 18); if (ACCESSING_BITS_8_15) voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, accum=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->accum); + LOG("%s:voice %d, accum=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->accum); break; case 0x0b: /* ACC (lo) */ @@ -1788,8 +1726,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin voice->accum = (voice->accum & ~0x000003fc) | ((data & 0x00ff) << 2); if (ACCESSING_BITS_8_15) voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, accum=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->accum); + LOG("%s:voice %d, accum=%08x\n", machine().describe_context(), m_current_page & 0x1f, voice->accum); break; case 0x0c: /* unused */ @@ -1802,8 +1739,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uin m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); + LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); } break; @@ -1835,8 +1771,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui voice->control |= ((data >> 2) & CONTROL_LPMASK) | ((data << 2) & (CONTROL_CA0 | CONTROL_CA1)); } - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine().describe_context(), m_current_page & 0x1f, voice->control, data, mem_mask); + LOG("%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine().describe_context(), m_current_page & 0x1f, voice->control, data, mem_mask); break; case 0x01: /* O4(n-1) */ @@ -1844,8 +1779,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui voice->o4n1 = (voice->o4n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) voice->o4n1 = (int16_t)((voice->o4n1 & ~0xff00) | (data & 0xff00)); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, O4(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o4n1 & 0x3ffff); + LOG("%s:voice %d, O4(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o4n1 & 0x3ffff); break; case 0x02: /* O3(n-1) */ @@ -1853,8 +1787,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui voice->o3n1 = (voice->o3n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) voice->o3n1 = (int16_t)((voice->o3n1 & ~0xff00) | (data & 0xff00)); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, O3(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o3n1 & 0x3ffff); + LOG("%s:voice %d, O3(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o3n1 & 0x3ffff); break; case 0x03: /* O3(n-2) */ @@ -1862,8 +1795,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui voice->o3n2 = (voice->o3n2 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) voice->o3n2 = (int16_t)((voice->o3n2 & ~0xff00) | (data & 0xff00)); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, O3(n-2)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o3n2 & 0x3ffff); + LOG("%s:voice %d, O3(n-2)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o3n2 & 0x3ffff); break; case 0x04: /* O2(n-1) */ @@ -1871,8 +1803,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui voice->o2n1 = (voice->o2n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) voice->o2n1 = (int16_t)((voice->o2n1 & ~0xff00) | (data & 0xff00)); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, O2(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n1 & 0x3ffff); + LOG("%s:voice %d, O2(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n1 & 0x3ffff); break; case 0x05: /* O2(n-2) */ @@ -1880,8 +1811,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui voice->o2n2 = (voice->o2n2 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) voice->o2n2 = (int16_t)((voice->o2n2 & ~0xff00) | (data & 0xff00)); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, O2(n-2)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n2 & 0x3ffff); + LOG("%s:voice %d, O2(n-2)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n2 & 0x3ffff); break; case 0x06: /* O1(n-1) */ @@ -1889,8 +1819,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui voice->o1n1 = (voice->o1n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) voice->o1n1 = (int16_t)((voice->o1n1 & ~0xff00) | (data & 0xff00)); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum); + LOG("%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum); break; case 0x07: @@ -1908,8 +1837,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, ui m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); + LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); } break; @@ -1952,8 +1880,7 @@ inline void es5505_device::reg_write_test(es550x_voice *voice, offs_t offset, ui m_sample_rate = m_master_clock / (16 * (m_active_voices + 1)); m_stream->set_sample_rate(m_sample_rate); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); + LOG("active voices=%d, sample_rate=%d\n", m_active_voices, m_sample_rate); } break; @@ -2194,8 +2121,7 @@ READ16_MEMBER( es5505_device::read ) es550x_voice *voice = &m_voice[m_current_page & 0x1f]; uint16_t result; - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "read from %02x/%02x -> ", m_current_page, offset); + LOG("read from %02x/%02x -> ", m_current_page, offset); /* force an update */ m_stream->update(); @@ -2208,8 +2134,7 @@ READ16_MEMBER( es5505_device::read ) else result = reg_read_test(voice, offset); - if (LOG_COMMANDS && m_eslog) - fprintf(m_eslog, "%04x (accum=%08x)\n", result, voice->accum); + LOG("%04x (accum=%08x)\n", result, voice->accum); /* return the high byte */ return result; diff --git a/src/devices/sound/es5506.h b/src/devices/sound/es5506.h index e83004e191c..baf3762e183 100644 --- a/src/devices/sound/es5506.h +++ b/src/devices/sound/es5506.h @@ -143,8 +143,6 @@ protected: void * m_wavraw; /* raw waveform */ #endif - FILE *m_eslog; - const char * m_region0; /* memory region where the sample ROM lives */ const char * m_region1; /* memory region where the sample ROM lives */ const char * m_region2; /* memory region where the sample ROM lives */ diff --git a/src/devices/video/mc6847.cpp b/src/devices/video/mc6847.cpp index 22f6cef81a0..5bfa04b0b4f 100644 --- a/src/devices/video/mc6847.cpp +++ b/src/devices/video/mc6847.cpp @@ -281,9 +281,9 @@ inline void mc6847_friend_device::new_frame() // scanline_zone_string //------------------------------------------------- -const char *mc6847_friend_device::scanline_zone_string(scanline_zone zone) +std::string mc6847_friend_device::scanline_zone_string(scanline_zone zone) const { - const char *result; + std::string result; switch(zone) { case SCANLINE_ZONE_TOP_BORDER: result = "SCANLINE_ZONE_TOP_BORDER"; break; @@ -526,14 +526,12 @@ void mc6847_friend_device::video_flush() // describe_context //------------------------------------------------- -const char *mc6847_friend_device::describe_context() +std::string mc6847_friend_device::describe_context() const { - static char buffer[128]; - snprintf(buffer, ARRAY_LENGTH(buffer), "%s (scanline %s:%d)", + return string_format("%s (scanline %s:%d)", machine().describe_context(), scanline_zone_string((scanline_zone) m_logical_scanline_zone), m_logical_scanline); - return buffer; } diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h index 781def31804..7dd4b3bd933 100644 --- a/src/devices/video/mc6847.h +++ b/src/devices/video/mc6847.h @@ -289,7 +289,7 @@ protected: // miscellaneous void video_flush(); - const char *describe_context(); + std::string describe_context() const; // setup functions emu_timer *setup_timer(device_timer_id id, double offset, double period); @@ -501,7 +501,7 @@ private: int32_t get_clocks_since_hsync(); // debugging - const char *scanline_zone_string(scanline_zone zone); + std::string scanline_zone_string(scanline_zone zone) const; }; // actual base class for MC6847 family of devices diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index 4d8b24243d6..7f8f532ddf7 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -176,7 +176,7 @@ running_machine::~running_machine() // PC //------------------------------------------------- -const char *running_machine::describe_context() +std::string running_machine::describe_context() const { device_execute_interface *executing = m_scheduler.currently_executing(); if (executing != nullptr) @@ -185,13 +185,11 @@ const char *running_machine::describe_context() if (cpu != nullptr) { address_space &prg = cpu->space(AS_PROGRAM); - m_context = string_format(prg.is_octal() ? "'%s' (%0*o)" : "'%s' (%0*X)", cpu->tag(), prg.logaddrchars(), cpu->pc()); + return string_format(prg.is_octal() ? "'%s' (%0*o)" : "'%s' (%0*X)", cpu->tag(), prg.logaddrchars(), cpu->pc()); } } - else - m_context.assign("(no context)"); - return m_context.c_str(); + return std::string("(no context)"); } diff --git a/src/emu/machine.h b/src/emu/machine.h index 5b1336407e6..6f7f77d58f0 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -248,7 +248,7 @@ public: template void logerror(Format &&fmt, Params &&... args) const; void strlog(const char *str) const; u32 rand(); - const char *describe_context(); + std::string describe_context() const; std::string compose_saveload_filename(std::string &&base_filename, const char **searchpath = nullptr); // CPU information @@ -346,7 +346,6 @@ private: bool m_ui_active; // ui active or not (useful for games / systems with keyboard inputs) time_t m_base_time; // real time at initial emulation time std::string m_basename; // basename used for game-related paths - std::string m_context; // context string buffer int m_sample_rate; // the digital audio sample rate std::unique_ptr m_logfile; // pointer to the active log file diff --git a/src/mame/drivers/amust.cpp b/src/mame/drivers/amust.cpp index cbb745fecf9..b6b21268af0 100644 --- a/src/mame/drivers/amust.cpp +++ b/src/mame/drivers/amust.cpp @@ -283,7 +283,7 @@ d7 - */ READ8_MEMBER( amust_state::port09_r ) { - printf("%s\n",machine().describe_context()); + logerror("%s\n",machine().describe_context()); return ioport("P9")->read(); } diff --git a/src/mame/drivers/bfm_sc5.cpp b/src/mame/drivers/bfm_sc5.cpp index 6d89ddaf442..bf7f9fcc339 100644 --- a/src/mame/drivers/bfm_sc5.cpp +++ b/src/mame/drivers/bfm_sc5.cpp @@ -26,7 +26,7 @@ WRITE16_MEMBER( bfm_sc5_state::sc5_duart_w ) { // clearly a duart of some kind, write patterns are the same as SC4 games -// printf("%s: duart_w %1x %04x %04x\n", machine().describe_context(), offset, data, mem_mask); +// logerror("%s: duart_w %1x %04x %04x\n", machine().describe_context(), offset, data, mem_mask); if (ACCESSING_BITS_8_15) { @@ -47,7 +47,7 @@ READ8_MEMBER( bfm_sc5_state::sc5_mux1_r ) return machine().rand(); } - printf("%s: sc5_mux1_r %1x\n", machine().describe_context(), offset); + logerror("%s: sc5_mux1_r %1x\n", machine().describe_context(), offset); return 0x00; } @@ -61,7 +61,7 @@ WRITE8_MEMBER( bfm_sc5_state::sc5_mux1_w ) } else { - printf("%s: sc5_mux1_w %1x %04x\n", machine().describe_context(), offset, data); + logerror("%s: sc5_mux1_w %1x %04x\n", machine().describe_context(), offset, data); } } @@ -75,7 +75,7 @@ WRITE8_MEMBER( bfm_sc5_state::sc5_mux2_w ) } else { - printf("%s: sc5_mux2_w %1x %04x\n", machine().describe_context(), offset, data); + logerror("%s: sc5_mux2_w %1x %04x\n", machine().describe_context(), offset, data); } } @@ -164,7 +164,7 @@ READ8_MEMBER( bfm_sc5_state::sc5_10202F0_r ) case 0x1: case 0x2: case 0x3: - printf("%s: sc5_10202F0_r %d\n", machine().describe_context(), offset); + logerror("%s: sc5_10202F0_r %d\n", machine().describe_context(), offset); return machine().rand(); } @@ -177,12 +177,12 @@ WRITE8_MEMBER( bfm_sc5_state::sc5_10202F0_w ) { case 0x0: bfm_sc45_write_serial_vfd((data &0x4)?1:0, (data &0x1)?1:0, (data&0x2) ? 0:1); - if (data&0xf8) printf("%s: sc5_10202F0_w %d - %02x\n", machine().describe_context(), offset, data); + if (data&0xf8) logerror("%s: sc5_10202F0_w %d - %02x\n", machine().describe_context(), offset, data); break; case 0x1: case 0x2: case 0x3: - printf("%s: sc5_10202F0_w %d - %02x\n", machine().describe_context(), offset, data); + logerror("%s: sc5_10202F0_w %d - %02x\n", machine().describe_context(), offset, data); break; } } @@ -190,7 +190,7 @@ WRITE8_MEMBER( bfm_sc5_state::sc5_10202F0_w ) WRITE_LINE_MEMBER(bfm_sc5_state::bfm_sc5_duart_irq_handler) { - printf("bfm_sc5_duart_irq_handler\n"); + logerror("bfm_sc5_duart_irq_handler\n"); } WRITE_LINE_MEMBER(bfm_sc5_state::bfm_sc5_duart_txa) @@ -200,7 +200,7 @@ WRITE_LINE_MEMBER(bfm_sc5_state::bfm_sc5_duart_txa) READ8_MEMBER(bfm_sc5_state::bfm_sc5_duart_input_r) { - printf("bfm_sc5_duart_input_r\n"); + logerror("bfm_sc5_duart_input_r\n"); return 0xff; } diff --git a/src/mame/drivers/cedar_magnet.cpp b/src/mame/drivers/cedar_magnet.cpp index 678f07850c2..c5cdfb8720e 100644 --- a/src/mame/drivers/cedar_magnet.cpp +++ b/src/mame/drivers/cedar_magnet.cpp @@ -340,7 +340,7 @@ READ8_MEMBER(cedar_magnet_state::watchdog_r) READ8_MEMBER(cedar_magnet_state::port7c_r) { - //printf("%s: port7c_r\n", machine().describe_context()); + //logerror("%s: port7c_r\n", machine().describe_context()); return 0x01; } @@ -354,19 +354,19 @@ READ8_MEMBER(cedar_magnet_state::port7c_r) READ8_MEMBER(cedar_magnet_state::port18_r) { -// printf("%s: port18_r\n", machine().describe_context()); +// logerror("%s: port18_r\n", machine().describe_context()); return 0x00; } WRITE8_MEMBER(cedar_magnet_state::port18_w) { -// printf("%s: port18_w %02x\n", machine().describe_context(), data); +// logerror("%s: port18_w %02x\n", machine().describe_context(), data); } READ8_MEMBER(cedar_magnet_state::port19_r) { uint8_t ret = 0x00; -// printf("%s: port19_r\n", machine().describe_context()); +// logerror("%s: port19_r\n", machine().describe_context()); // 9496 in a,($19) // 9498 bit 2,a @@ -378,19 +378,19 @@ READ8_MEMBER(cedar_magnet_state::port19_r) READ8_MEMBER(cedar_magnet_state::port1a_r) { -// printf("%s: port1a_r\n", machine().describe_context()); +// logerror("%s: port1a_r\n", machine().describe_context()); return 0x00; } WRITE8_MEMBER(cedar_magnet_state::port19_w) { -// printf("%s: port19_w %02x\n", machine().describe_context(), data); +// logerror("%s: port19_w %02x\n", machine().describe_context(), data); } WRITE8_MEMBER(cedar_magnet_state::port1b_w) { -// printf("%s: port1b_w %02x\n", machine().describe_context(), data); +// logerror("%s: port1b_w %02x\n", machine().describe_context(), data); } /*********************** @@ -531,14 +531,14 @@ WRITE8_MEMBER(cedar_magnet_state::other_cpu_w) { cpus_accessed++; m_cedsound->write_cpu_bus(offset2, data); - // printf("%s: sound cpu write %04x %02x - bank bits %d %d %d %d %d %d %d\n", machine().describe_context(), offset,data, bankbit0, plane0select, plane1select, spriteselect, soundselect, windowbank, unk2); + // logerror("%s: sound cpu write %04x %02x - bank bits %d %d %d %d %d %d %d\n", machine().describe_context(), offset,data, bankbit0, plane0select, plane1select, spriteselect, soundselect, windowbank, unk2); } if (cpus_accessed != 1) logerror("%s: writing multiple CPUS!!! %04x %02x - bank bits %d %d %d %d %d %d %d\n", machine().describe_context(), offset,data, bankbit0, plane0select, plane1select, spriteselect, soundselect, windowbank, unk2); // if ((offset==0) || (offset2 == 0xe) || (offset2 == 0xf) || (offset2 == 0x68)) -// printf("%s: other cpu write %04x %02x - bank bits %d %d %d %d %d %d %d\n", machine().describe_context(), offset,data, bankbit0, plane0select, plane1select, spriteselect, soundselect, windowbank, unk2); +// logerror("%s: other cpu write %04x %02x - bank bits %d %d %d %d %d %d %d\n", machine().describe_context(), offset,data, bankbit0, plane0select, plane1select, spriteselect, soundselect, windowbank, unk2); } @@ -575,7 +575,7 @@ READ8_MEMBER( cedar_magnet_state::ic48_pio_pa_r ) // 0x20 // interrupt source stuff?? ret &= ~0x10; - if (LOG_IC48_PIO_PA) printf("%s: ic48_pio_pa_r (returning %02x)\n", machine().describe_context(), ret); + if (LOG_IC48_PIO_PA) logerror("%s: ic48_pio_pa_r (returning %02x)\n", machine().describe_context(), ret); return ret; } @@ -587,16 +587,16 @@ WRITE8_MEMBER( cedar_magnet_state::ic48_pio_pa_w ) // 0x20 m_ic48_pio_pa_val = data; // address 0x20 - pio ic48 port a - if (LOG_IC48_PIO_PA) printf("%s: ic48_pio_pa_w %02x (memory banking etc.)\n", machine().describe_context(), data); + if (LOG_IC48_PIO_PA) logerror("%s: ic48_pio_pa_w %02x (memory banking etc.)\n", machine().describe_context(), data); - if (LOG_IC48_PIO_PA) printf("output bit 0x80 %d (unused)\n", (data >> 7)&1); // A7 -> 12 J4 unpopulated - if (LOG_IC48_PIO_PA) printf("output bit 0x40 %d (bank)\n", (data >> 6)&1); // A6 -> 2 74HC10 3NAND IC19 - if (LOG_IC48_PIO_PA) printf("output bit 0x20 %d (bank)\n", (data >> 5)&1); // A5 -> 4 74HC10 3NAND IC19 - if (LOG_IC48_PIO_PA) printf("input bit 0x10 %d (interrupt source related?)\n", (data >> 4)&1); // 10 in // A4 <- 9 74HC74 IC20 <- input from 18 74LS244 IC61 - if (LOG_IC48_PIO_PA) printf("input bit 0x08 %d (COIN1)\n", (data >> 3)&1); // 08 in // A3 <- 4 74HC14P (inverter) IC4 <- EDGE 21 COIN1 - if (LOG_IC48_PIO_PA) printf("output bit 0x04 %d (plane0 CPU/bus related?)\n", (data >> 2)&1); // A2 -> 45 J6 - if (LOG_IC48_PIO_PA) printf("output bit 0x02 %d (plane0 CPU/bus related?)\n", (data >> 1)&1); // A1 -> 47 J6 - if (LOG_IC48_PIO_PA) printf("input bit 0x01 %d (plane0 CPU/bus related?)\n", (data >> 0)&1); // A0 -> 49 J6 + if (LOG_IC48_PIO_PA) logerror("output bit 0x80 %d (unused)\n", (data >> 7)&1); // A7 -> 12 J4 unpopulated + if (LOG_IC48_PIO_PA) logerror("output bit 0x40 %d (bank)\n", (data >> 6)&1); // A6 -> 2 74HC10 3NAND IC19 + if (LOG_IC48_PIO_PA) logerror("output bit 0x20 %d (bank)\n", (data >> 5)&1); // A5 -> 4 74HC10 3NAND IC19 + if (LOG_IC48_PIO_PA) logerror("input bit 0x10 %d (interrupt source related?)\n", (data >> 4)&1); // 10 in // A4 <- 9 74HC74 IC20 <- input from 18 74LS244 IC61 + if (LOG_IC48_PIO_PA) logerror("input bit 0x08 %d (COIN1)\n", (data >> 3)&1); // 08 in // A3 <- 4 74HC14P (inverter) IC4 <- EDGE 21 COIN1 + if (LOG_IC48_PIO_PA) logerror("output bit 0x04 %d (plane0 CPU/bus related?)\n", (data >> 2)&1); // A2 -> 45 J6 + if (LOG_IC48_PIO_PA) logerror("output bit 0x02 %d (plane0 CPU/bus related?)\n", (data >> 1)&1); // A1 -> 47 J6 + if (LOG_IC48_PIO_PA) logerror("input bit 0x01 %d (plane0 CPU/bus related?)\n", (data >> 0)&1); // A0 -> 49 J6 int bankbit0 = (m_ic48_pio_pa_val & 0x60) >> 5; m_bank0->set_bank(bankbit0); @@ -616,7 +616,7 @@ READ8_MEMBER( cedar_magnet_state::ic48_pio_pb_r ) // 0x22 if (!m_cedsprite->is_running()) ret &= ~0x10; if (!m_cedplane1->is_running()) ret &= ~0x01; - if (LOG_IC48_PIO_PB) printf("%s: ic48_pio_pb_r (returning %02x)\n", machine().describe_context(), ret); + if (LOG_IC48_PIO_PB) logerror("%s: ic48_pio_pb_r (returning %02x)\n", machine().describe_context(), ret); return ret; } @@ -627,17 +627,17 @@ WRITE8_MEMBER(cedar_magnet_state::ic48_pio_pb_w) // 0x22 m_ic48_pio_pb_val = data; - if (LOG_IC48_PIO_PB) printf("%s: ic48_pio_pb_w %02x\n", machine().describe_context(), data); + if (LOG_IC48_PIO_PB) logerror("%s: ic48_pio_pb_w %02x\n", machine().describe_context(), data); // address 0x22 - pio ic48 port b - if (LOG_IC48_PIO_PB) printf("input bit 0x80 %d (COIN2)\n", (data >> 7)&1); // B7 <- 2 74HC14P (inverter) IC4 <- EDGE 22 COIN2 - if (LOG_IC48_PIO_PB) printf("output bit 0x40 (J6) (sprite CPU/bus related?) %d\n", (data >> 6)&1); // B6 -> 41 J6 - if (LOG_IC48_PIO_PB) printf("output bit 0x20 (J6) (sprite CPU/bus related?) %d\n", (data >> 5)&1); // B5 -> 43 J6 - if (LOG_IC48_PIO_PB) printf("input bit 0x10 (J6) (sprite CPU/bus related?) %d\n", (data >> 4)&1); // B4 -> 44 J6 - if (LOG_IC48_PIO_PB) printf("output bit 0x08 (Q8) %d\n", (data >> 3)&1); // B3 -> Q8 transistor - if (LOG_IC48_PIO_PB) printf("output bit 0x04 (J6) (plane1 CPU/bus related?) %d\n", (data >> 2)&1); // B2 -> 46 J6 - if (LOG_IC48_PIO_PB) printf("output bit 0x02 (J6) (plane1 CPU/bus related?) %d\n", (data >> 1)&1); // B1 -> 48 J6 - if (LOG_IC48_PIO_PB) printf("input bit 0x01 (J6) (plane1 CPU/bus related?) %d\n", (data >> 0)&1); // B0 -> 50 J6 + if (LOG_IC48_PIO_PB) logerror("input bit 0x80 %d (COIN2)\n", (data >> 7)&1); // B7 <- 2 74HC14P (inverter) IC4 <- EDGE 22 COIN2 + if (LOG_IC48_PIO_PB) logerror("output bit 0x40 (J6) (sprite CPU/bus related?) %d\n", (data >> 6)&1); // B6 -> 41 J6 + if (LOG_IC48_PIO_PB) logerror("output bit 0x20 (J6) (sprite CPU/bus related?) %d\n", (data >> 5)&1); // B5 -> 43 J6 + if (LOG_IC48_PIO_PB) logerror("input bit 0x10 (J6) (sprite CPU/bus related?) %d\n", (data >> 4)&1); // B4 -> 44 J6 + if (LOG_IC48_PIO_PB) logerror("output bit 0x08 (Q8) %d\n", (data >> 3)&1); // B3 -> Q8 transistor + if (LOG_IC48_PIO_PB) logerror("output bit 0x04 (J6) (plane1 CPU/bus related?) %d\n", (data >> 2)&1); // B2 -> 46 J6 + if (LOG_IC48_PIO_PB) logerror("output bit 0x02 (J6) (plane1 CPU/bus related?) %d\n", (data >> 1)&1); // B1 -> 48 J6 + if (LOG_IC48_PIO_PB) logerror("input bit 0x01 (J6) (plane1 CPU/bus related?) %d\n", (data >> 0)&1); // B0 -> 50 J6 int plane1select = (m_ic48_pio_pb_val & 0x07) >> 0; int spriteselect = (m_ic48_pio_pb_val & 0x70) >> 4; @@ -659,7 +659,7 @@ READ8_MEMBER( cedar_magnet_state::ic49_pio_pb_r ) // 0x42 if (!m_cedsound->is_running()) ret &= ~0x10; - if (LOG_IC49_PIO_PB) printf("%s: ic49_pio_pb_r (returning %02x)\n", machine().describe_context(), ret); + if (LOG_IC49_PIO_PB) logerror("%s: ic49_pio_pb_r (returning %02x)\n", machine().describe_context(), ret); return ret; } @@ -669,18 +669,18 @@ WRITE8_MEMBER( cedar_magnet_state::ic49_pio_pb_w ) // 0x42 m_ic49_pio_pb_val = data; - //printf("%s: ic49_pio_pb_w %02x\n", machine().describe_context(), data); + //logerror("%s: ic49_pio_pb_w %02x\n", machine().describe_context(), data); // address 0x42 - pio ic49 port b - if (LOG_IC49_PIO_PB) printf("output bit 0x80 %d (Q9)\n", (data >> 7)&1); // B7 -> Q9 transistor - if (LOG_IC49_PIO_PB) printf("output bit 0x40 %d (sound CPU bus related) (J3)\n", (data >> 6)&1); // B6 -> 9 J3 - if (LOG_IC49_PIO_PB) printf("output bit 0x20 %d (sound CPU bus related) (J3)\n", (data >> 5)&1); // B5 -> 8 J3 - if (LOG_IC49_PIO_PB) printf("input bit 0x10 %d (sound CPU bus related) (J3)\n", (data >> 4)&1); // B4 -> 7 J3 // input? - if (LOG_IC49_PIO_PB) printf("output bit 0x08 %d (J7)\n", (data >> 3)&1); // B3 -> 35 J7 bank bits - if (LOG_IC49_PIO_PB) printf("output bit 0x04 %d (J7)\n", (data >> 2)&1); // B2 -> 36 J7 bank bits + if (LOG_IC49_PIO_PB) logerror("output bit 0x80 %d (Q9)\n", (data >> 7)&1); // B7 -> Q9 transistor + if (LOG_IC49_PIO_PB) logerror("output bit 0x40 %d (sound CPU bus related) (J3)\n", (data >> 6)&1); // B6 -> 9 J3 + if (LOG_IC49_PIO_PB) logerror("output bit 0x20 %d (sound CPU bus related) (J3)\n", (data >> 5)&1); // B5 -> 8 J3 + if (LOG_IC49_PIO_PB) logerror("input bit 0x10 %d (sound CPU bus related) (J3)\n", (data >> 4)&1); // B4 -> 7 J3 // input? + if (LOG_IC49_PIO_PB) logerror("output bit 0x08 %d (J7)\n", (data >> 3)&1); // B3 -> 35 J7 bank bits + if (LOG_IC49_PIO_PB) logerror("output bit 0x04 %d (J7)\n", (data >> 2)&1); // B2 -> 36 J7 bank bits // there is code to mask out both bottom bits here before load operations? - if (LOG_IC49_PIO_PB) printf("output bit 0x02 %d (IC21)\n", (data >> 1)&1); // B1 -> 3 74HC04 IC21 (set before some SPRITE cpu operations, possibly halts the blitter?) - if (LOG_IC49_PIO_PB) printf("output bit 0x01 (LED) %d\n", (data >> 0)&1); // B0 -> LED LD1 + if (LOG_IC49_PIO_PB) logerror("output bit 0x02 %d (IC21)\n", (data >> 1)&1); // B1 -> 3 74HC04 IC21 (set before some SPRITE cpu operations, possibly halts the blitter?) + if (LOG_IC49_PIO_PB) logerror("output bit 0x01 (LED) %d\n", (data >> 0)&1); // B0 -> LED LD1 diff --git a/src/mame/drivers/fp1100.cpp b/src/mame/drivers/fp1100.cpp index 4dec3a64009..00e324177c5 100644 --- a/src/mame/drivers/fp1100.cpp +++ b/src/mame/drivers/fp1100.cpp @@ -62,8 +62,10 @@ #include "screen.h" #include "speaker.h" +#define VERBOSE 0 +#include "logmacro.h" + #define MAIN_CLOCK 15974400 -#define LOG 0 class fp1100_state : public driver_device { @@ -191,7 +193,7 @@ WRITE8_MEMBER( fp1100_state::irq_mask_w ) machine().scheduler().synchronize(); // force resync m_irq_mask = data; m_subcpu->set_input_line(UPD7810_INTF2, BIT(data, 7) ? HOLD_LINE : CLEAR_LINE); - if (LOG) printf("%s: IRQmask=%X\n",machine().describe_context(),data); + LOG("%s: IRQmask=%X\n",machine().describe_context(),data); } WRITE8_MEMBER( fp1100_state::main_to_sub_w ) @@ -199,14 +201,14 @@ WRITE8_MEMBER( fp1100_state::main_to_sub_w ) // machine().scheduler().synchronize(); // force resync // m_subcpu->set_input_line(UPD7810_INTF2, ASSERT_LINE); m_sub_latch = data; - if (LOG) printf("%s: From main:%X\n",machine().describe_context(),data); + LOG("%s: From main:%X\n",machine().describe_context(),data); } READ8_MEMBER( fp1100_state::sub_to_main_r ) { // machine().scheduler().synchronize(); // force resync // m_maincpu->set_input_line(0, CLEAR_LINE); - if (LOG) printf("%s: To main:%X\n",machine().describe_context(),m_main_latch); + LOG("%s: To main:%X\n",machine().describe_context(),m_main_latch); return m_main_latch; } @@ -241,7 +243,7 @@ READ8_MEMBER( fp1100_state::main_to_sub_r ) { // machine().scheduler().synchronize(); // force resync // m_subcpu->set_input_line(UPD7810_INTF2, CLEAR_LINE); - if (LOG) printf("%s: To sub:%X\n",machine().describe_context(),m_sub_latch); + LOG("%s: To sub:%X\n",machine().describe_context(),m_sub_latch); return m_sub_latch; } @@ -250,7 +252,7 @@ WRITE8_MEMBER( fp1100_state::sub_to_main_w ) // machine().scheduler().synchronize(); // force resync // m_maincpu->set_input_line_and_vector(0, ASSERT_LINE, 0xf0); m_main_latch = data; - if (LOG) printf("%s: From sub:%X\n",machine().describe_context(),data); + LOG("%s: From sub:%X\n",machine().describe_context(),data); } /* @@ -343,7 +345,7 @@ WRITE8_MEMBER( fp1100_state::portc_w ) { if (BIT(m_irq_mask, 4)) m_maincpu->set_input_line_and_vector(0, BIT(data, 3) ? CLEAR_LINE : HOLD_LINE, 0xf0); - if (LOG) printf("%s: PortC:%X\n",machine().describe_context(),data); + LOG("%s: PortC:%X\n",machine().describe_context(),data); m_upd7801.portc = data; m_cass->change_state(BIT(data, 5) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); m_centronics->write_strobe(BIT(data, 6)); diff --git a/src/mame/drivers/gamecstl.cpp b/src/mame/drivers/gamecstl.cpp index 03a738d3590..c0a335ddb20 100644 --- a/src/mame/drivers/gamecstl.cpp +++ b/src/mame/drivers/gamecstl.cpp @@ -170,14 +170,14 @@ uint32_t gamecstl_state::screen_update_gamecstl(screen_device &screen, bitmap_in static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { gamecstl_state *state = busdevice->machine().driver_data(); - printf("MTXC: read %d, %02X\n", function, reg); + state->logerror("MTXC: read %d, %02X\n", function, reg); return state->m_mtxc_config_reg[reg]; } static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { gamecstl_state *state = busdevice->machine().driver_data(); - printf("%s:MTXC: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); + state->logerror("%s:MTXC: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); switch(reg) { @@ -255,14 +255,14 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { gamecstl_state *state = busdevice->machine().driver_data(); - printf("PIIX4: read %d, %02X\n", function, reg); + state->logerror("PIIX4: read %d, %02X\n", function, reg); return state->m_piix4_config_reg[function][reg]; } static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { gamecstl_state *state = busdevice->machine().driver_data(); - printf("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); + state->logerror("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index 72cf68cf952..8319c334587 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -1853,7 +1853,7 @@ inline int atomiswave_state::decode_reg32_64(uint32_t offset, uint64_t mem_mask, // non 32-bit accesses have not yet been seen here, we need to know when they are if ((mem_mask != 0xffffffff00000000U) && (mem_mask != 0x00000000ffffffffU)) { - osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context()); + osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context().c_str()); //machine().debug_break(); } diff --git a/src/mame/drivers/statriv2.cpp b/src/mame/drivers/statriv2.cpp index 60b71915d44..41badde8bd5 100644 --- a/src/mame/drivers/statriv2.cpp +++ b/src/mame/drivers/statriv2.cpp @@ -1252,12 +1252,12 @@ DRIVER_INIT_MEMBER(statriv2_state,laserdisc) uint8_t result = 0x00; if (offset == 1) result = 0x18; - osd_printf_debug("%s:ld read ($%02X) = %02X\n", machine().describe_context(), 0x28 + offset, result); + logerror("%s:ld read ($%02X) = %02X\n", machine().describe_context(), 0x28 + offset, result); return result; },"write_lambda"), write8_delegate([this](address_space &space, offs_t offset, uint8_t data, uint8_t mem_mask) { - osd_printf_debug("%s:ld write ($%02X) = %02X\n", machine().describe_context(), 0x28 + offset, data); + logerror("%s:ld write ($%02X) = %02X\n", machine().describe_context(), 0x28 + offset, data); },"read_lambda") ); } diff --git a/src/mame/drivers/vidbrain.cpp b/src/mame/drivers/vidbrain.cpp index 8581750e536..697763f1dbf 100644 --- a/src/mame/drivers/vidbrain.cpp +++ b/src/mame/drivers/vidbrain.cpp @@ -207,12 +207,12 @@ WRITE8_MEMBER( vidbrain_state::f3853_w ) logerror("%s: F3853 Interrupt Control %u\n", machine().describe_context(), m_int_enable); interrupt_check(); - if (m_int_enable == 0x03) fatalerror("F3853 Timer not supported!\n"); + if (m_int_enable == 0x03) logerror("F3853 Timer not supported!\n"); break; case 3: // timer 8-bit polynomial counter - fatalerror("%s: F3853 Timer not supported!\n", machine().describe_context()); + logerror("%s: F3853 Timer not supported!\n", machine().describe_context()); } } diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp index 146565ffc04..eae06470722 100644 --- a/src/mame/drivers/viper.cpp +++ b/src/mame/drivers/viper.cpp @@ -1375,7 +1375,7 @@ READ64_MEMBER(viper_state::cf_card_data_r) default: { - fatalerror("%s:cf_card_data_r: IDE reg %02X\n", machine().describe_context(), offset & 0xf); + fatalerror("%s:cf_card_data_r: IDE reg %02X\n", machine().describe_context().c_str(), offset & 0xf); } } } @@ -1396,7 +1396,7 @@ WRITE64_MEMBER(viper_state::cf_card_data_w) default: { - fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", machine().describe_context(), offset & 0xf, (uint16_t)(data >> 16)); + fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", machine().describe_context().c_str(), offset & 0xf, (uint16_t)(data >> 16)); } } } @@ -1442,7 +1442,7 @@ READ64_MEMBER(viper_state::cf_card_r) default: { - printf("%s:compact_flash_r: IDE reg %02X\n", machine().describe_context(), offset & 0xf); + printf("%s:compact_flash_r: IDE reg %02X\n", machine().describe_context().c_str(), offset & 0xf); } } } @@ -1458,7 +1458,7 @@ READ64_MEMBER(viper_state::cf_card_r) } else { - fatalerror("%s:compact_flash_r: reg %02X\n", machine().describe_context(), reg); + fatalerror("%s:compact_flash_r: reg %02X\n", machine().describe_context().c_str(), reg); } } } @@ -1468,7 +1468,7 @@ READ64_MEMBER(viper_state::cf_card_r) WRITE64_MEMBER(viper_state::cf_card_w) { #ifdef VIPER_DEBUG_LOG - //printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", machine().describe_context(), (uint32_t)(data>>32), (uint32_t)(data), offset, (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); + //logerror("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", machine().describe_context(), (uint32_t)(data>>32), (uint32_t)(data), offset, (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); #endif if (ACCESSING_BITS_16_31) @@ -1507,7 +1507,7 @@ WRITE64_MEMBER(viper_state::cf_card_w) default: { - fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", machine().describe_context(), offset & 0xf, (uint16_t)((data >> 16) & 0xffff)); + fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", machine().describe_context().c_str(), offset & 0xf, (uint16_t)((data >> 16) & 0xffff)); } } } @@ -1527,7 +1527,7 @@ WRITE64_MEMBER(viper_state::cf_card_w) } default: { - fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", machine().describe_context(), offset, (uint16_t)((data >> 16) & 0xffff)); + fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", machine().describe_context().c_str(), offset, (uint16_t)((data >> 16) & 0xffff)); } } } diff --git a/src/mame/machine/cammu.cpp b/src/mame/machine/cammu.cpp index 0c5c8b27b9d..4e1d86b2076 100644 --- a/src/mame/machine/cammu.cpp +++ b/src/mame/machine/cammu.cpp @@ -215,7 +215,7 @@ READ32_MEMBER(cammu_device::insn_r) case 6: // cache purge case 7: // main memory, slave mode - fatalerror("system tag %d not supported %s\n", (pte & 0xe00) >> 9, machine().describe_context()); + fatalerror("system tag %d not supported %s\n", (pte & 0xe00) >> 9, machine().describe_context().c_str()); } return 0; @@ -285,7 +285,7 @@ READ32_MEMBER(cammu_device::data_r) case 6: // cache purge case 7: // main memory, slave mode - fatalerror("data_r: system tag %d not supported at %s\n", (pte & 0xe00) >> 9, machine().describe_context()); + fatalerror("data_r: system tag %d not supported at %s\n", (pte & 0xe00) >> 9, machine().describe_context().c_str()); } return 0; @@ -364,7 +364,7 @@ WRITE32_MEMBER(cammu_device::data_w) case 6: // cache purge case 7: // main memory, slave mode - fatalerror("data_w: system tag %d not supported at %s\n", (pte & 0xe00) >> 9, machine().describe_context()); + fatalerror("data_w: system tag %d not supported at %s\n", (pte & 0xe00) >> 9, machine().describe_context().c_str()); break; } #else @@ -386,11 +386,11 @@ u32 cammu_c4_device::get_pte(u32 va, int user, bool data) u32 pto = m_main_space->read_dword(pdo | (va & 0xffc00000) >> 20); if (pto & 0x1) - fatalerror("can't deal with pto faults va 0x%08x %s\n", va, machine().describe_context()); + fatalerror("can't deal with pto faults va 0x%08x %s\n", va, machine().describe_context().c_str()); u32 pte = m_main_space->read_dword((pto & 0xfffff000) | (va & 0x003ff000) >> 10); if (pte & 0x1) - fatalerror("can't deal with pte faults va 0x%08x %s\n", va, machine().describe_context()); + fatalerror("can't deal with pte faults va 0x%08x %s\n", va, machine().describe_context().c_str()); m_tlb[tlb_index].va = va & 0xfffff000; m_tlb[tlb_index].pte = pte; @@ -406,11 +406,11 @@ u32 cammu_c3_device::get_pte(u32 va, int user, bool data) u32 pto = m_main_space->read_dword(pdo | (va & 0xffc00000) >> 20); if (pto & 0x1) - fatalerror("can't deal with pto faults va 0x%08x %s\n", va, machine().describe_context()); + fatalerror("can't deal with pto faults va 0x%08x %s\n", va, machine().describe_context().c_str()); u32 pte = m_main_space->read_dword((pto & 0xfffff000) | (va & 0x003ff000) >> 10); if (pte & 0x1) - fatalerror("can't deal with pte faults va 0x%08x %s\n", va, machine().describe_context()); + fatalerror("can't deal with pte faults va 0x%08x %s\n", va, machine().describe_context().c_str()); return pte; } diff --git a/src/mame/machine/dc.cpp b/src/mame/machine/dc.cpp index 135f9e0d87a..a47880f9a9b 100644 --- a/src/mame/machine/dc.cpp +++ b/src/mame/machine/dc.cpp @@ -244,7 +244,7 @@ int dc_state::decode_reg32_64(uint32_t offset, uint64_t mem_mask, uint64_t *shif // non 32-bit accesses have not yet been seen here, we need to know when they are if ((mem_mask != 0xffffffff00000000U) && (mem_mask != 0x00000000ffffffffU)) { - osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context()); + osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context().c_str()); //machine().debug_break(); } @@ -268,7 +268,7 @@ int dc_state::decode_reg3216_64(uint32_t offset, uint64_t mem_mask, uint64_t *sh if ((mem_mask != 0x0000ffff00000000U) && (mem_mask != 0x000000000000ffffU) && (mem_mask != 0xffffffff00000000U) && (mem_mask != 0x00000000ffffffffU)) { - osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context()); + osd_printf_verbose("%s:Wrong mask!\n", machine().describe_context().c_str()); //machine().debug_break(); } diff --git a/src/mame/machine/iteagle_fpga.cpp b/src/mame/machine/iteagle_fpga.cpp index dc2f137e173..46920a33874 100644 --- a/src/mame/machine/iteagle_fpga.cpp +++ b/src/mame/machine/iteagle_fpga.cpp @@ -297,7 +297,7 @@ READ32_MEMBER( iteagle_fpga_device::fpga_r ) default: if (LOG_FPGA) logerror("%s:fpga_r offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); - osd_printf_debug("%s:fpga_r offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + osd_printf_debug("%s:fpga_r offset %04X = %08X & %08X\n", machine().describe_context().c_str(), offset*4, result, mem_mask); break; } if (offset!=0x4/4) @@ -443,7 +443,7 @@ WRITE32_MEMBER( iteagle_fpga_device::fpga_w ) default: if (LOG_FPGA) logerror("%s:fpga_w offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); - osd_printf_debug("%s:fpga_w offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); + osd_printf_debug("%s:fpga_w offset %04X = %08X & %08X\n", machine().describe_context().c_str(), offset*4, data, mem_mask); break; } } @@ -771,7 +771,7 @@ READ32_MEMBER( iteagle_periph_device::ctrl_r ) case 0x0/4: if (LOG_PERIPH) logerror("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); - osd_printf_debug("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + osd_printf_debug("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context().c_str(), offset*4, result, mem_mask); break; case 0x70/4: if (ACCESSING_BITS_8_15) { @@ -801,7 +801,7 @@ READ32_MEMBER( iteagle_periph_device::ctrl_r ) default: if (LOG_PERIPH) logerror("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); - osd_printf_debug("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); + osd_printf_debug("%s:fpga ctrl_r from offset %04X = %08X & %08X\n", machine().describe_context().c_str(), offset*4, result, mem_mask); break; } return result; diff --git a/src/mame/machine/slapstic.cpp b/src/mame/machine/slapstic.cpp index e312de55313..cffbaa13d91 100644 --- a/src/mame/machine/slapstic.cpp +++ b/src/mame/machine/slapstic.cpp @@ -1105,7 +1105,7 @@ void atari_slapstic_device::slapstic_log(running_machine &machine, offs_t offset fprintf(slapsticlog, "------------------------------------\n"); last_time = time; - fprintf(slapsticlog, "%s: %04X B=%d ", machine.describe_context(), offset, current_bank); + fprintf(slapsticlog, "%s: %04X B=%d ", machine.describe_context().c_str(), offset, current_bank); switch (state) { case DISABLED: diff --git a/src/mame/machine/tx1.cpp b/src/mame/machine/tx1.cpp index c297b741fa4..e410bec1d2f 100644 --- a/src/mame/machine/tx1.cpp +++ b/src/mame/machine/tx1.cpp @@ -137,7 +137,7 @@ static void sn_divide(running_machine &machine) if (SN74S516.X == 0) { - osd_printf_debug("%s:SN74S516 tried to divide by zero\n", machine.describe_context()); + machine.logerror("%s:SN74S516 tried to divide by zero\n", machine.describe_context()); SN74S516.ZW.as16bit.Z = (int16_t)0xffff; SN74S516.ZW.as16bit.W = 0xffff; SN74S516.ZWfl = 0; @@ -284,7 +284,7 @@ static void kick_sn74s516(running_machine &machine, uint16_t *data, const int in if (SN74S516.code == 0x6666) { CLEAR_SEQUENCE; - osd_printf_debug("%s:Code 6666: PROMADDR:%x\n", machine.describe_context(), math.promaddr); + machine.logerror("%s:Code 6666: PROMADDR:%x\n", machine.describe_context(), math.promaddr); } UPDATE_SEQUENCE; -- cgit v1.2.3