Handle a small number that only need a device variable to be added (nw)

This commit is contained in:
Olivier Galibert 2018-01-02 14:32:57 +01:00
parent 526ca7a22f
commit d016fe6c29
13 changed files with 24 additions and 13 deletions

View File

@ -363,13 +363,13 @@ WRITE8_MEMBER(cvs_state::cvs_speech_rom_address_lo_w)
{
/* assuming that d0-d2 are cleared here */
m_speech_rom_bit_address = (m_speech_rom_bit_address & 0xf800) | (data << 3);
LOG(("%04x : CVS: Speech Lo %02x Address = %04x\n", space.device().safe_pc(), data, m_speech_rom_bit_address >> 3));
LOG(("%04x : CVS: Speech Lo %02x Address = %04x\n", m_speechcpu->pc(), data, m_speech_rom_bit_address >> 3));
}
WRITE8_MEMBER(cvs_state::cvs_speech_rom_address_hi_w)
{
m_speech_rom_bit_address = (m_speech_rom_bit_address & 0x07ff) | (data << 11);
LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", space.device().safe_pc(), data, m_speech_rom_bit_address >> 3));
LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", m_speechcpu->pc(), data, m_speech_rom_bit_address >> 3));
}

View File

@ -386,7 +386,7 @@ WRITE32_MEMBER(midzeus_state::disk_asic_jr_w)
/* trackball reset; thegrid writes 1 at startup */
case 9:
if (data != 1)
logerror("%06X:disk_asic_jr_w(%X) = %X (unexpected)\n", space.device().safe_pc(), offset, data);
logerror("%06X:disk_asic_jr_w(%X) = %X (unexpected)\n", m_maincpu->pc(), offset, data);
break;
/* unknown purpose */
default:

View File

@ -583,7 +583,7 @@ READ16_MEMBER(namcos21_state::dspcuskey_r)
}
else if( m_gametype == NAMCOS21_CYBERSLED )
{
switch( space.device().safe_pc() )
switch( m_dspmaster->pc() )
{
case 0x8061: result = 0xfe95; break;
case 0x8069: result = 0xffff; break;

View File

@ -513,7 +513,7 @@ READ32_MEMBER( next_state::dma_ctrl_r)
const char *name = dma_name(slot);
if(maincpu->pc() != 0x409bb4e)
logerror("dma_ctrl_r %s:%d %02x (%08x)\n", name, reg, dma_slots[slot].state, space.device().safe_pc());
logerror("dma_ctrl_r %s:%d %02x (%08x)\n", name, reg, dma_slots[slot].state, maincpu->pc());
return reg ? 0 : dma_slots[slot].state << 24;
}
@ -604,7 +604,7 @@ WRITE32_MEMBER( next_state::scsictrl_w )
}
if(ACCESSING_BITS_16_23) {
scsistat = data >> 16;
logerror("SCSIstat %02x (%08x)\n", data, space.device().safe_pc());
logerror("SCSIstat %02x (%08x)\n", data, maincpu->pc());
}
}

View File

@ -85,7 +85,7 @@ WRITE8_MEMBER(redclash_state::sraider_misc_w)
m_sraider_0x38 = data&0x3f;
break;
default:
osd_printf_debug("(%04X) write to %02X\n", space.device().safe_pc(), offset);
osd_printf_debug("(%04X) write to %02X\n", m_sub->pc(), offset);
break;
}
}

View File

@ -1045,7 +1045,7 @@ ROM_END
READ8_MEMBER(route16_state::routex_prot_read)
{
if (space.device().safe_pc() == 0x2f) return 0xfb;
if (m_cpu1->pc() == 0x2f) return 0xfb;
logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", space.device().tag(), space.device().safe_pc());
return 0x00;

View File

@ -944,7 +944,7 @@ READ16_MEMBER(seta2_state::funcube_coins_r)
if ( m_funcube_coin_start_cycles )
{
uint64_t elapsed = downcast<cpu_device *>(&space.device())->total_cycles() - m_funcube_coin_start_cycles;
uint64_t elapsed = m_sub->total_cycles() - m_funcube_coin_start_cycles;
if ( elapsed < coin_total_cycles/2 )
coin_bit0 = 0;

View File

@ -310,14 +310,14 @@ MACHINE_START_MEMBER(suna16_state, bssoccer)
WRITE8_MEMBER(suna16_state::bssoccer_pcm_1_bankswitch_w)
{
const int bank = data & 7;
if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data);
if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", m_pcm1->pc(), data);
m_bank1->set_entry(bank);
}
WRITE8_MEMBER(suna16_state::bssoccer_pcm_2_bankswitch_w)
{
const int bank = data & 7;
if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data);
if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", m_pcm2->pc(), data);
m_bank2->set_entry(bank);
}
@ -363,7 +363,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(suna16_state::uballoon_pcm_1_bankswitch_w)
{
const int bank = data & 1;
if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", space.device().safe_pc(), data);
if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", m_pcm1->pc(), data);
m_bank1->set_entry(bank);
}

View File

@ -33,6 +33,7 @@ public:
m_dac3_state(*this, "dac3_state"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_speechcpu(*this, "speechcpu"),
m_dac2(*this, "dac2"),
m_dac3(*this, "dac3"),
m_tms5110(*this, "tms"),
@ -76,6 +77,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_speechcpu;
optional_device<dac_byte_interface> m_dac2;
optional_device<dac_bit_interface> m_dac3;
optional_device<tms5110_device> m_tms5110;

View File

@ -12,8 +12,9 @@ class redclash_state : public ladybug_state
{
public:
redclash_state(const machine_config &mconfig, device_type type, const char *tag)
: ladybug_state(mconfig, type, tag) { }
: ladybug_state(mconfig, type, tag), m_sub(*this, "sub") { }
optional_device<cpu_device> m_sub;
tilemap_t *m_fg_tilemap; // redclash
int m_gfxbank; // redclash only

View File

@ -7,6 +7,7 @@ class route16_state : public driver_device
public:
route16_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_cpu1(*this, "cpu1")
, m_sn(*this, "snsnd")
, m_sharedram(*this, "sharedram")
, m_videoram1(*this, "videoram1")
@ -33,6 +34,7 @@ public:
uint32_t screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
private:
required_device<cpu_device> m_cpu1;
optional_device<sn76477_device> m_sn;
required_shared_ptr<uint8_t> m_sharedram;

View File

@ -22,6 +22,7 @@ public:
seta2_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
m_sub(*this,"sub"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
@ -42,6 +43,7 @@ public:
{ }
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_sub;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;

View File

@ -11,6 +11,8 @@ public:
suna16_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
m_pcm1(*this,"pcm1"),
m_pcm2(*this,"pcm2"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
@ -24,6 +26,8 @@ public:
{ }
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_pcm1;
optional_device<cpu_device> m_pcm2;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;