diff options
author | smf- <smf-@users.noreply.github.com> | 2018-04-13 16:32:23 +0100 |
---|---|---|
committer | smf- <smf-@users.noreply.github.com> | 2018-04-13 16:41:37 +0100 |
commit | 1a27a251f819ecd7990a21d1b1c5ef82355b63c2 (patch) | |
tree | e64a720ca63495737ea5536cc90408343a4feff1 /src | |
parent | 603b5bfd61ed3b9968c268aaa9cb13ebb6801ec6 (diff) |
remove safe_pc() and safe_pcbase() (nw)
Diffstat (limited to 'src')
144 files changed, 560 insertions, 687 deletions
diff --git a/src/devices/bus/a2bus/a2ultraterm.cpp b/src/devices/bus/a2bus/a2ultraterm.cpp index da2ade80039..114795bc0cb 100644 --- a/src/devices/bus/a2bus/a2ultraterm.cpp +++ b/src/devices/bus/a2bus/a2ultraterm.cpp @@ -183,7 +183,7 @@ void a2bus_videx160_device::device_reset() uint8_t a2bus_videx160_device::read_c0nx(uint8_t offset) { -// printf("Read c0n%x (PC=%x)\n", offset, machine().describe_context()); +// printf("%s Read c0n%x\n", machine().describe_context().c_str(), offset); if (!(m_ctrl1 & CT1_VTEMU)) { @@ -212,7 +212,7 @@ uint8_t a2bus_videx160_device::read_c0nx(uint8_t offset) void a2bus_videx160_device::write_c0nx(uint8_t offset, uint8_t data) { -// printf("Write %02x to c0n%x (PC=%x)\n", data, offset, machine().describe_context()); +// printf("%s Write %02x to c0n%x\n", machine().describe_context().c_str(), data, offset); switch (offset) { diff --git a/src/devices/bus/cpc/mface2.cpp b/src/devices/bus/cpc/mface2.cpp index 7991a901f18..49cb59f54cc 100644 --- a/src/devices/bus/cpc/mface2.cpp +++ b/src/devices/bus/cpc/mface2.cpp @@ -29,7 +29,7 @@ DIRECT_UPDATE_MEMBER( cpc_multiface2_device::amstrad_multiface_directoverride ) { int pc; - pc = machine().device("maincpu")->safe_pc(); + pc = machine().device<cpu_device>("maincpu")->pc(); /* there are two places where CALL &0065 can be found in the multiface rom. At this address there is a RET. diff --git a/src/devices/bus/gba/rom.cpp b/src/devices/bus/gba/rom.cpp index 0824e1fbd0a..f31a23de07b 100644 --- a/src/devices/bus/gba/rom.cpp +++ b/src/devices/bus/gba/rom.cpp @@ -1058,7 +1058,7 @@ void gba_eeprom_device::write(uint32_t data) if (m_bits == 0) { - osd_printf_verbose("%08x: EEPROM: %02x to %x\n", machine().device("maincpu")->safe_pc(), m_eep_data, m_addr); + osd_printf_verbose("%s: EEPROM: %02x to %x\n", machine().describe_context().c_str(), m_eep_data, m_addr); if (m_addr >= m_data_size) fatalerror("eeprom: invalid address (%x)\n", m_addr); diff --git a/src/devices/bus/isa/3c505.cpp b/src/devices/bus/isa/3c505.cpp index 6c73275da90..71548dcbdaa 100644 --- a/src/devices/bus/isa/3c505.cpp +++ b/src/devices/bus/isa/3c505.cpp @@ -1644,7 +1644,7 @@ READ16_MEMBER(threecom3c505_device::read) // omit excessive logging if (data == last_data) { - uint32_t pc = space.device().safe_pcbase(); + uint32_t pc = space.device().state().pcbase(); if (pc == last_pc) { return data; diff --git a/src/devices/bus/nubus/nubus_48gc.cpp b/src/devices/bus/nubus/nubus_48gc.cpp index a3696a376ea..0b32fc9dea4 100644 --- a/src/devices/bus/nubus/nubus_48gc.cpp +++ b/src/devices/bus/nubus/nubus_48gc.cpp @@ -345,7 +345,7 @@ WRITE32_MEMBER( jmfb_device::mac_48gc_w ) READ32_MEMBER( jmfb_device::mac_48gc_r ) { -// printf("48gc_r: @ %x, mask %08x [PC=%x]\n", offset, mem_mask, m_maincpu->safe_pc()); +// printf("%s 48gc_r: @ %x, mask %08x\n", machine().describe_context().c_str(), offset, mem_mask); switch (offset) { diff --git a/src/devices/bus/nubus/nubus_cb264.cpp b/src/devices/bus/nubus/nubus_cb264.cpp index 1a819328e3c..9efb5e6d088 100644 --- a/src/devices/bus/nubus/nubus_cb264.cpp +++ b/src/devices/bus/nubus/nubus_cb264.cpp @@ -237,7 +237,7 @@ WRITE32_MEMBER( nubus_cb264_device::cb264_w ) break; default: -// printf("cb264_w: %x to reg %x (mask %x %s)\n", data, offset*4, mem_mask, machine().describe_context()); +// printf("%s cb264_w: %x to reg %x (mask %x)\n", machine().describe_context().c_str(), data, offset*4, mem_mask); break; } } diff --git a/src/devices/bus/nubus/pds30_mc30.cpp b/src/devices/bus/nubus/pds30_mc30.cpp index 5c6fa193bf6..592474b3c94 100644 --- a/src/devices/bus/nubus/pds30_mc30.cpp +++ b/src/devices/bus/nubus/pds30_mc30.cpp @@ -264,18 +264,18 @@ WRITE32_MEMBER( nubus_xceedmc30_device::xceedmc30_w ) break; case 0x100000: -// logerror("%08x to DAC control %s\n", data, machine().describe_context()); +// logerror("%s %08x to DAC control\n", machine().describe_context(), data); m_clutoffs = (data&0xff); m_count = 0; break; case 0x100001: -// printf("%08x to DAC data %s\n", data, machine().describe_context()); +// printf("%s %08x to DAC data\n", machine().describe_context().c_str(), data); m_colors[m_count++] = ((data>>24) & 0xff); if (m_count == 3) { -// printf("RAMDAC: color %02x = %02x %02x %02x %s\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], machine().describe_context()); +// printf("%s RAMDAC: color %02x = %02x %02x %02x\n", machine().describe_context().c_str(), m_clutoffs, m_colors[0], m_colors[1], m_colors[2]); m_palette[m_clutoffs] = rgb_t(m_colors[0], m_colors[1], m_colors[2]); m_clutoffs++; if (m_clutoffs > 255) @@ -299,7 +299,7 @@ WRITE32_MEMBER( nubus_xceedmc30_device::xceedmc30_w ) break; default: -// printf("xceedmc30_w: %08x @ %x, mask %08x %s\n", data, offset, mem_mask, machine().describe_context()); +// printf("%s xceedmc30_w: %08x @ %x, mask %08x\n", machine().describe_context().c_str(), data, offset, mem_mask); break; } } diff --git a/src/devices/bus/nubus/pds30_procolor816.cpp b/src/devices/bus/nubus/pds30_procolor816.cpp index 81417b33f44..72f1a5afad8 100644 --- a/src/devices/bus/nubus/pds30_procolor816.cpp +++ b/src/devices/bus/nubus/pds30_procolor816.cpp @@ -269,7 +269,7 @@ WRITE32_MEMBER( nubus_procolor816_device::procolor816_w ) case 0x3d800: if (mem_mask == 0x00ff0000) { - // printf("%08x to DAC control %s\n", data, machine().describe_context()); + // printf("%s %08x to DAC control\n", machine().describe_context().c_str(), data); m_clutoffs = bitswap<8>((data>>16)&0xff, 0, 1, 2, 3, 4, 5, 6, 7); } else if (mem_mask == 0x000000ff) @@ -278,7 +278,7 @@ WRITE32_MEMBER( nubus_procolor816_device::procolor816_w ) if (m_count == 3) { -// printf("RAMDAC: color %02x = %02x %02x %02x %s\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], machine().describe_context()); +// printf("%s RAMDAC: color %02x = %02x %02x %02x\n", machine().describe_context().c_str(), m_clutoffs, m_colors[0], m_colors[1], m_colors[2]); m_palette[m_clutoffs] = rgb_t(m_colors[0], m_colors[1], m_colors[2]); m_clutoffs++; if (m_clutoffs > 255) @@ -306,7 +306,7 @@ WRITE32_MEMBER( nubus_procolor816_device::procolor816_w ) break; default: -// printf("procolor816_w: %08x @ %x, mask %08x %s\n", data, offset, mem_mask, machine().describe_context()); +// printf("%s procolor816_w: %08x @ %x, mask %08x\n", machine().describe_context().c_str(), data, offset, mem_mask); break; } } diff --git a/src/devices/bus/nubus/pds30_sigmalview.cpp b/src/devices/bus/nubus/pds30_sigmalview.cpp index 1fcbb1ec3aa..0630e853748 100644 --- a/src/devices/bus/nubus/pds30_sigmalview.cpp +++ b/src/devices/bus/nubus/pds30_sigmalview.cpp @@ -163,7 +163,7 @@ READ32_MEMBER( nubus_lview_device::lview_r ) { uint32_t rv = 0; -// printf("prot_r: @ %x, mask %08x [PC=%x state %d]\n", offset, mem_mask, machine().device("maincpu")->safe_pc(), m_protstate); +// printf("%s prot_r: @ %x, mask %08x [state %d]\n", machine().describe_context().c_str(), offset, mem_mask, m_protstate); if ((m_protstate == 1) || (m_protstate == 10) || (machine().device<cpu_device>("maincpu")->pc() == 0x5aac)) { diff --git a/src/devices/machine/at28c16.cpp b/src/devices/machine/at28c16.cpp index 4f4b11002f8..7b4ef71e52d 100644 --- a/src/devices/machine/at28c16.cpp +++ b/src/devices/machine/at28c16.cpp @@ -145,11 +145,11 @@ WRITE8_MEMBER( at28c16_device::write ) { if( m_last_write >= 0 ) { -// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine.describe_context(), offset, data ); +// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine().describe_context(), offset, data ); } else if( m_oe_12v ) { -// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", machine.describe_context(), offset, data ); +// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", machine().describe_context(), offset, data ); if( m_last_write < 0 ) { for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ ) @@ -168,7 +168,7 @@ WRITE8_MEMBER( at28c16_device::write ) offset += AT28C16_ID_BYTES; } -// logerror( "%s: AT28C16: write( %04x, %02x )\n", machine.describe_context(), offset, data ); +// logerror( "%s: AT28C16: write( %04x, %02x )\n", machine().describe_context(), offset, data ); if( m_last_write < 0 && this->space(AS_PROGRAM).read_byte( offset ) != data ) { this->space(AS_PROGRAM).write_byte( offset, data ); @@ -184,7 +184,7 @@ READ8_MEMBER( at28c16_device::read ) if( m_last_write >= 0 ) { uint8_t data = m_last_write ^ 0x80; -// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine.describe_context(), offset, data ); +// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine().describe_context(), offset, data ); return data; } else @@ -195,7 +195,7 @@ READ8_MEMBER( at28c16_device::read ) } uint8_t data = this->space(AS_PROGRAM).read_byte( offset ); -// logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine.describe_context(), offset, data ); +// logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine().describe_context(), offset, data ); return data; } } @@ -206,7 +206,7 @@ WRITE_LINE_MEMBER( at28c16_device::set_a9_12v ) state &= 1; if( m_a9_12v != state ) { -// logerror( "%s: AT28C16: set_a9_12v( %d )\n", machine.describe_context(), state ); +// logerror( "%s: AT28C16: set_a9_12v( %d )\n", machine().describe_context(), state ); m_a9_12v = state; } } @@ -217,7 +217,7 @@ WRITE_LINE_MEMBER( at28c16_device::set_oe_12v ) state &= 1; if( m_oe_12v != state ) { -// logerror( "%s: AT28C16: set_oe_12v( %d )\n", machine.describe_context(), state ); +// logerror( "%s: AT28C16: set_oe_12v( %d )\n", machine().describe_context(), state ); m_oe_12v = state; } } diff --git a/src/devices/machine/mpu401.cpp b/src/devices/machine/mpu401.cpp index 37f4c6c23a2..d9c4a350557 100644 --- a/src/devices/machine/mpu401.cpp +++ b/src/devices/machine/mpu401.cpp @@ -204,7 +204,7 @@ WRITE8_MEMBER(mpu401_device::port1_w) READ8_MEMBER(mpu401_device::port2_r) { -// printf("Read P2 %s\n", machine().describe_context()); +// printf("%s Read P2\n", machine().describe_context().c_str()); return m_port2; } diff --git a/src/devices/machine/pci9050.cpp b/src/devices/machine/pci9050.cpp index bcf747bd958..c7e734c4b80 100644 --- a/src/devices/machine/pci9050.cpp +++ b/src/devices/machine/pci9050.cpp @@ -175,7 +175,7 @@ READ32_MEMBER (pci9050_device::lasrr_r) WRITE32_MEMBER(pci9050_device::lasrr_w) { - logerror("%06X:PCI9050 local bus %d range = %08x: %s flags %d pf %d addr bits 27-4 %08x\n", machine().device("maincpu")->safe_pc(), offset, data, (data & 1) ? "I/O" : "MEM", (data & 6)>>1, (data & 8)>>3, data & 0xfffffff); + logerror("%s:PCI9050 local bus %d range = %08x: %s flags %d pf %d addr bits 27-4 %08x\n", machine().describe_context(), offset, data, (data & 1) ? "I/O" : "MEM", (data & 6)>>1, (data & 8)>>3, data & 0xfffffff); m_lasrr[offset] = data; remap_local(offset); } @@ -187,7 +187,7 @@ READ32_MEMBER (pci9050_device::eromrr_r) WRITE32_MEMBER(pci9050_device::eromrr_w) { - logerror("%06X:PCI9050 ROM range = %08x: addr bits 27-11 %08x\n", machine().device("maincpu")->safe_pc(), data, data & 0xfffff800); + logerror("%s:PCI9050 ROM range = %08x: addr bits 27-11 %08x\n", machine().describe_context(), data, data & 0xfffff800); m_eromrr = data; remap_rom(); } @@ -199,7 +199,7 @@ READ32_MEMBER (pci9050_device::lasba_r) WRITE32_MEMBER(pci9050_device::lasba_w) { - logerror("%06X:PCI9050 local bus %d base = %08x: enable %d remap %08x\n", machine().device("maincpu")->safe_pc(), offset, data, data&1, data & 0x0ffffffe); + logerror("%s:PCI9050 local bus %d base = %08x: enable %d remap %08x\n", machine().describe_context(), offset, data, data&1, data & 0x0ffffffe); m_lasba[offset] = data; remap_local(offset); } @@ -211,7 +211,7 @@ READ32_MEMBER (pci9050_device::eromba_r) WRITE32_MEMBER(pci9050_device::eromba_w) { - logerror("%06X:PCI9050 ROM base = %08x: remap %08x\n", machine().device("maincpu")->safe_pc(), data, data & 0x0ffff800); + logerror("%s:PCI9050 ROM base = %08x: remap %08x\n", machine().describe_context(), data, data & 0x0ffff800); m_eromba = data; remap_rom(); } @@ -223,7 +223,7 @@ READ32_MEMBER (pci9050_device::lasbrd_r) WRITE32_MEMBER(pci9050_device::lasbrd_w) { - logerror("%06X:PCI9050 local bus %d descriptors = %08x: burst %d prefetch %d width %d, endian %s, endian mode %d\n", machine().device("maincpu")->safe_pc(), offset, data, data&1, (data >> 5) & 1, (data >> 22) & 3, ((data >> 24) & 1) ? "BE" : "LE", (data >> 25) & 1); + logerror("%s:PCI9050 local bus %d descriptors = %08x: burst %d prefetch %d width %d, endian %s, endian mode %d\n", machine().describe_context(), offset, data, data&1, (data >> 5) & 1, (data >> 22) & 3, ((data >> 24) & 1) ? "BE" : "LE", (data >> 25) & 1); m_lasbrd[offset] = data; remap_local(offset); } @@ -235,7 +235,7 @@ READ32_MEMBER (pci9050_device::erombrd_r) WRITE32_MEMBER(pci9050_device::erombrd_w) { - logerror("%06X:PCI9050 ROM descriptors = %08x: burst %d prefetch %d bits %d, endian %s, endian mode %d\n", machine().device("maincpu")->safe_pc(), data, data&1, (data >> 5) & 1, (data >> 22) & 3, ((data >> 24) & 1) ? "BE" : "LE", (data >> 25) & 1); + logerror("%s:PCI9050 ROM descriptors = %08x: burst %d prefetch %d bits %d, endian %s, endian mode %d\n", machine().describe_context(), data, data&1, (data >> 5) & 1, (data >> 22) & 3, ((data >> 24) & 1) ? "BE" : "LE", (data >> 25) & 1); m_erombrd = data; remap_rom(); } @@ -247,20 +247,20 @@ READ32_MEMBER (pci9050_device::csbase_r) WRITE32_MEMBER(pci9050_device::csbase_w) { - logerror("%06X:PCI9050 chip select %d base = %08x: enable %d size %08x\n", machine().device("maincpu")->safe_pc(), offset, data, data&1, data&0xfffffffe); + logerror("%s:PCI9050 chip select %d base = %08x: enable %d size %08x\n", machine().describe_context(), offset, data, data&1, data&0xfffffffe); m_csbase[offset] = data; remap_local(offset); } READ32_MEMBER (pci9050_device::intcsr_r) { - logerror("%06X:PCI9050 IRQ CSR read %08x\n", machine().device("maincpu")->safe_pc(), m_intcsr); + logerror("%s:PCI9050 IRQ CSR read %08x\n", machine().describe_context(), m_intcsr); return m_intcsr; } WRITE32_MEMBER(pci9050_device::intcsr_w) { - logerror("%06X:PCI9050 IRQ CSR write %08x\n", machine().device("maincpu")->safe_pc(), data); + logerror("%s:PCI9050 IRQ CSR write %08x\n", machine().describe_context(), data); m_intcsr = data; remap_rom(); } @@ -275,14 +275,14 @@ READ32_MEMBER (pci9050_device::cntrl_r) m_cntrl = (m_cntrl & ~(1<<(2 + userIndex * 3))) | (((readData>>userIndex)&1) << (2 + userIndex * 3)); } if (0) - logerror("%06X:PCI9050 CNTRL read = %08x\n", machine().device("maincpu")->safe_pc(), m_cntrl); + logerror("%s:PCI9050 CNTRL read = %08x\n", machine().describe_context(), m_cntrl); return m_cntrl; } WRITE32_MEMBER(pci9050_device::cntrl_w) { if (0) - logerror("%06X:PCI9050 CNTRL write %08x\n", machine().device("maincpu")->safe_pc(), data); + logerror("%s:PCI9050 CNTRL write %08x\n", machine().describe_context(), data); uint32_t oldData = m_cntrl; m_cntrl = data; remap_rom(); diff --git a/src/devices/machine/rf5c296.cpp b/src/devices/machine/rf5c296.cpp index 7627c0280aa..ee6d3e0ea54 100644 --- a/src/devices/machine/rf5c296.cpp +++ b/src/devices/machine/rf5c296.cpp @@ -22,7 +22,7 @@ void rf5c296_device::device_start() void rf5c296_device::reg_w(ATTR_UNUSED uint8_t reg, uint8_t data) { - // fprintf(stderr, "rf5c296_reg_w %02x, %02x (%s)\n", reg, data, machine().describe_context()); + // fprintf(stderr, "%s rf5c296_reg_w %02x, %02x\n", machine().describe_context().c_str(), reg, data); switch (reg) { // Interrupt and General Control Register @@ -41,7 +41,7 @@ void rf5c296_device::reg_w(ATTR_UNUSED uint8_t reg, uint8_t data) uint8_t rf5c296_device::reg_r(ATTR_UNUSED uint8_t reg) { - // fprintf(stderr, "rf5c296_reg_r %02x (%s)\n", reg, machine().describe_context()); + // fprintf(stderr, "%s rf5c296_reg_r %02x\n", machine().describe_context().c_str(), reg); return 0x00; } diff --git a/src/devices/machine/tmp68301.cpp b/src/devices/machine/tmp68301.cpp index 1b72596cb87..142bce4dde8 100644 --- a/src/devices/machine/tmp68301.cpp +++ b/src/devices/machine/tmp68301.cpp @@ -205,7 +205,7 @@ inline void tmp68301_device::write_word(offs_t address, uint16_t data) IRQ_CALLBACK_MEMBER(tmp68301_device::irq_callback) { int vector = m_irq_vector[irqline]; -// logerror("%s: irq callback returns %04X for level %x\n",machine.describe_context(),vector,int_level); +// logerror("%s: irq callback returns %04X for level %x\n",machine().describe_context(),vector,int_level); return vector; } @@ -216,7 +216,7 @@ TIMER_CALLBACK_MEMBER( tmp68301_device::timer_callback ) uint16_t ICR = m_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9) uint16_t IVNR = m_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR) -// logerror("s: callback timer %04X, j = %d\n",machine.describe_context(),i,tcount); +// logerror("s: callback timer %04X, j = %d\n",machine().describe_context(),i,tcount); if ( (TCR & 0x0004) && // INT !(m_imr & (0x100<<i)) diff --git a/src/devices/sound/es1373.cpp b/src/devices/sound/es1373.cpp index de41e0ca3d4..5f2cad5a841 100644 --- a/src/devices/sound/es1373.cpp +++ b/src/devices/sound/es1373.cpp @@ -259,12 +259,12 @@ void es1373_device::sound_stream_update(sound_stream &stream, stream_sample_t ** // Keep playing m_adc.buf_count = 0; if (LOG_ES) - logerror("%X: send_audio_out ADC clearing buf_count\n", machine().device("maincpu")->safe_pc()); + logerror("%s: send_audio_out ADC clearing buf_count\n", machine().describe_context()); } if (m_adc.int_en) { m_es_regs[ES_INT_CS_STATUS] |= ICSTATUS_ADC_INT_MASK; if (LOG_ES) - logerror("%X: send_audio_out Setting ADC interrupt\n", machine().device("maincpu")->safe_pc()); + logerror("%s: send_audio_out Setting ADC interrupt\n", machine().describe_context()); } } if (!(m_adc.buf_count&1) && !(m_adc.buf_wptr&0xf)) { @@ -314,8 +314,8 @@ void es1373_device::send_audio_out(chan_info& chan, uint32_t intr_mask, stream_s transfer_pci_audio(chan, ES_PCI_READ); } if (LOG_ES && i==0) - logerror("%X: chan: %X samples: %i buf_count: %X buf_size: %X buf_rptr: %X buf_wptr: %X\n", - machine().device("maincpu")->safe_pc(), chan.number, samples, chan.buf_count, chan.buf_size, chan.buf_rptr, chan.buf_wptr); + logerror("%s: chan: %X samples: %i buf_count: %X buf_size: %X buf_rptr: %X buf_wptr: %X\n", + machine().describe_context(), chan.number, samples, chan.buf_count, chan.buf_size, chan.buf_rptr, chan.buf_wptr); // Buffer is 4 bytes per location, need to switch on sample mode switch (chan.format) { case SCTRL_8BIT_MONO: @@ -358,12 +358,12 @@ void es1373_device::send_audio_out(chan_info& chan, uint32_t intr_mask, stream_s chan.buf_count = 0; //chan.buf_rptr -= 1; if (LOG_ES) - logerror("%X: send_audio_out DAC2 clearing buf_count\n", machine().device("maincpu")->safe_pc()); + logerror("%s: send_audio_out DAC2 clearing buf_count\n", machine().describe_context()); } if (chan.int_en) { m_es_regs[ES_INT_CS_STATUS] |= intr_mask; if (LOG_ES) - logerror("%X: send_audio_out Setting DAC2 interrupt\n", machine().device("maincpu")->safe_pc()); + logerror("%s: send_audio_out Setting DAC2 interrupt\n", machine().describe_context()); } } if (buf_row_done && !(chan.buf_rptr&0xf)) { @@ -486,7 +486,7 @@ READ32_MEMBER (es1373_device::reg_r) break; } if (LOG_ES_REG) - logerror("%08X:ES1373 read from offset %02X = %08X & %08X\n", machine().device("maincpu")->safe_pc(), offset*4, result, mem_mask); + logerror("%s:ES1373 read from offset %02X = %08X & %08X\n", machine().describe_context(), offset*4, result, mem_mask); return result; } @@ -537,7 +537,7 @@ WRITE32_MEMBER(es1373_device::reg_w) m_cpu->set_input_line(m_irq_num, CLEAR_LINE); m_es_regs[ES_INT_CS_STATUS] &= ~ICSTATUS_INTR_MASK; if (0 && LOG_ES_REG) - logerror("%X: es1373_device::reg_w Clearing interrupt\n", machine().device("maincpu")->safe_pc()); + logerror("%s: es1373_device::reg_w Clearing interrupt\n", machine().describe_context()); } } if (0 && LOG_ES_REG) @@ -592,7 +592,7 @@ WRITE32_MEMBER(es1373_device::reg_w) m_dac2.pci_count = (data>>16)&0xffff; m_dac2.pci_size = data&0xffff; if (LOG_ES_REG) - logerror("%08X:ES1373 write to offset %02X = %08X & %08X\n", machine().device("maincpu")->safe_pc(), offset*4, data, mem_mask); + logerror("%s:ES1373 write to offset %02X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); break; default: break; @@ -603,6 +603,6 @@ WRITE32_MEMBER(es1373_device::reg_w) } if (LOG_ES_REG) - logerror("%08X:ES1373 write to offset %02X = %08X & %08X\n", machine().device("maincpu")->safe_pc(), offset*4, data, mem_mask); + logerror("%s:ES1373 write to offset %02X = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); } diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp index 8c131cd8524..106af73b740 100644 --- a/src/devices/video/315_5313.cpp +++ b/src/devices/video/315_5313.cpp @@ -538,7 +538,7 @@ void sega315_5313_device::vdp_set_register(int regnum, uint8_t value) // if (regnum == 0x0a) // osd_printf_debug("Set HINT Reload Register to %d on scanline %d\n",value, get_scanline_counter()); -// osd_printf_debug("%s: Setting VDP Register #%02x to %02x\n",machine().describe_context(), regnum,value); +// osd_printf_debug("%s: Setting VDP Register #%02x to %02x\n",machine().describe_context().c_str(), regnum,value); } void sega315_5313_device::update_code_and_address(void) @@ -716,7 +716,7 @@ void sega315_5313_device::handle_dma_bits() uint16_t length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0xff)<<16))<<1; length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1; - osd_printf_debug("%s 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", machine().describe_context(), source, length, m_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, m_vdp_code,MEGADRIVE_REG0F_AUTO_INC); + osd_printf_debug("%s 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", machine().describe_context().c_str(), source, length, m_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, m_vdp_code,MEGADRIVE_REG0F_AUTO_INC); } #endif if (m_vdp_code==0x20) @@ -1322,7 +1322,7 @@ READ16_MEMBER( sega315_5313_device::vdp_r ) // if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) osd_printf_debug("8-bit VDP read HV counter port access, offset %04x mem_mask %04x\n",offset,mem_mask); retvalue = megadriv_read_hv_counters(); // retvalue = machine().rand(); - // osd_printf_debug("%s: Read HV counters at scanline %d hpos %d (return %04x)\n",machine().describe_context(),get_scanline_counter(), get_hposition(),retvalue); + // osd_printf_debug("%s: Read HV counters at scanline %d hpos %d (return %04x)\n",machine().describe_context().c_str(),get_scanline_counter(), get_hposition(),retvalue); break; case 0x10: diff --git a/src/devices/video/huc6270.cpp b/src/devices/video/huc6270.cpp index d72aa4a3281..38c379d1a80 100644 --- a/src/devices/video/huc6270.cpp +++ b/src/devices/video/huc6270.cpp @@ -764,7 +764,7 @@ WRITE8_MEMBER( huc6270_device::write ) case RCR: /* raster compare register MSB */ m_rcr = ( m_rcr & 0x00FF ) | ( ( data & 0x03 ) << 8 ); -//printf("%s: RCR set to %03x\n", machine().describe_context(), m_rcr); +//printf("%s: RCR set to %03x\n", machine().describe_context().c_str(), m_rcr); // if ( m_raster_count == m_rcr && m_cr & 0x04 ) // { // m_status |= HUC6270_RR; diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index 639a0af1e2f..2d36beb3972 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -2151,7 +2151,7 @@ void voodoo_device::stall_cpu(int state, attotime current_time) if (!m_stall.isnull()) m_stall(true); else - cpu->execute().spin_until_trigger(trigger); + cpu->spin_until_trigger(trigger); /* set a timer to clear the stall */ pci.continue_timer->adjust(pci.op_end_time - current_time); @@ -3939,7 +3939,7 @@ uint32_t voodoo_device::register_r(voodoo_device *vd, offs_t offset) /* bit 31 is not used */ /* eat some cycles since people like polling here */ - if (EAT_CYCLES) vd->cpu->execute().eat_cycles(1000); + if (EAT_CYCLES) vd->cpu->eat_cycles(1000); break; /* bit 2 of the initEnable register maps this to dacRead */ @@ -3951,7 +3951,7 @@ uint32_t voodoo_device::register_r(voodoo_device *vd, offs_t offset) /* return the current visible scanline */ case vRetrace: /* eat some cycles since people like polling here */ - if (EAT_CYCLES) vd->cpu->execute().eat_cycles(10); + if (EAT_CYCLES) vd->cpu->eat_cycles(10); // Return 0 if vblank is active if (vd->fbi.vblank) { result = 0; @@ -3965,7 +3965,7 @@ uint32_t voodoo_device::register_r(voodoo_device *vd, offs_t offset) /* return visible horizontal and vertical positions. Read by the Vegas startup sequence */ case hvRetrace: /* eat some cycles since people like polling here */ - if (EAT_CYCLES) vd->cpu->execute().eat_cycles(10); + if (EAT_CYCLES) vd->cpu->eat_cycles(10); //result = 0x200 << 16; /* should be between 0x7b and 0x267 */ //result |= 0x80; /* should be between 0x17 and 0x103 */ // Return 0 if vblank is active @@ -3985,7 +3985,7 @@ uint32_t voodoo_device::register_r(voodoo_device *vd, offs_t offset) result = vd->fbi.cmdfifo[0].rdptr; /* eat some cycles since people like polling here */ - if (EAT_CYCLES) vd->cpu->execute().eat_cycles(1000); + if (EAT_CYCLES) vd->cpu->eat_cycles(1000); break; case cmdFifoAMin: @@ -4023,7 +4023,7 @@ uint32_t voodoo_device::register_r(voodoo_device *vd, offs_t offset) /* don't log multiple identical status reads from the same address */ if (regnum == vdstatus) { - offs_t pc = vd->cpu->safe_pc(); + offs_t pc = vd->cpu->pc(); if (pc == vd->last_status_pc && result == vd->last_status_value) logit = false; vd->last_status_pc = pc; @@ -5137,9 +5137,9 @@ void voodoo_device::device_start() break; index++; } - screen = downcast<screen_device *>(machine().device(m_screen)); + screen = machine().device<screen_device>(m_screen); assert_always(screen != nullptr, "Unable to find screen attached to voodoo"); - cpu = machine().device(m_cputag); + cpu = machine().device<cpu_device>(m_cputag); assert_always(cpu != nullptr, "Unable to find CPU attached to voodoo"); if (m_tmumem1 != 0) diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h index 81a8442302a..a25508a4b6e 100644 --- a/src/devices/video/voodoo.h +++ b/src/devices/video/voodoo.h @@ -1875,7 +1875,7 @@ protected: public: uint8_t index; /* index of board */ screen_device *screen; /* the screen we are acting on */ - device_t *cpu; /* the CPU we interact with */ + cpu_device *cpu; /* the CPU we interact with */ const uint8_t vd_type; /* type of system */ uint8_t chipmask; /* mask for which chips are available */ uint32_t freq; /* operating frequency */ diff --git a/src/devices/video/zeus2.cpp b/src/devices/video/zeus2.cpp index 86492d9160c..ceddd4bd567 100644 --- a/src/devices/video/zeus2.cpp +++ b/src/devices/video/zeus2.cpp @@ -351,7 +351,7 @@ READ32_MEMBER( zeus2_device::zeus2_r ) } if (logit) - logerror("%08X:zeus2_r(%02X) = %08X\n", machine().device("maincpu")->safe_pc(), offset, result); + logerror("%s:zeus2_r(%02X) = %08X\n", machine().describe_context(), offset, result); return result; } @@ -374,7 +374,7 @@ WRITE32_MEMBER( zeus2_device::zeus2_w ) ); logit &= LOG_REGS; if (logit) - logerror("%08X:zeus2_w", machine().device("maincpu")->safe_pc()); + logerror("%s:zeus2_w", machine().describe_context()); zeus2_register32_w(offset, data, logit); } diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 55632bd4e85..b0f434197ea 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -2925,7 +2925,7 @@ void debugger_commands::execute_trackpc(int ref, const std::vector<std::string> // Insert current pc if (m_cpu.get_visible_cpu() == cpu) { - const offs_t pc = cpu->safe_pcbase(); + const offs_t pc = cpu->state().pcbase(); cpu->debug()->set_track_pc_visited(pc); } m_console.printf("PC tracking enabled\n"); diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 016d214cfa4..e2a3469ddb0 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -1741,7 +1741,7 @@ void device_debug::instruction_hook(offs_t curpc) // handle step out/over on the instruction we are about to execute if ((m_flags & (DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT)) != 0 && m_stepaddr == ~0) - prepare_for_step_overout(m_device.safe_pcbase()); + prepare_for_step_overout(m_state->pcbase()); // no longer in debugger code debugcpu.set_within_instruction(false); @@ -2776,7 +2776,7 @@ void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t addre { "0bytes", "byte", "word", "3bytes", "dword", "5bytes", "6bytes", "7bytes", "qword" }; - offs_t pc = space.device().safe_pcbase(); + offs_t pc = space.device().state().pcbase(); std::string buffer; if (type & WATCHPOINT_WRITE) @@ -2806,7 +2806,7 @@ void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t addre void device_debug::hotspot_check(address_space &space, offs_t address) { - offs_t curpc = m_device.safe_pcbase(); + offs_t curpc = m_device.state().pcbase(); // see if we have a match in our list unsigned int hotindex; @@ -2852,7 +2852,7 @@ void device_debug::hotspot_check(address_space &space, offs_t address) u64 device_debug::get_current_pc(symbol_table &table) { device_t *device = reinterpret_cast<device_t *>(table.globalref()); - return device->safe_pcbase(); + return device->state().pcbase(); } diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index dfa391bcd27..b10df8c618f 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -159,7 +159,7 @@ void debug_view_disasm::view_char(int chval) case DCH_HOME: // set the active column to the PC { const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); - offs_t pc = source.device()->safe_pcbase() & source.m_space.logaddrmask(); + offs_t pc = source.device()->state().pcbase() & source.m_space.logaddrmask(); // figure out which row the pc is on for(unsigned int curline = 0; curline < m_dasm.size(); curline++) @@ -375,7 +375,7 @@ void debug_view_disasm::view_update() { const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); debug_disasm_buffer buffer(*source.device()); - offs_t pc = source.device()->safe_pcbase() & source.m_space.logaddrmask(); + offs_t pc = source.device()->state().pcbase() & source.m_space.logaddrmask(); generate_dasm(buffer, pc); diff --git a/src/emu/device.h b/src/emu/device.h index af3cf537646..8710ae1cf10 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -535,8 +535,6 @@ public: // debugging device_debug *debug() const { return m_debug.get(); } - offs_t safe_pc() const; - offs_t safe_pcbase() const; void set_system_bios(u8 bios) { m_system_bios = bios; } bool findit(bool pre_map, bool isvalidation) const; diff --git a/src/emu/distate.h b/src/emu/distate.h index c3a044bb201..2e02c3604e7 100644 --- a/src/emu/distate.h +++ b/src/emu/distate.h @@ -253,8 +253,6 @@ public: // deliberately ambiguous functions; if you have the state interface // just use it or pc() and pcbase() directly device_state_interface &state() { return *this; } - offs_t safe_pc() { return pc(); } - offs_t safe_pcbase() { return pcbase(); } public: // protected eventually @@ -311,32 +309,4 @@ protected: // iterator typedef device_interface_iterator<device_state_interface> state_interface_iterator; - - -//************************************************************************** -// INLINE HELPERS -//************************************************************************** - -//------------------------------------------------- -// device_t::safe_pc - return the current PC -// or 0 if no state object exists -//------------------------------------------------- - -inline offs_t device_t::safe_pc() const -{ - return (m_interfaces.m_state != nullptr) ? m_interfaces.m_state->pc() : 0; -} - - -//------------------------------------------------- -// device_t::safe_pcbase - return the current PC -// base or 0 if no state object exists -//------------------------------------------------- - -inline offs_t device_t::safe_pcbase() const -{ - return (m_interfaces.m_state != nullptr) ? m_interfaces.m_state->pcbase() : 0; -} - - #endif /* MAME_EMU_DISTATE_H */ diff --git a/src/mame/audio/dkong.cpp b/src/mame/audio/dkong.cpp index 19cf417bb6e..4b58364893e 100644 --- a/src/mame/audio/dkong.cpp +++ b/src/mame/audio/dkong.cpp @@ -1241,7 +1241,7 @@ READ8_MEMBER(dkong_state::dkong_tune_r) } else { - /* printf("%s:rom access\n",machine().describe_context()); */ + /* printf("%s:rom access\n",machine().describe_context().c_str()); */ return (m_snd_rom[0x1000 + (page & 7) * 256 + offset]); } } diff --git a/src/mame/audio/harddriv.cpp b/src/mame/audio/harddriv.cpp index e4a6d9e8b3a..47bef45ab5b 100644 --- a/src/mame/audio/harddriv.cpp +++ b/src/mame/audio/harddriv.cpp @@ -91,7 +91,7 @@ void harddriv_sound_board_device::update_68k_interrupts() READ16_MEMBER(harddriv_sound_board_device::hd68k_snd_data_r) { m_soundflag = 0; - logerror("%06X:main read from sound=%04X\n", space.device().safe_pcbase(), m_sounddata); + logerror("%s:main read from sound=%04X\n", machine().describe_context(), m_sounddata); return m_sounddata; } @@ -113,7 +113,7 @@ TIMER_CALLBACK_MEMBER( harddriv_sound_board_device::delayed_68k_w ) WRITE16_MEMBER(harddriv_sound_board_device::hd68k_snd_data_w) { machine().scheduler().synchronize(timer_expired_delegate(FUNC(harddriv_sound_board_device::delayed_68k_w), this), data); - logerror("%06X:main write to sound=%04X\n", space.device().safe_pcbase(), data); + logerror("%s:main write to sound=%04X\n", machine().describe_context(), data); } @@ -123,7 +123,7 @@ WRITE16_MEMBER(harddriv_sound_board_device::hd68k_snd_reset_w) m_soundcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); m_mainflag = m_soundflag = 0; update_68k_interrupts(); - logerror("%06X:Reset sound\n", space.device().safe_pcbase()); + logerror("%s:Reset sound\n", machine().describe_context()); } @@ -138,7 +138,7 @@ READ16_MEMBER(harddriv_sound_board_device::hdsnd68k_data_r) { m_mainflag = 0; update_68k_interrupts(); - logerror("%06X:sound read from main=%04X\n", space.device().safe_pcbase(), m_maindata); + logerror("%s:sound read from main=%04X\n", machine().describe_context(), m_maindata); return m_maindata; } @@ -147,7 +147,7 @@ WRITE16_MEMBER(harddriv_sound_board_device::hdsnd68k_data_w) { COMBINE_DATA(&m_sounddata); m_soundflag = 1; - logerror("%06X:sound write to main=%04X\n", space.device().safe_pcbase(), data); + logerror("%s:sound write to main=%04X\n", machine().describe_context(), data); } @@ -160,14 +160,14 @@ WRITE16_MEMBER(harddriv_sound_board_device::hdsnd68k_data_w) READ16_MEMBER(harddriv_sound_board_device::hdsnd68k_switches_r) { - logerror("%06X:hdsnd68k_switches_r(%04X)\n", space.device().safe_pcbase(), offset); + logerror("%s:hdsnd68k_switches_r(%04X)\n", machine().describe_context(), offset); return 0; } READ16_MEMBER(harddriv_sound_board_device::hdsnd68k_320port_r) { - logerror("%06X:hdsnd68k_320port_r(%04X)\n", space.device().safe_pcbase(), offset); + logerror("%s:hdsnd68k_320port_r(%04X)\n", machine().describe_context(), offset); return 0; } @@ -179,7 +179,7 @@ READ16_MEMBER(harddriv_sound_board_device::hdsnd68k_status_r) // D14 = 'Sound Flag' // D13 = Test Switch // D12 = 5220 Ready Flag (0=Ready) - logerror("%06X:hdsnd68k_status_r(%04X)\n", space.device().safe_pcbase(), offset); + logerror("%s:hdsnd68k_status_r(%04X)\n", machine().describe_context(), offset); return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((ioport("IN0")->read() & 0x0020) << 8) | 0; } @@ -234,7 +234,7 @@ WRITE_LINE_MEMBER(harddriv_sound_board_device::led_w) WRITE16_MEMBER(harddriv_sound_board_device::hdsnd68k_speech_w) { - logerror("%06X:hdsnd68k_speech_w(%04X)=%04X\n", space.device().safe_pcbase(), offset, data); + logerror("%s:hdsnd68k_speech_w(%04X)=%04X\n", machine().describe_context(), offset, data); } @@ -281,7 +281,7 @@ READ16_MEMBER(harddriv_sound_board_device::hdsnd68k_320com_r) if (m_cramen) return m_comram[offset & 0x1ff]; - logerror("%06X:hdsnd68k_320com_r(%04X) -- not allowed\n", space.device().safe_pcbase(), offset); + logerror("%s:hdsnd68k_320com_r(%04X) -- not allowed\n", machine().describe_context(), offset); return 0xffff; } @@ -291,7 +291,7 @@ WRITE16_MEMBER(harddriv_sound_board_device::hdsnd68k_320com_w) if (m_cramen) COMBINE_DATA(&m_comram[offset & 0x1ff]); else - logerror("%06X:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", space.device().safe_pcbase(), offset, data); + logerror("%s:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", machine().describe_context(), offset, data); } @@ -336,14 +336,14 @@ WRITE16_MEMBER(harddriv_sound_board_device::hdsnddsp_dac_w) WRITE16_MEMBER(harddriv_sound_board_device::hdsnddsp_comport_w) { /* COM port TD0-7 */ - logerror("%06X:hdsnddsp_comport_w=%d\n", space.device().safe_pcbase(), data); + logerror("%s:hdsnddsp_comport_w=%d\n", machine().describe_context(), data); } WRITE16_MEMBER(harddriv_sound_board_device::hdsnddsp_mute_w) { /* mute DAC audio, D0=1 */ - logerror("%06X:mute DAC=%d\n", space.device().safe_pcbase(), data); + logerror("%s:mute DAC=%d\n", machine().describe_context(), data); } @@ -387,7 +387,7 @@ READ16_MEMBER(harddriv_sound_board_device::hdsnddsp_comram_r) READ16_MEMBER(harddriv_sound_board_device::hdsnddsp_compare_r) { - logerror("%06X:hdsnddsp_compare_r(%04X)\n", space.device().safe_pcbase(), offset); + logerror("%s:hdsnddsp_compare_r(%04X)\n", machine().describe_context(), offset); return 0; } diff --git a/src/mame/audio/hng64.cpp b/src/mame/audio/hng64.cpp index 4d6261935e9..2df7a111b3c 100644 --- a/src/mame/audio/hng64.cpp +++ b/src/mame/audio/hng64.cpp @@ -220,7 +220,7 @@ READ16_MEMBER(hng64_state::hng64_sound_port_0008_r) // but why not just use the V33/V53 XA mode?? WRITE16_MEMBER(hng64_state::hng64_sound_bank_w) { - logerror("%08x hng64_sound_bank_w? %02x %04x\n", space.device().safe_pc(), offset, data); + logerror("%s hng64_sound_bank_w? %02x %04x\n", machine().describe_context(), offset, data); // buriki writes 0x3f to 0x200 before jumping to the low addresses.. // where it expects to find data from 0x1f0000 @@ -252,18 +252,18 @@ WRITE16_MEMBER(hng64_state::hng64_sound_bank_w) WRITE16_MEMBER(hng64_state::hng64_sound_port_000a_w) { - logerror("%08x: hng64_port hng64_sound_port_000a_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); + logerror("%s: hng64_port hng64_sound_port_000a_w %04x mask (%04x)\n", machine().describe_context(), data, mem_mask); } WRITE16_MEMBER(hng64_state::hng64_sound_port_000c_w) { - logerror("%08x: hng64_port hng64_sound_port_000c_w %04x mask (%04x)\n", space.device().safe_pc(), data, mem_mask); + logerror("%s: hng64_port hng64_sound_port_000c_w %04x mask (%04x)\n", machine().describe_context(), data, mem_mask); } WRITE16_MEMBER(hng64_state::hng64_sound_port_0080_w) { - logerror("hng64_port 0x0080 %04x\n", data); + logerror("%s: hng64_port 0x0080 %04x\n", machine().describe_context(), data); } diff --git a/src/mame/audio/hyprolyb.cpp b/src/mame/audio/hyprolyb.cpp index e86905aad8f..c99d1ec05eb 100644 --- a/src/mame/audio/hyprolyb.cpp +++ b/src/mame/audio/hyprolyb.cpp @@ -23,7 +23,7 @@ hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, cons void hyprolyb_adpcm_device::device_start() { - m_space = &machine().device("audiocpu")->memory().space(AS_PROGRAM); + m_space = &machine().device<cpu_device>("audiocpu")->space(AS_PROGRAM); m_msm = machine().device<msm5205_device>("msm"); save_item(NAME(m_adpcm_ready)); // only bootlegs save_item(NAME(m_adpcm_busy)); diff --git a/src/mame/audio/jaguar.cpp b/src/mame/audio/jaguar.cpp index dd82952658d..eab65cc884c 100644 --- a/src/mame/audio/jaguar.cpp +++ b/src/mame/audio/jaguar.cpp @@ -218,7 +218,7 @@ void jaguar_state::sound_start() READ16_MEMBER( jaguar_state::jerry_regs_r ) { if (offset != JINTCTRL && offset != JINTCTRL+2) - logerror("%08X:jerry read register @ F10%03X\n", space.device().safe_pcbase(), offset * 2); + logerror("%s:jerry read register @ F10%03X\n", machine().describe_context(), offset * 2); switch (offset) { @@ -245,7 +245,7 @@ WRITE16_MEMBER( jaguar_state::jerry_regs_w ) } if (offset != JINTCTRL && offset != JINTCTRL+2 && offset != ASICTRL) - logerror("%08X:jerry write register @ F10%03X = %04X\n", space.device().safe_pcbase(), offset * 2, data); + logerror("%s:jerry write register @ F10%03X = %04X\n", machine().describe_context(), offset * 2, data); } @@ -323,7 +323,7 @@ void jaguar_state::serial_update() READ32_MEMBER( jaguar_state::serial_r ) { - logerror("%08X:jaguar_serial_r(%X)\n", space.device().safe_pcbase(), offset); + logerror("%s:jaguar_serial_r(%X)\n", machine().describe_context(), offset); return 0; } @@ -359,7 +359,7 @@ WRITE32_MEMBER( jaguar_state::serial_w ) break; default: - logerror("%08X:jaguar_serial_w(%X,%X)\n", space.device().safe_pcbase(), offset, data); + logerror("%s:jaguar_serial_w(%X,%X)\n", machine().describe_context(), offset, data); break; } } diff --git a/src/mame/audio/leland.cpp b/src/mame/audio/leland.cpp index bca2b1dd62c..4468347039c 100644 --- a/src/mame/audio/leland.cpp +++ b/src/mame/audio/leland.cpp @@ -403,12 +403,12 @@ WRITE16_MEMBER(leland_80186_sound_device::peripheral_ctrl) uint32_t temp = (m_peripheral & 0xffc0) << 4; if (data & 0x0040) { - m_audiocpu->device_t::memory().space(AS_PROGRAM).install_readwrite_handler(temp, temp + 0x2ff, read16_delegate(FUNC(leland_80186_sound_device::peripheral_r), this), write16_delegate(FUNC(leland_80186_sound_device::peripheral_w), this)); + m_audiocpu->space(AS_PROGRAM).install_readwrite_handler(temp, temp + 0x2ff, read16_delegate(FUNC(leland_80186_sound_device::peripheral_r), this), write16_delegate(FUNC(leland_80186_sound_device::peripheral_w), this)); } else { temp &= 0xffff; - m_audiocpu->device_t::memory().space(AS_IO).install_readwrite_handler(temp, temp + 0x2ff, read16_delegate(FUNC(leland_80186_sound_device::peripheral_r), this), write16_delegate(FUNC(leland_80186_sound_device::peripheral_w), this)); + m_audiocpu->space(AS_IO).install_readwrite_handler(temp, temp + 0x2ff, read16_delegate(FUNC(leland_80186_sound_device::peripheral_r), this), write16_delegate(FUNC(leland_80186_sound_device::peripheral_w), this)); } break; } @@ -434,7 +434,7 @@ WRITE8_MEMBER( leland_80186_sound_device::leland_80186_control_w ) if (LOG_COMM) { - logerror("%04X:80186 control = %02X", m_audiocpu->device_t::safe_pc(), data); + logerror("%s:80186 control = %02X", machine().describe_context(), data); if (!(data & 0x80)) logerror(" /RESET"); if (!(data & 0x40)) logerror(" ZNMI"); if (!(data & 0x20)) logerror(" INT0"); @@ -444,8 +444,8 @@ WRITE8_MEMBER( leland_80186_sound_device::leland_80186_control_w ) } /* /RESET */ - m_audiocpu->device_t::execute().set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); - m_audiocpu->device_t::execute().set_input_line(INPUT_LINE_TEST, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); + m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); + m_audiocpu->set_input_line(INPUT_LINE_TEST, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); /* /NMI */ /* If the master CPU doesn't get a response by the time it's ready to send @@ -486,7 +486,7 @@ WRITE8_MEMBER( leland_80186_sound_device::leland_80186_command_lo_w ) WRITE8_MEMBER( leland_80186_sound_device::leland_80186_command_hi_w ) { - if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", m_audiocpu->device_t::safe_pc(), data); + if (LOG_COMM) logerror("%s:Write sound command latch hi = %02X\n", machine().describe_context(), data); m_sound_command = (m_sound_command & 0x00ff) | (data << 8); } @@ -527,7 +527,7 @@ void leland_80186_sound_device::delayed_response_r(void *ptr, int param) READ8_MEMBER( leland_80186_sound_device::leland_80186_response_r ) { cpu_device *master = machine().device<cpu_device>("master"); - offs_t pc = master->device_t::safe_pcbase(); + offs_t pc = master->pcbase(); if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", pc, m_sound_response); @@ -674,7 +674,7 @@ WRITE16_MEMBER( leland_80186_sound_device::ataxx_dac_control ) break; } - logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", m_audiocpu->device_t::safe_pc(), 5, offset, data); + logerror("%s:Unexpected peripheral write %d/%02X = %02X\n", machine().describe_context(), 5, offset, data); } @@ -705,7 +705,7 @@ READ16_MEMBER( leland_80186_sound_device::peripheral_r ) return ((m_clock_active << 1) & 0x7e); case 1: - if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", m_audiocpu->device_t::safe_pc(), m_sound_command); + if (LOG_COMM) logerror("%s:Read sound command latch = %02X\n", machine().describe_context(), m_sound_command); return m_sound_command; case 2: @@ -730,11 +730,11 @@ READ16_MEMBER( leland_80186_sound_device::peripheral_r ) return m_pit2->read(space, offset & 3); } else - logerror("%05X:Unexpected peripheral read %d/%02X\n", m_audiocpu->device_t::safe_pc(), select, offset*2); + logerror("%s:Unexpected peripheral read %d/%02X\n", machine().describe_context(), select, offset*2); break; default: - logerror("%05X:Unexpected peripheral read %d/%02X\n", m_audiocpu->device_t::safe_pc(), select, offset*2); + logerror("%s:Unexpected peripheral read %d/%02X\n", machine().describe_context(), select, offset*2); break; } return 0xffff; @@ -749,7 +749,7 @@ WRITE16_MEMBER( leland_80186_sound_device::peripheral_w ) switch (select) { case 1: - if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", m_audiocpu->device_t::safe_pc(), data); + if (LOG_COMM) logerror("%s:Write sound response latch = %02X\n", machine().describe_context(), data); m_sound_response = data; break; @@ -787,7 +787,7 @@ WRITE16_MEMBER( leland_80186_sound_device::peripheral_w ) break; default: - logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", m_audiocpu->device_t::safe_pc(), select, offset, data); + logerror("%s:Unexpected peripheral write %d/%02X = %02X\n", machine().describe_context(), select, offset, data); break; } } diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp index fd886d46cd7..a8230e3f7da 100644 --- a/src/mame/audio/mario.cpp +++ b/src/mame/audio/mario.cpp @@ -418,7 +418,6 @@ void mario_state::set_ea(int ea) void mario_state::sound_start() { - device_t *audiocpu = machine().device("audiocpu"); uint8_t *SND = memregion("audiocpu")->base(); #if USE_8039 @@ -426,11 +425,11 @@ void mario_state::sound_start() #endif m_eabank = nullptr; - if (audiocpu != nullptr && audiocpu->type() != Z80) + if (m_audiocpu->type() != Z80) { m_eabank = "bank1"; - audiocpu->memory().space(AS_PROGRAM).install_read_bank(0x000, 0x7ff, "bank1"); + m_audiocpu->space(AS_PROGRAM).install_read_bank(0x000, 0x7ff, "bank1"); membank("bank1")->configure_entry(0, &SND[0]); membank("bank1")->configure_entry(1, &SND[0x1000]); @@ -448,7 +447,7 @@ void mario_state::sound_start() void mario_state::sound_reset() { - address_space &space = machine().device("audiocpu")->memory().space(AS_PROGRAM); + address_space &space = m_audiocpu->space(AS_PROGRAM); #if USE_8039 set_ea(1); diff --git a/src/mame/audio/segasnd.cpp b/src/mame/audio/segasnd.cpp index 2a97b561720..53aa78b52f5 100644 --- a/src/mame/audio/segasnd.cpp +++ b/src/mame/audio/segasnd.cpp @@ -393,7 +393,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( usb_sound_device::increment_t1_clock_timer_cb ) READ8_MEMBER( usb_sound_device::status_r ) { - LOG("%04X:usb_data_r = %02X\n", m_maincpu->safe_pc(), (m_out_latch & 0x81) | (m_in_latch & 0x7e)); + LOG("%s:usb_data_r = %02X\n", machine().describe_context(), (m_out_latch & 0x81) | (m_in_latch & 0x7e)); m_maincpu->execute().adjust_icount(-200); @@ -421,7 +421,7 @@ TIMER_CALLBACK_MEMBER( usb_sound_device::delayed_usb_data_w ) WRITE8_MEMBER( usb_sound_device::data_w ) { - LOG("%04X:usb_data_w = %02X\n", m_maincpu->safe_pc(), data); + LOG("%s:usb_data_w = %02X\n", machine().describe_context(), data); machine().scheduler().synchronize(timer_expired_delegate(FUNC(usb_sound_device::delayed_usb_data_w), this), data); /* boost the interleave so that sequences can be sent */ @@ -440,7 +440,7 @@ WRITE8_MEMBER( usb_sound_device::ram_w ) if (m_in_latch & 0x80) m_program_ram[offset] = data; else - LOG("%04X:sega_usb_ram_w(%03X) = %02X while /LOAD disabled\n", m_maincpu->safe_pc(), offset, data); + LOG("%s:sega_usb_ram_w(%03X) = %02X while /LOAD disabled\n", machine().describe_context(), offset, data); } @@ -455,7 +455,7 @@ READ8_MEMBER( usb_sound_device::p1_r ) { /* bits 0-6 are inputs and map to bits 0-6 of the input latch */ if ((m_in_latch & 0x7f) != 0) - LOG("%03X: P1 read = %02X\n", m_maincpu->safe_pc(), m_in_latch & 0x7f); + LOG("%s: P1 read = %02X\n", machine().describe_context(), m_in_latch & 0x7f); return m_in_latch & 0x7f; } @@ -464,7 +464,7 @@ WRITE8_MEMBER( usb_sound_device::p1_w ) { /* bit 7 maps to bit 0 on the output latch */ m_out_latch = (m_out_latch & 0xfe) | (data >> 7); - LOG("%03X: P1 write = %02X\n", m_maincpu->safe_pc(), data); + LOG("%s: P1 write = %02X\n", machine().describe_context(), data); } @@ -486,7 +486,7 @@ WRITE8_MEMBER( usb_sound_device::p2_w ) if ((old & 0x80) && !(data & 0x80)) m_t1_clock = 0; - LOG("%03X: P2 write -> bank=%d ready=%d clock=%d\n", m_maincpu->safe_pc(), data & 3, (data >> 6) & 1, (data >> 7) & 1); + LOG("%s: P2 write -> bank=%d ready=%d clock=%d\n", machine().describe_context(), data & 3, (data >> 6) & 1, (data >> 7) & 1); } diff --git a/src/mame/audio/snes_snd.cpp b/src/mame/audio/snes_snd.cpp index 495847ec887..9359b3778cb 100644 --- a/src/mame/audio/snes_snd.cpp +++ b/src/mame/audio/snes_snd.cpp @@ -1087,7 +1087,7 @@ READ8_MEMBER( snes_sound_device::spc_io_r ) case 0x5: /* Port 1 */ case 0x6: /* Port 2 */ case 0x7: /* Port 3 */ - // osd_printf_debug("SPC: rd %02x @ %d, %s\n", m_port_in[offset - 4], offset - 4, machine().describe_context()); + // osd_printf_debug("%s SPC: rd %02x @ %d\n", machine().describe_context().c_str(), m_port_in[offset - 4], offset - 4); return m_port_in[offset - 4]; case 0x8: //normal RAM, can be read even if the ram disabled flag ($f0 bit 1) is active case 0x9: @@ -1154,7 +1154,7 @@ WRITE8_MEMBER( snes_sound_device::spc_io_w ) case 0x5: /* Port 1 */ case 0x6: /* Port 2 */ case 0x7: /* Port 3 */ - // osd_printf_debug("SPC: %02x to APU @ %d %s\n", data, offset & 3, machine().describe_context()); + // osd_printf_debug("%s SPC: %02x to APU @ %d\n", machine().describe_context().c_str(), data, offset & 3); m_port_out[offset - 4] = data; // Unneeded, we already run at perfect_interleave // machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20)); diff --git a/src/mame/drivers/39in1.cpp b/src/mame/drivers/39in1.cpp index cefb7c079cc..5492770ed48 100644 --- a/src/mame/drivers/39in1.cpp +++ b/src/mame/drivers/39in1.cpp @@ -116,7 +116,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c vsprintf( buf, s_fmt, v ); va_end( v ); device.logerror( "%s: %s", device.machine().describe_context(), buf ); - //printf( "%s: %s", device.machine().describe_context(), buf ); + //printf( "%s: %s", device.machine().describe_context().c_str(), buf ); } } diff --git a/src/mame/drivers/4dpi.cpp b/src/mame/drivers/4dpi.cpp index f245174df69..ed3a11de476 100644 --- a/src/mame/drivers/4dpi.cpp +++ b/src/mame/drivers/4dpi.cpp @@ -68,7 +68,7 @@ inline void ATTR_PRINTF(3,4) sgi_ip6_state::verboselog( int n_level, const char va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror("%08x: %s", machine().device("maincpu")->safe_pc(), buf); + logerror("%s: %s", machine().describe_context(), buf); } #endif } diff --git a/src/mame/drivers/88games.cpp b/src/mame/drivers/88games.cpp index c2b6e4965ef..20ebb856924 100644 --- a/src/mame/drivers/88games.cpp +++ b/src/mame/drivers/88games.cpp @@ -263,7 +263,7 @@ INPUT_PORTS_END WRITE8_MEMBER( _88games_state::banking_callback ) { - logerror("%04x: bank select %02x\n", machine().device("maincpu")->safe_pc(), data); + logerror("%s: bank select %02x\n", machine().describe_context(), data); /* bits 0-2 select ROM bank for 0000-1fff */ /* bit 3: when 1, palette RAM at 1000-1fff */ diff --git a/src/mame/drivers/apollo.cpp b/src/mame/drivers/apollo.cpp index 9a272c712b4..36acbe3e8f3 100644 --- a/src/mame/drivers/apollo.cpp +++ b/src/mame/drivers/apollo.cpp @@ -139,7 +139,7 @@ const char *apollo_cpu_context(device_t *cpu) { int s = (t / osd_ticks_per_second()) % 3600; int ms = (t / (osd_ticks_per_second() / 1000)) % 1000; - sprintf(statebuf, "%d.%03d %s pc=%08x", s, ms, cpu->tag(), cpu->safe_pcbase()); + sprintf(statebuf, "%s %d.%03d", cpu->machine().describe_context().c_str(), s, ms); } else { strcpy(statebuf, "(no context)"); } diff --git a/src/mame/drivers/astrof.cpp b/src/mame/drivers/astrof.cpp index 68022aff578..195dae13a46 100644 --- a/src/mame/drivers/astrof.cpp +++ b/src/mame/drivers/astrof.cpp @@ -1379,8 +1379,8 @@ DRIVER_INIT_MEMBER(astrof_state,sstarbtl) DRIVER_INIT_MEMBER(astrof_state,acombat3) { /* set up protection handlers */ - machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); - machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0xa003, 0xa003, read8_delegate(FUNC(astrof_state::shoot_r),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0xa004, 0xa004, read8_delegate(FUNC(astrof_state::abattle_coin_prot_r),this)); } diff --git a/src/mame/drivers/atarigt.cpp b/src/mame/drivers/atarigt.cpp index 2a38b9c7038..8d11d511afc 100644 --- a/src/mame/drivers/atarigt.cpp +++ b/src/mame/drivers/atarigt.cpp @@ -287,7 +287,7 @@ void atarigt_state::tmek_protection_w(address_space &space, offs_t offset, uint1 Read ($38488) */ - if (LOG_PROTECTION) logerror("%06X:Protection W@%06X = %04X\n", space.device().safe_pcbase(), offset, data); + if (LOG_PROTECTION) logerror("%s:Protection W@%06X = %04X\n", machine().describe_context(), offset, data); /* track accesses */ tmek_update_mode(offset); @@ -302,7 +302,7 @@ void atarigt_state::tmek_protection_w(address_space &space, offs_t offset, uint1 void atarigt_state::tmek_protection_r(address_space &space, offs_t offset, uint16_t *data) { - if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", space.device().safe_pcbase(), offset); + if (LOG_PROTECTION) logerror("%s:Protection R@%06X\n", machine().describe_context(), offset); /* track accesses */ tmek_update_mode(offset); @@ -368,7 +368,7 @@ void atarigt_state::primrage_protection_w(address_space &space, offs_t offset, u { if (LOG_PROTECTION) { - uint32_t pc = space.device().safe_pcbase(); + uint32_t pc = m_maincpu->pcbase(); switch (pc) { /* protection code from 20f90 - 21000 */ @@ -401,7 +401,7 @@ void atarigt_state::primrage_protection_w(address_space &space, offs_t offset, u /* catch anything else */ default: - logerror("%06X:Unknown protection W@%06X = %04X\n", space.device().safe_pcbase(), offset, data); + logerror("%s:Unknown protection W@%06X = %04X\n", machine().describe_context(), offset, data); break; } } @@ -441,7 +441,7 @@ void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, u if (LOG_PROTECTION) { - uint32_t pc = space.device().safe_pcbase(); + uint32_t pc = m_maincpu->pcbase(); uint32_t p1, p2, a6; switch (pc) { @@ -504,7 +504,7 @@ if (LOG_PROTECTION) /* catch anything else */ default: - logerror("%06X:Unknown protection R@%06X\n", space.device().safe_pcbase(), offset); + logerror("%s:Unknown protection R@%06X\n", machine().describe_context(), offset); break; } } diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp index 0028fb99e85..293f61a2f1f 100644 --- a/src/mame/drivers/atlantis.cpp +++ b/src/mame/drivers/atlantis.cpp @@ -193,25 +193,25 @@ public: READ8_MEMBER(atlantis_state::parallel_r) { uint8_t result = 0x7; - logerror("%06X: parallel_r %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, result); + logerror("%s: parallel_r %08x = %02x\n", machine().describe_context(), offset, result); return result; } WRITE8_MEMBER(atlantis_state::parallel_w) { - logerror("%06X: parallel_w %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: parallel_w %08x = %02x\n", machine().describe_context(), offset, data); } // Expansion ROM READ8_MEMBER (atlantis_state::exprom_r) { - logerror("%06X: exprom_r %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, 0xff); + logerror("%s: exprom_r %08x = %02x\n", machine().describe_context(), offset, 0xff); return 0xff; } WRITE8_MEMBER(atlantis_state::exprom_w) { - logerror("%06X: exprom_w %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: exprom_w %08x = %02x\n", machine().describe_context(), offset, data); } // Board PLD @@ -319,7 +319,7 @@ WRITE32_MEMBER(atlantis_state::board_ctrl_w) case 0xbf: digit = '|'; break; case 0xfe: digit = '-'; break; case 0xff: digit = 'Z'; break; - if (0) logerror("%06X: status_leds_w digit: %c %08x = %02x\n", machine().device("maincpu")->safe_pc(), digit, offset, data); + if (0) logerror("%s: status_leds_w digit: %c %08x = %02x\n", machine().describe_context(), digit, offset, data); } } break; @@ -355,7 +355,7 @@ WRITE8_MEMBER(atlantis_state::cmos_w) if (offset == 0 && (m_user_io_state & 0x1)) { // Data written is shifted by 1 bit each time. Maybe a serial line output? if (LOG_RTC && m_serial_count == 0) - logerror("%06X: cmos_w[0] start serial %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: cmos_w[0] start serial %08x = %02x\n", machine().describe_context(), offset, data); m_serial_count++; if (m_serial_count == 8) m_serial_count = 0; diff --git a/src/mame/drivers/bfcobra.cpp b/src/mame/drivers/bfcobra.cpp index 8a6768fea69..4099bf49981 100644 --- a/src/mame/drivers/bfcobra.cpp +++ b/src/mame/drivers/bfcobra.cpp @@ -495,7 +495,7 @@ void bfcobra_state::RunBlit(address_space &space) /* This debug is now wrong ! */ if (DEBUG_BLITTER) { - osd_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", device->machine().describe_context(), blitter.program.addr - 12); + osd_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", device->machine().describe_context().c_str(), blitter.program.addr - 12); osd_printf_debug("Command Reg %.2x", blitter.command); osd_printf_debug(" %s %s %s %s %s %s %s\n", blitter.command & CMD_RUN ? "RUN" : " ", diff --git a/src/mame/drivers/calchase.cpp b/src/mame/drivers/calchase.cpp index a752ec6e107..672929b5b47 100644 --- a/src/mame/drivers/calchase.cpp +++ b/src/mame/drivers/calchase.cpp @@ -200,7 +200,7 @@ uint8_t calchase_state::mtxc_config_r(int function, int reg) void calchase_state::mtxc_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); /* memory banking with North Bridge: @@ -294,7 +294,7 @@ uint8_t calchase_state::piix4_config_r(int function, int reg) void calchase_state::piix4_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); m_piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/camplynx.cpp b/src/mame/drivers/camplynx.cpp index 8aaa1986eea..ae72292761d 100644 --- a/src/mame/drivers/camplynx.cpp +++ b/src/mame/drivers/camplynx.cpp @@ -245,7 +245,7 @@ d7 = read from bank 4 */ m_bankdata = data; data ^= 0x31; // make all lines active high -//printf("%s:%X\n", machine().describe_context(), data); +//printf("%s:%X\n", machine().describe_context().c_str(), data); // do writes m_wbyte = (data & 0x0f) | ((m_port80 & 0x0c) << 3); // do reads @@ -371,7 +371,7 @@ d0 = read from bank 4 */ uint8_t rbyte = bitswap<8>(data, 0, 0, 0, 0, 0, 1, 2, 3) & 0x0f; // rearrange to 0,1,2,4 if (BIT(rbyte, 1)) rbyte &= 0x07; // remove 4 if 1 selected (AND gate in IC82) -//printf("%s:%X:%X:%X\n", machine().describe_context(), data, rbyte, m_wbyte); +//printf("%s:%X:%X:%X\n", machine().describe_context().c_str(), data, rbyte, m_wbyte); switch (rbyte) { case 0x00: diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index 16d5b99c469..baa6f7d3493 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -1169,19 +1169,7 @@ void cobra_fifo::push(const device_t *cpu, uint64_t data) { if (m_verbose) { - char accessor_location[50]; - if (cpu != nullptr) - { - // cpu has a name and a PC - sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc()); - } - else - { - // non-cpu - sprintf(accessor_location, "(non-cpu)"); - } - - printf("%s: push %08X%08X (%d) at %s\n", m_name, (uint32_t)(data >> 32), (uint32_t)(data), m_num, accessor_location); + printf("%s %s: push %08X%08X (%d)\n", cpu->machine().describe_context().c_str(), m_name, (uint32_t)(data >> 32), (uint32_t)(data), m_num); } if (m_num == m_size) @@ -1189,19 +1177,7 @@ void cobra_fifo::push(const device_t *cpu, uint64_t data) if (m_verbose) { int i, j; - char accessor_location[50]; - if (cpu != nullptr) - { - // cpu has a name and a PC - sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc()); - } - else - { - // non-cpu - sprintf(accessor_location, "(non-cpu)"); - } - - printf("%s overflow at %s\n", m_name, accessor_location); + printf("%s %s overflow\n", cpu->machine().describe_context().c_str(), m_name); printf("%s dump:\n", m_name); for (j=0; j < 128; j+=4) @@ -1246,19 +1222,7 @@ bool cobra_fifo::pop(const device_t *cpu, uint64_t *result) { if (m_verbose) { - char accessor_location[50]; - if (cpu != nullptr) - { - // cpu has a name and a PC - sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc()); - } - else - { - // non-cpu - sprintf(accessor_location, "(non-cpu)"); - } - - printf("%s underflow at %s\n", m_name, accessor_location); + printf("%s %s underflow\n", cpu->machine().describe_context().c_str(), m_name); } return false; } @@ -1267,19 +1231,7 @@ bool cobra_fifo::pop(const device_t *cpu, uint64_t *result) if (m_verbose) { - char accessor_location[50]; - if (cpu != nullptr) - { - // cpu has a name and a PC - sprintf(accessor_location, "(%s) %08X", cpu->tag(), const_cast<device_t *>(cpu)->safe_pc()); - } - else - { - // non-cpu - sprintf(accessor_location, "(non-cpu)"); - } - - printf("%s: pop %08X%08X (%d) at %s\n", m_name, (uint32_t)(r >> 32), (uint32_t)(r), m_num-1, accessor_location); + printf("%s %s: pop %08X%08X (%d)\n", cpu->machine().describe_context().c_str(), m_name, (uint32_t)(r >> 32), (uint32_t)(r), m_num-1); } m_rpos++; diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp index d544fa6fafe..5e2eb44038b 100644 --- a/src/mame/drivers/cps3.cpp +++ b/src/mame/drivers/cps3.cpp @@ -2440,7 +2440,7 @@ SH2_DMA_KLUDGE_CB(cps3_state::dma_callback) } else { - //printf("%s :src %08x, dst %08x, returning %08x\n", machine().describe_context(), src, dst, data); + //printf("%s :src %08x, dst %08x, returning %08x\n", machine().describe_context().c_str(), src, dst, data); } /* I doubt this is endian safe.. needs checking / fixing */ diff --git a/src/mame/drivers/craft.cpp b/src/mame/drivers/craft.cpp index 3228365e81b..ec81337ac0f 100644 --- a/src/mame/drivers/craft.cpp +++ b/src/mame/drivers/craft.cpp @@ -83,7 +83,7 @@ inline void craft_state::verboselog(int n_level, const char *s_fmt, ...) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%08x: %s", m_maincpu->safe_pc(), buf ); + logerror( "%s: %s", machine().describe_context(), buf ); } #endif } diff --git a/src/mame/drivers/crystal.cpp b/src/mame/drivers/crystal.cpp index d8494ec7e5f..eca562f6d6f 100644 --- a/src/mame/drivers/crystal.cpp +++ b/src/mame/drivers/crystal.cpp @@ -421,7 +421,7 @@ WRITE32_MEMBER(crystal_state::IntAck_w) IRQ_CALLBACK_MEMBER(crystal_state::icallback) { - address_space &space = device.memory().space(AS_PROGRAM); + address_space &space = m_maincpu->space(AS_PROGRAM); uint32_t IntPend = space.read_dword(0x01800c0c); int i; diff --git a/src/mame/drivers/darius.cpp b/src/mame/drivers/darius.cpp index 5f3aefc5598..95955651ad1 100644 --- a/src/mame/drivers/darius.cpp +++ b/src/mame/drivers/darius.cpp @@ -455,7 +455,7 @@ WRITE_LINE_MEMBER(darius_state::darius_adpcm_int) READ8_MEMBER(darius_state::adpcm_command_read) { - /* logerror("read port 0: %02x PC=%4x\n",adpcm_command, space.device().safe_pc() ); */ + /* logerror("%s read port 0: %02x\n", machine().describe_context(), adpcm_command ); */ return m_adpcm_command; } @@ -472,13 +472,13 @@ READ8_MEMBER(darius_state::readport3) WRITE8_MEMBER(darius_state::adpcm_nmi_disable) { m_nmi_enable = 0; - /* logerror("write port 0: NMI DISABLE PC=%4x\n", data, space.device().safe_pc() ); */ + /* logerror("%s write port 0: NMI DISABLE\n", machine().describe_context(), data ); */ } WRITE8_MEMBER(darius_state::adpcm_nmi_enable) { m_nmi_enable = 1; - /* logerror("write port 1: NMI ENABLE PC=%4x\n", space.device().safe_pc() ); */ + /* logerror("%s write port 1: NMI ENABLE\n", machine().describe_context() ); */ } WRITE8_MEMBER(darius_state::adpcm_data_w) diff --git a/src/mame/drivers/dkong.cpp b/src/mame/drivers/dkong.cpp index 486761b11d3..7a3fb34c4e1 100644 --- a/src/mame/drivers/dkong.cpp +++ b/src/mame/drivers/dkong.cpp @@ -685,7 +685,7 @@ WRITE8_MEMBER(dkong_state::s2650_data_w) WRITE_LINE_MEMBER(dkong_state::s2650_fo_w) { #if DEBUG_PROTECTION - logerror("write : pc = %04x, FO = %02x\n",space.device().safe_pc(), data); + logerror("%s write : FO = %02x\n", machine().describe_context(), data); #endif m_main_fo = state; diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp index 125eaf3100a..90f0f4020e5 100644 --- a/src/mame/drivers/eolith.cpp +++ b/src/mame/drivers/eolith.cpp @@ -1599,7 +1599,7 @@ void eolith_state::speedup_read() { /* for debug */ //if ((m_maincpu->pc()!=m_speedup_address) && (m_speedup_vblank!=1) ) - // printf("%s:eolith speedup_read data %02x\n",machine().describe_context(), m_speedup_vblank); + // printf("%s:eolith speedup_read data %02x\n",machine().describe_context().c_str(), m_speedup_vblank); if (m_speedup_vblank==0 && m_speedup_scanline < m_speedup_resume_scanline) { diff --git a/src/mame/drivers/esq1.cpp b/src/mame/drivers/esq1.cpp index 33e657ba3a0..2297bcb825b 100644 --- a/src/mame/drivers/esq1.cpp +++ b/src/mame/drivers/esq1.cpp @@ -547,7 +547,7 @@ WRITE8_MEMBER(esq1_state::duart_output) { int bank = ((data >> 1) & 0x7); // printf("DP [%02x]: %d mlo %d mhi %d tape %d\n", data, data&1, (data>>4)&1, (data>>5)&1, (data>>6)&3); -// printf("[%02x] bank %d => offset %x (PC=%x)\n", data, bank, bank * 0x1000, m_maincpu->safe_pc()); +// printf("%s [%02x] bank %d => offset %x\n", machine().describe_context().c_str(), data, bank, bank * 0x1000); membank("osbank")->set_base(memregion("osrom")->base() + (bank * 0x1000) ); m_seq_bank = (data & 0x8) ? 0x8000 : 0x0000; diff --git a/src/mame/drivers/galpani2.cpp b/src/mame/drivers/galpani2.cpp index e336569e8e0..f04d87a182c 100644 --- a/src/mame/drivers/galpani2.cpp +++ b/src/mame/drivers/galpani2.cpp @@ -143,9 +143,9 @@ void galpani2_state::machine_reset() machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); //initial mcu xchk } -static void galpani2_write_kaneko(device_t *device) +static void galpani2_write_kaneko(cpu_device *cpu) { - address_space &dstspace = device->memory().space(AS_PROGRAM); + address_space &dstspace = cpu->space(AS_PROGRAM); int i,x,tpattidx; unsigned char testpattern[] = {0xFF,0x55,0xAA,0xDD,0xBB,0x99}; diff --git a/src/mame/drivers/gts3.cpp b/src/mame/drivers/gts3.cpp index 7e6ea28bafd..fdd842265fa 100644 --- a/src/mame/drivers/gts3.cpp +++ b/src/mame/drivers/gts3.cpp @@ -255,7 +255,7 @@ WRITE8_MEMBER( gts3_state::u4b_w ) m_lampclk = clk_bit; -// printf("B=%s=%X ",machine().describe_context(),data&0xe0); +// printf("%s B=%X ",machine().describe_context().c_str(),data&0xe0); } READ8_MEMBER( gts3_state::u4a_r ) diff --git a/src/mame/drivers/gts3a.cpp b/src/mame/drivers/gts3a.cpp index af5d17210a5..fe3ce919bee 100644 --- a/src/mame/drivers/gts3a.cpp +++ b/src/mame/drivers/gts3a.cpp @@ -268,7 +268,7 @@ WRITE8_MEMBER( gts3a_state::u4b_w ) m_lampclk = clk_bit; -// printf("B=%s=%X ",machine().describe_context(),data&0xe0); +// printf("%s B=%X ",machine().describe_context().c_str(),data&0xe0); } READ8_MEMBER( gts3a_state::u4a_r ) diff --git a/src/mame/drivers/gts80.cpp b/src/mame/drivers/gts80.cpp index 5ee2f60b165..0858ca32f6a 100644 --- a/src/mame/drivers/gts80.cpp +++ b/src/mame/drivers/gts80.cpp @@ -325,7 +325,7 @@ WRITE8_MEMBER( gts80_state::port2a_w ) //d0-3 bcd data; d4-6 = centre segment; d7 = dipsw enable WRITE8_MEMBER( gts80_state::port2b_w ) { - m_segment = data;//printf("%s:%X ",machine().describe_context(),data); + m_segment = data;//printf("%s:%X ",machine().describe_context().c_str(),data); } // solenoids diff --git a/src/mame/drivers/gts80a.cpp b/src/mame/drivers/gts80a.cpp index 504044b5ef6..a8586f37d42 100644 --- a/src/mame/drivers/gts80a.cpp +++ b/src/mame/drivers/gts80a.cpp @@ -315,7 +315,7 @@ WRITE8_MEMBER( gts80a_state::port2a_w ) //d0-3 bcd data; d4-6 = centre segment; d7 = dipsw enable WRITE8_MEMBER( gts80a_state::port2b_w ) { - m_segment = data;//printf("%s:%X ",machine().describe_context(),data); + m_segment = data;//printf("%s:%X ",machine().describe_context().c_str(),data); } // solenoids diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp index 48e0d38ba35..c6b721195b6 100644 --- a/src/mame/drivers/halleys.cpp +++ b/src/mame/drivers/halleys.cpp @@ -392,7 +392,7 @@ void halleys_state::blit(int offset) #if HALLEYS_DEBUG if (0) { - logerror("%s:[%04x]", machine.describe_context(), offset); + logerror("%s:[%04x]", machine().describe_context(), offset); for (ecx=0; ecx<16; ecx++) logerror(" %02x", param[ecx]); logerror("\n"); } diff --git a/src/mame/drivers/indy_indigo2.cpp b/src/mame/drivers/indy_indigo2.cpp index 3c8219fd08e..88f1a43a8d1 100644 --- a/src/mame/drivers/indy_indigo2.cpp +++ b/src/mame/drivers/indy_indigo2.cpp @@ -1333,8 +1333,7 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq) dump_chain(space, m_hpc3.m_scsi0_desc); - printf("PC is %08x\n", machine.device("maincpu")->safe_pc()); - printf("DMA to device: length %x xie %d eox %d\n", length, xie, eox); + printf("%s DMA to device: length %x xie %d eox %d\n", machine().describe_context().c_str(), length, xie, eox); if (length <= 0x4000) { diff --git a/src/mame/drivers/iris3130.cpp b/src/mame/drivers/iris3130.cpp index b9cafd0f827..05f8148b24a 100644 --- a/src/mame/drivers/iris3130.cpp +++ b/src/mame/drivers/iris3130.cpp @@ -131,7 +131,7 @@ inline void ATTR_PRINTF(3,4) sgi_ip2_state::verboselog( int n_level, const char va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror("%08x: %s", machine().device("maincpu")->safe_pc(), buf); + logerror("%s: %s", machine().describe_context(), buf); } #endif } diff --git a/src/mame/drivers/kenseim.cpp b/src/mame/drivers/kenseim.cpp index 0d2a8e44360..74e42a8cd68 100644 --- a/src/mame/drivers/kenseim.cpp +++ b/src/mame/drivers/kenseim.cpp @@ -271,7 +271,7 @@ WRITE8_MEMBER(kenseim_state::mb8936_portc_w) { // I'm guessing these are the 20 'power meter' LEDs, 10 for each player? (it writes 42 times, with the last write being some terminator?) -// printf("%s mb8936 write %02x to port C but no handler assigned (serial data?)\n", machine().describe_context(), data); +// printf("%s mb8936 write %02x to port C but no handler assigned (serial data?)\n", machine().describe_context().c_str(), data); if (data & 0x08) { @@ -306,7 +306,7 @@ WRITE8_MEMBER(kenseim_state::mb8936_portc_w) WRITE8_MEMBER(kenseim_state::mb8936_porta_w) // maybe molesa output? (6-bits?) { - //if (data&0xc0) printf("%s mb8936 write %02x to port A (mole output 1?)\n", machine().describe_context(), data); + //if (data&0xc0) printf("%s mb8936 write %02x to port A (mole output 1?)\n", machine().describe_context().c_str(), data); for (int i = 0; i < 6; i++) @@ -325,7 +325,7 @@ WRITE8_MEMBER(kenseim_state::mb8936_porta_w) // maybe molesa output? (6-bits?) WRITE8_MEMBER(kenseim_state::mb8936_portb_w) // maybe molesb output? (6-bits?) { - //if (data&0xc0) printf("%s mb8936 write %02x to port B (mole output 2?)\n", machine().describe_context(), data); + //if (data&0xc0) printf("%s mb8936 write %02x to port B (mole output 2?)\n", machine().describe_context().c_str(), data); for (int i = 0; i < 6; i++) { @@ -344,7 +344,7 @@ WRITE8_MEMBER(kenseim_state::mb8936_portb_w) // maybe molesb output? (6-bits?) WRITE8_MEMBER(kenseim_state::mb8936_portf_w) { // typically written when the 'moles' output is, maybe the 2 strobes? - //printf("%s mb8936 write %02x to port F (strobe?)\n", machine().describe_context(), data); + //printf("%s mb8936 write %02x to port F (strobe?)\n", machine().describe_context().c_str(), data); } diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp index dd66aed59a6..520205762a3 100644 --- a/src/mame/drivers/mac.cpp +++ b/src/mame/drivers/mac.cpp @@ -260,7 +260,7 @@ READ8_MEMBER ( mac_state::mac_rbv_r ) { data &= ~0x38; data |= (m_montype.read_safe(2)<<3); -// printf("rbv_r montype: %02x (PC %x)\n", data, space.cpu->safe_pc()); +// printf("%s rbv_r montype: %02x\n", machine().describe_context().c_str(), data); } // bit 7 of these registers always reads as 0 on RBV diff --git a/src/mame/drivers/mac128.cpp b/src/mame/drivers/mac128.cpp index ac157b18170..f88b5cd190d 100644 --- a/src/mame/drivers/mac128.cpp +++ b/src/mame/drivers/mac128.cpp @@ -737,7 +737,7 @@ READ8_MEMBER(mac128_state::mac_via_in_b) val |= m_rtc->data_r(); -// printf("VIA1 IN_B = %02x (PC %x)\n", val, m_maincpu->safe_pc()); +// printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val); return val; } @@ -745,7 +745,7 @@ READ8_MEMBER(mac128_state::mac_via_in_b) WRITE8_MEMBER(mac128_state::mac_via_out_a) { device_t *fdc = machine().device("fdc"); -// printf("VIA1 OUT A: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT A: %02x (PC %x)\n", machine().describe_context().c_str(), data); //set_scc_waitrequest((data & 0x80) >> 7); m_screen_buffer = (data & 0x40) >> 6; @@ -767,7 +767,7 @@ WRITE8_MEMBER(mac128_state::mac_via_out_a) WRITE8_MEMBER(mac128_state::mac_via_out_b) { -// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); m_snd_enable = ((data & 0x80) == 0) ? true : false; update_volume(); diff --git a/src/mame/drivers/malzak.cpp b/src/mame/drivers/malzak.cpp index 505cf3bc2c1..200afe9963a 100644 --- a/src/mame/drivers/malzak.cpp +++ b/src/mame/drivers/malzak.cpp @@ -156,7 +156,7 @@ WRITE8_MEMBER(malzak_state::port40_w) // Bits 1-3 are all set high upon death, until the game continues // Bit 6 is used only in Malzak II, and is set high after checking // the selected version -// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", m_maincpu->safe_pc(), data); +// logerror("%s S2650: port 0x40 write: 0x%02x\n", machine().describe_context(), data); membank("bank1")->set_entry((data & 0x40) >> 6); } diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp index b0201255005..88cdef56dfe 100644 --- a/src/mame/drivers/mediagx.cpp +++ b/src/mame/drivers/mediagx.cpp @@ -931,7 +931,7 @@ void mediagx_state::init_mediagx() uint32_t mediagx_state::generic_speedup(address_space &space, int idx) { - if (space.device().safe_pc() == m_speedup_table[idx].pc) + if (m_maincpu->pc() == m_speedup_table[idx].pc) { m_speedup_hits[idx]++; space.device().execute().spin_until_interrupt(); diff --git a/src/mame/drivers/model3.cpp b/src/mame/drivers/model3.cpp index 575877d4a96..03226ea2d5b 100644 --- a/src/mame/drivers/model3.cpp +++ b/src/mame/drivers/model3.cpp @@ -1254,7 +1254,7 @@ LSI53C810_DMA_CB(model3_state::real3d_dma_callback) case 0x9c: /* Unknown */ break; default: - logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, machine().device("maincpu")->safe_pc()); + logerror("%s dma_callback: %08X, %08X, %d at %08X", machine().describe_context(), src, dst, length); break; } } @@ -1517,7 +1517,7 @@ WRITE64_MEMBER(model3_state::model3_ctrl_w) } break; default: - //osd_printf_debug("Lightgun: Unknown command %02X %s\n", (uint32_t)(data >> 24), machine().describe_context()); + //osd_printf_debug("%s Lightgun: Unknown command %02X\n", machine().describe_context().c_str(), (uint32_t)(data >> 24)); break; } } @@ -1544,7 +1544,7 @@ WRITE64_MEMBER(model3_state::model3_ctrl_w) READ64_MEMBER(model3_state::model3_sys_r) { -// printf("model3_sys_r: mask %llx @ %x %s\n", mem_mask, offset, machine().describe_context()); +// printf("%s model3_sys_r: mask %llx @ %x\n", machine().describe_context().c_str(), mem_mask, offset); switch (offset) { @@ -1569,7 +1569,7 @@ READ64_MEMBER(model3_state::model3_sys_r) else logerror("m3_sys: Unk sys_r @ 0x10: mask = %x\n", (uint32_t)mem_mask); break; case 0x18/8: -// printf("read irq_state %x %s\n", m_irq_state, machine().describe_context()); +// printf("%s read irq_state %x\n", machine().describe_context().c_str(), m_irq_state); return (uint64_t)m_irq_state<<56 | 0xff000000; } diff --git a/src/mame/drivers/namcona1.cpp b/src/mame/drivers/namcona1.cpp index de83625a057..dde78db24eb 100644 --- a/src/mame/drivers/namcona1.cpp +++ b/src/mame/drivers/namcona1.cpp @@ -452,7 +452,7 @@ void namcona1_state::blit() (void)src0; /* logerror( "%s: blt(%08x,%08x,numBytes=%04x);src=%04x %04x %04x; dst=%04x %04x %04x; gfx=%04x\n", - machine.describe_context(), + machine().describe_context(), dst_baseaddr,src_baseaddr,num_bytes, src0,src1,src2, dst0,dst1,dst2, diff --git a/src/mame/drivers/namcos21.cpp b/src/mame/drivers/namcos21.cpp index a98dfe278c8..6350861fa72 100644 --- a/src/mame/drivers/namcos21.cpp +++ b/src/mame/drivers/namcos21.cpp @@ -1149,9 +1149,8 @@ WRITE16_MEMBER(namcos21_state::pointram_control_w) /* m_pointram_control&0x20 : bank for depthcue data */ #if 0 - logerror( "dsp_control_w:'%s':%x[%x]:=%04x ", - cpu->tag, - cpu->safe_pc(), + logerror( "%s dsp_control_w:[%x]:=%04x ", + machine().describe_context(), offset, m_pointram_control ); diff --git a/src/mame/drivers/neoprint.cpp b/src/mame/drivers/neoprint.cpp index db7c9ffcd09..9fdd574447b 100644 --- a/src/mame/drivers/neoprint.cpp +++ b/src/mame/drivers/neoprint.cpp @@ -191,7 +191,7 @@ READ8_MEMBER(neoprint_state::neoprint_unk_r) m_vblank = (m_screen->frame_number() & 0x1) ? 0x10 : 0x00; - //if(m_maincpu->pc() != 0x1504 && m_maincpu->pc() != 0x5f86 && m_machine->safe_pc() != 0x5f90) + //if(m_maincpu->pc() != 0x1504 && m_maincpu->pc() != 0x5f86 && m_maincpu->pc() != 0x5f90) // printf("%08x\n",m_maincpu->pc()); return m_vblank| 4 | 3; diff --git a/src/mame/drivers/nyny.cpp b/src/mame/drivers/nyny.cpp index ef335ef75b8..e020eee411a 100644 --- a/src/mame/drivers/nyny.cpp +++ b/src/mame/drivers/nyny.cpp @@ -383,7 +383,7 @@ WRITE8_MEMBER(nyny_state::nyny_ay8910_37_port_a_w) { /* not sure what this does */ - /*logerror("%x PORT A write %x at Y=%x X=%x\n", space.device().safe_pc(), data, m_screen->vpos(), m_screen->hpos());*/ + /*logerror("%s PORT A write %x at Y=%x X=%x\n", machine().describe_context(), data, m_screen->vpos(), m_screen->hpos());*/ } /************************************* diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp index efe9107238a..39b541642b8 100644 --- a/src/mame/drivers/overdriv.cpp +++ b/src/mame/drivers/overdriv.cpp @@ -60,7 +60,7 @@ static const uint16_t overdriv_default_eeprom[64] = WRITE16_MEMBER(overdriv_state::eeprom_w) { -//logerror("%s: write %04x to eeprom_w\n",machine.describe_context(),data); +//logerror("%s: write %04x to eeprom_w\n",machine().describe_context(),data); if (ACCESSING_BITS_0_7) { /* bit 0 is data */ diff --git a/src/mame/drivers/parodius.cpp b/src/mame/drivers/parodius.cpp index 8c42ee3e773..e70b183e791 100644 --- a/src/mame/drivers/parodius.cpp +++ b/src/mame/drivers/parodius.cpp @@ -223,7 +223,7 @@ void parodius_state::machine_reset() WRITE8_MEMBER( parodius_state::banking_callback ) { if (data & 0xf0) - logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), data); + logerror("%s: setlines %02x\n", machine().describe_context(), data); membank("bank1")->set_entry((data & 0x0f) ^ 0x0f); } diff --git a/src/mame/drivers/pirates.cpp b/src/mame/drivers/pirates.cpp index bf58e431489..8b968563611 100644 --- a/src/mame/drivers/pirates.cpp +++ b/src/mame/drivers/pirates.cpp @@ -130,7 +130,7 @@ CUSTOM_INPUT_MEMBER(pirates_state::prot_r) 602e and 62a6 */ /* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */ - pc = machine().device("main")->safe_pc(); + pc = m_maincpu->pc(); if (pc == 0x6134) { bit = prot & 1; diff --git a/src/mame/drivers/psikyo.cpp b/src/mame/drivers/psikyo.cpp index 61cb9ff425a..9914a999ab0 100644 --- a/src/mame/drivers/psikyo.cpp +++ b/src/mame/drivers/psikyo.cpp @@ -458,7 +458,7 @@ CUSTOM_INPUT_MEMBER(psikyo_state::z80_nmi_r) /* main CPU might be waiting for sound CPU to finish NMI, so set a timer to give sound CPU a chance to run */ machine().scheduler().synchronize(); -// logerror("%s - Read coin port during Z80 NMI\n", machine.describe_context()); +// logerror("%s - Read coin port during Z80 NMI\n", machine().describe_context()); } return ret; diff --git a/src/mame/drivers/queen.cpp b/src/mame/drivers/queen.cpp index 1731e143ed5..a12d1719694 100644 --- a/src/mame/drivers/queen.cpp +++ b/src/mame/drivers/queen.cpp @@ -174,7 +174,7 @@ uint8_t queen_state::piix4_config_r(int function, int reg) void queen_state::piix4_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); m_piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/savquest.cpp b/src/mame/drivers/savquest.cpp index 6414f74ac33..2f31185b4b7 100644 --- a/src/mame/drivers/savquest.cpp +++ b/src/mame/drivers/savquest.cpp @@ -156,7 +156,7 @@ uint8_t savquest_state::mtxc_config_r(int function, int reg) void savquest_state::mtxc_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); #if 1 switch(reg) @@ -299,7 +299,7 @@ uint8_t savquest_state::piix4_config_r(int function, int reg) void savquest_state::piix4_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); m_piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/segald.cpp b/src/mame/drivers/segald.cpp index 9cfd3e6ef59..6cd988930b5 100644 --- a/src/mame/drivers/segald.cpp +++ b/src/mame/drivers/segald.cpp @@ -240,7 +240,7 @@ WRITE8_MEMBER(segald_state::astron_COLOR_write) WRITE8_MEMBER(segald_state::astron_FIX_write) { m_fix_ram[offset] = data; - /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, space.device().safe_pc()); */ + /* logerror("%s FIX write : 0x%04x [0x%x]\n", machine().describe_context(), data, offset); */ } WRITE8_MEMBER(segald_state::astron_io_bankswitch_w) diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index cda8f69aaa6..1c2b49291b3 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -1415,8 +1415,8 @@ void seta_state::uPD71054_update_timer(device_t *cpu, int no) uPD71054->timer[no]->adjust( period, no ); } else { uPD71054->timer[no]->adjust( attotime::never, no); - logerror( "CPU #0 PC %06X: uPD71054 error, timer %d duration is 0\n", - (cpu != nullptr) ? cpu->safe_pc() : -1, no ); + logerror( "%s: uPD71054 error, timer %d duration is 0\n", + machine().describe_context(), no ); } } diff --git a/src/mame/drivers/sothello.cpp b/src/mame/drivers/sothello.cpp index 18d11a2c99a..5b13d7ad3f4 100644 --- a/src/mame/drivers/sothello.cpp +++ b/src/mame/drivers/sothello.cpp @@ -252,7 +252,7 @@ void sothello_state::unlock_shared_ram() } else { - //logerror("Sub cpu active! @%x\n",device().safe_pc()); + //logerror("%s Sub cpu active!\n",machine().describe_context()); } } diff --git a/src/mame/drivers/squale.cpp b/src/mame/drivers/squale.cpp index 8b84f145420..6fa00ec6102 100644 --- a/src/mame/drivers/squale.cpp +++ b/src/mame/drivers/squale.cpp @@ -246,7 +246,7 @@ WRITE8_MEMBER( squale_state::fdc_sel0_w ) floppy_image_device *floppy = 0; #ifdef DBGMODE - printf("%s: write fdc_sel0_w reg : 0x%X\n",machine().describe_context(),data); + printf("%s: write fdc_sel0_w reg : 0x%X\n",machine().describe_context().c_str(),data); #endif fdc_sel0 = data; @@ -292,7 +292,7 @@ WRITE8_MEMBER( squale_state::fdc_sel0_w ) WRITE8_MEMBER( squale_state::fdc_sel1_w ) { #ifdef DBGMODE - printf("%s: write fdc_sel1_w reg : 0x%X\n",machine().describe_context(),data); + printf("%s: write fdc_sel1_w reg : 0x%X\n",machine().describe_context().c_str(),data); #endif fdc_sel1 = data; @@ -305,7 +305,7 @@ READ8_MEMBER( squale_state::fdc_sel0_r ) data = fdc_sel0; #ifdef DBGMODE - printf("%s: read fdc_sel0_r 0x%.2X\n",machine().describe_context(),data); + printf("%s: read fdc_sel0_r 0x%.2X\n",machine().describe_context().c_str(),data); #endif return data; @@ -318,7 +318,7 @@ READ8_MEMBER( squale_state::fdc_sel1_r ) data = fdc_sel1; #ifdef DBGMODE - printf("%s: read fdc_sel1_r 0x%.2X\n",machine().describe_context(),data); + printf("%s: read fdc_sel1_r 0x%.2X\n",machine().describe_context().c_str(),data); #endif return data; @@ -332,7 +332,7 @@ WRITE8_MEMBER( squale_state::pia_u75_porta_w ) { // U75 PIA Port A : Keyboard rows output #ifdef DBGMODE - printf("%s: write pia_u75_porta_w : 0x%.2X\n",machine().describe_context(),data); + printf("%s: write pia_u75_porta_w : 0x%.2X\n",machine().describe_context().c_str(),data); #endif keyboard_line = data; return; @@ -344,7 +344,7 @@ READ8_MEMBER( squale_state::pia_u75_porta_r ) uint8_t data; #ifdef DBGMODE - printf("%s: read pia_u75_porta_r\n",machine().describe_context()); + printf("%s: read pia_u75_porta_r\n",machine().describe_context().c_str()); #endif data = keyboard_line; @@ -380,7 +380,7 @@ READ8_MEMBER( squale_state::pia_u75_portb_r ) } #ifdef DBGMODE - printf("%s: read pia_u75_portb_r : 0x%.2X\n",machine().describe_context(),data); + printf("%s: read pia_u75_portb_r : 0x%.2X\n",machine().describe_context().c_str(),data); #endif return data; @@ -390,7 +390,7 @@ WRITE8_MEMBER( squale_state::pia_u75_portb_w ) { // U75 PIA Port B : Keyboard column input #ifdef DBGMODE - printf("%s: write pia_u75_portb_w : 0x%.2X\n",machine().describe_context(),data); + printf("%s: write pia_u75_portb_w : 0x%.2X\n",machine().describe_context().c_str(),data); #endif return; } @@ -418,7 +418,7 @@ READ8_MEMBER( squale_state::ay_portb_r ) data |= ( ioport("ay_joy_2")->read() ) & 0x8F; #ifdef DBGMODE - printf("%s: read ay_portb_r : 0x%.2X\n",machine().describe_context(),data); + printf("%s: read ay_portb_r : 0x%.2X\n",machine().describe_context().c_str(),data); #endif return data; @@ -439,7 +439,7 @@ READ8_MEMBER( squale_state::ay_porta_r ) uint8_t data; #ifdef DBGMODE - printf("%s: read ay_porta_r\n",machine().describe_context()); + printf("%s: read ay_porta_r\n",machine().describe_context().c_str()); #endif data = ( ioport("ay_joy_2")->read() ) & 0x8F; @@ -460,7 +460,7 @@ WRITE8_MEMBER( squale_state::ay_porta_w ) // B0 : Joystick 1 - Right #ifdef DBGMODE - printf("%s: write ay_porta_w : 0x%.2X\n",machine().describe_context(),data); + printf("%s: write ay_porta_w : 0x%.2X\n",machine().describe_context().c_str(),data); #endif return; } @@ -478,7 +478,7 @@ WRITE8_MEMBER( squale_state::ay_portb_w ) // B0 : Joystick 2 - Right #ifdef DBGMODE - printf("%s: write ay_portb_w : 0x%.2X\n",machine().describe_context(),data); + printf("%s: write ay_portb_w : 0x%.2X\n",machine().describe_context().c_str(),data); #endif return; } @@ -493,7 +493,7 @@ READ8_MEMBER( squale_state::pia_u72_porta_r ) uint8_t data; #ifdef DBGMODE - printf("%s: read pia_u72_porta_r\n",machine().describe_context()); + printf("%s: read pia_u72_porta_r\n",machine().describe_context().c_str()); #endif if( m_cart_rom && m_cart_rom->bytes() ) @@ -509,7 +509,7 @@ WRITE8_MEMBER( squale_state::pia_u72_porta_w ) // U72 PIA Port A : Cartridge data bus #ifdef DBGMODE - printf("%s: write pia_u72_porta_w : 0x%.2X\n",machine().describe_context(),data); + printf("%s: write pia_u72_porta_w : 0x%.2X\n",machine().describe_context().c_str(),data); #endif return; @@ -520,7 +520,7 @@ WRITE_LINE_MEMBER( squale_state::pia_u72_ca2_w ) // U72 PIA CA2 : Cartridge address control #ifdef DBGMODE - printf("%s: U72 PIA Port CA2 Set to %2x\n", machine().describe_context(),state); + printf("%s: U72 PIA Port CA2 Set to %2x\n", machine().describe_context().c_str(),state); #endif if( state ) @@ -544,7 +544,7 @@ WRITE_LINE_MEMBER( squale_state::pia_u75_cb2_w ) // U75 PIA CB2 : Cartridge address reset #ifdef DBGMODE - printf("%s: U75 PIA Port CB2 Set to %2x\n", machine().describe_context(),state); + printf("%s: U75 PIA Port CB2 Set to %2x\n", machine().describe_context().c_str(),state); #endif if( state ) @@ -570,7 +570,7 @@ READ8_MEMBER( squale_state::pia_u72_portb_r ) uint8_t data = 0xFF; #ifdef DBGMODE - printf("%s: read pia_u72_portb_r\n",machine().describe_context()); + printf("%s: read pia_u72_portb_r\n",machine().describe_context().c_str()); #endif return data; @@ -581,7 +581,7 @@ WRITE8_MEMBER( squale_state::pia_u72_portb_w ) // U72 PIA Port B : Printer data bus #ifdef DBGMODE - printf("%s: write pia_u72_portb_w : 0x%.2X\n",machine().describe_context(),data); + printf("%s: write pia_u72_portb_w : 0x%.2X\n",machine().describe_context().c_str(),data); #endif return; @@ -592,7 +592,7 @@ WRITE_LINE_MEMBER( squale_state::pia_u72_cb2_w ) // U72 PIA CB2 : Printer Data Strobe line #ifdef DBGMODE - printf("%s: U72 PIA Port CB2 Set to %2x\n", machine().describe_context(),state); + printf("%s: U72 PIA Port CB2 Set to %2x\n", machine().describe_context().c_str(),state); #endif } diff --git a/src/mame/drivers/supracan.cpp b/src/mame/drivers/supracan.cpp index 32595bd6e50..e92cf7f03b7 100644 --- a/src/mame/drivers/supracan.cpp +++ b/src/mame/drivers/supracan.cpp @@ -207,8 +207,6 @@ private: uint16_t m_video_regs[256]; - bool m_hack_68k_to_6502_access; - tilemap_t *m_tilemap_sizes[4][4]; bitmap_ind16 m_sprite_final_bitmap; void write_swapped_byte(int offset, uint8_t byte); @@ -228,7 +226,7 @@ private: TIMER_CALLBACK_MEMBER(supracan_line_off_callback); TIMER_CALLBACK_MEMBER(supracan_video_callback); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(supracan_cart); - inline void verboselog(const char *tag, int n_level, const char *s_fmt, ...) ATTR_PRINTF(4,5); + inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4); int supracan_tilemap_get_region(int layer); void supracan_tilemap_get_info_common(int layer, tile_data &tileinfo, int count); void supracan_tilemap_get_info_roz(int layer, tile_data &tileinfo, int count); @@ -244,7 +242,7 @@ public: -inline void supracan_state::verboselog(const char *tag, int n_level, const char *s_fmt, ...) +inline void supracan_state::verboselog(int n_level, const char *s_fmt, ...) { #if ENABLE_VERBOSE_LOG if( VERBOSE_LEVEL >= n_level ) @@ -254,7 +252,7 @@ inline void supracan_state::verboselog(const char *tag, int n_level, const char va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%06x: %s: %s", machine().device(tag)->safe_pc(), tag, buf ); + logerror( "%s: %s", machine().describe_context(), buf ); } #endif } @@ -341,7 +339,7 @@ void supracan_state::supracan_tilemap_get_info_common(int layer, tile_data &tile break; default: - verboselog("maincpu", 0, "Unsupported tilemap mode: %d\n", (m_tilemap_mode[layer] & 0x7000) >> 12); + verboselog(0, "Unsupported tilemap mode: %d\n", (m_tilemap_mode[layer] & 0x7000) >> 12); break; } @@ -491,7 +489,7 @@ int supracan_state::get_tilemap_dimensions(int &xsize, int &ysize, int layer) return 3; default: - verboselog("maincpu", 0, "Unsupported tilemap size for layer %d: %04x\n", layer, select); + verboselog(0, "Unsupported tilemap size for layer %d: %04x\n", layer, select); return 0; } } @@ -1016,31 +1014,31 @@ void supracan_state::dma_w(address_space &space, int offset, uint16_t data, uint switch(offset) { case 0x00/2: // Source address MSW - verboselog("maincpu", 0, "dma_w: source msw %d: %04x\n", ch, data); + verboselog(0, "dma_w: source msw %d: %04x\n", ch, data); acan_dma_regs->source[ch] &= 0x0000ffff; acan_dma_regs->source[ch] |= data << 16; break; case 0x02/2: // Source address LSW - verboselog("maincpu", 0, "dma_w: source lsw %d: %04x\n", ch, data); + verboselog(0, "dma_w: source lsw %d: %04x\n", ch, data); acan_dma_regs->source[ch] &= 0xffff0000; acan_dma_regs->source[ch] |= data; break; case 0x04/2: // Destination address MSW - verboselog("maincpu", 0, "dma_w: dest msw %d: %04x\n", ch, data); + verboselog(0, "dma_w: dest msw %d: %04x\n", ch, data); acan_dma_regs->dest[ch] &= 0x0000ffff; acan_dma_regs->dest[ch] |= data << 16; break; case 0x06/2: // Destination address LSW - verboselog("maincpu", 0, "dma_w: dest lsw %d: %04x\n", ch, data); + verboselog(0, "dma_w: dest lsw %d: %04x\n", ch, data); acan_dma_regs->dest[ch] &= 0xffff0000; acan_dma_regs->dest[ch] |= data; break; case 0x08/2: // Byte count - verboselog("maincpu", 0, "dma_w: count %d: %04x\n", ch, data); + verboselog(0, "dma_w: count %d: %04x\n", ch, data); acan_dma_regs->count[ch] = data; break; case 0x0a/2: // Control - verboselog("maincpu", 0, "dma_w: control %d: %04x\n", ch, data); + verboselog(0, "dma_w: control %d: %04x\n", ch, data); if(data & 0x8800) { // if(data & 0x2000) @@ -1068,12 +1066,12 @@ void supracan_state::dma_w(address_space &space, int offset, uint16_t data, uint } else if(data != 0x0000) // fake DMA, used by C.U.G. { - verboselog("maincpu", 0, "dma_w: Unknown DMA kickoff value of %04x (other regs %08x, %08x, %d)\n", data, acan_dma_regs->source[ch], acan_dma_regs->dest[ch], acan_dma_regs->count[ch] + 1); + verboselog(0, "dma_w: Unknown DMA kickoff value of %04x (other regs %08x, %08x, %d)\n", data, acan_dma_regs->source[ch], acan_dma_regs->dest[ch], acan_dma_regs->count[ch] + 1); fatalerror("dma_w: Unknown DMA kickoff value of %04x (other regs %08x, %08x, %d)\n",data, acan_dma_regs->source[ch], acan_dma_regs->dest[ch], acan_dma_regs->count[ch] + 1); } break; default: - verboselog("maincpu", 0, "dma_w: Unknown register: %08x = %04x & %04x\n", 0xe90020 + (offset << 1), data, mem_mask); + verboselog(0, "dma_w: Unknown register: %08x = %04x & %04x\n", 0xe90020 + (offset << 1), data, mem_mask); break; } } @@ -1153,7 +1151,7 @@ READ8_MEMBER( supracan_state::_6502_soundmem_r ) case 0x410: // Sound IRQ enable data = m_sound_irq_enable_reg; - if(!machine().side_effects_disabled()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 0, "supracan_soundreg_r: IRQ enable: %04x\n", data); + if(!machine().side_effects_disabled()) verboselog(0, "supracan_soundreg_r: IRQ enable: %04x\n", data); if(!machine().side_effects_disabled()) { if(m_sound_irq_enable_reg & m_sound_irq_source_reg) @@ -1169,17 +1167,17 @@ READ8_MEMBER( supracan_state::_6502_soundmem_r ) case 0x411: // Sound IRQ source data = m_sound_irq_source_reg; m_sound_irq_source_reg = 0; - if(!machine().side_effects_disabled()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 3, "supracan_soundreg_r: IRQ source: %04x\n", data); + if(!machine().side_effects_disabled()) verboselog(3, "supracan_soundreg_r: IRQ source: %04x\n", data); if(!machine().side_effects_disabled()) { m_soundcpu->set_input_line(0, CLEAR_LINE); } break; case 0x420: - if(!machine().side_effects_disabled()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 3, "supracan_soundreg_r: Sound hardware status? (not yet implemented): %02x\n", 0); + if(!machine().side_effects_disabled()) verboselog(3, "supracan_soundreg_r: Sound hardware status? (not yet implemented): %02x\n", 0); break; case 0x422: - if(!machine().side_effects_disabled()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 3, "supracan_soundreg_r: Sound hardware data? (not yet implemented): %02x\n", 0); + if(!machine().side_effects_disabled()) verboselog(3, "supracan_soundreg_r: Sound hardware data? (not yet implemented): %02x\n", 0); break; case 0x404: case 0x405: @@ -1190,7 +1188,7 @@ READ8_MEMBER( supracan_state::_6502_soundmem_r ) default: if(offset >= 0x300 && offset < 0x500) { - if(!machine().side_effects_disabled()) verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 0, "supracan_soundreg_r: Unknown register %04x\n", offset); + if(!machine().side_effects_disabled()) verboselog(0, "supracan_soundreg_r: Unknown register %04x\n", offset); } break; } @@ -1205,29 +1203,29 @@ WRITE8_MEMBER( supracan_state::_6502_soundmem_w ) case 0x407: if(m_sound_cpu_68k_irq_reg &~ data) { - verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 0, "supracan_soundreg_w: sound_cpu_68k_irq_reg: %04x: Triggering M68k IRQ\n", data); + verboselog(0, "supracan_soundreg_w: sound_cpu_68k_irq_reg: %04x: Triggering M68k IRQ\n", data); m_maincpu->set_input_line(7, HOLD_LINE); } else { - verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 0, "supracan_soundreg_w: sound_cpu_68k_irq_reg: %04x\n", data); + verboselog(0, "supracan_soundreg_w: sound_cpu_68k_irq_reg: %04x\n", data); } m_sound_cpu_68k_irq_reg = data; break; case 0x410: m_sound_irq_enable_reg = data; - verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 0, "supracan_soundreg_w: IRQ enable: %02x\n", data); + verboselog(0, "supracan_soundreg_w: IRQ enable: %02x\n", data); break; case 0x420: - verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 3, "supracan_soundreg_w: Sound hardware reg data? (not yet implemented): %02x\n", data); + verboselog(3, "supracan_soundreg_w: Sound hardware reg data? (not yet implemented): %02x\n", data); break; case 0x422: - verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 3, "supracan_soundreg_w: Sound hardware reg addr? (not yet implemented): %02x\n", data); + verboselog(3, "supracan_soundreg_w: Sound hardware reg addr? (not yet implemented): %02x\n", data); break; default: if(offset >= 0x300 && offset < 0x500) { - verboselog(m_hack_68k_to_6502_access ? "maincpu" : "soundcpu", 0, "supracan_soundreg_w: Unknown register %04x = %02x\n", offset, data); + verboselog(0, "supracan_soundreg_w: Unknown register %04x = %02x\n", offset, data); } m_soundram[offset] = data; break; @@ -1379,15 +1377,11 @@ WRITE16_MEMBER( supracan_state::_68k_soundram_w ) { if(ACCESSING_BITS_8_15) { - m_hack_68k_to_6502_access = true; _6502_soundmem_w(mem, offset*2, data >> 8); - m_hack_68k_to_6502_access = false; } if(ACCESSING_BITS_0_7) { - m_hack_68k_to_6502_access = true; _6502_soundmem_w(mem, offset*2 + 1, data & 0xff); - m_hack_68k_to_6502_access = false; } } } @@ -1403,15 +1397,11 @@ READ16_MEMBER( supracan_state::_68k_soundram_r ) val = 0; if(ACCESSING_BITS_8_15) { - m_hack_68k_to_6502_access = true; val |= _6502_soundmem_r(mem, offset*2) << 8; - m_hack_68k_to_6502_access = false; } if(ACCESSING_BITS_0_7) { - m_hack_68k_to_6502_access = true; val |= _6502_soundmem_r(mem, offset*2 + 1); - m_hack_68k_to_6502_access = false; } } @@ -1425,7 +1415,7 @@ READ16_MEMBER( supracan_state::sound_r ) switch( offset ) { default: - verboselog("maincpu", 0, "sound_r: Unknown register: (%08x) & %04x\n", 0xe90000 + (offset << 1), mem_mask); + verboselog(0, "sound_r: Unknown register: (%08x) & %04x\n", 0xe90000 + (offset << 1), mem_mask); break; } @@ -1457,10 +1447,10 @@ WRITE16_MEMBER( supracan_state::sound_w ) /* Halt the sound cpu */ m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); } - verboselog("maincpu", 0, "sound cpu ctrl: %04x\n", data); + verboselog(0, "sound cpu ctrl: %04x\n", data); break; default: - verboselog("maincpu", 0, "sound_w: Unknown register: %08x = %04x & %04x\n", 0xe90000 + (offset << 1), data, mem_mask); + verboselog(0, "sound_w: Unknown register: %08x = %04x & %04x\n", 0xe90000 + (offset << 1), data, mem_mask); break; } } @@ -1475,7 +1465,7 @@ READ16_MEMBER( supracan_state::video_r ) case 0x00/2: // Video IRQ flags if(!machine().side_effects_disabled()) { - //verboselog("maincpu", 0, "read video IRQ flags (%04x)\n", data); + //verboselog(0, "read video IRQ flags (%04x)\n", data); m_maincpu->set_input_line(7, CLEAR_LINE); } break; @@ -1485,16 +1475,16 @@ READ16_MEMBER( supracan_state::video_r ) //data = 0; break; case 0x100/2: - if(!machine().side_effects_disabled()) verboselog("maincpu", 0, "read tilemap_flags[0] (%04x)\n", data); + if(!machine().side_effects_disabled()) verboselog(0, "read tilemap_flags[0] (%04x)\n", data); break; case 0x106/2: - if(!machine().side_effects_disabled()) verboselog("maincpu", 0, "read tilemap_scrolly[0] (%04x)\n", data); + if(!machine().side_effects_disabled()) verboselog(0, "read tilemap_scrolly[0] (%04x)\n", data); break; case 0x120/2: - if(!machine().side_effects_disabled()) verboselog("maincpu", 0, "read tilemap_flags[1] (%04x)\n", data); + if(!machine().side_effects_disabled()) verboselog(0, "read tilemap_flags[1] (%04x)\n", data); break; default: - if(!machine().side_effects_disabled()) verboselog("maincpu", 0, "video_r: Unknown register: %08x (%04x & %04x)\n", 0xf00000 + (offset << 1), data, mem_mask); + if(!machine().side_effects_disabled()) verboselog(0, "video_r: Unknown register: %08x (%04x & %04x)\n", 0xf00000 + (offset << 1), data, mem_mask); break; } @@ -1549,7 +1539,7 @@ TIMER_CALLBACK_MEMBER(supracan_state::supracan_video_callback) case 240: if(m_irq_mask & 1) { - verboselog("maincpu", 0, "Triggering VBL IRQ\n\n"); + verboselog(0, "Triggering VBL IRQ\n\n"); m_maincpu->set_input_line(7, HOLD_LINE); } break; @@ -1576,35 +1566,35 @@ WRITE16_MEMBER( supracan_state::video_w ) switch(offset) { case 0x10/2: // Byte count - verboselog("maincpu", 0, "sprite dma word count: %04x\n", data); + verboselog(0, "sprite dma word count: %04x\n", data); acan_sprdma_regs->count = data; break; case 0x12/2: // Destination address MSW acan_sprdma_regs->dst &= 0x0000ffff; acan_sprdma_regs->dst |= data << 16; - verboselog("maincpu", 0, "sprite dma dest msw: %04x\n", data); + verboselog(0, "sprite dma dest msw: %04x\n", data); break; case 0x14/2: // Destination address LSW acan_sprdma_regs->dst &= 0xffff0000; acan_sprdma_regs->dst |= data; - verboselog("maincpu", 0, "sprite dma dest lsw: %04x\n", data); + verboselog(0, "sprite dma dest lsw: %04x\n", data); break; case 0x16/2: // Source word increment - verboselog("maincpu", 0, "sprite dma dest word inc: %04x\n", data); + verboselog(0, "sprite dma dest word inc: %04x\n", data); acan_sprdma_regs->dst_inc = data; break; case 0x18/2: // Source address MSW acan_sprdma_regs->src &= 0x0000ffff; acan_sprdma_regs->src |= data << 16; - verboselog("maincpu", 0, "sprite dma src msw: %04x\n", data); + verboselog(0, "sprite dma src msw: %04x\n", data); break; case 0x1a/2: // Source address LSW - verboselog("maincpu", 0, "sprite dma src lsw: %04x\n", data); + verboselog(0, "sprite dma src lsw: %04x\n", data); acan_sprdma_regs->src &= 0xffff0000; acan_sprdma_regs->src |= data; break; case 0x1c/2: // Source word increment - verboselog("maincpu", 0, "sprite dma src word inc: %04x\n", data); + verboselog(0, "sprite dma src word inc: %04x\n", data); acan_sprdma_regs->src_inc = data; break; case 0x1e/2: @@ -1641,12 +1631,12 @@ WRITE16_MEMBER( supracan_state::video_w ) } else { - verboselog("maincpu", 0, "dma_w: Attempting to kick off a DMA without bit 15 set! (%04x)\n", data); + verboselog(0, "dma_w: Attempting to kick off a DMA without bit 15 set! (%04x)\n", data); } break; case 0x08/2: { - verboselog("maincpu", 3, "video_flags = %04x\n", data); + verboselog(3, "video_flags = %04x\n", data); m_video_flags = data; rectangle visarea = m_screen->visible_area(); @@ -1658,7 +1648,7 @@ WRITE16_MEMBER( supracan_state::video_w ) case 0x0a/2: { // raster interrupt - verboselog("maincpu", 0, "IRQ Trigger? = %04x\n", data); + verboselog(0, "IRQ Trigger? = %04x\n", data); if(data & 0x8000) { m_line_on_timer->adjust(m_screen->time_until_pos((data & 0x00ff), 0)); @@ -1672,7 +1662,7 @@ WRITE16_MEMBER( supracan_state::video_w ) case 0x0c/2: { - verboselog("maincpu", 0, "IRQ De-Trigger? = %04x\n", data); + verboselog(0, "IRQ De-Trigger? = %04x\n", data); if(data & 0x8000) { m_line_off_timer->adjust(m_screen->time_until_pos(data & 0x00ff, 0)); @@ -1685,48 +1675,48 @@ WRITE16_MEMBER( supracan_state::video_w ) break; /* Sprites */ - case 0x20/2: m_sprite_base_addr = data << 2; verboselog("maincpu", 0, "sprite_base_addr = %04x\n", data); break; - case 0x22/2: m_sprite_count = data+1; verboselog("maincpu", 0, "sprite_count = %d\n", data+1); break; - case 0x26/2: m_sprite_flags = data; verboselog("maincpu", 0, "sprite_flags = %04x\n", data); break; + case 0x20/2: m_sprite_base_addr = data << 2; verboselog(0, "sprite_base_addr = %04x\n", data); break; + case 0x22/2: m_sprite_count = data+1; verboselog(0, "sprite_count = %d\n", data+1); break; + case 0x26/2: m_sprite_flags = data; verboselog(0, "sprite_flags = %04x\n", data); break; /* Tilemap 0 */ - case 0x100/2: m_tilemap_flags[0] = data; verboselog("maincpu", 3, "tilemap_flags[0] = %04x\n", data); break; - case 0x104/2: m_tilemap_scrollx[0] = data; verboselog("maincpu", 3, "tilemap_scrollx[0] = %04x\n", data); break; - case 0x106/2: m_tilemap_scrolly[0] = data; verboselog("maincpu", 3, "tilemap_scrolly[0] = %04x\n", data); break; - case 0x108/2: m_tilemap_base_addr[0] = (data) << 1; verboselog("maincpu", 3, "tilemap_base_addr[0] = %05x\n", data << 2); break; - case 0x10a/2: m_tilemap_mode[0] = data; verboselog("maincpu", 3, "tilemap_mode[0] = %04x\n", data); break; + case 0x100/2: m_tilemap_flags[0] = data; verboselog(3, "tilemap_flags[0] = %04x\n", data); break; + case 0x104/2: m_tilemap_scrollx[0] = data; verboselog(3, "tilemap_scrollx[0] = %04x\n", data); break; + case 0x106/2: m_tilemap_scrolly[0] = data; verboselog(3, "tilemap_scrolly[0] = %04x\n", data); break; + case 0x108/2: m_tilemap_base_addr[0] = (data) << 1; verboselog(3, "tilemap_base_addr[0] = %05x\n", data << 2); break; + case 0x10a/2: m_tilemap_mode[0] = data; verboselog(3, "tilemap_mode[0] = %04x\n", data); break; /* Tilemap 1 */ - case 0x120/2: m_tilemap_flags[1] = data; verboselog("maincpu", 3, "tilemap_flags[1] = %04x\n", data); break; - case 0x124/2: m_tilemap_scrollx[1] = data; verboselog("maincpu", 3, "tilemap_scrollx[1] = %04x\n", data); break; - case 0x126/2: m_tilemap_scrolly[1] = data; verboselog("maincpu", 3, "tilemap_scrolly[1] = %04x\n", data); break; - case 0x128/2: m_tilemap_base_addr[1] = (data) << 1; verboselog("maincpu", 3, "tilemap_base_addr[1] = %05x\n", data << 2); break; - case 0x12a/2: m_tilemap_mode[1] = data; verboselog("maincpu", 3, "tilemap_mode[1] = %04x\n", data); break; + case 0x120/2: m_tilemap_flags[1] = data; verboselog(3, "tilemap_flags[1] = %04x\n", data); break; + case 0x124/2: m_tilemap_scrollx[1] = data; verboselog(3, "tilemap_scrollx[1] = %04x\n", data); break; + case 0x126/2: m_tilemap_scrolly[1] = data; verboselog(3, "tilemap_scrolly[1] = %04x\n", data); break; + case 0x128/2: m_tilemap_base_addr[1] = (data) << 1; verboselog(3, "tilemap_base_addr[1] = %05x\n", data << 2); break; + case 0x12a/2: m_tilemap_mode[1] = data; verboselog(3, "tilemap_mode[1] = %04x\n", data); break; /* Tilemap 2? */ - case 0x140/2: m_tilemap_flags[2] = data; verboselog("maincpu", 0, "tilemap_flags[2] = %04x\n", data); break; - case 0x144/2: m_tilemap_scrollx[2] = data; verboselog("maincpu", 0, "tilemap_scrollx[2] = %04x\n", data); break; - case 0x146/2: m_tilemap_scrolly[2] = data; verboselog("maincpu", 0, "tilemap_scrolly[2] = %04x\n", data); break; - case 0x148/2: m_tilemap_base_addr[2] = (data) << 1; verboselog("maincpu", 0, "tilemap_base_addr[2] = %05x\n", data << 2); break; - case 0x14a/2: m_tilemap_mode[2] = data; verboselog("maincpu", 0, "tilemap_mode[2] = %04x\n", data); break; + case 0x140/2: m_tilemap_flags[2] = data; verboselog(0, "tilemap_flags[2] = %04x\n", data); break; + case 0x144/2: m_tilemap_scrollx[2] = data; verboselog(0, "tilemap_scrollx[2] = %04x\n", data); break; + case 0x146/2: m_tilemap_scrolly[2] = data; verboselog(0, "tilemap_scrolly[2] = %04x\n", data); break; + case 0x148/2: m_tilemap_base_addr[2] = (data) << 1; verboselog(0, "tilemap_base_addr[2] = %05x\n", data << 2); break; + case 0x14a/2: m_tilemap_mode[2] = data; verboselog(0, "tilemap_mode[2] = %04x\n", data); break; /* ROZ */ - case 0x180/2: m_roz_mode = data; verboselog("maincpu", 3, "roz_mode = %04x\n", data); break; - case 0x184/2: m_roz_scrollx = (data << 16) | (m_roz_scrollx & 0xffff); m_roz_changed |= 1; verboselog("maincpu", 3, "roz_scrollx = %08x\n", m_roz_scrollx); break; - case 0x186/2: m_roz_scrollx = (data) | (m_roz_scrollx & 0xffff0000); m_roz_changed |= 1; verboselog("maincpu", 3, "roz_scrollx = %08x\n", m_roz_scrollx); break; - case 0x188/2: m_roz_scrolly = (data << 16) | (m_roz_scrolly & 0xffff); m_roz_changed |= 2; verboselog("maincpu", 3, "roz_scrolly = %08x\n", m_roz_scrolly); break; - case 0x18a/2: m_roz_scrolly = (data) | (m_roz_scrolly & 0xffff0000); m_roz_changed |= 2; verboselog("maincpu", 3, "roz_scrolly = %08x\n", m_roz_scrolly); break; - case 0x18c/2: m_roz_coeffa = data; verboselog("maincpu", 3, "roz_coeffa = %04x\n", data); break; - case 0x18e/2: m_roz_coeffb = data; verboselog("maincpu", 3, "roz_coeffb = %04x\n", data); break; - case 0x190/2: m_roz_coeffc = data; verboselog("maincpu", 3, "roz_coeffc = %04x\n", data); break; - case 0x192/2: m_roz_coeffd = data; verboselog("maincpu", 3, "roz_coeffd = %04x\n", data); break; - case 0x194/2: m_roz_base_addr = (data) << 1; verboselog("maincpu", 3, "roz_base_addr = %05x\n", data << 2); break; - case 0x196/2: m_roz_tile_bank = data; verboselog("maincpu", 3, "roz_tile_bank = %04x\n", data); break; //tile bank - case 0x198/2: m_roz_unk_base0 = data << 2; verboselog("maincpu", 3, "roz_unk_base0 = %05x\n", data << 2); break; - case 0x19a/2: m_roz_unk_base1 = data << 2; verboselog("maincpu", 3, "roz_unk_base1 = %05x\n", data << 2); break; - case 0x19e/2: m_roz_unk_base2 = data << 2; verboselog("maincpu", 3, "roz_unk_base2 = %05x\n", data << 2); break; + case 0x180/2: m_roz_mode = data; verboselog(3, "roz_mode = %04x\n", data); break; + case 0x184/2: m_roz_scrollx = (data << 16) | (m_roz_scrollx & 0xffff); m_roz_changed |= 1; verboselog(3, "roz_scrollx = %08x\n", m_roz_scrollx); break; + case 0x186/2: m_roz_scrollx = (data) | (m_roz_scrollx & 0xffff0000); m_roz_changed |= 1; verboselog(3, "roz_scrollx = %08x\n", m_roz_scrollx); break; + case 0x188/2: m_roz_scrolly = (data << 16) | (m_roz_scrolly & 0xffff); m_roz_changed |= 2; verboselog(3, "roz_scrolly = %08x\n", m_roz_scrolly); break; + case 0x18a/2: m_roz_scrolly = (data) | (m_roz_scrolly & 0xffff0000); m_roz_changed |= 2; verboselog(3, "roz_scrolly = %08x\n", m_roz_scrolly); break; + case 0x18c/2: m_roz_coeffa = data; verboselog(3, "roz_coeffa = %04x\n", data); break; + case 0x18e/2: m_roz_coeffb = data; verboselog(3, "roz_coeffb = %04x\n", data); break; + case 0x190/2: m_roz_coeffc = data; verboselog(3, "roz_coeffc = %04x\n", data); break; + case 0x192/2: m_roz_coeffd = data; verboselog(3, "roz_coeffd = %04x\n", data); break; + case 0x194/2: m_roz_base_addr = (data) << 1; verboselog(3, "roz_base_addr = %05x\n", data << 2); break; + case 0x196/2: m_roz_tile_bank = data; verboselog(3, "roz_tile_bank = %04x\n", data); break; //tile bank + case 0x198/2: m_roz_unk_base0 = data << 2; verboselog(3, "roz_unk_base0 = %05x\n", data << 2); break; + case 0x19a/2: m_roz_unk_base1 = data << 2; verboselog(3, "roz_unk_base1 = %05x\n", data << 2); break; + case 0x19e/2: m_roz_unk_base2 = data << 2; verboselog(3, "roz_unk_base2 = %05x\n", data << 2); break; - case 0x1d0/2: m_unk_1d0 = data; verboselog("maincpu", 3, "unk_1d0 = %04x\n", data); break; + case 0x1d0/2: m_unk_1d0 = data; verboselog(3, "unk_1d0 = %04x\n", data); break; @@ -1739,10 +1729,10 @@ WRITE16_MEMBER( supracan_state::video_w ) m_maincpu->set_input_line(7, CLEAR_LINE); } #endif - verboselog("maincpu", 3, "irq_mask = %04x\n", data); + verboselog(3, "irq_mask = %04x\n", data); break; default: - verboselog("maincpu", 0, "video_w: Unknown register: %08x = %04x & %04x\n", 0xf00000 + (offset << 1), data, mem_mask); + verboselog(0, "video_w: Unknown register: %08x = %04x & %04x\n", 0xf00000 + (offset << 1), data, mem_mask); break; } // m_video_regs[offset] = data; diff --git a/src/mame/drivers/surpratk.cpp b/src/mame/drivers/surpratk.cpp index e2f223970bb..d4cbdd897c9 100644 --- a/src/mame/drivers/surpratk.cpp +++ b/src/mame/drivers/surpratk.cpp @@ -29,7 +29,7 @@ INTERRUPT_GEN_MEMBER(surpratk_state::surpratk_interrupt) WRITE8_MEMBER(surpratk_state::surpratk_videobank_w) { if (data & 0xf8) - logerror("%04x: videobank = %02x\n",m_maincpu->pc(),data); + logerror("%s: videobank = %02x\n", machine().describe_context(), data); /* bit 0 = select 053245 at 0000-07ff */ /* bit 1 = select palette at 0000-07ff */ @@ -164,7 +164,7 @@ void surpratk_state::machine_reset() WRITE8_MEMBER( surpratk_state::banking_callback ) { -// logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), data); +// logerror("%s: setlines %02x\n", machine().describe_context(), data); membank("bank1")->set_entry(data & 0x1f); } diff --git a/src/mame/drivers/taitowlf.cpp b/src/mame/drivers/taitowlf.cpp index 9014573d659..e8775976818 100644 --- a/src/mame/drivers/taitowlf.cpp +++ b/src/mame/drivers/taitowlf.cpp @@ -119,7 +119,7 @@ uint8_t taitowlf_state::mtxc_config_r(int function, int reg) void taitowlf_state::mtxc_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); switch(reg) { @@ -202,7 +202,7 @@ uint8_t taitowlf_state::piix4_config_r(int function, int reg) void taitowlf_state::piix4_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); m_piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp index 741243b114c..73b8fad51a5 100644 --- a/src/mame/drivers/thunderx.cpp +++ b/src/mame/drivers/thunderx.cpp @@ -697,7 +697,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER( thunderx_state::banking_callback ) { - //logerror("thunderx %04x: bank select %02x\n", machine().device("maincpu")->safe_pc(), data); + //logerror("%s thunderx bank select %02x\n", machine().describe_context(), data); m_rombank->set_entry(data & 0x0f); } diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp index 3cacc0d19f1..1a53fd6f1de 100644 --- a/src/mame/drivers/vegas.cpp +++ b/src/mame/drivers/vegas.cpp @@ -559,7 +559,7 @@ WRITE32_MEMBER( vegas_state::timekeeper_w ) m_cmos_unlocked = 0; } else - logerror("%08X:timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", safe_pc(), offset, data, mem_mask); + logerror("%s: timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", machine().describe_context(), offset, data, mem_mask); } @@ -679,7 +679,7 @@ READ8_MEMBER(vegas_state::sio_r) result = m_sio_irq_enable; if (LOG_SIO) { std::string sioBitSel = sioIRQString(result); - logerror("%08X: sio_r: INTR ENABLE 0x%02x %s\n", machine().device("maincpu")->safe_pc(), result, sioBitSel); + logerror("%s: sio_r: INTR ENABLE 0x%02x %s\n", machine().describe_context(), result, sioBitSel); } break; case 2: @@ -687,7 +687,7 @@ READ8_MEMBER(vegas_state::sio_r) result = m_sio_irq_state & m_sio_irq_enable; if (LOG_SIO) { std::string sioBitSel = sioIRQString(result); - logerror("%08X: sio_r: INTR CAUSE 0x%02x %s\n", machine().device("maincpu")->safe_pc(), result, sioBitSel); + logerror("%s: sio_r: INTR CAUSE 0x%02x %s\n", machine().describe_context(), result, sioBitSel); } //m_sio_irq_state &= ~0x02; break; @@ -696,7 +696,7 @@ READ8_MEMBER(vegas_state::sio_r) result = m_sio_irq_state; if (LOG_SIO) { std::string sioBitSel = sioIRQString(result); - logerror("%08X: sio_r: INTR STATUS 0x%02x %s\n", machine().device("maincpu")->safe_pc(), result, sioBitSel); + logerror("%s: sio_r: INTR STATUS 0x%02x %s\n", machine().describe_context(), result, sioBitSel); } break; case 4: @@ -736,7 +736,7 @@ READ8_MEMBER(vegas_state::sio_r) } } if (LOG_SIO && (index < 0x1 || index > 0x4)) - logerror("%08X: sio_r: offset: %08x index: %d result: %02X\n", machine().device("maincpu")->safe_pc(), offset, index, result); + logerror("%s: sio_r: offset: %08x index: %d result: %02X\n", machine().describe_context(), offset, index, result); return result; } @@ -848,7 +848,7 @@ WRITE8_MEMBER(vegas_state::cpu_io_w) } if (LOG_SIO) { popmessage("System LED: %C", digit); - //logerror("%08X: cpu_io_w System LED offset %X = %02X '%c'\n", machine().device("maincpu")->safe_pc(), offset, data, digit); + //logerror("%s: cpu_io_w System LED offset %X = %02X '%c'\n", machine().describe_context(), offset, data, digit); } } break; @@ -861,19 +861,19 @@ WRITE8_MEMBER(vegas_state::cpu_io_w) reset_sio(); } if (LOG_SIO) - logerror("%08X: cpu_io_w PLD Config offset %X = %02X\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: cpu_io_w PLD Config offset %X = %02X\n", machine().describe_context(), offset, data); break; case 2: if (LOG_SIO && (m_cpuio_data[3] & 0x1)) - logerror("%08X: cpu_io_w PLD Status / Jamma Serial Sense offset %X = %02X\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: cpu_io_w PLD Status / Jamma Serial Sense offset %X = %02X\n", machine().describe_context(), offset, data); break; case 3: // Bit 0: Enable SIO, Bit 1: Enable SIO_R0/IDE, Bit 2: Enable PCI if (LOG_SIO) - logerror("%08X: cpu_io_w System Reset offset %X = %02X\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: cpu_io_w System Reset offset %X = %02X\n", machine().describe_context(), offset, data); break; default: - logerror("%08X: cpu_io_w unknown offset %X = %02X\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: cpu_io_w unknown offset %X = %02X\n", machine().describe_context(), offset, data); break; } } @@ -884,7 +884,7 @@ READ8_MEMBER( vegas_state::cpu_io_r ) if (offset < 4) result = m_cpuio_data[offset]; if (LOG_SIO && !(!(m_cpuio_data[3] & 0x1))) - logerror("%08X:cpu_io_r offset %X = %02X\n", machine().device("maincpu")->safe_pc(), offset, result); + logerror("%s:cpu_io_r offset %X = %02X\n", machine().describe_context(), offset, result); return result; } @@ -898,7 +898,7 @@ READ8_MEMBER( vegas_state::cpu_io_r ) READ32_MEMBER( vegas_state::analog_port_r ) { - //logerror("%08X: analog_port_r = %08X & %08X\n", machine().device("maincpu")->safe_pc(), m_pending_analog_read, mem_mask); + //logerror("%s: analog_port_r = %08X & %08X\n", machine().describe_context(), m_pending_analog_read, mem_mask); // Clear interrupt m_sio_irq_state &= ~0x02; if (m_sio_irq_enable & 0x02) { @@ -936,7 +936,7 @@ WRITE32_MEMBER( vegas_state::analog_port_w ) //osd_printf_info("wheel calibration comlete wheel: %02x\n", currValue); } //logerror("analog_port_w: wheel_force: %i read: %i\n", m_wheel_force, m_pending_analog_read); - //logerror("%08X: analog_port_w = %08X & %08X index = %d\n", machine().device("maincpu")->safe_pc(), data, mem_mask, index); + //logerror("%s: analog_port_w = %08X & %08X index = %d\n", machine().describe_context(), data, mem_mask, index); if (m_sio_irq_enable & 0x02) { m_sio_irq_state |= 0x02; update_sio_irqs(); @@ -997,13 +997,13 @@ READ32_MEMBER(vegas_state::unknown_r) READ8_MEMBER(vegas_state::parallel_r) { uint8_t result = 0x7; - logerror("%06X: parallel_r %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, result); + logerror("%s: parallel_r %08x = %02x\n", machine().describe_context(), offset, result); return result; } WRITE8_MEMBER(vegas_state::parallel_w) { - logerror("%06X: parallel_w %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: parallel_w %08x = %02x\n", machine().describe_context(), offset, data); } /************************************* @@ -1011,7 +1011,7 @@ WRITE8_MEMBER(vegas_state::parallel_w) *************************************/ WRITE8_MEMBER(vegas_state::mpsreset_w) { - logerror("%06X: mpsreset_w %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data); + logerror("%s: mpsreset_w %08x = %02x\n", machine().describe_context(), offset, data); } /************************************* @@ -1061,11 +1061,11 @@ CUSTOM_INPUT_MEMBER(vegas_state::i40_r) data = ~index & 0xf; break; default: - //logerror("%08X: i40_r: select: %x index: %d data: %x\n", machine().device("maincpu")->safe_pc(), m_i40_data, index, data); + //logerror("%s: i40_r: select: %x index: %d data: %x\n", machine().describe_context(), m_i40_data, index, data); break; } //if (m_i40_data & 0x1000) - // printf("%08X: i40_r: select: %x index: %d data: %x\n", machine().device("maincpu")->safe_pc(), m_i40_data, index, data); + // printf("%s: i40_r: select: %x index: %d data: %x\n", machine().describe_context().c_str(), m_i40_data, index, data); //m_i40_data &= ~0x1000; return data; } diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp index 01d8c772b04..6b8f48fcc42 100644 --- a/src/mame/drivers/vendetta.cpp +++ b/src/mame/drivers/vendetta.cpp @@ -422,7 +422,7 @@ void vendetta_state::machine_reset() WRITE8_MEMBER( vendetta_state::banking_callback ) { if (data >= 0x1c) - logerror("PC = %04x : Unknown bank selected %02x\n", machine().device("maincpu")->safe_pc(), data); + logerror("%s Unknown bank selected %02x\n", machine().describe_context(), data); else membank("bank1")->set_entry(data); } diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp index 1ee098762cf..dd66728ec56 100644 --- a/src/mame/drivers/viper.cpp +++ b/src/mame/drivers/viper.cpp @@ -1931,7 +1931,7 @@ READ64_MEMBER(viper_state::e70000_r) m_ds2430_bit_timer->reset(); m_ds2430_bit_timer->start_time(); -// printf("e70000_r: %08X (mask %08X%08X) at %08X\n", offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask, cpu->safe_pc()); +// printf("%s e70000_r: %08X (mask %08X%08X)\n", machine().describe_context().c_str(), offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask); } return 0; @@ -1971,7 +1971,7 @@ WRITE64_MEMBER(viper_state::unk1a_w) { if (ACCESSING_BITS_56_63) { - // printf("unk1a_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (uint32_t)(data >> 32), (uint32_t)data, offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask, cpu->safe_pc()); + // printf("%s unk1a_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", machine().describe_context().c_str(), (uint32_t)(data >> 32), (uint32_t)data, offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask); } } @@ -1980,7 +1980,7 @@ WRITE64_MEMBER(viper_state::unk1b_w) if (ACCESSING_BITS_56_63) { m_ds2430_unk_status = 0; - // printf("unk1b_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (uint32_t)(data >> 32), (uint32_t)data, offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask, cpu->safe_pc()); + // printf("%s unk1b_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", machine().describe_context().c_str(), (uint32_t)(data >> 32), (uint32_t)data, offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask); } } diff --git a/src/mame/drivers/voyager.cpp b/src/mame/drivers/voyager.cpp index 4b2ba7c8e5d..21423bfc76b 100644 --- a/src/mame/drivers/voyager.cpp +++ b/src/mame/drivers/voyager.cpp @@ -82,7 +82,7 @@ uint8_t voyager_state::mtxc_config_r(int function, int reg) void voyager_state::mtxc_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); switch(reg) { @@ -181,7 +181,7 @@ uint8_t voyager_state::piix4_config_r(int function, int reg) void voyager_state::piix4_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); m_piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/wheelfir.cpp b/src/mame/drivers/wheelfir.cpp index 9e7102ff60c..bb899a1c156 100644 --- a/src/mame/drivers/wheelfir.cpp +++ b/src/mame/drivers/wheelfir.cpp @@ -429,7 +429,7 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_blit_w) { vpage=LAYER_BG; /* - printf("bg -> %d %d %d %d %d %d @ %x\n",dst_x0,dst_y0, dst_x1,dst_y1, dst_x1-dst_x0, dst_y1-dst_y0,space.device().safe_pc()); + printf("%s bg -> %d %d %d %d %d %d @ %x\n",machine().describe_context().c_str(), dst_x0,dst_y0, dst_x1,dst_y1, dst_x1-dst_x0, dst_y1-dst_y0); for(int i=0;i<16;++i) { @@ -538,8 +538,8 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_7c0000_w) { if (ACCESSING_BITS_8_15) { - //{uint16_t x = data & 0xf800; static int y = -1; if (x != y) { y = x; printf("%s wheelfir_7c0000_w %d%d%d%d%d\n", machine().describe_context(), BIT(data, 15), BIT(data, 14), BIT(data, 13), BIT(data, 12), BIT(data, 11)); }} - //{uint16_t x = data & 0x0700; static int y = -1; if (x != y) { y = x; printf("%s eeprom write %d%d%d\n", machine().describe_context(), BIT(data, 10), BIT(data, 9), BIT(data, 8)); }} + //{uint16_t x = data & 0xf800; static int y = -1; if (x != y) { y = x; printf("%s wheelfir_7c0000_w %d%d%d%d%d\n", machine().describe_context().c_str(), BIT(data, 15), BIT(data, 14), BIT(data, 13), BIT(data, 12), BIT(data, 11)); }} + //{uint16_t x = data & 0x0700; static int y = -1; if (x != y) { y = x; printf("%s eeprom write %d%d%d\n", machine().describe_context().c_str(), BIT(data, 10), BIT(data, 9), BIT(data, 8)); }} m_eeprom->di_write(BIT(data, 9)); m_eeprom->clk_write(BIT(data, 8)); m_eeprom->cs_write(BIT(data, 10)); @@ -561,7 +561,7 @@ READ16_MEMBER(wheelfir_state::wheelfir_7c0000_r) { data |= (machine().rand() & 0x2000); // ? data |= m_eeprom->do_read() << 15; - //printf("%s eeprom read %04x %04x\n", machine().describe_context(), data, mem_mask); + //printf("%s eeprom read %04x %04x\n", machine().describe_context().c_str(), data, mem_mask); } if (ACCESSING_BITS_0_7) diff --git a/src/mame/drivers/xtom3d.cpp b/src/mame/drivers/xtom3d.cpp index 8ec5817ac35..4aa6b37b8fc 100644 --- a/src/mame/drivers/xtom3d.cpp +++ b/src/mame/drivers/xtom3d.cpp @@ -244,7 +244,7 @@ uint8_t xtom3d_state::piix4_config_r(int function, int reg) void xtom3d_state::piix4_config_w(int function, int reg, uint8_t data) { -// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context(), function, reg, data); +// osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine().describe_context().c_str(), function, reg, data); m_piix4_config_reg[function][reg] = data; } diff --git a/src/mame/drivers/zaurus.cpp b/src/mame/drivers/zaurus.cpp index dde72fa0571..588ed5a55ab 100644 --- a/src/mame/drivers/zaurus.cpp +++ b/src/mame/drivers/zaurus.cpp @@ -1467,7 +1467,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c vsprintf( buf, s_fmt, v ); va_end( v ); device.logerror( "%s: %s", device.machine().describe_context(), buf ); - //printf( "%s: %s", device.machine().describe_context(), buf ); + //printf( "%s: %s", device.machine().describe_context().c_str(), buf ); } } diff --git a/src/mame/includes/coco.h b/src/mame/includes/coco.h index cfa5b9975c4..2e06453f102 100644 --- a/src/mame/includes/coco.h +++ b/src/mame/includes/coco.h @@ -153,8 +153,6 @@ protected: virtual void pia1_pb_changed(uint8_t data); // accessors - cpu_device &maincpu() { return *m_maincpu; } - address_space &cpu_address_space() { return maincpu().space(); } pia6821_device &pia_0() { return *m_pia_0; } pia6821_device &pia_1() { return *m_pia_1; } cococart_slot_device &cococart() { return *m_cococart; } @@ -165,7 +163,7 @@ protected: virtual void cart_w(bool state); virtual void update_cart_base(uint8_t *cart_base) = 0; -private: +protected: // timer constants static const device_timer_id TIMER_HIRES_JOYSTICK_X = 0; static const device_timer_id TIMER_HIRES_JOYSTICK_Y = 1; diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp index b3e81311061..2a6035b84d7 100644 --- a/src/mame/machine/apollo.cpp +++ b/src/mame/machine/apollo.cpp @@ -342,7 +342,7 @@ READ8_MEMBER(apollo_state::apollo_dma_2_r){ // (8237dma.c was always fast enough to omit these problems) if (offset == 8) { - switch (space.device().safe_pcbase()) + switch (m_maincpu->pcbase()) { case 0x00102e22: // DN3000 case 0x01002f3c: // DN3500 diff --git a/src/mame/machine/arkanoid.cpp b/src/mame/machine/arkanoid.cpp index 5f39d2d7d93..defde6ab266 100644 --- a/src/mame/machine/arkanoid.cpp +++ b/src/mame/machine/arkanoid.cpp @@ -84,10 +84,10 @@ TO DO (2006.09.12) : */ -#define LOG_F000_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_f000_r - cmd = %02x - val = %02x\n", space.device().safe_pc(), m_bootleg_cmd, arkanoid_bootleg_val); -#define LOG_F002_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n", space.device().safe_pc(), m_bootleg_cmd, arkanoid_bootleg_val); -#define LOG_D018_W if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n", space.device().safe_pc(), data, m_bootleg_cmd); -#define LOG_D008_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n", space.device().safe_pc(), arkanoid_bootleg_d008_val); +#define LOG_F000_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%s: arkanoid_bootleg_f000_r - cmd = %02x - val = %02x\n", machine().describe_context(), m_bootleg_cmd, arkanoid_bootleg_val); +#define LOG_F002_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%s: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n", machine().describe_context(), m_bootleg_cmd, arkanoid_bootleg_val); +#define LOG_D018_W if (ARKANOID_BOOTLEG_VERBOSE) logerror("%s: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n", machine().describe_context(), data, m_bootleg_cmd); +#define LOG_D008_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%s: arkanoid_bootleg_d008_r - val = %02x\n", machine().describe_context(), arkanoid_bootleg_d008_val); /* Kludge for some bootlegs that read this address */ @@ -125,7 +125,7 @@ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_f000_r) LOG_F000_R break; default: - logerror("%04x: arkanoid_bootleg_f000_r - cmd = %02x - unknown bootleg !\n", space.device().safe_pc(), m_bootleg_cmd); + logerror("%s: arkanoid_bootleg_f000_r - cmd = %02x - unknown bootleg !\n", machine().describe_context(), m_bootleg_cmd); break; } @@ -212,7 +212,7 @@ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_f002_r) LOG_F002_R break; default: - logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - unknown bootleg !\n", space.device().safe_pc(), m_bootleg_cmd); + logerror("%s: arkanoid_bootleg_f002_r - cmd = %02x - unknown bootleg !\n", machine().describe_context(), m_bootleg_cmd); break; } @@ -231,27 +231,27 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_bootleg_d018_w) switch (data) { case 0x36: /* unneeded value : no call 0x2050, unused A and overwritten HL (0x0313 -> 0x0340) */ - if (space.device().safe_pc() == 0x7c47) + if (m_maincpu->pc() == 0x7c47) m_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : no call 0x2050, unused A and fixed HL (0x7bd5) */ - if (space.device().safe_pc() == 0x7b87) + if (m_maincpu->pc() == 0x7b87) m_bootleg_cmd = 0x00; break; case 0x8a: /* unneeded value : no call 0x2050, unused A and overwritten HL (0x7b77 -> 0x7c1c) */ - if (space.device().safe_pc() == 0x9661) + if (m_maincpu->pc() == 0x9661) m_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x00) and fixed HL (0xed83) */ - if (space.device().safe_pc() == 0x67e3) + if (m_maincpu->pc() == 0x67e3) m_bootleg_cmd = 0x00; break; case 0xf7: /* unneeded value : 3 * 'NOP' at 0x034f + 2 * 'NOP' at 0x35b */ - if (space.device().safe_pc() == 0x0349) + if (m_maincpu->pc() == 0x0349) m_bootleg_cmd = 0x00; break; case 0xff: /* unneeded value : no call 0x2050, unused A and overwritten HL (0x7c4f -> 0x7d31) */ - if (space.device().safe_pc() == 0x9670) + if (m_maincpu->pc() == 0x9670) m_bootleg_cmd = 0x00; break; default: @@ -264,37 +264,37 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_bootleg_d018_w) switch (data) { case 0x36: /* unneeded value : call 0x2050 but fixed A (0x2d) */ - if (space.device().safe_pc() == 0x7c4c) + if (m_maincpu->pc() == 0x7c4c) m_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : call 0x2050 but fixed A (0xf3) */ - if (space.device().safe_pc() == 0x7b87) + if (m_maincpu->pc() == 0x7b87) m_bootleg_cmd = 0x00; break; case 0x88: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e3) + if (m_maincpu->pc() == 0x67e3) m_bootleg_cmd = 0x00; - if (space.device().safe_pc() == 0x7c47) + if (m_maincpu->pc() == 0x7c47) m_bootleg_cmd = 0x00; break; case 0x89: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e5) + if (m_maincpu->pc() == 0x67e5) m_bootleg_cmd = 0x00; break; case 0x8a: /* unneeded value : call 0x2050 but fixed A (0xa5) */ - if (space.device().safe_pc() == 0x9661) + if (m_maincpu->pc() == 0x9661) m_bootleg_cmd = 0x00; break; case 0xc0: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e7) + if (m_maincpu->pc() == 0x67e7) m_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x61) */ - if (space.device().safe_pc() == 0x67e9) + if (m_maincpu->pc() == 0x67e9) m_bootleg_cmd = 0x00; break; case 0xff: /* unneeded value : call 0x2050 but fixed A (0xe2) */ - if (space.device().safe_pc() == 0x9670) + if (m_maincpu->pc() == 0x9670) m_bootleg_cmd = 0x00; break; default: @@ -307,11 +307,11 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_bootleg_d018_w) switch (data) { case 0x05: /* Check 1 */ - if (space.device().safe_pc() == 0x0363) + if (m_maincpu->pc() == 0x0363) m_bootleg_cmd = 0x05; break; case 0x0a: /* Check 2 */ - if (space.device().safe_pc() == 0x0372) + if (m_maincpu->pc() == 0x0372) m_bootleg_cmd = 0x0a; break; default: @@ -324,41 +324,41 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_bootleg_d018_w) switch (data) { case 0x36: /* unneeded value : call 0x2050 but fixed A (0x2d) */ - if (space.device().safe_pc() == 0x7c4c) + if (m_maincpu->pc() == 0x7c4c) m_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : call 0x2050 but fixed A (0xf3) */ - if (space.device().safe_pc() == 0x7b87) + if (m_maincpu->pc() == 0x7b87) m_bootleg_cmd = 0x00; break; case 0x88: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e3) + if (m_maincpu->pc() == 0x67e3) m_bootleg_cmd = 0x00; - if (space.device().safe_pc() == 0x7c47) + if (m_maincpu->pc() == 0x7c47) m_bootleg_cmd = 0x00; break; case 0x89: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e5) + if (m_maincpu->pc() == 0x67e5) m_bootleg_cmd = 0x00; break; case 0x8a: /* unneeded value : call 0x2050 but unused HL and fixed DE (0x7c1c) */ - if (space.device().safe_pc() == 0x9661) + if (m_maincpu->pc() == 0x9661) m_bootleg_cmd = 0x00; break; case 0xc0: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e7) + if (m_maincpu->pc() == 0x67e7) m_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x61) */ - if (space.device().safe_pc() == 0x67e9) + if (m_maincpu->pc() == 0x67e9) m_bootleg_cmd = 0x00; break; case 0xf7: /* unneeded value : call 0x2050 but never called (check code at 0x0340) */ - if (space.device().safe_pc() == 0x0349) + if (m_maincpu->pc() == 0x0349) m_bootleg_cmd = 0x00; break; case 0xff: /* unneeded value : no call 0x2050, unused A and fixed HL (0x7d31) */ - if (space.device().safe_pc() == 0x9670) + if (m_maincpu->pc() == 0x9670) m_bootleg_cmd = 0x00; break; default: @@ -371,40 +371,40 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_bootleg_d018_w) switch (data) { case 0x36: /* unneeded value : call 0x2050 but fixed A (0x2d) */ - if (space.device().safe_pc() == 0x7c4c) + if (m_maincpu->pc() == 0x7c4c) m_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : call 0x2050 but fixed A (0xf3) */ - if (space.device().safe_pc() == 0x7b87) + if (m_maincpu->pc() == 0x7b87) m_bootleg_cmd = 0x00; break; case 0x88: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e3) + if (m_maincpu->pc() == 0x67e3) m_bootleg_cmd = 0x00; - if (space.device().safe_pc() == 0x7c47) + if (m_maincpu->pc() == 0x7c47) m_bootleg_cmd = 0x00; case 0x89: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e5) + if (m_maincpu->pc() == 0x67e5) m_bootleg_cmd = 0x00; break; case 0x8a: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x9661) + if (m_maincpu->pc() == 0x9661) m_bootleg_cmd = data; break; case 0xc0: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e7) + if (m_maincpu->pc() == 0x67e7) m_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x61) */ - if (space.device().safe_pc() == 0x67e9) + if (m_maincpu->pc() == 0x67e9) m_bootleg_cmd = 0x00; break; case 0xf7: /* unneeded value : 3 * 'NOP' at 0x034f + 'JR NZ,$035D' at 0x35b */ - if (space.device().safe_pc() == 0x0349) + if (m_maincpu->pc() == 0x0349) m_bootleg_cmd = 0x00; break; case 0xff: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x9670) + if (m_maincpu->pc() == 0x9670) m_bootleg_cmd = data; break; default: @@ -417,48 +417,48 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_bootleg_d018_w) switch (data) { case 0x24: /* A read from 0xf002 (expected to be 0x9b) */ - if (space.device().safe_pc() == 0xbd7a) + if (m_maincpu->pc() == 0xbd7a) m_bootleg_cmd = data; break; case 0x36: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x7c4c) + if (m_maincpu->pc() == 0x7c4c) m_bootleg_cmd = data; break; case 0x38: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x7b87) + if (m_maincpu->pc() == 0x7b87) m_bootleg_cmd = data; break; case 0x88: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e3) + if (m_maincpu->pc() == 0x67e3) m_bootleg_cmd = 0x00; - if (space.device().safe_pc() == 0x7c47) + if (m_maincpu->pc() == 0x7c47) m_bootleg_cmd = 0x00; case 0x89: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e5) + if (m_maincpu->pc() == 0x67e5) m_bootleg_cmd = 0x00; break; case 0x8a: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x9661) + if (m_maincpu->pc() == 0x9661) m_bootleg_cmd = data; break; case 0xc0: /* unneeded value : no read back */ - if (space.device().safe_pc() == 0x67e7) + if (m_maincpu->pc() == 0x67e7) m_bootleg_cmd = 0x00; break; case 0xc3: /* A read from 0xf002 (expected to be 0x1d) */ - if (space.device().safe_pc() == 0xbd8a) + if (m_maincpu->pc() == 0xbd8a) m_bootleg_cmd = data; break; case 0xe3: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x67e9) + if (m_maincpu->pc() == 0x67e9) m_bootleg_cmd = data; break; case 0xf7: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x0349) + if (m_maincpu->pc() == 0x0349) m_bootleg_cmd = data; break; case 0xff: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (space.device().safe_pc() == 0x9670) + if (m_maincpu->pc() == 0x9670) m_bootleg_cmd = data; break; default: @@ -469,7 +469,7 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_bootleg_d018_w) break; default: - logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - unknown bootleg !\n", space.device().safe_pc(), data); + logerror("%s: arkanoid_bootleg_d018_w - data = %02x - unknown bootleg !\n", machine().describe_context(), data); break; } } @@ -536,7 +536,7 @@ READ8_MEMBER(arkanoid_state::arkanoid_bootleg_d008_r) arkanoid_bootleg_d008_bit[2] = 0; /* untested bit */ arkanoid_bootleg_d008_bit[3] = 0; /* untested bit */ arkanoid_bootleg_d008_bit[5] = 0; /* untested bit */ - logerror("%04x: arkanoid_bootleg_d008_r - unknown bootleg !\n",space.device().safe_pc()); + logerror("%s: arkanoid_bootleg_d008_r - unknown bootleg !\n", machine().describe_context()); break; } diff --git a/src/mame/machine/asic65.cpp b/src/mame/machine/asic65.cpp index e792501b294..f701a54e47b 100644 --- a/src/mame/machine/asic65.cpp +++ b/src/mame/machine/asic65.cpp @@ -218,7 +218,7 @@ WRITE16_MEMBER( asic65_device::data_w ) else { int command = (data < MAX_COMMANDS) ? command_map[m_asic65_type][data] : OP_UNKNOWN; - if (m_log) fprintf(m_log, "\n(%06X)%c%04X:", safe_pcbase(), (command == OP_UNKNOWN) ? '*' : ' ', data); + if (m_log) fprintf(m_log, "\n%s %c%04X:", machine().describe_context().c_str(), (command == OP_UNKNOWN) ? '*' : ' ', data); /* set the command number and reset the parameter/result indices */ m_command = data; diff --git a/src/mame/machine/balsente.cpp b/src/mame/machine/balsente.cpp index aca5e6d6c0e..fd5cd932780 100644 --- a/src/mame/machine/balsente.cpp +++ b/src/mame/machine/balsente.cpp @@ -1185,7 +1185,7 @@ void balsente_state::update_grudge_steering() READ8_MEMBER(balsente_state::grudge_steering_r) { - logerror("%04X:grudge_steering_r(@%d)\n", space.device().safe_pc(), m_screen->vpos()); + logerror("%s:grudge_steering_r(@%d)\n", machine().describe_context(), m_screen->vpos()); m_grudge_steering_result |= 0x80; return m_grudge_steering_result; } diff --git a/src/mame/machine/bebox.cpp b/src/mame/machine/bebox.cpp index e5a0f504a90..3fc8b1f7f67 100644 --- a/src/mame/machine/bebox.cpp +++ b/src/mame/machine/bebox.cpp @@ -153,8 +153,8 @@ WRITE64_MEMBER(bebox_state::bebox_cpu0_imask_w ) { if (LOG_CPUIMASK) { - logerror("BeBox CPU #0 pc=0x%08X imask=0x%08x\n", - (unsigned) space.device().safe_pc( ), m_cpu_imask[0]); + logerror("%s BeBox CPU #0 imask=0x%08x\n", + machine().describe_context(), m_cpu_imask[0]); } bebox_update_interrupts(); } @@ -170,8 +170,8 @@ WRITE64_MEMBER(bebox_state::bebox_cpu1_imask_w ) { if (LOG_CPUIMASK) { - logerror("BeBox CPU #1 pc=0x%08X imask=0x%08x\n", - (unsigned) space.device() .safe_pc( ), m_cpu_imask[1]); + logerror("%s BeBox CPU #1 imask=0x%08x\n", + machine().describe_context(), m_cpu_imask[1]); } bebox_update_interrupts(); } diff --git a/src/mame/machine/cedar_magnet_flop.cpp b/src/mame/machine/cedar_magnet_flop.cpp index 61020923366..83d8134c669 100644 --- a/src/mame/machine/cedar_magnet_flop.cpp +++ b/src/mame/machine/cedar_magnet_flop.cpp @@ -51,7 +51,7 @@ READ8_MEMBER(cedar_magnet_flop_device::port63_r) { uint8_t ret = machine().rand(); - // printf("%s: port63_r (DATA) (%02x)\n", machine().describe_context(), ret); + // printf("%s: port63_r (DATA) (%02x)\n", machine().describe_context().c_str(), ret); if ((m_flopcmd&0xf0) == 0x90) // reading data { @@ -103,7 +103,7 @@ READ8_MEMBER(cedar_magnet_flop_device::port63_r) WRITE8_MEMBER(cedar_magnet_flop_device::port60_w) { - //printf("%s: port60_w (COMMAND) %02x\n", machine().describe_context(), data); + //printf("%s: port60_w (COMMAND) %02x\n", machine().describe_context().c_str(), data); m_flopcmd = data; @@ -150,7 +150,7 @@ WRITE8_MEMBER(cedar_magnet_flop_device::port60_w) WRITE8_MEMBER(cedar_magnet_flop_device::port62_w) { - //printf("%s: port62_w (SECTOR) %02x\n", machine().describe_context(), data); + //printf("%s: port62_w (SECTOR) %02x\n", machine().describe_context().c_str(), data); m_flopsec = data; if (m_flopsec < 200) @@ -163,7 +163,7 @@ WRITE8_MEMBER(cedar_magnet_flop_device::port62_w) WRITE8_MEMBER(cedar_magnet_flop_device::port63_w) { - //printf("%s: port63_w (DATA) %02x\n", machine().describe_context(), data); + //printf("%s: port63_w (DATA) %02x\n", machine().describe_context().c_str(), data); m_flopdat = data; if ((m_flopcmd & 0xf0) == 0xb0) // writing data diff --git a/src/mame/machine/cedar_magnet_sprite.cpp b/src/mame/machine/cedar_magnet_sprite.cpp index fb5170e6647..791780dadae 100644 --- a/src/mame/machine/cedar_magnet_sprite.cpp +++ b/src/mame/machine/cedar_magnet_sprite.cpp @@ -162,7 +162,7 @@ void cedar_magnet_sprite_device::do_blit() WRITE8_MEMBER(cedar_magnet_sprite_device::sprite_port80_w) { m_spritecodelow = data; -// printf("%s:sprite numlow / trigger %02x\n", machine().describe_context(), data); +// printf("%s:sprite numlow / trigger %02x\n", machine().describe_context().c_str(), data); do_blit(); } @@ -171,20 +171,20 @@ WRITE8_MEMBER(cedar_magnet_sprite_device::sprite_port84_w) { m_spritecodehigh = data; m_high_write = 1; -// printf("%s:sprite numhigh %02x\n", machine().describe_context(), data); +// printf("%s:sprite numhigh %02x\n", machine().describe_context().c_str(), data); } WRITE8_MEMBER(cedar_magnet_sprite_device::sprite_port88_w) { // frequent -// printf("%s:sprite_y_coordinate %02x\n", machine().describe_context(), data); +// printf("%s:sprite_y_coordinate %02x\n", machine().describe_context().c_str(), data); m_upperaddr = data; } WRITE8_MEMBER(cedar_magnet_sprite_device::pio2_pa_w) { // frequent -// printf("%s:sprite_x_coordinate %02x\n", machine().describe_context(), data); +// printf("%s:sprite_x_coordinate %02x\n", machine().describe_context().c_str(), data); m_loweraddr = data; } @@ -198,7 +198,7 @@ WRITE8_MEMBER(cedar_magnet_sprite_device::sprite_port8c_w) // possible watchdog? WRITE8_MEMBER(cedar_magnet_sprite_device::sprite_port9c_w) { -// printf("%s:sprite_port9c_w %02x\n", machine().describe_context(), data); +// printf("%s:sprite_port9c_w %02x\n", machine().describe_context().c_str(), data); } MACHINE_CONFIG_START(cedar_magnet_sprite_device::device_add_mconfig) @@ -239,7 +239,7 @@ MACHINE_CONFIG_END READ8_MEMBER(cedar_magnet_sprite_device::pio0_pa_r) { // actually read -// printf("%s: pio0_pa_r\n", machine().describe_context()); +// printf("%s: pio0_pa_r\n", machine().describe_context().c_str()); return 0x00; } @@ -253,17 +253,17 @@ WRITE8_MEMBER(cedar_magnet_sprite_device::pio0_pa_w) WRITE8_MEMBER(cedar_magnet_sprite_device::pio0_pb_w) { pio0_pb_data = data; - //printf("%s: pio0_pb_w %02x\n", machine().describe_context(), data); + //printf("%s: pio0_pb_w %02x\n", machine().describe_context().c_str(), data); } WRITE8_MEMBER(cedar_magnet_sprite_device::pio1_pa_w) { - //printf("%s: pio1_pa_w %02x\n", machine().describe_context(), data); + //printf("%s: pio1_pa_w %02x\n", machine().describe_context().c_str(), data); } WRITE8_MEMBER(cedar_magnet_sprite_device::pio1_pb_w) { - //printf("%s: pio1_pb_w %02x\n", machine().describe_context(), data); + //printf("%s: pio1_pb_w %02x\n", machine().describe_context().c_str(), data); } @@ -281,7 +281,7 @@ WRITE8_MEMBER(cedar_magnet_sprite_device::pio2_pb_w) } pio2_pb_data = data; - //printf("%s: ******************************************* BANK? **** pio2_pb_w %02x\n", machine().describe_context(), data); + //printf("%s: ******************************************* BANK? **** pio2_pb_w %02x\n", machine().describe_context().c_str(), data); // yes, it ends up banking the ram right out from under itself during startup execution... // during this time the main cpu is waiting in a loop, after which it copies the startup code again, and reboots it. m_sprite_ram_bankdev->set_bank(data & 0x03); diff --git a/src/mame/machine/coco.cpp b/src/mame/machine/coco.cpp index 41661d65247..cfb60864d67 100644 --- a/src/mame/machine/coco.cpp +++ b/src/mame/machine/coco.cpp @@ -274,17 +274,17 @@ uint8_t coco_state::floating_bus_read() uint16_t pc = m_maincpu->pc(); // get the byte; and skip over header bytes - uint8_t byte = cpu_address_space().read_byte(prev_pc); + uint8_t byte = m_maincpu->space().read_byte(prev_pc); if ((byte == 0x10) || (byte == 0x11)) - byte = cpu_address_space().read_byte(++prev_pc); + byte = m_maincpu->space().read_byte(++prev_pc); // check to see if the opcode specifies the indexed addressing mode, and the secondary byte // specifies no-offset bool is_nooffset_indexed = (((byte & 0xF0) == 0x60) || ((byte & 0xF0) == 0xA0) || ((byte & 0xF0) == 0xE0)) - && ((cpu_address_space().read_byte(prev_pc + 1) & 0xBF) == 0x84); + && ((m_maincpu->space().read_byte(prev_pc + 1) & 0xBF) == 0x84); // finally read the byte - result = cpu_address_space().read_byte(is_nooffset_indexed ? pc : 0xFFFF); + result = m_maincpu->space().read_byte(is_nooffset_indexed ? pc : 0xFFFF); // we're done reading m_in_floating_bus_read = false; @@ -620,7 +620,7 @@ void coco_state::recalculate_irq(void) bool line = irq_get_line(); if (LOG_INTERRUPTS) logerror("recalculate_irq(): line=%d\n", line ? 1 : 0); - maincpu().set_input_line(M6809_IRQ_LINE, line ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(M6809_IRQ_LINE, line ? ASSERT_LINE : CLEAR_LINE); } @@ -646,7 +646,7 @@ void coco_state::recalculate_firq(void) bool line = firq_get_line(); if (LOG_INTERRUPTS) logerror("recalculate_firq(): line=%d\n", line ? 1 : 0); - maincpu().set_input_line(M6809_FIRQ_LINE, line ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(M6809_FIRQ_LINE, line ? ASSERT_LINE : CLEAR_LINE); } @@ -1109,7 +1109,7 @@ void coco_state::poll_hires_joystick(void) double value = m_joystick.input(joystick_index, axis) / 255.0; value *= is_cocomax3 ? 2500.0 : 4160.0; value += is_cocomax3 ? 400.0 : 592.0; - attotime duration = maincpu().clocks_to_attotime((uint64_t) value) * 2; + attotime duration = m_maincpu->clocks_to_attotime((uint64_t) value) * 2; m_hiresjoy_transition_timer[axis]->adjust(duration); } else if (!m_hiresjoy_ca && newvalue) diff --git a/src/mame/machine/dgn_beta.cpp b/src/mame/machine/dgn_beta.cpp index e15f23ffe0f..0c8a7774132 100644 --- a/src/mame/machine/dgn_beta.cpp +++ b/src/mame/machine/dgn_beta.cpp @@ -149,7 +149,7 @@ void dgn_beta_state::UpdateBanks(int first, int last) int MapPage; char page_num[10]; - LOG_BANK_UPDATE(("\n\nUpdating banks %d to %d at PC=$%X\n",first,last,space_0.device().safe_pc())); + LOG_BANK_UPDATE(("\n\n%s Updating banks %d to %d\n", machine().describe_context(), first, last)); for(Page=first;Page<=last;Page++) { sprintf(page_num,"bank%d",Page+1); diff --git a/src/mame/machine/dgnalpha.cpp b/src/mame/machine/dgnalpha.cpp index a8f33681d15..41ff87aeec7 100644 --- a/src/mame/machine/dgnalpha.cpp +++ b/src/mame/machine/dgnalpha.cpp @@ -355,12 +355,12 @@ WRITE_LINE_MEMBER( dragon_alpha_state::fdc_intrq_w ) else { if (m_pia_2->ca2_output_z()) - maincpu().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } } else { - maincpu().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } } diff --git a/src/mame/machine/dragon.cpp b/src/mame/machine/dragon.cpp index 2ef1851d7d5..12950837d6d 100644 --- a/src/mame/machine/dragon.cpp +++ b/src/mame/machine/dragon.cpp @@ -235,7 +235,7 @@ void d64plus_state::device_start() { dragon_state::device_start(); - address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); + address_space& space = m_maincpu->space(AS_PROGRAM); space.install_readwrite_handler(0xffe0, 0xffe0, READ8_DEVICE_DELEGATE(m_crtc, mc6845_device, status_r), WRITE8_DEVICE_DELEGATE(m_crtc, mc6845_device, address_w)); space.install_readwrite_handler(0xffe1, 0xffe1, READ8_DEVICE_DELEGATE(m_crtc, mc6845_device, register_r), WRITE8_DEVICE_DELEGATE(m_crtc, mc6845_device, register_w)); space.install_readwrite_handler(0xffe2, 0xffe2, READ8_DELEGATE(d64plus_state, d64plus_6845_disp_r), WRITE8_DELEGATE(d64plus_state, d64plus_bank_w)); diff --git a/src/mame/machine/fddebug.cpp b/src/mame/machine/fddebug.cpp index 6495af49f52..a62cb823d9a 100644 --- a/src/mame/machine/fddebug.cpp +++ b/src/mame/machine/fddebug.cpp @@ -888,7 +888,7 @@ static void execute_fdunlock(running_machine &machine, int ref, int params, cons /* support 0 or 1 parameters */ uint64_t offset; if (params != 1 || !machine.debugger().commands().validate_number_parameter(param[0], &offset)) - offset = cpu->safe_pc(); + offset = cpu->state().pc(); int keyaddr = addr_to_keyaddr(offset / 2); /* toggle the ignore PC status */ @@ -932,7 +932,7 @@ static void execute_fdignore(running_machine &machine, int ref, int params, cons uint64_t offset; if (params != 1 || !machine.debugger().commands().validate_number_parameter(param[0], &offset)) - offset = cpu->safe_pc(); + offset = cpu->state().pc(); offset /= 2; /* toggle the ignore PC status */ @@ -1031,7 +1031,7 @@ static void execute_fdpc(running_machine &machine, int ref, int params, const ch /* support 0 or 1 parameters */ uint64_t newpc = 0; if (!machine.debugger().commands().validate_number_parameter(param[0], &newpc)) - newpc = cpu->safe_pc(); + newpc = cpu->state().pc(); /* set the new PC */ cpu->state().set_pc(newpc); @@ -1049,7 +1049,7 @@ static void execute_fdpc(running_machine &machine, int ref, int params, const ch static void execute_fdsearch(running_machine &machine, int ref, int params, const char **param) { address_space &space = machine->debugger().cpu().get_visible_cpu()->memory().space(AS_PROGRAM); - int pc = space.device().safe_pc(); + int pc = space.device().state().pc(); int length, first = true; uint8_t instrdata[2]; uint16_t decoded; diff --git a/src/mame/machine/gaelcrpt.cpp b/src/mame/machine/gaelcrpt.cpp index 63733b18b11..a227c9fc772 100644 --- a/src/mame/machine/gaelcrpt.cpp +++ b/src/mame/machine/gaelcrpt.cpp @@ -126,7 +126,7 @@ uint16_t gaelco_decrypt(address_space &space, int offset, int data, int param1, { static int lastpc, lastoffset, lastencword, lastdecword; - int thispc = space.device().safe_pc(); + int thispc = space.device().state().pc(); // int savedata = data; /* check if 2nd half of 32 bit */ diff --git a/src/mame/machine/hp48.cpp b/src/mame/machine/hp48.cpp index 2bbf60f33c1..2deefceaae2 100644 --- a/src/mame/machine/hp48.cpp +++ b/src/mame/machine/hp48.cpp @@ -523,7 +523,7 @@ WRITE8_MEMBER(hp48_state::hp49_bank_w) offset &= 0x7e; if ( m_bank_switch != offset ) { - LOG(( "%05x %f hp49_bank_w: off=%03x\n", space.device().safe_pcbase(), machine().time().as_double(), offset )); + LOG(("%s %f hp49_bank_w: off=%03x\n", machine().describe_context(), machine().time().as_double(), offset)); m_bank_switch = offset; apply_modules(); } diff --git a/src/mame/machine/inder_sb.cpp b/src/mame/machine/inder_sb.cpp index 382e0b7c7c2..4ac836b222a 100644 --- a/src/mame/machine/inder_sb.cpp +++ b/src/mame/machine/inder_sb.cpp @@ -37,20 +37,18 @@ READ8_MEMBER(inder_sb_device::vec_bankswitch_r) READ16_MEMBER(inder_sb_device::megaphx_0x050002_r) { + //logerror("%s megaphx_0x050002_r (from z80?) %04x\n", machine().describe_context(), mem_mask); machine().scheduler().synchronize(); -// int pc = machine().device("maincpu")->safe_pc(); int ret = m_soundback; //m_soundback = 0; - //logerror("(%06x) megaphx_0x050002_r (from z80?) %04x\n", pc, mem_mask); return ret; } WRITE16_MEMBER(inder_sb_device::megaphx_0x050000_w) { -// int pc = machine().device("maincpu")->safe_pc(); + //logerror("%s megaphx_0x050000_w (to z80?) %04x %04x\n", machine().describe_context(), data, mem_mask); machine().scheduler().synchronize(); - //logerror("(%06x) megaphx_0x050000_w (to z80?) %04x %04x\n", pc, data, mem_mask); m_soundsent = 0xff; m_sounddata = data; @@ -90,9 +88,8 @@ READ8_MEMBER(inder_sb_device::megaphx_sound_sent_r) WRITE8_MEMBER(inder_sb_device::megaphx_sound_to_68k_w) { -// int pc = machine().device("audiocpu")->safe_pc(); + //logerror("%s megaphx_sound_to_68k_w (to 68k?) %02x\n", machine().describe_context(), data); machine().scheduler().synchronize(); - //logerror("(%04x) megaphx_sound_to_68k_w (to 68k?) %02x\n", pc, data); m_soundback = data; } diff --git a/src/mame/machine/kaneko_toybox.cpp b/src/mame/machine/kaneko_toybox.cpp index 23905f67dc6..39eefffb676 100644 --- a/src/mame/machine/kaneko_toybox.cpp +++ b/src/mame/machine/kaneko_toybox.cpp @@ -467,7 +467,7 @@ WRITE16_MEMBER(kaneko_toybox_device::mcu_com3_w){ mcu_com_w(offset, data, mem_ma */ READ16_MEMBER(kaneko_toybox_device::mcu_status_r) { - logerror("CPU %s (PC=%06X) : read MCU status\n", space.device().tag(), space.device().safe_pcbase()); + logerror("%s : read MCU status\n", machine().describe_context()); return 0; // most games test bit 0 for failure } diff --git a/src/mame/machine/kay_kbd.cpp b/src/mame/machine/kay_kbd.cpp index fa5578e2d2b..ccda70529fd 100644 --- a/src/mame/machine/kay_kbd.cpp +++ b/src/mame/machine/kay_kbd.cpp @@ -389,7 +389,7 @@ READ8_MEMBER(kaypro_10_keyboard_device::p2_r) WRITE8_MEMBER(kaypro_10_keyboard_device::p2_w) { - if ((VERBOSE & LOG_TXD) && (0x0014U >= static_cast<device_state_interface *>(m_mcu)->safe_pc())) + if ((VERBOSE & LOG_TXD) && (0x0014U >= m_mcu->pc())) { auto const suppressor(machine().disable_side_effects()); address_space &mcu_ram(m_mcu->space(AS_DATA)); diff --git a/src/mame/machine/konppc.cpp b/src/mame/machine/konppc.cpp index cc779d94d91..5ecd105ff3f 100644 --- a/src/mame/machine/konppc.cpp +++ b/src/mame/machine/konppc.cpp @@ -114,7 +114,7 @@ READ32_MEMBER( konppc_device::cgboard_dsp_comm_r_ppc ) { if (cgboard_id < MAX_CG_BOARDS) { -// osd_printf_debug("dsp_cmd_r: (board %d) %08X, %08X %s\n", cgboard_id, offset, mem_mask, machine().describe_context()); +// osd_printf_debug("%s dsp_cmd_r: (board %d) %08X, %08X\n", machine().describe_context().c_str(), cgboard_id, offset, mem_mask); return dsp_comm_sharc[cgboard_id][offset] | (dsp_state[cgboard_id] << 16); } else @@ -129,7 +129,7 @@ WRITE32_MEMBER( konppc_device::cgboard_dsp_comm_w_ppc ) const char *pcitag = (cgboard_id == 0) ? "k033906_1" : "k033906_2"; device_t *dsp = machine().device(dsptag); k033906_device *k033906 = machine().device<k033906_device>(pcitag); -// osd_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X %s\n", cgboard_id, data, offset, mem_mask, machine().describe_context()); +// osd_printf_debug("%s dsp_cmd_w: (board %d) %08X, %08X, %08X\n", machine().describe_context().c_str(), cgboard_id, data, offset, mem_mask); if (cgboard_id < MAX_CG_BOARDS) { @@ -261,7 +261,7 @@ void konppc_device::dsp_comm_sharc_w(address_space &space, int board, int offset } } -// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", machine().describe_context(), data, offset, mem_mask); +// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", machine().describe_context().c_str(), data, offset, mem_mask); dsp_comm_sharc[board][offset] = data; } diff --git a/src/mame/machine/leland.cpp b/src/mame/machine/leland.cpp index ac5f1f9e4c3..05a33177fa0 100644 --- a/src/mame/machine/leland.cpp +++ b/src/mame/machine/leland.cpp @@ -109,7 +109,7 @@ WRITE8_MEMBER(leland_state::alleymas_joystick_kludge) { /* catch the case where they clear this memory location at PC $1827 and change */ /* the value written to be a 1 */ - if (space.device().safe_pcbase() == 0x1827) + if (m_master->pcbase() == 0x1827) *m_alleymas_kludge_mem = 1; else *m_alleymas_kludge_mem = data; @@ -1128,7 +1128,7 @@ READ8_MEMBER(leland_state::leland_master_input_r) case 0x11: /* /GIN1 */ result = ioport("IN3")->read(); - if (LOG_EEPROM) logerror("%04X:EE read\n", space.device().safe_pc()); + if (LOG_EEPROM) logerror("%s:EE read\n", machine().describe_context()); break; default: @@ -1149,7 +1149,7 @@ WRITE8_MEMBER(leland_state::leland_master_output_w) m_slave->set_input_line(INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); m_slave->set_input_line(0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); - if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", space.device().safe_pc(), + if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", machine().describe_context(), (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); m_eeprom->di_write ((data & 0x10) >> 4); m_eeprom->clk_write((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp index 68df2a75ed4..a8a9e980ba1 100644 --- a/src/mame/machine/mac.cpp +++ b/src/mame/machine/mac.cpp @@ -1207,7 +1207,7 @@ READ16_MEMBER ( mac_state::mac_iwm_r ) result = fdc->read(offset >> 8); if (LOG_MAC_IWM) - printf("mac_iwm_r: offset=0x%08x mem_mask %04x = %02x (PC %x)\n", offset, mem_mask, result, m_maincpu->pc()); + printf("%s mac_iwm_r: offset=0x%08x mem_mask %04x = %02x\n", machine().describe_context().c_str(), offset, mem_mask, result); return (result << 8) | result; } @@ -1288,7 +1288,7 @@ WRITE_LINE_MEMBER(mac_state::mac_adb_via_out_cb2) READ8_MEMBER(mac_state::mac_via_in_a) { -// printf("VIA1 IN_A (PC %x)\n", m_maincpu->safe_pc()); +// printf("%s VIA1 IN_A\n", machine().describe_context().c_str()); switch (m_model) { @@ -1343,7 +1343,7 @@ READ8_MEMBER(mac_state::mac_via_in_a) READ8_MEMBER(mac_state::mac_via_in_a_pmu) { -// printf("VIA1 IN_A (PC %x)\n", m_maincpu->safe_pc()); +// printf("%s VIA1 IN_A\n", machine().describe_context().c_str()); #if LOG_ADB // printf("Read PM data %x\n", m_pm_data_recv); @@ -1389,7 +1389,7 @@ READ8_MEMBER(mac_state::mac_via_in_b) val |= m_rtc->data_r(); } -// printf("VIA1 IN_B = %02x (PC %x)\n", val, m_maincpu->safe_pc()); +// printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val); return val; } @@ -1418,7 +1418,7 @@ READ8_MEMBER(mac_state::mac_via_in_b_ii) val |= m_cuda->get_treq()<<3; } -// printf("VIA1 IN_B_II = %02x (PC %x)\n", val, m_maincpu->safe_pc()); +// printf("%s VIA1 IN_B_II = %02x\n", machine().describe_context().c_str(), val); return val; } @@ -1433,7 +1433,7 @@ READ8_MEMBER(mac_state::mac_via_in_b_via2pmu) val |= 0x40; -// printf("VIA1 IN_B = %02x (PC %x)\n", val, m_maincpu->safe_pc()); +// printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val); return val; } @@ -1444,7 +1444,7 @@ READ8_MEMBER(mac_state::mac_via_in_b_pmu) // printf("Read VIA B: PM_ACK %x\n", m_pm_ack); val = 0x80 | 0x04 | m_pm_ack; // SCC wait/request (bit 2 must be set at 900c1a or startup tests always fail) -// printf("VIA1 IN_B = %02x (PC %x)\n", val, m_maincpu->safe_pc()); +// printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val); return val; } @@ -1452,7 +1452,7 @@ READ8_MEMBER(mac_state::mac_via_in_b_pmu) WRITE8_MEMBER(mac_state::mac_via_out_a) { device_t *fdc = machine().device("fdc"); -// printf("VIA1 OUT A: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT A: %02x\n", machine().describe_context().c_str(), data); set_scc_waitrequest((data & 0x80) >> 7); m_screen_buffer = (data & 0x40) >> 6; @@ -1484,7 +1484,7 @@ WRITE8_MEMBER(mac_state::mac_via_out_a) WRITE8_MEMBER(mac_state::mac_via_out_a_pmu) { -// printf("VIA1 OUT A: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT A: %02x\n", machine().describe_context().c_str(), data); #if LOG_ADB // printf("%02x to PM\n", data); @@ -1495,7 +1495,7 @@ WRITE8_MEMBER(mac_state::mac_via_out_a_pmu) WRITE8_MEMBER(mac_state::mac_via_out_b) { -// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); if (AUDIO_IS_CLASSIC) { @@ -1530,7 +1530,7 @@ void mac_state::update_volume(void) WRITE8_MEMBER(mac_state::mac_via_out_b_bbadb) { -// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); // SE and Classic have SCSI enable/disable here if ((m_model == MODEL_MAC_SE) || (m_model == MODEL_MAC_CLASSIC)) @@ -1560,10 +1560,10 @@ WRITE8_MEMBER(mac_state::mac_via_out_b_bbadb) WRITE8_MEMBER(mac_state::mac_via_out_b_egadb) { -// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->pc()); +// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); #if LOG_ADB - printf("68K: New Egret state: SS %d VF %d (PC %x)\n", (data>>5)&1, (data>>4)&1, m_maincpu->pc()); + printf("%s 68K: New Egret state: SS %d VF %d\n", machine().describe_context().c_str(), (data>>5)&1, (data>>4)&1); #endif m_egret->set_via_full((data&0x10) ? 1 : 0); m_egret->set_sys_session((data&0x20) ? 1 : 0); @@ -1571,10 +1571,10 @@ WRITE8_MEMBER(mac_state::mac_via_out_b_egadb) WRITE8_MEMBER(mac_state::mac_via_out_b_cdadb) { -// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->pc()); +// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); #if LOG_ADB - printf("68K: New Cuda state: TIP %d BYTEACK %d (PC %x)\n", (data>>5)&1, (data>>4)&1, m_maincpu->pc()); + printf("%s 68K: New Cuda state: TIP %d BYTEACK %d\n", machine().describe_context().c_str(), (data>>5)&1, (data>>4)&1); #endif m_cuda->set_byteack((data&0x10) ? 1 : 0); m_cuda->set_tip((data&0x20) ? 1 : 0); @@ -1582,12 +1582,12 @@ WRITE8_MEMBER(mac_state::mac_via_out_b_cdadb) WRITE8_MEMBER(mac_state::mac_via_out_b_via2pmu) { -// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); } WRITE8_MEMBER(mac_state::mac_via_out_b_pmu) { -// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); device_t *fdc = machine().device("fdc"); @@ -1750,7 +1750,7 @@ READ8_MEMBER(mac_state::mac_via2_in_a_pmu) READ8_MEMBER(mac_state::mac_via2_in_b) { -// logerror("VIA2 IN B (PC %x)\n", m_maincpu->safe_pc()); +// logerror("%s VIA2 IN B\n", machine().describe_context()); if ((m_model == MODEL_MAC_LC) || (m_model == MODEL_MAC_LC_II) || (m_model == MODEL_MAC_CLASSIC_II)) { @@ -1767,7 +1767,7 @@ READ8_MEMBER(mac_state::mac_via2_in_b) READ8_MEMBER(mac_state::mac_via2_in_b_pmu) { -// logerror("VIA2 IN B (PC %x)\n", m_maincpu->safe_pc()); +// logerror("%s VIA2 IN B\n", machine().describe_context()); if (m_pm_ack == 2) { @@ -1781,18 +1781,18 @@ READ8_MEMBER(mac_state::mac_via2_in_b_pmu) WRITE8_MEMBER(mac_state::mac_via2_out_a) { -// logerror("VIA2 OUT A: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// logerror("%s VIA2 OUT A: %02x\n", machine().describe_context(), data); } WRITE8_MEMBER(mac_state::mac_via2_out_a_pmu) { -// logerror("VIA2 OUT A: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// logerror("%s VIA2 OUT A: %02x\n", machine().describe_context(), data); m_pm_data_send = data; } WRITE8_MEMBER(mac_state::mac_via2_out_b) { -// logerror("VIA2 OUT B: %02x (PC %x)\n", data, m_maincpu->safe_pc()); +// logerror("%s VIA2 OUT B: %02x\n", machine().describe_context(), data); // chain 60.15 Hz to VIA1 m_via1->write_ca1(data>>7); @@ -1806,7 +1806,7 @@ WRITE8_MEMBER(mac_state::mac_via2_out_b) WRITE8_MEMBER(mac_state::mac_via2_out_b_pmu) { -// logerror("VIA2 OUT B PMU: %02x (PC %x)\n", data, m_maincpu->pc()); +// logerror("%s VIA2 OUT B PMU: %02x\n", machine().describe_context(), data); if ((data & 4) && !(m_pm_req & 4)) { diff --git a/src/mame/machine/midtunit.cpp b/src/mame/machine/midtunit.cpp index f9471c9e3ce..23b4d4b8274 100644 --- a/src/mame/machine/midtunit.cpp +++ b/src/mame/machine/midtunit.cpp @@ -92,12 +92,12 @@ static const uint8_t mk_prot_values[] = READ16_MEMBER(midtunit_state::mk_prot_r) { - logerror("%08X:Protection R @ %05X = %04X\n", space.device().safe_pc(), offset, mk_prot_values[m_mk_prot_index] << 9); + logerror("%s:Protection R @ %05X = %04X\n", machine().describe_context(), offset, mk_prot_values[m_mk_prot_index] << 9); /* just in case */ if (m_mk_prot_index >= sizeof(mk_prot_values)) { - logerror("%08X:Unexpected protection R @ %05X\n", space.device().safe_pc(), offset); + logerror("%s:Unexpected protection R @ %05X\n", machine().describe_context(), offset); m_mk_prot_index = 0; } @@ -122,11 +122,11 @@ WRITE16_MEMBER(midtunit_state::mk_prot_w) /* just in case */ if (i == sizeof(mk_prot_values)) { - logerror("%08X:Unhandled protection W @ %05X = %04X\n", space.device().safe_pc(), offset, data); + logerror("%s:Unhandled protection W @ %05X = %04X\n", machine().describe_context(), offset, data); m_mk_prot_index = 0; } - logerror("%08X:Protection W @ %05X = %04X\n", space.device().safe_pc(), offset, data); + logerror("%s:Protection W @ %05X = %04X\n", machine().describe_context(), offset, data); } } @@ -294,7 +294,7 @@ static const uint8_t jdredd_prot_values_80020[] = WRITE16_MEMBER(midtunit_state::jdredd_prot_w) { - logerror("%08X:jdredd_prot_w(%04X,%04X)\n", space.device().safe_pcbase(), offset*16, data); + logerror("%s:jdredd_prot_w(%04X,%04X)\n", machine().describe_context(), offset*16, data); switch (offset) { @@ -342,7 +342,7 @@ READ16_MEMBER(midtunit_state::jdredd_prot_r) if (m_jdredd_prot_table && m_jdredd_prot_index < m_jdredd_prot_max) result = m_jdredd_prot_table[m_jdredd_prot_index++] << 9; - logerror("%08X:jdredd_prot_r(%04X) = %04X\n", space.device().safe_pcbase(), offset*16, result); + logerror("%s:jdredd_prot_r(%04X) = %04X\n", machine().describe_context(), offset*16, result); return result; } @@ -511,7 +511,7 @@ MACHINE_RESET_MEMBER(midtunit_state,midtunit) READ16_MEMBER(midtunit_state::midtunit_sound_state_r) { -/* logerror("%08X:Sound status read\n", space.device().safe_pc());*/ +/* logerror("%s:Sound status read\n", machine().describe_context());*/ if (m_chip_type == SOUND_DCS) return m_dcs->control_r() >> 4; diff --git a/src/mame/machine/midwayic.cpp b/src/mame/machine/midwayic.cpp index 8829097b3ac..816dc10ec0a 100644 --- a/src/mame/machine/midwayic.cpp +++ b/src/mame/machine/midwayic.cpp @@ -216,37 +216,37 @@ void midway_serial_pic_emu_device::device_start() READ8_MEMBER(midway_serial_pic_emu_device::read_a) { -// printf("%s: read_a\n", machine().describe_context()); +// printf("%s: read_a\n", machine().describe_context().c_str()); return 0x00; } READ8_MEMBER(midway_serial_pic_emu_device::read_b) { -// printf("%s: read_b\n", machine().describe_context()); +// printf("%s: read_b\n", machine().describe_context().c_str()); return 0x00; } READ8_MEMBER(midway_serial_pic_emu_device::read_c) { // used -// printf("%s: read_c\n", machine().describe_context()); +// printf("%s: read_c\n", machine().describe_context().c_str()); return 0x00; } WRITE8_MEMBER(midway_serial_pic_emu_device::write_a) { -// printf("%s: write_a %02x\n", machine().describe_context(), data); +// printf("%s: write_a %02x\n", machine().describe_context().c_str(), data); } WRITE8_MEMBER(midway_serial_pic_emu_device::write_b) { -// printf("%s: write_b %02x\n", machine().describe_context(), data); +// printf("%s: write_b %02x\n", machine().describe_context().c_str(), data); } WRITE8_MEMBER(midway_serial_pic_emu_device::write_c) { // used -// printf("%s: write_c %02x\n", machine().describe_context(), data); +// printf("%s: write_c %02x\n", machine().describe_context().c_str(), data); } MACHINE_CONFIG_START(midway_serial_pic_emu_device::device_add_mconfig) diff --git a/src/mame/machine/midyunit.cpp b/src/mame/machine/midyunit.cpp index 986a5a3ceec..fb827eefaa8 100644 --- a/src/mame/machine/midyunit.cpp +++ b/src/mame/machine/midyunit.cpp @@ -176,7 +176,7 @@ WRITE16_MEMBER(midyunit_state::term2_sound_w) WRITE16_MEMBER(midyunit_state::term2_hack_w) { - if (offset == 1 && space.device().safe_pc() == 0xffce6520) + if (offset == 1 && m_maincpu->pc() == 0xffce6520) { m_t2_hack_mem[offset] = 0; return; @@ -186,7 +186,7 @@ WRITE16_MEMBER(midyunit_state::term2_hack_w) WRITE16_MEMBER(midyunit_state::term2la3_hack_w) { - if (offset == 0 && space.device().safe_pc() == 0xffce5230) + if (offset == 0 && m_maincpu->pc() == 0xffce5230) { m_t2_hack_mem[offset] = 0; return; @@ -196,7 +196,7 @@ WRITE16_MEMBER(midyunit_state::term2la3_hack_w) WRITE16_MEMBER(midyunit_state::term2la2_hack_w) { - if (offset == 0 && space.device().safe_pc() == 0xffce4b80) + if (offset == 0 && m_maincpu->pc() == 0xffce4b80) { m_t2_hack_mem[offset] = 0; return; @@ -206,7 +206,7 @@ WRITE16_MEMBER(midyunit_state::term2la2_hack_w) WRITE16_MEMBER(midyunit_state::term2la1_hack_w) { - if (offset == 0 && space.device().safe_pc() == 0xffce33f0) + if (offset == 0 && m_maincpu->pc() == 0xffce33f0) { m_t2_hack_mem[offset] = 0; return; diff --git a/src/mame/machine/mpu4.cpp b/src/mame/machine/mpu4.cpp index 4b4c266ec50..86481bfeba2 100644 --- a/src/mame/machine/mpu4.cpp +++ b/src/mame/machine/mpu4.cpp @@ -1896,10 +1896,10 @@ WRITE8_MEMBER(mpu4_state::characteriser_w) { int x; int call=data; - LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", space.device().safe_pcbase(),offset,data)); + LOG_CHR_FULL(("%s Characteriser write offset %02X data %02X\n", machine().describe_context(), offset, data)); if (!m_current_chr_table) { - logerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase()); + logerror("%s No Characteriser Table\n", machine().describe_context()); return; } @@ -1973,7 +1973,7 @@ READ8_MEMBER(mpu4_state::characteriser_r) { if (!m_current_chr_table) { - logerror("No Characteriser Table @ %04x", space.device().safe_pcbase()); + logerror("%s No Characteriser Table\n", machine().describe_context()); /* a cheat ... many early games use a standard check */ int addr = space.device().state().state_int(M6809_X); @@ -2044,9 +2044,9 @@ WRITE8_MEMBER(mpu4_state::bwb_characteriser_w) { int x; int call=data; - LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", space.device().safe_pcbase(),offset,data)); + LOG_CHR_FULL(("%s Characteriser write offset %02X data %02X\n", machine().describe_context(), offset, data)); if (!m_current_chr_table) - fatalerror("No Characteriser Table @ %04x\n", space.device().safe_pcbase()); + fatalerror("%s No Characteriser Table\n", machine().describe_context().c_str()); if ((offset & 0x3f)== 0)//initialisation is always at 0x800 { diff --git a/src/mame/machine/namcond1.cpp b/src/mame/machine/namcond1.cpp index 3155577d111..6fa23881dea 100644 --- a/src/mame/machine/namcond1.cpp +++ b/src/mame/machine/namcond1.cpp @@ -64,8 +64,8 @@ READ16_MEMBER(namcond1_state::cuskey_r) return( 0x0000 ); default : - logerror( "offset $%X accessed from $%X\n", - offset<<1, space.device().safe_pc() ); + logerror("%s offset $%X accessed\n", + machine().describe_context(), offset << 1); return( 0 ); } } diff --git a/src/mame/machine/naomi.cpp b/src/mame/machine/naomi.cpp index 07854c27f59..0d46b1ff23a 100644 --- a/src/mame/machine/naomi.cpp +++ b/src/mame/machine/naomi.cpp @@ -41,7 +41,7 @@ READ64_MEMBER(naomi_state::naomi_biosh_idle_skip_r ) // if (m_maincpu->pc()==0xc045ffc) // m_maincpu->spin_until_time(attotime::from_usec(500)); -// printf("%08x\n", m_maincpu->safe_pc()); +// printf("%08\n", m_maincpu->pc()); return dc_ram[0x2b0600/8]; } diff --git a/src/mame/machine/pc1403.cpp b/src/mame/machine/pc1403.cpp index db97958690b..4418f968ed0 100644 --- a/src/mame/machine/pc1403.cpp +++ b/src/mame/machine/pc1403.cpp @@ -124,7 +124,7 @@ READ8_MEMBER(pc1403_state::pc1403_inb) WRITE8_MEMBER(pc1403_state::pc1403_outc) { m_portc = data; -// logerror("%g pc %.4x outc %.2x\n", device->machine().time().as_double(), device->m_maincpu->safe_pc(), data); +// logerror("%s %g pc %.4x outc %.2x\n", machine().describe_context(), machine().time().as_double(), data); } diff --git a/src/mame/machine/pgmprot_igs027a_type1.cpp b/src/mame/machine/pgmprot_igs027a_type1.cpp index 97ad4650988..f112e37b092 100644 --- a/src/mame/machine/pgmprot_igs027a_type1.cpp +++ b/src/mame/machine/pgmprot_igs027a_type1.cpp @@ -542,21 +542,21 @@ void pgm_arm_type1_state::command_handler_ddp3(int pc) break; case 0x67: // set high bits - // printf("%s command %02x | %04x\n", machine().describe_context(), m_ddp3lastcommand, m_value0); + // printf("%s command %02x | %04x\n", machine().describe_context().c_str(), m_ddp3lastcommand, m_value0); m_valueresponse = 0x880000; m_curslots = (m_value0 & 0xff00)>>8; m_slots[m_curslots] = (m_value0 & 0x00ff) << 16; break; case 0xe5: // set low bits for operation? - // printf("%s command %02x | %04x\n", machine().describe_context(), m_ddp3lastcommand, m_value0); + // printf("%s command %02x | %04x\n", machine().describe_context().c_str(), m_ddp3lastcommand, m_value0); m_valueresponse = 0x880000; m_slots[m_curslots] |= (m_value0 & 0xffff); break; case 0x8e: // read back result of operations - // printf("%s command %02x | %04x\n", machine().describe_context(), m_ddp3lastcommand, m_value0); + // printf("%s command %02x | %04x\n", machine().describe_context().c_str(), m_ddp3lastcommand, m_value0); m_valueresponse = m_slots[m_value0&0xff]; break; diff --git a/src/mame/machine/pgmprot_igs027a_type2.cpp b/src/mame/machine/pgmprot_igs027a_type2.cpp index 206c7a325b9..fd518139811 100644 --- a/src/mame/machine/pgmprot_igs027a_type2.cpp +++ b/src/mame/machine/pgmprot_igs027a_type2.cpp @@ -41,14 +41,14 @@ READ32_MEMBER(pgm_arm_type2_state::arm7_latch_arm_r ) m_prot->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE ); // guess if (PGMARM7LOGERROR) - logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", m_kov2_latchdata_68k_w, mem_mask, space.device().safe_pc()); + logerror("%s ARM7: Latch read: %08x (%08x)\n", machine().describe_context(), m_kov2_latchdata_68k_w, mem_mask); return m_kov2_latchdata_68k_w; } WRITE32_MEMBER(pgm_arm_type2_state::arm7_latch_arm_w ) { if (PGMARM7LOGERROR) - logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, space.device().safe_pc()); + logerror("%s ARM7: Latch write: %08x (%08x)\n", machine().describe_context(), data, mem_mask); COMBINE_DATA(&m_kov2_latchdata_arm_w); } @@ -56,28 +56,28 @@ WRITE32_MEMBER(pgm_arm_type2_state::arm7_latch_arm_w ) READ32_MEMBER(pgm_arm_type2_state::arm7_shareram_r ) { if (PGMARM7LOGERROR) - logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, m_arm7_shareram[offset], mem_mask, space.device().safe_pc()); + logerror("%s ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x)\n", machine().describe_context(), offset << 2, m_arm7_shareram[offset], mem_mask); return m_arm7_shareram[offset]; } WRITE32_MEMBER(pgm_arm_type2_state::arm7_shareram_w ) { if (PGMARM7LOGERROR) - logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, space.device().safe_pc()); + logerror("%s ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x)\n", machine().describe_context(), offset << 2, data, mem_mask); COMBINE_DATA(&m_arm7_shareram[offset]); } READ16_MEMBER(pgm_arm_type2_state::arm7_latch_68k_r ) { if (PGMARM7LOGERROR) - logerror("M68K: Latch read: %04x (%04x) (%06x)\n", m_kov2_latchdata_arm_w & 0x0000ffff, mem_mask, space.device().safe_pc()); + logerror("%s M68K: Latch read: %04x (%04x)\n", machine().describe_context(), m_kov2_latchdata_arm_w & 0x0000ffff, mem_mask); return m_kov2_latchdata_arm_w; } WRITE16_MEMBER(pgm_arm_type2_state::arm7_latch_68k_w ) { if (PGMARM7LOGERROR) - logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, space.device().safe_pc()); + logerror("%s M68K: Latch write: %04x (%04x)\n", machine().describe_context(), data & 0x0000ffff, mem_mask); COMBINE_DATA(&m_kov2_latchdata_68k_w); m_prot->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE ); // guess @@ -88,7 +88,7 @@ READ16_MEMBER(pgm_arm_type2_state::arm7_ram_r ) uint16_t *share16 = reinterpret_cast<uint16_t *>(m_arm7_shareram.target()); if (PGMARM7LOGERROR) - logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, space.device().safe_pc()); + logerror("%s M68K: ARM7 Shared RAM Read: %04x = %04x (%08x)\n", machine().describe_context(), BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask); return share16[BYTE_XOR_LE(offset)]; } @@ -97,7 +97,7 @@ WRITE16_MEMBER(pgm_arm_type2_state::arm7_ram_w ) uint16_t *share16 = reinterpret_cast<uint16_t *>(m_arm7_shareram.target()); if (PGMARM7LOGERROR) - logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, space.device().safe_pc()); + logerror("%s M68K: ARM7 Shared RAM Write: %04x = %04x (%04x)\n", machine().describe_context(), BYTE_XOR_LE(offset), data, mem_mask); COMBINE_DATA(&share16[BYTE_XOR_LE(offset)]); } @@ -159,7 +159,7 @@ void pgm_arm_type2_state::kov2_latch_init() WRITE32_MEMBER(pgm_arm_type2_state::kov2_arm_region_w ) { - int pc = space.device().safe_pc(); + int pc = m_prot->pc(); int regionhack = ioport("RegionHack")->read(); if (pc==0x190 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0); COMBINE_DATA(&m_arm7_shareram[0x138/4]); @@ -167,7 +167,7 @@ WRITE32_MEMBER(pgm_arm_type2_state::kov2_arm_region_w ) WRITE32_MEMBER(pgm_arm_type2_state::kov2p_arm_region_w ) { - int pc = space.device().safe_pc(); + int pc = m_prot->pc(); int regionhack = ioport("RegionHack")->read(); // printf("%08x\n", pc); if (pc==0x1b0 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0); @@ -182,7 +182,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,kov2) kov2_latch_init(); // we only have a HK internal ROM dumped for now, allow us to override that for debugging purposes. - machine().device("prot")->memory().space(AS_PROGRAM).install_write_handler(0x48000138, 0x4800013b, write32_delegate(FUNC(pgm_arm_type2_state::kov2_arm_region_w),this)); + m_prot->space(AS_PROGRAM).install_write_handler(0x48000138, 0x4800013b, write32_delegate(FUNC(pgm_arm_type2_state::kov2_arm_region_w),this)); } @@ -196,12 +196,12 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,kov2p) kov2_latch_init(); // we only have a China internal ROM dumped for now, allow us to override that for debugging purposes. - machine().device("prot")->memory().space(AS_PROGRAM).install_write_handler(0x48000138, 0x4800013b, write32_delegate(FUNC(pgm_arm_type2_state::kov2p_arm_region_w),this)); + m_prot->space(AS_PROGRAM).install_write_handler(0x48000138, 0x4800013b, write32_delegate(FUNC(pgm_arm_type2_state::kov2p_arm_region_w),this)); } WRITE32_MEMBER(pgm_arm_type2_state::martmast_arm_region_w ) { - int pc = space.device().safe_pc(); + int pc = m_prot->pc(); int regionhack = ioport("RegionHack")->read(); if (pc==0x170 && regionhack != 0xff) data = (data & 0xffff0000) | (regionhack << 0); COMBINE_DATA(&m_arm7_shareram[0x138/4]); @@ -215,7 +215,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,martmast) kov2_latch_init(); // we only have a USA / CHINA internal ROMs dumped for now, allow us to override that for debugging purposes. - machine().device("prot")->memory().space(AS_PROGRAM).install_write_handler(0x48000138, 0x4800013b, write32_delegate(FUNC(pgm_arm_type2_state::martmast_arm_region_w),this)); + m_prot->space(AS_PROGRAM).install_write_handler(0x48000138, 0x4800013b, write32_delegate(FUNC(pgm_arm_type2_state::martmast_arm_region_w),this)); } @@ -223,7 +223,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,martmast) READ32_MEMBER(pgm_arm_type2_state::ddp2_speedup_r ) { - int pc = space.device().safe_pc(); + int pc = m_prot->pc(); uint32_t data = m_arm_ram[0x300c/4]; if (pc==0x080109b4) @@ -245,10 +245,10 @@ READ32_MEMBER(pgm_arm_type2_state::ddp2_speedup_r ) READ16_MEMBER(pgm_arm_type2_state::ddp2_main_speedup_r ) { uint16_t data = m_mainram[0x0ee54/2]; - int pc = space.device().safe_pc(); + int pc = m_maincpu->pc(); - if (pc == 0x149dce) space.device().execute().spin_until_interrupt(); - if (pc == 0x149cfe) space.device().execute().spin_until_interrupt(); + if (pc == 0x149dce) m_maincpu->spin_until_interrupt(); + if (pc == 0x149cfe) m_maincpu->spin_until_interrupt(); return data; @@ -260,7 +260,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type2_state,ddp2) pgm_ddp2_decrypt(machine()); kov2_latch_init(); - machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1800300c, 0x1800300f, read32_delegate(FUNC(pgm_arm_type2_state::ddp2_speedup_r),this)); + m_prot->space(AS_PROGRAM).install_read_handler(0x1800300c, 0x1800300f, read32_delegate(FUNC(pgm_arm_type2_state::ddp2_speedup_r),this)); m_maincpu->space(AS_PROGRAM).install_read_handler(0x80ee54, 0x80ee55, read16_delegate(FUNC(pgm_arm_type2_state::ddp2_main_speedup_r),this)); } diff --git a/src/mame/machine/rm380z.cpp b/src/mame/machine/rm380z.cpp index e811de279fa..2f0a33d3244 100644 --- a/src/mame/machine/rm380z.cpp +++ b/src/mame/machine/rm380z.cpp @@ -32,7 +32,7 @@ WRITE8_MEMBER( rm380z_state::port_write ) switch ( offset ) { case 0xFC: // PORT0 - //printf("FBFCw[%2.2x] FBFD [%2.2x] FBFE [%2.2x] PC [%4.4x] writenum [%4.4x]\n",data,m_fbfd,m_fbfe,m_maincpu->safe_pc(),writenum); + //printf("%s FBFCw[%2.2x] FBFD [%2.2x] FBFE [%2.2x] writenum [%4.4x]\n",machine().describe_context().c_str(),data,m_fbfd,m_fbfe,writenum); m_port0 = data; m_cassette->output((m_port0 & 0xEF) ? +1.0 : -1.0); // set 2400hz, bit 4 @@ -49,7 +49,7 @@ WRITE8_MEMBER( rm380z_state::port_write ) break; case 0xFD: // screen line counter (?) - //printf("FBFC [%2.2x] FBFDw[%2.2x] FBFE [%2.2x] PC [%4.4x] writenum [%4.4x]\n",m_port0,data,m_fbfe,m_maincpu->safe_pc(),writenum); + //printf("%s FBFC [%2.2x] FBFDw[%2.2x] FBFE [%2.2x] writenum [%4.4x]\n",machine().describe_context().c_str(),m_port0,data,m_fbfe,writenum); m_old_old_fbfd=m_old_fbfd; m_old_fbfd=m_fbfd; @@ -63,7 +63,7 @@ WRITE8_MEMBER( rm380z_state::port_write ) // port 1 case 0xFE: // line on screen to write to divided by 2 - //printf("FBFC [%2.2x] FBFD [%2.2x] FBFEw[%2.2x] PC [%4.4x] writenum [%4.4x]\n",m_port0,m_fbfd,data,m_maincpu->safe_pc(),writenum); + //printf("%s FBFC [%2.2x] FBFD [%2.2x] FBFEw[%2.2x] writenum [%4.4x]\n",machine().describe_context().c_str(),m_port0,m_fbfd,data,writenum); m_fbfe=data; break; @@ -89,11 +89,11 @@ READ8_MEMBER( rm380z_state::port_read ) data = m_port0_kbd; //if (m_port0_kbd!=0) m_port0_kbd=0; //m_port0_kbd=0; - //printf("read of port0 (kbd) from PC [%x]\n",m_maincpu->safe_pc()); + //printf("%s read of port0 (kbd)\n",machine().describe_context().c_str()); break; case 0xFD: // "counter" (?) - //printf("%s: Read from counter FBFD\n", machine().describe_context()); + //printf("%s: Read from counter FBFD\n", machine().describe_context().c_str()); data = 0x00; break; @@ -104,11 +104,11 @@ READ8_MEMBER( rm380z_state::port_read ) m_port1 |= 0x20; // bit 5 on data = m_port1; - //printf("read of port1 from PC [%x]\n",m_maincpu->safe_pc()); + //printf("%s read of port1\n",machine().describe_context().c_str()); break; case 0xFF: // user port - //printf("%s: Read from user port\n", machine().describe_context()); + //printf("%s: Read from user port\n", machine().describe_context().c_str()); break; default: @@ -147,7 +147,7 @@ READ8_MEMBER( rm380z_state::rm380z_portlow_r ) WRITE8_MEMBER( rm380z_state::rm380z_portlow_w ) { - //printf("port write [%x] [%x] at PC [%x]\n",offset,data,m_maincpu->safe_pc()); + //printf("%s port write [%x] [%x]\n",machine().describe_context().c_str(),offset,data); } READ8_MEMBER( rm380z_state::rm380z_porthi_r ) diff --git a/src/mame/machine/segaic16.cpp b/src/mame/machine/segaic16.cpp index 7028364044a..1e6431cb0a3 100644 --- a/src/mame/machine/segaic16.cpp +++ b/src/mame/machine/segaic16.cpp @@ -75,7 +75,7 @@ READ16_MEMBER( sega_16bit_common_base::open_bus_r ) // read original encrypted memory at that address m_open_bus_recurse = true; - uint16_t result = space.read_word(space.device().safe_pc()); + uint16_t result = space.read_word(space.device().state().pc()); m_open_bus_recurse = false; return result; } diff --git a/src/mame/machine/segas32.cpp b/src/mame/machine/segas32.cpp index 2424a498d00..abb0cabd6c7 100644 --- a/src/mame/machine/segas32.cpp +++ b/src/mame/machine/segas32.cpp @@ -213,15 +213,15 @@ void segas32_state::darkedge_fd1149_vblank() WRITE16_MEMBER(segas32_state::darkedge_protection_w) { - logerror("%06x:darkedge_prot_w(%06X) = %04X & %04X\n", - space.device().safe_pc(), 0xa00000 + 2*offset, data, mem_mask); + logerror("%s:darkedge_prot_w(%06X) = %04X & %04X\n", + machine().describe_context(), 0xa00000 + 2*offset, data, mem_mask); } READ16_MEMBER(segas32_state::darkedge_protection_r) { - logerror("%06x:darkedge_prot_r(%06X) & %04X\n", - space.device().safe_pc(), 0xa00000 + 2*offset, mem_mask); + logerror("%s:darkedge_prot_r(%06X) & %04X\n", + machine().describe_context(), 0xa00000 + 2*offset, mem_mask); return 0xffff; } @@ -296,12 +296,12 @@ const uint8_t segas32_v25_state::arf_opcode_table[256] = { #if 0 // old simulation READ16_MEMBER(segas32_state::arabfgt_protection_r) { - int PC = space.device().safe_pc(); + int PC = m_maincpu->pc(); int cmpVal; if (PC == 0xfe0325 || PC == 0xfe01e5 || PC == 0xfe035e || PC == 0xfe03cc) { - cmpVal = space.device().state().state_int(1); + cmpVal = m_maincpu->state_int(V60_R0); // R0 always contains the value the protection is supposed to return (!) return cmpVal; diff --git a/src/mame/machine/sgi.cpp b/src/mame/machine/sgi.cpp index 7feedb42209..ed0967130c4 100644 --- a/src/mame/machine/sgi.cpp +++ b/src/mame/machine/sgi.cpp @@ -23,7 +23,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_ va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%08x: %s", (unsigned) machine.device("maincpu")->safe_pc(), buf ); + logerror( "%s: %s", machine.describe_context(), buf ); } } #endif diff --git a/src/mame/machine/slapstic.cpp b/src/mame/machine/slapstic.cpp index 9b751954b88..2c3ec486e82 100644 --- a/src/mame/machine/slapstic.cpp +++ b/src/mame/machine/slapstic.cpp @@ -832,10 +832,10 @@ int atari_slapstic_device::alt2_kludge(address_space &space, offs_t offset) if (access_68k) { /* first verify that the prefetched PC matches the first alternate */ - if (MATCHES_MASK_VALUE(space.device().safe_pc() >> 1, slapstic.alt1)) + if (MATCHES_MASK_VALUE(space.device().state().pc() >> 1, slapstic.alt1)) { /* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */ - uint16_t opcode = space.read_word(space.device().safe_pcbase() & 0xffffff); + uint16_t opcode = space.read_word(space.device().state().pcbase() & 0xffffff); if ((opcode & 0xf1f8) == 0x3090 || (opcode & 0xf1f8) == 0xb148) { /* fetch the value of the register for the second operand, and see */ diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp index 1e37ac62a73..582ce406f46 100644 --- a/src/mame/machine/sms.cpp +++ b/src/mame/machine/sms.cpp @@ -803,7 +803,7 @@ WRITE8_MEMBER(sms_state::sms_mem_control_w) { m_mem_ctrl_reg = data; - logerror("memory control reg write %02x, pc: %04x\n", data, space.device().safe_pc()); + logerror("%s memory control reg write %02x\n", machine().describe_context(), data); setup_media_slots(); } diff --git a/src/mame/machine/st0016.cpp b/src/mame/machine/st0016.cpp index 66a74b82c73..d9dfce67473 100644 --- a/src/mame/machine/st0016.cpp +++ b/src/mame/machine/st0016.cpp @@ -324,7 +324,7 @@ WRITE8_MEMBER(st0016_cpu_device::st0016_vregs_w) { /* samples ? sound dma ? */ // speaglsht: unknown DMA copy : src - 2B6740, dst - 4400, len - 1E400 - logerror("unknown DMA copy : src - %X, dst - %X, len - %X, PC - %X\n",srcadr,dstadr,length,space.device().safe_pcbase()); + logerror("%s unknown DMA copy : src - %X, dst - %X, len - %X\n", machine().describe_context(), srcadr, dstadr, length); break; } } diff --git a/src/mame/machine/taitosj.cpp b/src/mame/machine/taitosj.cpp index 4861e58c90d..12fc4d81ff7 100644 --- a/src/mame/machine/taitosj.cpp +++ b/src/mame/machine/taitosj.cpp @@ -124,7 +124,7 @@ WRITE_LINE_MEMBER(taitosj_state::mcu_busrq_w) READ8_MEMBER(taitosj_state::spacecr_prot_r) { - int pc = space.device().safe_pc(); + int pc = m_maincpu->pc(); if( pc != 0x368A && pc != 0x36A6 ) logerror("Read protection from an unknown location: %04X\n",pc); diff --git a/src/mame/machine/tigeroad.cpp b/src/mame/machine/tigeroad.cpp index baa91d83646..b6da75c6005 100644 --- a/src/mame/machine/tigeroad.cpp +++ b/src/mame/machine/tigeroad.cpp @@ -58,7 +58,7 @@ void tigeroad_state::f1dream_protection_w(address_space &space) { int indx; int value = 255; - int prevpc = space.device().safe_pcbase(); + int prevpc = m_maincpu->pcbase(); if (prevpc == 0x244c) { @@ -119,7 +119,7 @@ void tigeroad_state::f1dream_protection_w(address_space &space) WRITE16_MEMBER(tigeroad_state::f1dream_control_w) { - logerror("protection write, PC: %04x FFE1 Value:%01x\n",space.device().safe_pc(), m_ram16[0x3fe0/2]); + logerror("%s protection write, FFE1 Value:%01x\n",machine().describe_context(), m_ram16[0x3fe0/2]); f1dream_protection_w(space); } diff --git a/src/mame/machine/tx1.cpp b/src/mame/machine/tx1.cpp index e410bec1d2f..4521e4fcb5d 100644 --- a/src/mame/machine/tx1.cpp +++ b/src/mame/machine/tx1.cpp @@ -371,7 +371,7 @@ static void kick_sn74s516(running_machine &machine, uint16_t *data, const int in } math.dbgaddr = math.promaddr; - math.dbgpc = machine.device("math_cpu")->safe_pcbase(); + math.dbgpc = state->m_mathcpu->pcbase(); } diff --git a/src/mame/machine/xevious.cpp b/src/mame/machine/xevious.cpp index 833c352eee2..62bde9d5fbc 100644 --- a/src/mame/machine/xevious.cpp +++ b/src/mame/machine/xevious.cpp @@ -57,7 +57,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(xevious_state::battles_nmi_generate) READ8_MEMBER( xevious_state::battles_customio0_r ) { - logerror("CPU0 %04x: custom I/O Read = %02x\n",space.device().safe_pc(),m_battles_customio_command); + logerror("%s: custom I/O Read = %02x\n", machine().describe_context(), m_battles_customio_command); return m_battles_customio_command; } @@ -75,7 +75,7 @@ READ8_MEMBER( xevious_state::battles_customio3_r ) | 0x60 | (m_battles_customio_prev_command & 0x0f); } - logerror("CPU3 %04x: custom I/O Read = %02x\n",m_subcpu3->pc(),return_data); + logerror("%s: custom I/O Read = %02x\n", machine().describe_context(), return_data); return return_data; } @@ -85,7 +85,7 @@ WRITE8_MEMBER( xevious_state::battles_customio0_w ) { timer_device *timer = machine().device<timer_device>("battles_nmi"); - logerror("CPU0 %04x: custom I/O Write = %02x\n",space.device().safe_pc(),data); + logerror("%s: custom I/O Write = %02x\n", machine().describe_context(), data); m_battles_customio_command = data; m_battles_customio_command_count = 0; @@ -102,7 +102,7 @@ WRITE8_MEMBER( xevious_state::battles_customio0_w ) WRITE8_MEMBER( xevious_state::battles_customio3_w ) { - logerror("CPU3 %04x: custom I/O Write = %02x\n",m_subcpu3->pc(),data); + logerror("%s: custom I/O Write = %02x\n", machine().describe_context(), data); m_battles_customio_command = data; } @@ -111,27 +111,27 @@ WRITE8_MEMBER( xevious_state::battles_customio3_w ) READ8_MEMBER( xevious_state::battles_customio_data0_r ) { - logerror("CPU0 %04x: custom I/O parameter %02x Read = %02x\n",space.device().safe_pc(),offset,m_battles_customio_data); + logerror("%s: custom I/O parameter %02x Read = %02x\n", machine().describe_context(), offset, m_battles_customio_data); return m_battles_customio_data; } READ8_MEMBER( xevious_state::battles_customio_data3_r ) { - logerror("CPU3 %04x: custom I/O parameter %02x Read = %02x\n",m_subcpu3->pc(),offset,m_battles_customio_data); + logerror("%s: custom I/O parameter %02x Read = %02x\n", machine().describe_context(), offset, m_battles_customio_data); return m_battles_customio_data; } WRITE8_MEMBER( xevious_state::battles_customio_data0_w ) { - logerror("CPU0 %04x: custom I/O parameter %02x Write = %02x\n",space.device().safe_pc(),offset,data); + logerror("%s: custom I/O parameter %02x Write = %02x\n", machine().describe_context(), offset, data); m_battles_customio_data = data; } WRITE8_MEMBER( xevious_state::battles_customio_data3_w ) { - logerror("CPU3 %04x: custom I/O parameter %02x Write = %02x\n",m_subcpu3->pc(),offset,data); + logerror("%s: custom I/O parameter %02x Write = %02x\n", machine().describe_context(), offset, data); m_battles_customio_data = data; } @@ -149,7 +149,7 @@ WRITE8_MEMBER( xevious_state::battles_CPU4_coin_w ) WRITE8_MEMBER( xevious_state::battles_noise_sound_w ) { - logerror("CPU3 %04x: 50%02x Write = %02x\n",m_subcpu3->pc(),offset,data); + logerror("%s: 50%02x Write = %02x\n", machine().describe_context(), offset, data); if( (m_battles_sound_played == 0) && (data == 0xFF) ){ if( m_customio[0] == 0x40 ){ m_samples->start(0, 0); diff --git a/src/mame/video/artmagic.cpp b/src/mame/video/artmagic.cpp index d15d3925c5e..2eed4acef1d 100644 --- a/src/mame/video/artmagic.cpp +++ b/src/mame/video/artmagic.cpp @@ -102,7 +102,7 @@ void artmagic_state::execute_blit() static FILE *f; logerror("%s:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n", - machine.describe_context(), offset, x, y, w, h, + machine().describe_context(), offset, x, y, w, h, m_blitter_data[0], m_blitter_data[1], m_blitter_data[2], m_blitter_data[3], m_blitter_data[4], m_blitter_data[5], @@ -120,7 +120,7 @@ void artmagic_state::execute_blit() fprintf(f, "----------------------\n" "%s:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n", - machine.describe_context(), offset, x, y, w, h, + machine().describe_context(), offset, x, y, w, h, m_blitter_data[0], m_blitter_data[1], m_blitter_data[2], m_blitter_data[3], m_blitter_data[4], m_blitter_data[5], diff --git a/src/mame/video/cischeat.cpp b/src/mame/video/cischeat.cpp index 6042562e7d5..7ef507da847 100644 --- a/src/mame/video/cischeat.cpp +++ b/src/mame/video/cischeat.cpp @@ -51,35 +51,6 @@ Note: if MAME_DEBUG is defined, pressing Z or X with: #include "emu.h" #include "includes/cischeat.h" -#ifdef MAME_DEBUG -#define SHOW_READ_ERROR(_format_,_offset_)\ -{\ - popmessage(_format_,_offset_);\ - logerror("CPU #0 PC %06X : Warning, ",space.device().safe_pc()); \ - logerror(_format_ "\n",_offset_);\ -} -#define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\ -{\ - popmessage(_format_,_offset_,_data_);\ - logerror("CPU #0 PC %06X : Warning, ",space.device().safe_pc()); \ - logerror(_format_ "\n",_offset_,_data_); \ -} - -#else - -#define SHOW_READ_ERROR(_format_,_offset_)\ -{\ - logerror("CPU #0 PC %06X : Warning, ",space.device().safe_pc()); \ - logerror(_format_ "\n",_offset_);\ -} -#define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\ -{\ - logerror("CPU #0 PC %06X : Warning, ",space.device().safe_pc()); \ - logerror(_format_ "\n",_offset_,_data_); \ -} - -#endif - #define cischeat_tmap_DRAW(_n_) \ if ( (m_tmap[_n_]).found() && (active_layers1 & (1 << _n_) ) ) \ diff --git a/src/mame/video/galivan.cpp b/src/mame/video/galivan.cpp index e16895253c5..a5ccf0ad347 100644 --- a/src/mame/video/galivan.cpp +++ b/src/mame/video/galivan.cpp @@ -217,7 +217,7 @@ WRITE8_MEMBER(galivan_state::galivan_gfxbank_w) /* bit 7 selects one of two ROM banks for c000-dfff */ membank("bank1")->set_entry((data & 0x80) >> 7); - /* logerror("Address: %04X - port 40 = %02x\n", space.device().safe_pc(), data); */ + /* logerror("%s port 40 = %02x\n", machine().describe_context(), data); */ } WRITE8_MEMBER(galivan_state::ninjemak_gfxbank_w) diff --git a/src/mame/video/galpani2.cpp b/src/mame/video/galpani2.cpp index 8ba47f672fa..83d8c831e43 100644 --- a/src/mame/video/galpani2.cpp +++ b/src/mame/video/galpani2.cpp @@ -34,7 +34,7 @@ inline uint16_t galpani2_state::galpani2_bg8_regs_r(address_space &space, offs_t { case 0x16: return machine().rand() & 1; default: - logerror("CPU #0 PC %06X : Warning, bg8 #%d screen reg %04X read\n",space.cpu->safe_pc(),_n_,offset*2); + logerror("%s: Warning, bg8 #%d screen reg %04X read\n",machine().describe_context(),_n_,offset*2); } return m_bg8_regs[_n_][offset]; } diff --git a/src/mame/video/itech8.cpp b/src/mame/video/itech8.cpp index 6d88ffad63d..b81035968a0 100644 --- a/src/mame/video/itech8.cpp +++ b/src/mame/video/itech8.cpp @@ -420,7 +420,7 @@ READ8_MEMBER(itech8_state::blitter_r) int result = m_blitter_data[offset / 2]; /* debugging */ - if (FULL_LOGGING) logerror("%04x:blitter_r(%02x)\n", space.device().safe_pcbase(), offset / 2); + if (FULL_LOGGING) logerror("%s:blitter_r(%02x)\n", machine().describe_context(), offset / 2); /* low bit seems to be ignored */ offset /= 2; diff --git a/src/mame/video/jaguar.cpp b/src/mame/video/jaguar.cpp index 08c01a43200..803d5e14061 100644 --- a/src/mame/video/jaguar.cpp +++ b/src/mame/video/jaguar.cpp @@ -534,7 +534,7 @@ READ32_MEMBER( jaguar_state::blitter_r ) return m_blitter_status & 3; default: - logerror("%08X:Blitter read register @ F022%02X\n", space.device().safe_pcbase(), offset * 4); + logerror("%s:Blitter read register @ F022%02X\n", machine().describe_context(), offset * 4); return 0; } } @@ -553,7 +553,7 @@ WRITE32_MEMBER( jaguar_state::blitter_w ) } if (LOG_BLITTER_WRITE) - logerror("%08X:Blitter write register @ F022%02X = %08X\n", space.device().safe_pcbase(), offset * 4, data); + logerror("%s:Blitter write register @ F022%02X = %08X\n", machine().describe_context(), offset * 4, data); } @@ -567,7 +567,7 @@ WRITE32_MEMBER( jaguar_state::blitter_w ) READ16_MEMBER( jaguar_state::tom_regs_r ) { if (offset != INT1 && offset != INT2 && offset != HC && offset != VC) - logerror("%08X:TOM read register @ F00%03X\n", space.device().safe_pcbase(), offset * 2); + logerror("%s:TOM read register @ F00%03X\n", machine().describe_context(), offset * 2); switch (offset) { @@ -666,7 +666,7 @@ WRITE16_MEMBER( jaguar_state::tom_regs_w ) } if (offset != INT2 && offset != VI && offset != INT1) - logerror("%08X:TOM write register @ F00%03X = %04X\n", space.device().safe_pcbase(), offset * 2, data); + logerror("%s:TOM write register @ F00%03X = %04X\n", machine().describe_context(), offset * 2, data); } diff --git a/src/mame/video/k001005.cpp b/src/mame/video/k001005.cpp index dabed4b5966..5d4290684c5 100644 --- a/src/mame/video/k001005.cpp +++ b/src/mame/video/k001005.cpp @@ -1313,7 +1313,7 @@ READ32_MEMBER( k001005_device::read ) } default: - //osd_printf_debug("m_r: %08X, %08X at %s\n", offset, mem_mask, machine().describe_context()); + //osd_printf_debug("%s m_r: %08X, %08X\n", machine().describe_context().c_str(), offset, mem_mask); break; } return 0; @@ -1327,7 +1327,7 @@ WRITE32_MEMBER( k001005_device::write ) { case 0x000: // FIFO write { - //osd_printf_debug("K001005 FIFO write: %08X at %s\n", data, machine().describe_context()); + //osd_printf_debug("%s K001005 FIFO write: %08X\n", machine().describe_context().c_str(), data); if (m_status != 1 && m_status != 2) { if (m_fifo_write_ptr < 0x400) @@ -1344,7 +1344,7 @@ WRITE32_MEMBER( k001005_device::write ) dsp->set_flag_input(1, ASSERT_LINE); } - // osd_printf_debug("K001005 FIFO write: %08X at %s\n", data, machine().describe_context()); + // osd_printf_debug("%s K001005 FIFO write: %08X\n", machine().describe_context().c_str(), data); m_fifo[m_fifo_write_ptr] = data; m_fifo_write_ptr++; m_fifo_write_ptr &= 0x7ff; @@ -1362,16 +1362,16 @@ WRITE32_MEMBER( k001005_device::write ) #endif // !!! HACK to get past the FIFO B test (GTI Club & Thunder Hurricane) !!! - if (space.device().safe_pc() == 0x201ee) + if (dsp->pc() == 0x201ee) { // This is used to make the SHARC timeout - space.device().execute().spin_until_trigger(10000); + dsp->spin_until_trigger(10000); } // !!! HACK to get past the FIFO B test (Winding Heat & Midnight Run) !!! - if (space.device().safe_pc() == 0x201e6) + if (dsp->pc() == 0x201e6) { // This is used to make the SHARC timeout - space.device().execute().spin_until_trigger(10000); + dsp->spin_until_trigger(10000); } break; @@ -1451,7 +1451,7 @@ WRITE32_MEMBER( k001005_device::write ) break; default: - //osd_printf_debug("m_w: %08X, %08X, %08X at %s\n", data, offset, mem_mask, machine().describe_context()); + //osd_printf_debug("%s m_w: %08X, %08X, %08X\n", machine().describe_context().c_str(), data, offset, mem_mask); break; } diff --git a/src/mame/video/kaneko_grap2.cpp b/src/mame/video/kaneko_grap2.cpp index 3c2c37f532d..5ec64cb0008 100644 --- a/src/mame/video/kaneko_grap2.cpp +++ b/src/mame/video/kaneko_grap2.cpp @@ -97,7 +97,7 @@ READ16_MEMBER(kaneko_grap2_device::regs1_r) } default: - logerror("cpu '%s' (PC=%06X): regs1_r %02x %04x\n", space.device().tag(), space.device().safe_pcbase(), offset, mem_mask); + logerror("%s: regs1_r %02x %04x\n", machine().describe_context(), offset, mem_mask); break; } diff --git a/src/mame/video/lethalj.cpp b/src/mame/video/lethalj.cpp index 85ac76c1b1a..120a864d211 100644 --- a/src/mame/video/lethalj.cpp +++ b/src/mame/video/lethalj.cpp @@ -71,7 +71,7 @@ READ16_MEMBER(lethalj_state::lethalj_gun_r) result = m_guny + 4; break; } -/* logerror("%08X:lethalj_gun_r(%d) = %04X\n", space.device().safe_pc(), offset, result); */ +/* logerror("%s:lethalj_gun_r(%d) = %04X\n", machine().describe_context(), offset, result); */ return result; } diff --git a/src/mame/video/newport.cpp b/src/mame/video/newport.cpp index 8691d996dd1..d1ae70816a2 100644 --- a/src/mame/video/newport.cpp +++ b/src/mame/video/newport.cpp @@ -41,7 +41,7 @@ static inline void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_l va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%08x: %s", machine.device("maincpu")->safe_pc(), buf ); + logerror( "%s %s", machine.describe_context(), buf ); } } #endif diff --git a/src/mame/video/rm380z.cpp b/src/mame/video/rm380z.cpp index 9b39feff211..e05f42e90b1 100644 --- a/src/mame/video/rm380z.cpp +++ b/src/mame/video/rm380z.cpp @@ -195,7 +195,7 @@ void rm380z_state::check_scroll_register() WRITE8_MEMBER( rm380z_state::videoram_write ) { - //printf("vramw [%2.2x][%2.2x] port0 [%2.2x] fbfd [%2.2x] fbfe [%2.2x] PC [%4.4x]\n",offset,data,m_port0,m_fbfd,m_fbfe,m_maincpu->safe_pc()); + //printf("%s vramw [%2.2x][%2.2x] port0 [%2.2x] fbfd [%2.2x] fbfe [%2.2x]\n",machine().describe_context().c_str(),offset,data,m_port0,m_fbfd,m_fbfe); int lineWidth=0x80; if (m_videomode==RM380Z_VIDEOMODE_40COL) diff --git a/src/mame/video/x68k.cpp b/src/mame/video/x68k.cpp index 0c30afaa7d9..7a8912a80b0 100644 --- a/src/mame/video/x68k.cpp +++ b/src/mame/video/x68k.cpp @@ -446,14 +446,14 @@ WRITE16_MEMBER(x68k_state::x68k_crtc_w ) } break; } -// logerror("CRTC: [%08x] Wrote %04x to CRTC register %i\n",m_maincpu->safe_pc(),data,offset); +// logerror("%s CRTC: Wrote %04x to CRTC register %i\n",machine().describe_context(),data,offset); } READ16_MEMBER(x68k_state::x68k_crtc_r ) { if(offset < 24) { -// logerror("CRTC: [%08x] Read %04x from CRTC register %i\n",m_maincpu->safe_pc(),m_crtc.reg[offset],offset); +// logerror("%s CRTC: Read %04x from CRTC register %i\n",machine().describe_context(),m_crtc.reg[offset],offset); switch(offset) { case 9: |