diff options
Diffstat (limited to 'src/mess/machine')
69 files changed, 293 insertions, 293 deletions
diff --git a/src/mess/machine/a2bus.c b/src/mess/machine/a2bus.c index aa2f4d8f644..05532afc5e7 100644 --- a/src/mess/machine/a2bus.c +++ b/src/mess/machine/a2bus.c @@ -175,7 +175,7 @@ a2bus_device::a2bus_device(const machine_config &mconfig, device_type type, cons void a2bus_device::device_start() { - m_maincpu = machine().device(m_cputag); + m_maincpu = machine().device<cpu_device>(m_cputag); // resolve callbacks m_out_irq_func.resolve(m_out_irq_cb, *this); diff --git a/src/mess/machine/a2bus.h b/src/mess/machine/a2bus.h index 3fc80c25843..71e9a634137 100644 --- a/src/mess/machine/a2bus.h +++ b/src/mess/machine/a2bus.h @@ -105,7 +105,7 @@ protected: virtual void device_config_complete(); // internal state - device_t *m_maincpu; + cpu_device *m_maincpu; devcb_resolved_write_line m_out_irq_func; devcb_resolved_write_line m_out_nmi_func; diff --git a/src/mess/machine/a2eauxslot.c b/src/mess/machine/a2eauxslot.c index 568907b525b..39c5562c690 100644 --- a/src/mess/machine/a2eauxslot.c +++ b/src/mess/machine/a2eauxslot.c @@ -112,7 +112,7 @@ a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, device_type void a2eauxslot_device::device_start() { - m_maincpu = machine().device(m_cputag); + m_maincpu = machine().device<cpu_device>(m_cputag); // resolve callbacks m_out_irq_func.resolve(m_out_irq_cb, *this); diff --git a/src/mess/machine/a2eauxslot.h b/src/mess/machine/a2eauxslot.h index 8e645c7b352..bcead368242 100644 --- a/src/mess/machine/a2eauxslot.h +++ b/src/mess/machine/a2eauxslot.h @@ -97,7 +97,7 @@ protected: virtual void device_config_complete(); // internal state - device_t *m_maincpu; + cpu_device *m_maincpu; devcb_resolved_write_line m_out_irq_func; devcb_resolved_write_line m_out_nmi_func; diff --git a/src/mess/machine/a2softcard.c b/src/mess/machine/a2softcard.c index adc2836941e..b8610453d44 100644 --- a/src/mess/machine/a2softcard.c +++ b/src/mess/machine/a2softcard.c @@ -85,7 +85,7 @@ void a2bus_softcard_device::device_reset() m_bEnabled = false; m_6502space = NULL; m_FirstZ80Boot = true; - device_set_input_line(m_z80, INPUT_LINE_HALT, ASSERT_LINE); + m_z80->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); } void a2bus_softcard_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) @@ -97,8 +97,8 @@ void a2bus_softcard_device::write_cnxx(address_space &space, UINT8 offset, UINT8 // steal the 6502's address space m_6502space = &space; - device_set_input_line(m_z80, INPUT_LINE_HALT, CLEAR_LINE); - device_set_input_line(state->m_maincpu, INPUT_LINE_HALT, ASSERT_LINE); + m_z80->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + state->m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); if (m_FirstZ80Boot) { @@ -110,8 +110,8 @@ void a2bus_softcard_device::write_cnxx(address_space &space, UINT8 offset, UINT8 } else { - device_set_input_line(m_z80, INPUT_LINE_HALT, ASSERT_LINE); - device_set_input_line(state->m_maincpu, INPUT_LINE_HALT, CLEAR_LINE); + m_z80->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + state->m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); m_bEnabled = false; } } diff --git a/src/mess/machine/a2themill.c b/src/mess/machine/a2themill.c index c080f04cba7..1f64df6cdf6 100644 --- a/src/mess/machine/a2themill.c +++ b/src/mess/machine/a2themill.c @@ -108,8 +108,8 @@ void a2bus_themill_device::device_reset() m_flipAddrSpace = false; m_6809Mode = false; m_status = 0xc0; // OS9 loader relies on this - device_set_input_line(m_6809, INPUT_LINE_HALT, ASSERT_LINE); - device_set_input_line(m_6809, INPUT_LINE_RESET, ASSERT_LINE); + m_6809->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + m_6809->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } UINT8 a2bus_themill_device::read_c0nx(address_space &space, UINT8 offset) @@ -141,15 +141,15 @@ void a2bus_themill_device::write_c0nx(address_space &space, UINT8 offset, UINT8 m_6502space = &space; m_6809->reset(); - device_set_input_line(m_6809, INPUT_LINE_HALT, CLEAR_LINE); - device_set_input_line(m_6809, INPUT_LINE_RESET, CLEAR_LINE); + m_6809->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + m_6809->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); m_bEnabled = true; m_status &= ~0x04; } else { - device_set_input_line(m_6809, INPUT_LINE_HALT, ASSERT_LINE); + m_6809->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); m_bEnabled = false; m_status |= 0x04; } @@ -170,12 +170,12 @@ void a2bus_themill_device::write_c0nx(address_space &space, UINT8 offset, UINT8 case 3: // 6809 NMI if (data & 0x80) { - device_set_input_line(m_6809, INPUT_LINE_NMI, CLEAR_LINE); + m_6809->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); m_status |= 0x08; } else { - device_set_input_line(m_6809, INPUT_LINE_NMI, ASSERT_LINE); + m_6809->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); m_status &= ~0x08; } break; @@ -183,12 +183,12 @@ void a2bus_themill_device::write_c0nx(address_space &space, UINT8 offset, UINT8 case 4: // 6809 FIRQ if (data & 0x80) { - device_set_input_line(m_6809, M6809_FIRQ_LINE, CLEAR_LINE); + m_6809->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); m_status |= 0x10; } else { - device_set_input_line(m_6809, M6809_FIRQ_LINE, ASSERT_LINE); + m_6809->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); m_status &= ~0x10; } break; @@ -196,12 +196,12 @@ void a2bus_themill_device::write_c0nx(address_space &space, UINT8 offset, UINT8 case 5: // 6809 IRQ if (data & 0x80) { - device_set_input_line(m_6809, M6809_IRQ_LINE, CLEAR_LINE); + m_6809->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); m_status |= 0x20; } else { - device_set_input_line(m_6809, M6809_IRQ_LINE, ASSERT_LINE); + m_6809->set_input_line(M6809_IRQ_LINE, ASSERT_LINE); m_status &= ~0x20; } break; diff --git a/src/mess/machine/abc77.c b/src/mess/machine/abc77.c index b835e104cf6..6712b6e87fb 100644 --- a/src/mess/machine/abc77.c +++ b/src/mess/machine/abc77.c @@ -498,10 +498,10 @@ void abc77_device::device_reset() int ea = BIT(ioport("DSW")->read(), 7); // trigger reset - device_set_input_line(m_maincpu, INPUT_LINE_RESET, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); m_reset_timer->adjust(attotime::from_msec(t)); - device_set_input_line(m_maincpu, MCS48_INPUT_EA, ea ? CLEAR_LINE : ASSERT_LINE); + m_maincpu->set_input_line(MCS48_INPUT_EA, ea ? CLEAR_LINE : ASSERT_LINE); } @@ -518,7 +518,7 @@ void abc77_device::device_timer(emu_timer &timer, device_timer_id id, int param, break; case TIMER_RESET: - device_set_input_line(m_maincpu, INPUT_LINE_RESET, CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); break; } } @@ -638,7 +638,7 @@ WRITE8_MEMBER( abc77_device::j3_w ) WRITE_LINE_MEMBER( abc77_device::rxd_w ) { - device_set_input_line(m_maincpu, MCS48_INPUT_IRQ, state ? CLEAR_LINE : ASSERT_LINE); + m_maincpu->set_input_line(MCS48_INPUT_IRQ, state ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mess/machine/abc99.c b/src/mess/machine/abc99.c index e9eae6c1675..50dc2eae0a5 100644 --- a/src/mess/machine/abc99.c +++ b/src/mess/machine/abc99.c @@ -239,7 +239,7 @@ machine_config_constructor abc99_device::device_mconfig_additions() const INPUT_CHANGED_MEMBER( abc99_device::keyboard_reset ) { - device_set_input_line(m_mousecpu, INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); + m_mousecpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); } @@ -459,8 +459,8 @@ ioport_constructor abc99_device::device_input_ports() const inline void abc99_device::serial_input() { - device_set_input_line(m_maincpu, MCS48_INPUT_IRQ, (m_si | m_si_en) ? CLEAR_LINE : ASSERT_LINE); - device_set_input_line(m_mousecpu, MCS48_INPUT_IRQ, m_si ? CLEAR_LINE : ASSERT_LINE); + m_maincpu->set_input_line(MCS48_INPUT_IRQ, (m_si | m_si_en) ? CLEAR_LINE : ASSERT_LINE); + m_mousecpu->set_input_line(MCS48_INPUT_IRQ, m_si ? CLEAR_LINE : ASSERT_LINE); } @@ -578,8 +578,8 @@ void abc99_device::device_start() void abc99_device::device_reset() { // set EA lines - device_set_input_line(m_maincpu, MCS48_INPUT_EA, ASSERT_LINE); - device_set_input_line(m_mousecpu, MCS48_INPUT_EA, ASSERT_LINE); + m_maincpu->set_input_line(MCS48_INPUT_EA, ASSERT_LINE); + m_mousecpu->set_input_line(MCS48_INPUT_EA, ASSERT_LINE); } @@ -786,7 +786,7 @@ WRITE8_MEMBER( abc99_device::z5_p2_w ) if (m_reset != reset) { m_reset = reset; - device_set_input_line(m_maincpu, INPUT_LINE_RESET, m_reset ? CLEAR_LINE : ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_RESET, m_reset ? CLEAR_LINE : ASSERT_LINE); } // serial output @@ -854,5 +854,5 @@ READ_LINE_MEMBER( abc99_device::txd_r ) WRITE_LINE_MEMBER( abc99_device::reset_w ) { - device_set_input_line(m_mousecpu, INPUT_LINE_RESET, state ? CLEAR_LINE : ASSERT_LINE); + m_mousecpu->set_input_line(INPUT_LINE_RESET, state ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mess/machine/advision.c b/src/mess/machine/advision.c index 928afd84e0b..f6868755f81 100644 --- a/src/mess/machine/advision.c +++ b/src/mess/machine/advision.c @@ -40,11 +40,11 @@ void advision_state::machine_start() void advision_state::machine_reset() { /* enable internal ROM */ - device_set_input_line(m_maincpu, MCS48_INPUT_EA, CLEAR_LINE); + m_maincpu->set_input_line(MCS48_INPUT_EA, CLEAR_LINE); membank("bank1")->set_entry(0); /* reset sound CPU */ - device_set_input_line(m_soundcpu, INPUT_LINE_RESET, ASSERT_LINE); + m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); m_rambank = 0x300; m_frame_start = 0; @@ -58,7 +58,7 @@ WRITE8_MEMBER( advision_state::bankswitch_w ) { int ea = BIT(data, 2); - device_set_input_line(m_maincpu, MCS48_INPUT_EA, ea ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(MCS48_INPUT_EA, ea ? ASSERT_LINE : CLEAR_LINE); membank("bank1")->set_entry(ea); @@ -79,7 +79,7 @@ READ8_MEMBER( advision_state::ext_ram_r ) if (m_video_bank == 0x06) { - device_set_input_line(m_soundcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); + m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); } return data; diff --git a/src/mess/machine/amigacrt.c b/src/mess/machine/amigacrt.c index 53beead947c..84de5897c9a 100644 --- a/src/mess/machine/amigacrt.c +++ b/src/mess/machine/amigacrt.c @@ -166,7 +166,7 @@ static void amiga_ar1_init( running_machine &machine ) amigacrt.ar1_spurious = 0; /* Install IRQ ACK callback */ - device_set_irq_callback(machine.device("maincpu"), amiga_ar1_irqack); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(amiga_ar1_irqack); } /*************************************************************************** diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c index c8f49e76fc7..df2a7c12ba5 100644 --- a/src/mess/machine/amstrad.c +++ b/src/mess/machine/amstrad.c @@ -1446,7 +1446,7 @@ WRITE8_MEMBER(amstrad_state::amstrad_plus_asic_6000_w) if ( m_asic.enabled ) { vector = (data & 0xf8) + (m_plus_irq_cause); - device_set_input_line_vector(m_maincpu, 0, vector); + m_maincpu->set_input_line_vector(0, vector); logerror("ASIC: IM 2 vector write %02x, data = &%02x\n",vector,data); } m_asic.dma_clear = data & 0x01; @@ -2888,9 +2888,9 @@ static void amstrad_common_init(running_machine &machine) state->m_maincpu->reset(); if ( state->m_system_type == SYSTEM_CPC || state->m_system_type == SYSTEM_ALESTE ) - device_set_input_line_vector(state->m_maincpu, 0, 0xff); + state->m_maincpu->set_input_line_vector(0, 0xff); else - device_set_input_line_vector(state->m_maincpu, 0, 0x00); + state->m_maincpu->set_input_line_vector(0, 0x00); /* The opcode timing in the Amstrad is different to the opcode timing in the core for the Z80 CPU. @@ -2911,7 +2911,7 @@ static void amstrad_common_init(running_machine &machine) (const UINT8*)amstrad_cycle_table_ex); /* Juergen is a cool dude! */ - device_set_irq_callback(state->m_maincpu, amstrad_cpu_acknowledge_int); + state->m_maincpu->set_irq_acknowledge_callback(amstrad_cpu_acknowledge_int); } static TIMER_CALLBACK( cb_set_resolution ) diff --git a/src/mess/machine/at.c b/src/mess/machine/at.c index e5ef24e96e2..e59d02387b2 100644 --- a/src/mess/machine/at.c +++ b/src/mess/machine/at.c @@ -155,7 +155,7 @@ WRITE8_MEMBER( at_state::at_page8_w ) WRITE_LINE_MEMBER( at_state::pc_dma_hrq_changed ) { - device_set_input_line(m_maincpu, INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); /* Assert HLDA */ m_dma8237_2->hack_w(state); @@ -354,7 +354,7 @@ static IRQ_CALLBACK(at_irq_callback) MACHINE_START( at ) { - device_set_irq_callback(machine.device("maincpu"), at_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(at_irq_callback); } MACHINE_RESET( at ) diff --git a/src/mess/machine/b2m.c b/src/mess/machine/b2m.c index ec4bffe4cdc..f56de201486 100644 --- a/src/mess/machine/b2m.c +++ b/src/mess/machine/b2m.c @@ -372,6 +372,6 @@ MACHINE_RESET(b2m) state->m_b2m_side = 0; state->m_b2m_drive = 0; - device_set_irq_callback(machine.device("maincpu"), b2m_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(b2m_irq_callback); b2m_set_bank(machine, 7); } diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index 1581b7e48bb..a356cf700f6 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -1425,7 +1425,7 @@ static void bbc_i8271_interrupt(device_t *device, int state) { /* I'll pulse it because if I used hold-line I'm not sure it would clear - to be checked */ - device_set_input_line(device->machine().device("maincpu"), INPUT_LINE_NMI,PULSE_LINE); + device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); } } diff --git a/src/mess/machine/bk.c b/src/mess/machine/bk.c index 8bf33c9e731..d8c24e57677 100644 --- a/src/mess/machine/bk.c +++ b/src/mess/machine/bk.c @@ -74,14 +74,14 @@ MACHINE_START(bk0010) static IRQ_CALLBACK(bk0010_irq_callback) { bk_state *state = device->machine().driver_data<bk_state>(); - device_set_input_line(device, 0, CLEAR_LINE); + device->execute().set_input_line(0, CLEAR_LINE); return state->m_key_irq_vector; } MACHINE_RESET( bk0010 ) { bk_state *state = machine.driver_data<bk_state>(); - device_set_irq_callback(machine.device("maincpu"), bk0010_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(bk0010_irq_callback); state->m_kbd_state = 0; state->m_scrool = 01330; diff --git a/src/mess/machine/c64_cpm.c b/src/mess/machine/c64_cpm.c index 197d9f3e4ff..937f4ded1bd 100644 --- a/src/mess/machine/c64_cpm.c +++ b/src/mess/machine/c64_cpm.c @@ -89,8 +89,8 @@ inline void c64_cpm_cartridge_device::update_signals() { if (m_enabled) { - device_set_input_line(m_maincpu, INPUT_LINE_HALT, CLEAR_LINE); - device_set_input_line(machine().firstcpu, INPUT_LINE_HALT, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + machine().firstcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); if (m_reset) { @@ -101,8 +101,8 @@ inline void c64_cpm_cartridge_device::update_signals() } else { - device_set_input_line(m_maincpu, INPUT_LINE_HALT, ASSERT_LINE); - device_set_input_line(machine().firstcpu, INPUT_LINE_HALT, CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + machine().firstcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); } /* diff --git a/src/mess/machine/compis.c b/src/mess/machine/compis.c index 0c781ba1453..efd590297a0 100644 --- a/src/mess/machine/compis.c +++ b/src/mess/machine/compis.c @@ -414,7 +414,7 @@ static IRQ_CALLBACK(int_callback) logerror("(%f) **** Acknowledged interrupt vector %02X\n", device->machine().time().as_double(), state->m_i186.intr.poll_status & 0x1f); /* clear the interrupt */ - device_set_input_line(device, 0, CLEAR_LINE); + device->execute().set_input_line(0, CLEAR_LINE); state->m_i186.intr.pending = 0; /* clear the request and set the in-service bit */ @@ -1216,7 +1216,7 @@ WRITE16_MEMBER( compis_state::compis_i186_internal_port_w ) /* we need to do this at a time when the I86 context is swapped in */ /* this register is generally set once at startup and never again, so it's a good */ /* time to set it up */ - device_set_irq_callback(m_maincpu, int_callback); + m_maincpu->set_irq_acknowledge_callback(int_callback); break; case 0x60: @@ -1367,7 +1367,7 @@ static IRQ_CALLBACK( compis_irq_callback ) DRIVER_INIT_MEMBER(compis_state,compis) { - device_set_irq_callback(machine().device("maincpu"), compis_irq_callback); + machine().device("maincpu")->execute().set_irq_acknowledge_callback(compis_irq_callback); memset (&m_compis, 0, sizeof (m_compis) ); } @@ -1390,7 +1390,7 @@ MACHINE_RESET( compis ) compis_keyb_init(state); /* OSP PIC 8259 */ - device_set_irq_callback(state->m_maincpu, compis_irq_callback); + state->m_maincpu->set_irq_acknowledge_callback(compis_irq_callback); } /*-------------------------------------------------------------------------*/ diff --git a/src/mess/machine/cuda.c b/src/mess/machine/cuda.c index de423c2eb00..1086a1b3a85 100644 --- a/src/mess/machine/cuda.c +++ b/src/mess/machine/cuda.c @@ -108,7 +108,7 @@ const rom_entry *cuda_device::device_rom_region() const void cuda_device::send_port(address_space &space, UINT8 offset, UINT8 data) { -// printf("PORT %c write %02x (DDR = %02x) (PC=%x)\n", 'A' + offset, data, ddrs[offset], m_maincpu->safe_pc()); +// printf("PORT %c write %02x (DDR = %02x) (PC=%x)\n", 'A' + offset, data, ddrs[offset], m_maincpu->pc()); switch (offset) { @@ -138,21 +138,21 @@ void cuda_device::send_port(address_space &space, UINT8 offset, UINT8 data) if (treq != ((data>>1)&1)) { #ifdef CUDA_SUPER_VERBOSE - printf("CU-> TREQ: %d (PC=%x)\n", (data>>1)&1, m_maincpu->safe_pc()); + printf("CU-> TREQ: %d (PC=%x)\n", (data>>1)&1, m_maincpu->pc()); #endif treq = (data>>1) & 1; } if (via_data != ((data>>5)&1)) { #ifdef CUDA_SUPER_VERBOSE - printf("CU-> VIA_DATA: %d (PC=%x)\n", (data>>5)&1, m_maincpu->safe_pc()); + printf("CU-> VIA_DATA: %d (PC=%x)\n", (data>>5)&1, m_maincpu->pc()); #endif via_data = (data>>5) & 1; } if (via_clock != ((data>>4)&1)) { #ifdef CUDA_SUPER_VERBOSE - printf("CU-> VIA_CLOCK: %d (PC=%x)\n", ((data>>4)&1)^1, m_maincpu->safe_pc()); + printf("CU-> VIA_CLOCK: %d (PC=%x)\n", ((data>>4)&1)^1, m_maincpu->pc()); #endif via_clock = (data>>4) & 1; via6522_device *via1 = machine().device<via6522_device>("via6522_0"); @@ -165,7 +165,7 @@ void cuda_device::send_port(address_space &space, UINT8 offset, UINT8 data) if ((data & 8) != reset_line) { #ifdef CUDA_SUPER_VERBOSE - printf("680x0 reset: %d -> %d (PC=%x)\n", (ports[2] & 8)>>3, (data & 8)>>3, m_maincpu->safe_pc()); + printf("680x0 reset: %d -> %d (PC=%x)\n", (ports[2] & 8)>>3, (data & 8)>>3, m_maincpu->pc()); #endif reset_line = (data & 8); // falling edge, should reset the machine too @@ -193,7 +193,7 @@ READ8_MEMBER( cuda_device::ddr_r ) WRITE8_MEMBER( cuda_device::ddr_w ) { -// printf("%02x to PORT %c DDR (PC=%x)\n", data, 'A' + offset, m_maincpu->safe_pc()); +// printf("%02x to PORT %c DDR (PC=%x)\n", data, 'A' + offset, m_maincpu->pc()); send_port(space, offset, ports[offset] & data); @@ -251,7 +251,7 @@ READ8_MEMBER( cuda_device::ports_r ) incoming |= 0x01; } -// printf("PORT %c read = %02x (DDR = %02x latch = %02x) (PC=%x)\n", 'A' + offset, ports[offset], ddrs[offset], ports[offset], m_maincpu->safe_pc()); +// printf("PORT %c read = %02x (DDR = %02x latch = %02x) (PC=%x)\n", 'A' + offset, ports[offset], ddrs[offset], ports[offset], m_maincpu->pc()); return incoming; } @@ -279,7 +279,7 @@ WRITE8_MEMBER( cuda_device::pll_w ) (data & 0x40) ? 1 : 0, (data & 0x20) ? 1 : 0, (data & 0x10) ? 1 : 0, - (data & 0x08) ? 1 : 0, m_maincpu->safe_pc()); + (data & 0x08) ? 1 : 0, m_maincpu->pc()); } #endif pll_ctrl = data; @@ -300,7 +300,7 @@ WRITE8_MEMBER( cuda_device::timer_ctrl_w ) { attotime::from_seconds(8), attotime::from_msec(250.0f), attotime::from_msec(125.1f), attotime::from_msec(62.5f), attotime::from_msec(31.3f) }, }; -// printf("%02x to timer control (PC=%x)\n", data, m_maincpu->safe_pc()); +// printf("%02x to timer control (PC=%x)\n", data, m_maincpu->pc()); if (data & 0x50) { @@ -314,12 +314,12 @@ WRITE8_MEMBER( cuda_device::timer_ctrl_w ) if ((timer_ctrl & 0x80) && !(data & 0x80)) { - device_set_input_line(m_maincpu, M68HC05EG_INT_TIMER, CLEAR_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_TIMER, CLEAR_LINE); timer_ctrl &= ~0x80; } else if ((timer_ctrl & 0x40) && !(data & 0x40)) { - device_set_input_line(m_maincpu, M68HC05EG_INT_TIMER, CLEAR_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_TIMER, CLEAR_LINE); timer_ctrl &= ~0x40; } @@ -334,7 +334,7 @@ READ8_MEMBER( cuda_device::timer_counter_r ) WRITE8_MEMBER( cuda_device::timer_counter_w ) { -// printf("%02x to timer counter (PC=%x)\n", data, m_maincpu->safe_pc()); +// printf("%02x to timer counter (PC=%x)\n", data, m_maincpu->pc()); timer_counter = data; ripple_counter = timer_counter; } @@ -350,7 +350,7 @@ WRITE8_MEMBER( cuda_device::onesec_w ) if ((onesec & 0x40) && !(data & 0x40)) { - device_set_input_line(m_maincpu, M68HC05EG_INT_CPI, CLEAR_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_CPI, CLEAR_LINE); } onesec = data; @@ -464,7 +464,7 @@ void cuda_device::device_timer(emu_timer &timer, device_timer_id id, int param, if (onesec & 0x10) { - device_set_input_line(m_maincpu, M68HC05EG_INT_CPI, ASSERT_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_CPI, ASSERT_LINE); } } else @@ -473,7 +473,7 @@ void cuda_device::device_timer(emu_timer &timer, device_timer_id id, int param, if (timer_ctrl & 0x20) { - device_set_input_line(m_maincpu, M68HC05EG_INT_TIMER, ASSERT_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_TIMER, ASSERT_LINE); } ripple_counter--; @@ -485,7 +485,7 @@ void cuda_device::device_timer(emu_timer &timer, device_timer_id id, int param, if (timer_ctrl & 0x10) { - device_set_input_line(m_maincpu, M68HC05EG_INT_TIMER, ASSERT_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_TIMER, ASSERT_LINE); } } } diff --git a/src/mess/machine/dec_lk201.c b/src/mess/machine/dec_lk201.c index f4197e2d108..e8200508dd3 100644 --- a/src/mess/machine/dec_lk201.c +++ b/src/mess/machine/dec_lk201.c @@ -107,7 +107,7 @@ READ8_MEMBER( lk201_device::ddr_r ) WRITE8_MEMBER( lk201_device::ddr_w ) { -// printf("%02x to PORT %c DDR (PC=%x)\n", data, 'A' + offset, m_maincpu->safe_pc()); +// printf("%02x to PORT %c DDR (PC=%x)\n", data, 'A' + offset, m_maincpu->pc()); send_port(space, offset, ports[offset] & data); @@ -135,7 +135,7 @@ READ8_MEMBER( lk201_device::ports_r ) // add in ddr-masked version of port writes incoming |= (ports[offset] & ddrs[offset]); -// printf("PORT %c read = %02x (DDR = %02x latch = %02x) (PC=%x)\n", 'A' + offset, ports[offset], ddrs[offset], ports[offset], m_maincpu->safe_pc()); +// printf("PORT %c read = %02x (DDR = %02x latch = %02x) (PC=%x)\n", 'A' + offset, ports[offset], ddrs[offset], ports[offset], m_maincpu->pc()); return incoming; } @@ -149,7 +149,7 @@ WRITE8_MEMBER( lk201_device::ports_w ) void lk201_device::send_port(address_space &space, UINT8 offset, UINT8 data) { -// printf("PORT %c write %02x (DDR = %02x) (PC=%x)\n", 'A' + offset, data, ddrs[offset], m_maincpu->safe_pc()); +// printf("PORT %c write %02x (DDR = %02x) (PC=%x)\n", 'A' + offset, data, ddrs[offset], m_maincpu->pc()); switch (offset) { @@ -187,7 +187,7 @@ READ8_MEMBER( lk201_device::sci_r ) break; } -// printf("SCI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->safe_pc()); +// printf("SCI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->pc()); return incoming; } @@ -212,7 +212,7 @@ WRITE8_MEMBER( lk201_device::sci_w ) break; } -// printf("SCI %02x to %x (PC=%x)\n", data, offset, m_maincpu->safe_pc()); +// printf("SCI %02x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); } READ8_MEMBER( lk201_device::spi_r ) @@ -232,7 +232,7 @@ READ8_MEMBER( lk201_device::spi_r ) break; } -// printf("SPI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->safe_pc()); +// printf("SPI read @ %x = %02x (PC=%x)\n", offset, incoming, m_maincpu->pc()); return incoming; } @@ -251,7 +251,7 @@ WRITE8_MEMBER( lk201_device::spi_w ) break; } -// printf("SPI %02x to %x (PC=%x)\n", data, offset, m_maincpu->safe_pc()); +// printf("SPI %02x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); } /* diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c index bc45ce2767d..ca1878fd108 100644 --- a/src/mess/machine/dgn_beta.c +++ b/src/mess/machine/dgn_beta.c @@ -702,7 +702,7 @@ static WRITE8_DEVICE_HANDLER(d_pia1_pa_w) /* CPU un-halted let it run ! */ if (HALT_DMA == CLEAR_LINE) - device_yield(device->machine().device(MAINCPU_TAG)); + device->machine().device(MAINCPU_TAG)->execute().yield(); state->m_d_pia1_pa_last = data & 0x80; } @@ -741,7 +741,7 @@ static WRITE8_DEVICE_HANDLER(d_pia1_pb_w) /* CPU un-halted let it run ! */ if (HALT_CPU == CLEAR_LINE) - device_yield(device->machine().device(DMACPU_TAG)); + device->machine().device(DMACPU_TAG)->execute().yield(); } } @@ -789,7 +789,7 @@ static WRITE8_DEVICE_HANDLER(d_pia2_pa_w) { device->machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); logerror("device_yield()\n"); - device_yield(device->machine().device(DMACPU_TAG)); /* Let DMA CPU run */ + device->machine().device(DMACPU_TAG)->execute().yield(); /* Let DMA CPU run */ } else { diff --git a/src/mess/machine/ecbbus.c b/src/mess/machine/ecbbus.c index 8c147a32767..1b5781a41f0 100644 --- a/src/mess/machine/ecbbus.c +++ b/src/mess/machine/ecbbus.c @@ -144,7 +144,7 @@ ecbbus_device::ecbbus_device(const machine_config &mconfig, const char *tag, dev void ecbbus_device::device_start() { - m_maincpu = machine().device(m_cputag); + m_maincpu = machine().device<cpu_device>(m_cputag); // resolve callbacks m_out_int_func.resolve(m_out_int_cb, *this); diff --git a/src/mess/machine/ecbbus.h b/src/mess/machine/ecbbus.h index 8b9d53b20f3..96bc575823d 100644 --- a/src/mess/machine/ecbbus.h +++ b/src/mess/machine/ecbbus.h @@ -123,7 +123,7 @@ protected: private: // internal state - device_t *m_maincpu; + cpu_device *m_maincpu; devcb_resolved_write_line m_out_int_func; devcb_resolved_write_line m_out_nmi_func; diff --git a/src/mess/machine/egret.c b/src/mess/machine/egret.c index b7f8a5c396e..8d8afe65ec8 100644 --- a/src/mess/machine/egret.c +++ b/src/mess/machine/egret.c @@ -137,21 +137,21 @@ void egret_device::send_port(address_space &space, UINT8 offset, UINT8 data) if (xcvr_session != ((data>>1)&1)) { #ifdef EGRET_SUPER_VERBOSE - printf("EG-> XCVR_SESSION: %d (PC=%x)\n", (data>>1)&1, m_maincpu->safe_pc()); + printf("EG-> XCVR_SESSION: %d (PC=%x)\n", (data>>1)&1, m_maincpu->pc()); #endif xcvr_session = (data>>1) & 1; } if (via_data != ((data>>5)&1)) { #ifdef EGRET_SUPER_VERBOSE - printf("EG-> VIA_DATA: %d (PC=%x)\n", (data>>5)&1, m_maincpu->safe_pc()); + printf("EG-> VIA_DATA: %d (PC=%x)\n", (data>>5)&1, m_maincpu->pc()); #endif via_data = (data>>5) & 1; } if (via_clock != ((data>>4)&1)) { #ifdef EGRET_SUPER_VERBOSE - printf("EG-> VIA_CLOCK: %d (PC=%x)\n", ((data>>4)&1)^1, m_maincpu->safe_pc()); + printf("EG-> VIA_CLOCK: %d (PC=%x)\n", ((data>>4)&1)^1, m_maincpu->pc()); #endif via_clock = (data>>4) & 1; via6522_device *via1 = machine().device<via6522_device>("via6522_0"); @@ -312,7 +312,7 @@ WRITE8_MEMBER( egret_device::onesec_w ) if ((onesec & 0x40) && !(data & 0x40)) { - device_set_input_line(m_maincpu, M68HC05EG_INT_CPI, CLEAR_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_CPI, CLEAR_LINE); } onesec = data; @@ -419,7 +419,7 @@ void egret_device::device_timer(emu_timer &timer, device_timer_id id, int param, if (onesec & 0x10) { - device_set_input_line(m_maincpu, M68HC05EG_INT_CPI, ASSERT_LINE); + m_maincpu->set_input_line(M68HC05EG_INT_CPI, ASSERT_LINE); } } diff --git a/src/mess/machine/galaxy.c b/src/mess/machine/galaxy.c index 4962afab2c2..8a3fedabf82 100644 --- a/src/mess/machine/galaxy.c +++ b/src/mess/machine/galaxy.c @@ -47,7 +47,7 @@ WRITE8_MEMBER(galaxy_state::galaxy_latch_w) INTERRUPT_GEN( galaxy_interrupt ) { - device_set_input_line(device, 0, HOLD_LINE); + device->execute().set_input_line(0, HOLD_LINE); } static IRQ_CALLBACK ( galaxy_irq_callback ) @@ -123,8 +123,8 @@ static void galaxy_setup_snapshot (running_machine &machine, const UINT8 * data, break; } - device_set_input_line(cpu, INPUT_LINE_NMI, CLEAR_LINE); - device_set_input_line(cpu, INPUT_LINE_IRQ0, CLEAR_LINE); + cpu->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + cpu->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); } SNAPSHOT_LOAD( galaxy ) @@ -185,7 +185,7 @@ MACHINE_RESET( galaxy ) if (machine.root_device().ioport("ROM2")->read()) state->membank("bank10")->set_base(machine.root_device().memregion("maincpu")->base() + 0x1000); - device_set_irq_callback(machine.device("maincpu"), galaxy_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(galaxy_irq_callback); state->m_interrupts_enabled = TRUE; } @@ -200,7 +200,7 @@ MACHINE_RESET( galaxyp ) UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); - device_set_irq_callback(machine.device("maincpu"), galaxy_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(galaxy_irq_callback); ROM[0x0037] = 0x29; ROM[0x03f9] = 0xcd; diff --git a/src/mess/machine/genpc.c b/src/mess/machine/genpc.c index 9b77cbdb5b1..57b4f972244 100644 --- a/src/mess/machine/genpc.c +++ b/src/mess/machine/genpc.c @@ -60,7 +60,7 @@ WRITE8_DEVICE_HANDLER(pc_page_w) WRITE_LINE_MEMBER( ibm5160_mb_device::pc_dma_hrq_changed ) { - device_set_input_line(m_maincpu, INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); /* Assert HLDA */ m_dma8237->hack_w(state); @@ -665,7 +665,7 @@ IRQ_CALLBACK(ibm5160_mb_device::pc_irq_callback) void ibm5160_mb_device::device_reset() { - device_set_irq_callback(m_maincpu, pc_irq_callback); + m_maincpu->set_irq_acknowledge_callback(pc_irq_callback); m_u73_q2 = 0; m_out1 = 2; // initial state of pit output is undefined diff --git a/src/mess/machine/hd63450.c b/src/mess/machine/hd63450.c index 4a40204b11e..63f05419047 100644 --- a/src/mess/machine/hd63450.c +++ b/src/mess/machine/hd63450.c @@ -258,7 +258,7 @@ static void dma_transfer_start(device_t* device, int channel, int dir) if((dmac->reg[channel].dcr & 0xc0) == 0x00) // Burst transfer { device_t *cpu = device->machine().device(dmac->intf->cpu_tag); - device_set_input_line(cpu, INPUT_LINE_HALT, ASSERT_LINE); + cpu->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); dmac->timer[channel]->adjust(attotime::zero, channel, dmac->burst_clock[channel]); } else @@ -440,7 +440,7 @@ void hd63450_single_transfer(device_t* device, int x) if((dmac->reg[x].dcr & 0xc0) == 0x00) { device_t *cpu = device->machine().device(dmac->intf->cpu_tag); - device_set_input_line(cpu, INPUT_LINE_HALT, CLEAR_LINE); + cpu->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); } if(dmac->intf->dma_end) diff --git a/src/mess/machine/i82371ab.c b/src/mess/machine/i82371ab.c index 81e51538a5a..ac25c5ddf08 100644 --- a/src/mess/machine/i82371ab.c +++ b/src/mess/machine/i82371ab.c @@ -224,7 +224,7 @@ void i82371ab_device::device_start() /* setup save states */ save_item(NAME(m_regs)); - device_set_irq_callback(machine().device(":maincpu"), at_irq_callback); + machine().device(":maincpu")->execute().set_irq_acknowledge_callback(at_irq_callback); } //------------------------------------------------- diff --git a/src/mess/machine/i82371sb.c b/src/mess/machine/i82371sb.c index a020bb94896..ef5cee00877 100644 --- a/src/mess/machine/i82371sb.c +++ b/src/mess/machine/i82371sb.c @@ -154,7 +154,7 @@ void i82371sb_device::device_start() /* setup save states */ save_item(NAME(m_regs)); - device_set_irq_callback(machine().device(":maincpu"), at_irq_callback); + machine().device(":maincpu")->execute().set_irq_acknowledge_callback(at_irq_callback); } //------------------------------------------------- diff --git a/src/mess/machine/intv.c b/src/mess/machine/intv.c index 7c8ffec2cb6..68762fbe76c 100644 --- a/src/mess/machine/intv.c +++ b/src/mess/machine/intv.c @@ -618,11 +618,11 @@ DRIVER_INIT_MEMBER(intv_state,intv) /* Set Reset and INTR/INTRM Vector */ MACHINE_RESET( intv ) { - device_set_input_line_vector(machine.device("maincpu"), CP1610_RESET, 0x1000); + machine.device("maincpu")->execute().set_input_line_vector(CP1610_RESET, 0x1000); /* These are actually the same vector, and INTR is unused */ - device_set_input_line_vector(machine.device("maincpu"), CP1610_INT_INTRM, 0x1004); - device_set_input_line_vector(machine.device("maincpu"), CP1610_INT_INTR, 0x1004); + machine.device("maincpu")->execute().set_input_line_vector(CP1610_INT_INTRM, 0x1004); + machine.device("maincpu")->execute().set_input_line_vector(CP1610_INT_INTR, 0x1004); /* Set initial PC */ machine.device("maincpu")->state().set_state_int(CP1610_R7, 0x1000); @@ -638,11 +638,11 @@ MACHINE_RESET( intvecs ) state->membank("bank3")->set_base(machine.root_device().memregion("maincpu")->base() + (0xE000 << 1)); state->membank("bank4")->set_base(machine.root_device().memregion("maincpu")->base() + (0xF000 << 1)); - device_set_input_line_vector(machine.device("maincpu"), CP1610_RESET, 0x1000); + machine.device("maincpu")->execute().set_input_line_vector(CP1610_RESET, 0x1000); /* These are actually the same vector, and INTR is unused */ - device_set_input_line_vector(machine.device("maincpu"), CP1610_INT_INTRM, 0x1004); - device_set_input_line_vector(machine.device("maincpu"), CP1610_INT_INTR, 0x1004); + machine.device("maincpu")->execute().set_input_line_vector(CP1610_INT_INTRM, 0x1004); + machine.device("maincpu")->execute().set_input_line_vector(CP1610_INT_INTR, 0x1004); /* Set initial PC */ machine.device("maincpu")->state().set_state_int(CP1610_R7, 0x1000); @@ -663,7 +663,7 @@ static TIMER_CALLBACK(intv_btb_fill) intv_state *state = machine.driver_data<intv_state>(); UINT8 column; UINT8 row = state->m_backtab_row; - //device_adjust_icount(machine.device("maincpu"), -STIC_ROW_FETCH); + //machine.device("maincpu")->execute().adjust_icount(-STIC_ROW_FETCH); for(column=0; column < STIC_BACKTAB_WIDTH; column++) { state->m_backtab_buffer[row][column] = state->m_ram16[column + row * STIC_BACKTAB_WIDTH]; @@ -680,7 +680,7 @@ INTERRUPT_GEN( intv_interrupt ) state->m_bus_copy_mode = 1; state->m_backtab_row = 0; UINT8 row; - device_adjust_icount(device->machine().device("maincpu"), -(12*STIC_ROW_BUSRQ+STIC_FRAME_BUSRQ)); // Account for stic cycle stealing + device->machine().device("maincpu")->execute().adjust_icount(-(12*STIC_ROW_BUSRQ+STIC_FRAME_BUSRQ)); // Account for stic cycle stealing device->machine().scheduler().timer_set(device->machine().device<cpu_device>("maincpu") ->cycles_to_attotime(STIC_VBLANK_END), FUNC(intv_interrupt_complete)); for (row=0; row < STIC_BACKTAB_HEIGHT; row++) @@ -691,7 +691,7 @@ INTERRUPT_GEN( intv_interrupt ) if (state->m_row_delay == 0) { - device_adjust_icount(device->machine().device("maincpu"), -STIC_ROW_BUSRQ); // extra row fetch occurs if vertical delay == 0 + device->machine().device("maincpu")->execute().adjust_icount(-STIC_ROW_BUSRQ); // extra row fetch occurs if vertical delay == 0 } intv_stic_screenrefresh(device->machine()); diff --git a/src/mess/machine/isa.c b/src/mess/machine/isa.c index edc4290a44d..1fa0f0a6efd 100644 --- a/src/mess/machine/isa.c +++ b/src/mess/machine/isa.c @@ -133,7 +133,7 @@ void isa8_device::device_config_complete() memset(&m_out_drq2_cb, 0, sizeof(m_out_drq2_cb)); memset(&m_out_drq3_cb, 0, sizeof(m_out_drq3_cb)); } - m_maincpu = mconfig().device(m_cputag); + m_maincpu = mconfig().device<cpu_device>(m_cputag); } //************************************************************************** @@ -201,25 +201,25 @@ void isa8_device::device_reset() void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name) { - int buswidth = m_maincpu->memory().space_config(spacenum)->m_databus_width; + int buswidth = m_maincpu->space_config(spacenum)->m_databus_width; switch(buswidth) { case 8: - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); break; case 16: - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff); break; case 32: if ((start % 4) == 0) { if ((end-start)==1) { - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); } else { - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); } } else { // we handle just misalligned by 2 - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); } break; default: @@ -231,25 +231,25 @@ void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler) { - int buswidth = m_maincpu->memory().space_config(spacenum)->m_databus_width; + int buswidth = m_maincpu->space_config(spacenum)->m_databus_width; switch(buswidth) { case 8: - m_maincpu->memory().space(spacenum)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); + m_maincpu->space(spacenum)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); break; case 16: - m_maincpu->memory().space(spacenum)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff); + m_maincpu->space(spacenum)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff); break; case 32: if ((start % 4) == 0) { if ((end-start)==1) { - m_maincpu->memory().space(spacenum)->install_readwrite_handler(start, end+2, mask, mirror, rhandler, whandler, 0x0000ffff); + m_maincpu->space(spacenum)->install_readwrite_handler(start, end+2, mask, mirror, rhandler, whandler, 0x0000ffff); } else { - m_maincpu->memory().space(spacenum)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); + m_maincpu->space(spacenum)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); } } else { // we handle just misalligned by 2 - m_maincpu->memory().space(spacenum)->install_readwrite_handler(start-2, end, mask, mirror, rhandler, whandler, 0xffff0000); + m_maincpu->space(spacenum)->install_readwrite_handler(start-2, end, mask, mirror, rhandler, whandler, 0xffff0000); } break; default: @@ -261,25 +261,25 @@ void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t void isa8_device::install_space(address_spacenum spacenum, device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name) { - int buswidth = m_maincpu->memory().space_config(spacenum)->m_databus_width; + int buswidth = m_maincpu->space_config(spacenum)->m_databus_width; switch(buswidth) { case 8: - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); break; case 16: - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff); break; case 32: if ((start % 4) == 0) { if ((end-start)==1) { - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(*dev, start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(*dev, start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); } else { - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); } } else { // we handle just misalligned by 2 - m_maincpu->memory().space(spacenum)->install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); + m_maincpu->space(spacenum)->install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); } break; default: @@ -327,14 +327,14 @@ void isa8_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t m void isa8_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data) { - address_space *space = m_maincpu->memory().space(AS_PROGRAM); + address_space *space = m_maincpu->space(AS_PROGRAM); space->install_readwrite_bank(start, end, mask, mirror, tag ); machine().root_device().membank(tag)->set_base(data); } void isa8_device::unmap_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror) { - address_space *space = m_maincpu->memory().space(AS_PROGRAM); + address_space *space = m_maincpu->space(AS_PROGRAM); space->unmap_readwrite(start, end, mask, mirror); } @@ -346,7 +346,7 @@ void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t ma UINT8 *dest = machine().root_device().memregion("isa")->base() + start - 0xc0000; memcpy(dest,src, end - start + 1); } else { - address_space *space = m_maincpu->memory().space(AS_PROGRAM); + address_space *space = m_maincpu->space(AS_PROGRAM); space->install_read_bank(start, end, mask, mirror, tag); space->unmap_write(start, end, mask, mirror); machine().root_device().membank(tag)->set_base(machine().root_device().memregion(dev->subtag(tempstring, region))->base()); @@ -355,14 +355,14 @@ void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t ma void isa8_device::unmap_rom(offs_t start, offs_t end, offs_t mask, offs_t mirror) { - address_space *space = m_maincpu->memory().space(AS_PROGRAM); + address_space *space = m_maincpu->space(AS_PROGRAM); space->unmap_read(start, end, mask, mirror); } bool isa8_device::is_option_rom_space_available(offs_t start, int size) { - m_maincpu = machine().device(m_cputag); - address_space *space = m_maincpu->memory().space(AS_PROGRAM); + m_maincpu = machine().device<cpu_device>(m_cputag); + address_space *space = m_maincpu->space(AS_PROGRAM); for(int i = 0; i < size; i += 4096) // 4KB granularity should be enough if(space->get_read_ptr(start + i)) return false; return true; @@ -404,7 +404,7 @@ void isa8_device::nmi() { if (m_nmi_enabled) { - device_set_input_line( m_maincpu, INPUT_LINE_NMI, PULSE_LINE ); + m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); } } //************************************************************************** @@ -518,7 +518,7 @@ void isa16_device::device_config_complete() memset(&m_out_drq6_cb, 0, sizeof(m_out_drq6_cb)); memset(&m_out_drq7_cb, 0, sizeof(m_out_drq7_cb)); } - m_maincpu = mconfig().device(m_cputag); + m_maincpu = mconfig().device<cpu_device>(m_cputag); } //------------------------------------------------- @@ -544,22 +544,22 @@ void isa16_device::device_start() void isa16_device::install16_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_device_func rhandler, const char* rhandler_name, write16_device_func whandler, const char *whandler_name) { - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 16: - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0); break; case 32: if ((start % 4) == 0) { if ((end-start)==1) { - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff); } else { - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff); } } else { // we handle just misalligned by 2 - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000); } break; @@ -571,23 +571,23 @@ void isa16_device::install16_device(device_t *dev, offs_t start, offs_t end, off void isa16_device::install16_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_delegate rhandler, write16_delegate whandler) { - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 16: - m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); + m_maincpu->space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0); break; case 32: - m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); + m_maincpu->space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); if ((start % 4) == 0) { if ((end-start)==1) { - m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end+2, mask, mirror, rhandler, whandler, 0x0000ffff); + m_maincpu->space(AS_IO)->install_readwrite_handler(start, end+2, mask, mirror, rhandler, whandler, 0x0000ffff); } else { - m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); + m_maincpu->space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffffffff); } } else { // we handle just misalligned by 2 - m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start-2, end, mask, mirror, rhandler, whandler, 0xffff0000); + m_maincpu->space(AS_IO)->install_readwrite_handler(start-2, end, mask, mirror, rhandler, whandler, 0xffff0000); } break; @@ -599,23 +599,23 @@ void isa16_device::install16_device(offs_t start, offs_t end, offs_t mask, offs_ void isa16_device::install16_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_space_func rhandler, const char* rhandler_name, write16_space_func whandler, const char *whandler_name) { - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 16: - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0); break; case 32: - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffffffff); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffffffff); if ((start % 4) == 0) { if ((end-start)==1) { - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0x0000ffff); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0x0000ffff); } else { - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffffffff); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffffffff); } } else { // we handle just misalligned by 2 - m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffff0000); + m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0xffff0000); } break; diff --git a/src/mess/machine/isa.h b/src/mess/machine/isa.h index 5989c6d0e5f..3e0a8b755b8 100644 --- a/src/mess/machine/isa.h +++ b/src/mess/machine/isa.h @@ -190,7 +190,7 @@ protected: virtual void device_config_complete(); // internal state - device_t *m_maincpu; + cpu_device *m_maincpu; devcb_resolved_write_line m_out_irq2_func; devcb_resolved_write_line m_out_irq3_func; diff --git a/src/mess/machine/kb_keytro.c b/src/mess/machine/kb_keytro.c index 52f18f6ac11..235552fdb78 100644 --- a/src/mess/machine/kb_keytro.c +++ b/src/mess/machine/kb_keytro.c @@ -468,13 +468,13 @@ const rom_entry *pc_kbd_keytronic_pc3270_device::device_rom_region() const WRITE_LINE_MEMBER( pc_kbd_keytronic_pc3270_device::clock_write ) { - device_set_input_line( m_cpu, MCS51_INT0_LINE, state ); + m_cpu->set_input_line(MCS51_INT0_LINE, state ); } WRITE_LINE_MEMBER( pc_kbd_keytronic_pc3270_device::data_write ) { - device_set_input_line( m_cpu, MCS51_T0_LINE, state); + m_cpu->set_input_line(MCS51_T0_LINE, state); } diff --git a/src/mess/machine/kc_d004.c b/src/mess/machine/kc_d004.c index b902867cd26..6842ae1d98a 100644 --- a/src/mess/machine/kc_d004.c +++ b/src/mess/machine/kc_d004.c @@ -245,7 +245,7 @@ void kc_d004_device::device_timer(emu_timer &timer, device_timer_id id, int para switch(id) { case TIMER_RESET: - device_set_input_line(m_cpu, INPUT_LINE_RESET, ASSERT_LINE); + m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); break; case TIMER_TC_CLEAR: upd765_tc_w(m_fdc, 0x00); @@ -331,21 +331,21 @@ void kc_d004_device::io_write(offs_t offset, UINT8 data) break; case 0xf4: if (data & 0x01) - device_set_input_line(m_cpu, INPUT_LINE_RESET, CLEAR_LINE); + m_cpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); if (data & 0x02) { for (int i=0; i<0xfc00; i++) m_cpu->space(AS_PROGRAM)->write_byte(i, 0); - device_set_input_line(m_cpu, INPUT_LINE_RESET, ASSERT_LINE); + m_cpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } if (data & 0x04) - device_set_input_line(m_cpu, INPUT_LINE_RESET, HOLD_LINE); + m_cpu->set_input_line(INPUT_LINE_RESET, HOLD_LINE); if (data & 0x08) - device_set_input_line(m_cpu, INPUT_LINE_NMI, HOLD_LINE); + m_cpu->set_input_line(INPUT_LINE_NMI, HOLD_LINE); //printf("D004 CPU state: %x\n", data & 0x0f); break; diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c index ab6b183ed3d..58bea46d73e 100644 --- a/src/mess/machine/lisa.c +++ b/src/mess/machine/lisa.c @@ -328,7 +328,7 @@ static void scan_keyboard(running_machine &machine) if (keycode == state->m_NMIcode) { /* generate NMI interrupt */ machine.device("maincpu")->execute().set_input_line(M68K_IRQ_7, PULSE_LINE); - device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR); + machine.device("maincpu")->execute().set_input_line_vector(M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR); } #endif COPS_queue_data(machine, & keycode, 1); diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c index 40d81f1a5a4..1e0a1154571 100644 --- a/src/mess/machine/mac.c +++ b/src/mess/machine/mac.c @@ -1568,7 +1568,7 @@ READ16_MEMBER ( mac_state::mac_via_r ) logerror("mac_via_r: offset=0x%02x\n", offset); data = m_via1->read(space, offset); - device_adjust_icount(m_maincpu, m_via_cycles); + m_maincpu->adjust_icount(m_via_cycles); return (data & 0xff) | (data << 8); } @@ -1586,7 +1586,7 @@ WRITE16_MEMBER ( mac_state::mac_via_w ) if (ACCESSING_BITS_8_15) m_via1->write(space, offset, (data >> 8) & 0xff); - device_adjust_icount(m_maincpu, m_via_cycles); + m_maincpu->adjust_icount(m_via_cycles); } /* ************************************************************************* diff --git a/src/mess/machine/macpci.c b/src/mess/machine/macpci.c index 625b1d7f9ad..aa360d09dca 100644 --- a/src/mess/machine/macpci.c +++ b/src/mess/machine/macpci.c @@ -101,7 +101,7 @@ READ16_MEMBER ( macpci_state::mac_via_r ) printf("mac_via_r: offset=0x%02x (PC=%x)\n", offset, m_maincpu->pc()); data = m_via1->read(space, offset); - device_adjust_icount(m_maincpu, m_via_cycles); + m_maincpu->adjust_icount(m_via_cycles); return data | (data<<8); } @@ -119,7 +119,7 @@ WRITE16_MEMBER ( macpci_state::mac_via_w ) if (ACCESSING_BITS_8_15) m_via1->write(space, offset, (data >> 8) & 0xff); - device_adjust_icount(m_maincpu, m_via_cycles); + m_maincpu->adjust_icount(m_via_cycles); } static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2) diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c index 465e86c063b..fe88d250094 100644 --- a/src/mess/machine/mbc55x.c +++ b/src/mess/machine/mbc55x.c @@ -388,7 +388,7 @@ MACHINE_RESET( mbc55x ) { set_ram_size(machine); keyboard_reset(machine); - device_set_irq_callback(machine.device(MAINCPU_TAG), mbc55x_irq_callback); + machine.device(MAINCPU_TAG)->execute().set_irq_acknowledge_callback(mbc55x_irq_callback); } MACHINE_START( mbc55x ) diff --git a/src/mess/machine/mboard.c b/src/mess/machine/mboard.c index 8200153b1d7..d17e36af32c 100644 --- a/src/mess/machine/mboard.c +++ b/src/mess/machine/mboard.c @@ -219,13 +219,13 @@ WRITE32_HANDLER( mboard_write_board_32 ) WRITE8_HANDLER( mboard_write_LED_8 ) { write_LED(data); - device_spin_until_time(&space->device(), attotime::from_usec(7)); + space->device().execute().spin_until_time(attotime::from_usec(7)); } WRITE16_HANDLER( mboard_write_LED_16 ) { write_LED(data >> 8); - device_spin_until_time(&space->device(), attotime::from_usec(9)); + space->device().execute().spin_until_time(attotime::from_usec(9)); } WRITE32_HANDLER( mboard_write_LED_32 ) @@ -235,7 +235,7 @@ WRITE32_HANDLER( mboard_write_LED_32 ) if (offset) write_LED(data); else write_LED(data >> 24); logerror("write LED 32 o: %08x d: %08x\n",offset,data); -// device_spin_until_time(&space->device(), ATTOTIME_IN_USEC(20)); +// space->device().execute().spin_until_time(ATTOTIME_IN_USEC(20)); } diff --git a/src/mess/machine/mc68328.c b/src/mess/machine/mc68328.c index 4143c8ff6fd..f4671589aa2 100644 --- a/src/mess/machine/mc68328.c +++ b/src/mess/machine/mc68328.c @@ -42,31 +42,31 @@ static void mc68328_set_interrupt_line(device_t *device, UINT32 line, UINT32 act if(mc68328->regs.isr & INT_M68K_LINE7) { - device_set_input_line_and_vector(cpu, M68K_IRQ_7, ASSERT_LINE, mc68328->regs.ivr | 0x07); + cpu->execute().set_input_line_and_vector(M68K_IRQ_7, ASSERT_LINE, mc68328->regs.ivr | 0x07); } else if(mc68328->regs.isr & INT_M68K_LINE6) { - device_set_input_line_and_vector(cpu, M68K_IRQ_6, ASSERT_LINE, mc68328->regs.ivr | 0x06); + cpu->execute().set_input_line_and_vector(M68K_IRQ_6, ASSERT_LINE, mc68328->regs.ivr | 0x06); } else if(mc68328->regs.isr & INT_M68K_LINE5) { - device_set_input_line_and_vector(cpu, M68K_IRQ_5, ASSERT_LINE, mc68328->regs.ivr | 0x05); + cpu->execute().set_input_line_and_vector(M68K_IRQ_5, ASSERT_LINE, mc68328->regs.ivr | 0x05); } else if(mc68328->regs.isr & INT_M68K_LINE4) { - device_set_input_line_and_vector(cpu, M68K_IRQ_4, ASSERT_LINE, mc68328->regs.ivr | 0x04); + cpu->execute().set_input_line_and_vector(M68K_IRQ_4, ASSERT_LINE, mc68328->regs.ivr | 0x04); } else if(mc68328->regs.isr & INT_M68K_LINE3) { - device_set_input_line_and_vector(cpu, M68K_IRQ_3, ASSERT_LINE, mc68328->regs.ivr | 0x03); + cpu->execute().set_input_line_and_vector(M68K_IRQ_3, ASSERT_LINE, mc68328->regs.ivr | 0x03); } else if(mc68328->regs.isr & INT_M68K_LINE2) { - device_set_input_line_and_vector(cpu, M68K_IRQ_2, ASSERT_LINE, mc68328->regs.ivr | 0x02); + cpu->execute().set_input_line_and_vector(M68K_IRQ_2, ASSERT_LINE, mc68328->regs.ivr | 0x02); } else if(mc68328->regs.isr & INT_M68K_LINE1) { - device_set_input_line_and_vector(cpu, M68K_IRQ_1, ASSERT_LINE, mc68328->regs.ivr | 0x01); + cpu->execute().set_input_line_and_vector(M68K_IRQ_1, ASSERT_LINE, mc68328->regs.ivr | 0x01); } } } @@ -76,31 +76,31 @@ static void mc68328_set_interrupt_line(device_t *device, UINT32 line, UINT32 act if((line & INT_M68K_LINE7) && !(mc68328->regs.isr & INT_M68K_LINE7)) { - device_set_input_line(cpu, M68K_IRQ_7, CLEAR_LINE); + cpu->execute().set_input_line(M68K_IRQ_7, CLEAR_LINE); } if((line & INT_M68K_LINE6) && !(mc68328->regs.isr & INT_M68K_LINE6)) { - device_set_input_line(cpu, M68K_IRQ_6, CLEAR_LINE); + cpu->execute().set_input_line(M68K_IRQ_6, CLEAR_LINE); } if((line & INT_M68K_LINE5) && !(mc68328->regs.isr & INT_M68K_LINE5)) { - device_set_input_line(cpu, M68K_IRQ_5, CLEAR_LINE); + cpu->execute().set_input_line(M68K_IRQ_5, CLEAR_LINE); } if((line & INT_M68K_LINE4) && !(mc68328->regs.isr & INT_M68K_LINE4)) { - device_set_input_line(cpu, M68K_IRQ_4, CLEAR_LINE); + cpu->execute().set_input_line(M68K_IRQ_4, CLEAR_LINE); } if((line & INT_M68K_LINE3) && !(mc68328->regs.isr & INT_M68K_LINE3)) { - device_set_input_line(cpu, M68K_IRQ_3, CLEAR_LINE); + cpu->execute().set_input_line(M68K_IRQ_3, CLEAR_LINE); } if((line & INT_M68K_LINE2) && !(mc68328->regs.isr & INT_M68K_LINE2)) { - device_set_input_line(cpu, M68K_IRQ_2, CLEAR_LINE); + cpu->execute().set_input_line(M68K_IRQ_2, CLEAR_LINE); } if((line & INT_M68K_LINE1) && !(mc68328->regs.isr & INT_M68K_LINE1)) { - device_set_input_line(cpu, M68K_IRQ_1, CLEAR_LINE); + cpu->execute().set_input_line(M68K_IRQ_1, CLEAR_LINE); } } } diff --git a/src/mess/machine/mc80.c b/src/mess/machine/mc80.c index 163f62de9de..1bdd2e99887 100644 --- a/src/mess/machine/mc80.c +++ b/src/mess/machine/mc80.c @@ -20,7 +20,7 @@ static IRQ_CALLBACK( mc8020_irq_callback ) MACHINE_RESET( mc8020 ) { - device_set_irq_callback(machine.device("maincpu"), mc8020_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(mc8020_irq_callback); } WRITE_LINE_MEMBER( mc80_state::ctc_z0_w ) @@ -114,7 +114,7 @@ static IRQ_CALLBACK( mc8030_irq_callback ) MACHINE_RESET( mc8030 ) { - device_set_irq_callback(machine.device("maincpu"), mc8030_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(mc8030_irq_callback); } READ8_MEMBER( mc80_state::zve_port_a_r ) diff --git a/src/mess/machine/mpc105.c b/src/mess/machine/mpc105.c index c71a73d2864..f0b46acf50b 100644 --- a/src/mess/machine/mpc105.c +++ b/src/mess/machine/mpc105.c @@ -40,7 +40,7 @@ mpc105_device::mpc105_device(const machine_config &mconfig, const char *tag, dev void mpc105_device::device_start() { - m_maincpu = machine().device(m_cputag); + m_maincpu = machine().device<cpu_device>(m_cputag); } //------------------------------------------------- @@ -94,7 +94,7 @@ void mpc105_device::update_memory() if (m_bank_base > 0) { - address_space *space = m_maincpu->memory().space(AS_PROGRAM); + address_space *space = m_maincpu->space(AS_PROGRAM); /* first clear everything out */ space->nop_read(0x00000000, 0x3FFFFFFF); diff --git a/src/mess/machine/mpc105.h b/src/mess/machine/mpc105.h index 5a1370ba1f2..42e809f2289 100644 --- a/src/mess/machine/mpc105.h +++ b/src/mess/machine/mpc105.h @@ -47,7 +47,7 @@ private: UINT8 m_bank_enable; UINT32 m_bank_registers[8]; - device_t* m_maincpu; + cpu_device* m_maincpu; }; diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c index ae0e60767d7..e0109c859f8 100644 --- a/src/mess/machine/msx.c +++ b/src/mess/machine/msx.c @@ -520,7 +520,7 @@ static const UINT8 cc_ex[0x100] = { DRIVER_INIT_MEMBER(msx_state,msx) { - device_set_input_line_vector (machine().device("maincpu"), 0, 0xff); + machine().device("maincpu")->execute().set_input_line_vector(0, 0xff); msx_memory_init (machine()); diff --git a/src/mess/machine/nes.c b/src/mess/machine/nes.c index b17cdacfd94..7633cc3f11d 100644 --- a/src/mess/machine/nes.c +++ b/src/mess/machine/nes.c @@ -222,7 +222,7 @@ MACHINE_RESET( nes ) static TIMER_CALLBACK( nes_irq_callback ) { nes_state *state = machine.driver_data<nes_state>(); - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_irq_timer->adjust(attotime::never); } @@ -296,7 +296,7 @@ MACHINE_START( nes ) init_nes_core(machine); machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(nes_machine_stop),&machine)); - state->m_maincpu = machine.device("maincpu"); + state->m_maincpu = machine.device<cpu_device>("maincpu"); state->m_sound = machine.device("nessound"); state->m_cart = machine.device("cart"); @@ -1538,13 +1538,13 @@ static void fds_irq( device_t *device, int scanline, int vblank, int blanked ) nes_state *state = device->machine().driver_data<nes_state>(); if (state->m_IRQ_enable_latch) - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); if (state->m_IRQ_enable) { if (state->m_IRQ_count <= 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_enable = 0; state->m_fds_status0 |= 0x01; } diff --git a/src/mess/machine/nes_ines.c b/src/mess/machine/nes_ines.c index 3519b22882d..d7dfa7aa16d 100644 --- a/src/mess/machine/nes_ines.c +++ b/src/mess/machine/nes_ines.c @@ -38,7 +38,7 @@ static void ffe_irq( device_t *device, int scanline, int vblank, int blanked ) { if ((0xffff - state->m_IRQ_count) < 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_count = 0xffff; state->m_IRQ_enable = 0; } diff --git a/src/mess/machine/nes_pcb.c b/src/mess/machine/nes_pcb.c index 44398635c90..1369d4f70e6 100644 --- a/src/mess/machine/nes_pcb.c +++ b/src/mess/machine/nes_pcb.c @@ -1292,7 +1292,7 @@ static void mmc3_irq( device_t *device, int scanline, int vblank, int blanked ) { LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, device->machine().primary_screen->vpos(), device->machine().primary_screen->hpos())); - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } } state->m_IRQ_clear = 0; @@ -1822,7 +1822,7 @@ static void mmc5_irq( device_t *device, int scanline, int vblank, int blanked ) if (scanline == state->m_IRQ_count) { if (state->m_IRQ_enable) - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_status = 0xff; } @@ -2461,7 +2461,7 @@ static void jxrom_irq( device_t *device, int scanline, int vblank, int blanked ) if (state->m_IRQ_count <= 114) { state->m_IRQ_count = 0xffff; - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } else state->m_IRQ_count -= 114; @@ -2834,7 +2834,7 @@ static void bandai_lz_irq( device_t *device, int scanline, int vblank, int blank { if (state->m_IRQ_count <= 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_count = (0xffff - 114 + state->m_IRQ_count); // wrap around the 16 bits counter } state->m_IRQ_count -= 114; @@ -3092,7 +3092,7 @@ static void h3001_irq( device_t *device, int scanline, int vblank, int blanked ) if (state->m_IRQ_count <= 114) { state->m_IRQ_enable = 0; - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } } } @@ -3175,7 +3175,7 @@ static void ss88006_irq( device_t *device, int scanline, int vblank, int blanked { if ((state->m_IRQ_count & 0x000f) < 114) // always true, but we only update the IRQ once per scanlines so we cannot be more precise :( { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_count = (state->m_IRQ_count & ~0x000f) | (0x0f - (114 & 0x0f) + (state->m_IRQ_count & 0x000f)); // sort of wrap around the counter } // decrements should not affect upper bits, so we don't do anything here (114 > 0x0f) @@ -3184,7 +3184,7 @@ static void ss88006_irq( device_t *device, int scanline, int vblank, int blanked { if ((state->m_IRQ_count & 0x00ff) < 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_count = (state->m_IRQ_count & ~0x00ff) | (0xff - 114 + (state->m_IRQ_count & 0x00ff)); // wrap around the 8 bits counter } else @@ -3194,7 +3194,7 @@ static void ss88006_irq( device_t *device, int scanline, int vblank, int blanked { if ((state->m_IRQ_count & 0x0fff) < 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_count = (state->m_IRQ_count & ~0x0fff) | (0xfff - 114 + (state->m_IRQ_count & 0x0fff)); // wrap around the 12 bits counter } else @@ -3202,7 +3202,7 @@ static void ss88006_irq( device_t *device, int scanline, int vblank, int blanked } else if (state->m_IRQ_count < 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_count = (0xffff - 114 + state->m_IRQ_count); // wrap around the 16 bits counter } else @@ -3586,7 +3586,7 @@ static void konami_irq( device_t *device, int scanline, int vblank, int blanked { state->m_IRQ_count = state->m_IRQ_count_latch; state->m_IRQ_enable = state->m_IRQ_enable_latch; - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } } @@ -3855,7 +3855,7 @@ static void namcot_irq( device_t *device, int scanline, int vblank, int blanked { if (state->m_IRQ_count >= (0x7fff - 114)) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_count = 0; } else @@ -4028,7 +4028,7 @@ static void sunsoft3_irq( device_t *device, int scanline, int vblank, int blanke { state->m_IRQ_enable = 0; state->m_IRQ_count = 0xffff; - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } else state->m_IRQ_count -= 114; @@ -5100,7 +5100,7 @@ static void futuremedia_irq( device_t *device, int scanline, int vblank, int bla { state->m_IRQ_count--; if (!state->m_IRQ_count) - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } } } @@ -5481,7 +5481,7 @@ static void ks7032_irq( device_t *device, int scanline, int vblank, int blanked { state->m_IRQ_enable = 0; state->m_IRQ_count = state->m_IRQ_count_latch; - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } else state->m_IRQ_count += 114; @@ -5594,7 +5594,7 @@ static void mmc_fds_irq( device_t *device, int scanline, int vblank, int blanked { if (state->m_IRQ_count <= 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_enable = 0; state->m_IRQ_status |= 0x01; } @@ -7226,7 +7226,7 @@ static void tengen_800032_irq( device_t *device, int scanline, int vblank, int b { LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, device->machine().primary_screen->vpos(), device->machine().primary_screen->hpos())); - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } } } @@ -7253,7 +7253,7 @@ static void tengen_800032_irq( device_t *device, int scanline, int vblank, int b { LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, device->machine().primary_screen->vpos(), device->machine().primary_screen->hpos())); - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } } } @@ -8936,7 +8936,7 @@ static void sc127_irq( device_t *device, int scanline, int vblank, int blanked ) { LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, device->machine().primary_screen->vpos(), device->machine().primary_screen->hpos())); - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_enable = 0; } } @@ -9075,7 +9075,7 @@ static void smb2jb_irq( device_t *device, int scanline, int vblank, int blanked if (state->m_IRQ_count < 0x1000) { if ((0x1000 - state->m_IRQ_count) <= 114) - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); else state->m_IRQ_count += 114; } @@ -9361,7 +9361,7 @@ static void btl_smb2a_irq( device_t *device, int scanline, int vblank, int blank { state->m_IRQ_count = (state->m_IRQ_count + 1) & 0xfff; state->m_IRQ_enable = 0; - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } else state->m_IRQ_count += 114; @@ -9447,7 +9447,7 @@ static void btl_smb3_irq( device_t *device, int scanline, int vblank, int blanke { if ((0xffff - state->m_IRQ_count) < 114) { - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); state->m_IRQ_enable = 0; } @@ -9526,7 +9526,7 @@ static void btl_dn_irq( device_t *device, int scanline, int vblank, int blanked state->m_IRQ_count = 0; LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, device->machine().primary_screen->vpos(), device->machine().primary_screen->hpos())); - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } } @@ -11408,7 +11408,7 @@ static void shjy3_irq( device_t *device, int scanline, int vblank, int blanked ) { state->m_IRQ_count = state->m_IRQ_count_latch; state->m_IRQ_enable = state->m_IRQ_enable | ((state->m_IRQ_enable & 0x01) << 1); - device_set_input_line(state->m_maincpu, M6502_IRQ_LINE, HOLD_LINE); + state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE); } else state->m_IRQ_count++; diff --git a/src/mess/machine/nubus.c b/src/mess/machine/nubus.c index f7fc7aa08f9..031559570c6 100644 --- a/src/mess/machine/nubus.c +++ b/src/mess/machine/nubus.c @@ -116,7 +116,7 @@ nubus_device::nubus_device(const machine_config &mconfig, device_type type, cons void nubus_device::device_start() { - m_maincpu = machine().device(m_cputag); + m_maincpu = machine().device<cpu_device>(m_cputag); // resolve callbacks m_out_irq9_func.resolve(m_out_irq9_cb, *this); m_out_irqa_func.resolve(m_out_irqa_cb, *this); @@ -141,15 +141,15 @@ void nubus_device::add_nubus_card(device_nubus_card_interface *card) void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, UINT32 mask) { - m_maincpu = machine().device(m_cputag); - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + m_maincpu = machine().device<cpu_device>(m_cputag); + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 32: - m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, mask); + m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -159,15 +159,15 @@ void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhand void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, UINT32 mask) { - m_maincpu = machine().device(m_cputag); - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + m_maincpu = machine().device<cpu_device>(m_cputag); + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 32: - m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, mask); + m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -177,15 +177,15 @@ void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhan void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, UINT32 mask) { - m_maincpu = machine().device(m_cputag); - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + m_maincpu = machine().device<cpu_device>(m_cputag); + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 32: - m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, mask); + m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -195,15 +195,15 @@ void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhan void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, UINT32 mask) { - m_maincpu = machine().device(m_cputag); - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + m_maincpu = machine().device<cpu_device>(m_cputag); + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 32: - m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(start, end, rhandler, mask); + m_maincpu->space(AS_PROGRAM)->install_read_handler(start, end, rhandler, mask); break; case 64: - m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(start, end, rhandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM)->install_read_handler(start, end, rhandler, ((UINT64)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -213,15 +213,15 @@ void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_dele void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, UINT32 mask) { - m_maincpu = machine().device(m_cputag); - int buswidth = m_maincpu->memory().space_config(AS_PROGRAM)->m_databus_width; + m_maincpu = machine().device<cpu_device>(m_cputag); + int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; switch(buswidth) { case 32: - m_maincpu->memory().space(AS_PROGRAM)->install_write_handler(start, end, whandler, mask); + m_maincpu->space(AS_PROGRAM)->install_write_handler(start, end, whandler, mask); break; case 64: - m_maincpu->memory().space(AS_PROGRAM)->install_write_handler(start, end, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM)->install_write_handler(start, end, whandler, ((UINT64)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -232,8 +232,8 @@ void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_de void nubus_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data) { // printf("install_bank: %s @ %x->%x mask %x mirror %x\n", tag, start, end, mask, mirror); - m_maincpu = machine().device(m_cputag); - address_space *space = m_maincpu->memory().space(AS_PROGRAM); + m_maincpu = machine().device<cpu_device>(m_cputag); + address_space *space = m_maincpu->space(AS_PROGRAM); space->install_readwrite_bank(start, end, mask, mirror, tag ); machine().root_device().membank(tag)->set_base(data); } diff --git a/src/mess/machine/nubus.h b/src/mess/machine/nubus.h index 532532d35ad..b44ea828ae7 100644 --- a/src/mess/machine/nubus.h +++ b/src/mess/machine/nubus.h @@ -113,7 +113,7 @@ protected: virtual void device_config_complete(); // internal state - device_t *m_maincpu; + cpu_device *m_maincpu; devcb_resolved_write_line m_out_irq9_func; devcb_resolved_write_line m_out_irqa_func; diff --git a/src/mess/machine/orion.c b/src/mess/machine/orion.c index e860fc50f26..07640dfb44f 100644 --- a/src/mess/machine/orion.c +++ b/src/mess/machine/orion.c @@ -374,7 +374,7 @@ INTERRUPT_GEN( orionz80_interrupt ) orion_state *state = device->machine().driver_data<orion_state>(); if ((state->m_orionz80_dispatcher & 0x40)==0x40) { - device_set_input_line(device, 0, HOLD_LINE); + device->execute().set_input_line(0, HOLD_LINE); } } diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c index 66645020ddb..21ca9de4694 100644 --- a/src/mess/machine/pc.c +++ b/src/mess/machine/pc.c @@ -171,7 +171,7 @@ WRITE8_MEMBER(pc_state::pc_page_w) static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed ) { pc_state *st = device->machine().driver_data<pc_state>(); - device_set_input_line(st->m_maincpu, INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); + st->m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); /* Assert HLDA */ i8237_hlda_w( device, state ); @@ -291,7 +291,7 @@ static emu_timer *pc_int_delay_timer; static TIMER_CALLBACK( pcjr_delayed_pic8259_irq ) { - device_set_input_line(machine.firstcpu, 0, param ? ASSERT_LINE : CLEAR_LINE); + machine.firstcpu->set_input_line(0, param ? ASSERT_LINE : CLEAR_LINE); } static WRITE_LINE_DEVICE_HANDLER( pcjr_pic8259_set_int_line ) @@ -302,7 +302,7 @@ static WRITE_LINE_DEVICE_HANDLER( pcjr_pic8259_set_int_line ) } else { - device_set_input_line(device->machine().firstcpu, 0, state ? ASSERT_LINE : CLEAR_LINE); + device->machine().firstcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); } } @@ -645,7 +645,7 @@ static void pcjr_set_keyb_int(running_machine &machine, int state) pcjr_keyb.latch = 1; if ( nmi_enabled & 0x80 ) { - device_set_input_line( st->m_pit8253->machine().firstcpu, INPUT_LINE_NMI, PULSE_LINE ); + st->m_pit8253->machine().firstcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); } } } @@ -1447,8 +1447,8 @@ MACHINE_RESET( pc ) { device_t *speaker = machine.device(SPEAKER_TAG); pc_state *st = machine.driver_data<pc_state>(); - st->m_maincpu = machine.device("maincpu" ); - device_set_irq_callback(st->m_maincpu, pc_irq_callback); + st->m_maincpu = machine.device<cpu_device>("maincpu" ); + st->m_maincpu->set_irq_acknowledge_callback(pc_irq_callback); st->m_u73_q2 = 0; st->m_out1 = 0; @@ -1473,8 +1473,8 @@ MACHINE_RESET( pc ) MACHINE_START( mc1502 ) { pc_state *st = machine.driver_data<pc_state>(); - st->m_maincpu = machine.device("maincpu" ); - device_set_irq_callback(st->m_maincpu, pc_irq_callback); + st->m_maincpu = machine.device<cpu_device>("maincpu" ); + st->m_maincpu->set_irq_acknowledge_callback(pc_irq_callback); st->m_pic8259 = machine.device("pic8259"); st->m_dma8237 = NULL; @@ -1499,8 +1499,8 @@ MACHINE_START( pcjr ) pc_fdc_init( machine, &pcjr_fdc_interface_nc ); pcjr_keyb.keyb_signal_timer = machine.scheduler().timer_alloc(FUNC(pcjr_keyb_signal_callback)); pc_int_delay_timer = machine.scheduler().timer_alloc(FUNC(pcjr_delayed_pic8259_irq)); - st->m_maincpu = machine.device("maincpu" ); - device_set_irq_callback(st->m_maincpu, pc_irq_callback); + st->m_maincpu = machine.device<cpu_device>("maincpu" ); + st->m_maincpu->set_irq_acknowledge_callback(pc_irq_callback); st->m_pic8259 = machine.device("pic8259"); st->m_dma8237 = NULL; diff --git a/src/mess/machine/pc1512kb.c b/src/mess/machine/pc1512kb.c index 14dc29497aa..34c13958026 100644 --- a/src/mess/machine/pc1512kb.c +++ b/src/mess/machine/pc1512kb.c @@ -299,7 +299,7 @@ void pc1512_keyboard_device::device_start() void pc1512_keyboard_device::device_reset() { - device_set_input_line(m_maincpu, MCS48_INPUT_EA, CLEAR_LINE); + m_maincpu->set_input_line(MCS48_INPUT_EA, CLEAR_LINE); } @@ -311,7 +311,7 @@ void pc1512_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, { if (!m_clock_in) { - device_set_input_line(m_maincpu, INPUT_LINE_RESET, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } } @@ -340,7 +340,7 @@ WRITE_LINE_MEMBER( pc1512_keyboard_device::clock_w ) } else { - device_set_input_line(m_maincpu, INPUT_LINE_RESET, CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); } } diff --git a/src/mess/machine/pet.c b/src/mess/machine/pet.c index fae44c4947b..0481d382a9f 100644 --- a/src/mess/machine/pet.c +++ b/src/mess/machine/pet.c @@ -198,7 +198,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia0_irq_w ) driver_state->m_pia0_irq = state; int level = (driver_state->m_pia0_irq | driver_state->m_pia1_irq | driver_state->m_via_irq) ? ASSERT_LINE : CLEAR_LINE; - device_set_input_line(device->machine().firstcpu, INPUT_LINE_IRQ0, level); + device->machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level); } const pia6821_interface pet_pia0 = @@ -249,7 +249,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia1_irq_w ) driver_state->m_pia1_irq = state; int level = (driver_state->m_pia0_irq | driver_state->m_pia1_irq | driver_state->m_via_irq) ? ASSERT_LINE : CLEAR_LINE; - device_set_input_line(device->machine().firstcpu, INPUT_LINE_IRQ0, level); + device->machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level); } const pia6821_interface pet_pia1 = @@ -382,7 +382,7 @@ static WRITE_LINE_DEVICE_HANDLER( via_irq_w ) driver_state->m_via_irq = state; int level = (driver_state->m_pia0_irq | driver_state->m_pia1_irq | driver_state->m_via_irq) ? ASSERT_LINE : CLEAR_LINE; - device_set_input_line(device->machine().firstcpu, INPUT_LINE_IRQ0, level); + device->machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level); } const via6522_interface pet_via = @@ -770,14 +770,14 @@ INTERRUPT_GEN( pet_frame_interrupt ) { if (state->ioport("CFG")->read() & 0x04) { - device_set_input_line(device, INPUT_LINE_HALT, 1); - device_set_input_line(device, INPUT_LINE_HALT, 0); + device->execute().set_input_line(INPUT_LINE_HALT, 1); + device->execute().set_input_line(INPUT_LINE_HALT, 0); state->m_font |= 2; } else { - device_set_input_line(device, INPUT_LINE_HALT, 0); - device_set_input_line(device, INPUT_LINE_HALT, 1); + device->execute().set_input_line(INPUT_LINE_HALT, 0); + device->execute().set_input_line(INPUT_LINE_HALT, 1); state->m_font &= ~2; } } diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c index 729ca9dedc7..9895cde56e6 100644 --- a/src/mess/machine/pk8020.c +++ b/src/mess/machine/pk8020.c @@ -998,7 +998,7 @@ MACHINE_RESET( pk8020 ) { pk8020_state *state = machine.driver_data<pk8020_state>(); pk8020_set_bank(machine,0); - device_set_irq_callback(machine.device("maincpu"), pk8020_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(pk8020_irq_callback); state->m_sound_gate = 0; state->m_sound_level = 0; diff --git a/src/mess/machine/poly88.c b/src/mess/machine/poly88.c index 9c5f016facd..2ef0507fe88 100644 --- a/src/mess/machine/poly88.c +++ b/src/mess/machine/poly88.c @@ -16,7 +16,7 @@ static TIMER_CALLBACK(poly88_usart_timer_callback) { poly88_state *state = machine.driver_data<poly88_state>(); state->m_int_vector = 0xe7; - device_set_input_line(machine.device("maincpu"), 0, HOLD_LINE); + machine.device("maincpu")->execute().set_input_line(0, HOLD_LINE); } WRITE8_MEMBER(poly88_state::poly88_baud_rate_w) @@ -210,7 +210,7 @@ DRIVER_INIT_MEMBER(poly88_state,poly88) MACHINE_RESET(poly88) { poly88_state *state = machine.driver_data<poly88_state>(); - device_set_irq_callback(machine.device("maincpu"), poly88_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(poly88_irq_callback); state->m_intr = 0; state->m_last_code = 0; @@ -221,14 +221,14 @@ INTERRUPT_GEN( poly88_interrupt ) { poly88_state *state = device->machine().driver_data<poly88_state>(); state->m_int_vector = 0xf7; - device_set_input_line(device, 0, HOLD_LINE); + device->execute().set_input_line(0, HOLD_LINE); } static WRITE_LINE_DEVICE_HANDLER( poly88_usart_rxready ) { //poly88_state *drvstate = device->machine().driver_data<poly88_state>(); //drvstate->m_int_vector = 0xe7; - //device_set_input_line(device, 0, HOLD_LINE); + //device->execute().set_input_line(0, HOLD_LINE); } const i8251_interface poly88_usart_interface= diff --git a/src/mess/machine/primo.c b/src/mess/machine/primo.c index b0ebe0b6eee..ac580f02bf8 100644 --- a/src/mess/machine/primo.c +++ b/src/mess/machine/primo.c @@ -35,7 +35,7 @@ INTERRUPT_GEN( primo_vblank_interrupt ) { primo_state *state = device->machine().driver_data<primo_state>(); if (state->m_nmi) - device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); + device->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); } /******************************************************************************* diff --git a/src/mess/machine/rmnimbus.c b/src/mess/machine/rmnimbus.c index f17945deaf8..6ac07b26fab 100644 --- a/src/mess/machine/rmnimbus.c +++ b/src/mess/machine/rmnimbus.c @@ -203,7 +203,7 @@ static IRQ_CALLBACK(int_callback) logerror("(%f) **** Acknowledged interrupt vector %02X\n", device->machine().time().as_double(), state->m_i186.intr.poll_status & 0x1f); /* clear the interrupt */ - device_set_input_line(device, 0, CLEAR_LINE); + device->execute().set_input_line(0, CLEAR_LINE); state->m_i186.intr.pending = 0; oldreq=state->m_i186.intr.request; @@ -1178,7 +1178,7 @@ WRITE16_MEMBER(rmnimbus_state::nimbus_i186_internal_port_w) /* we need to do this at a time when the I86 context is swapped in */ /* this register is generally set once at startup and never again, so it's a good */ /* time to set it up */ - device_set_irq_callback(&space.device(), int_callback); + space.device().execute().set_irq_acknowledge_callback(int_callback); break; case 0x60: diff --git a/src/mess/machine/s100.c b/src/mess/machine/s100.c index 9c5f5cb8aa8..22286546e42 100644 --- a/src/mess/machine/s100.c +++ b/src/mess/machine/s100.c @@ -126,7 +126,7 @@ s100_device::s100_device(const machine_config &mconfig, const char *tag, device_ void s100_device::device_start() { - m_maincpu = machine().device(m_cputag); + m_maincpu = machine().device<cpu_device>(m_cputag); // resolve callbacks m_out_int_func.resolve(m_out_int_cb, *this); diff --git a/src/mess/machine/s100.h b/src/mess/machine/s100.h index d16d2fe3d9a..72daae09b34 100644 --- a/src/mess/machine/s100.h +++ b/src/mess/machine/s100.h @@ -206,7 +206,7 @@ protected: private: // internal state - device_t *m_maincpu; + cpu_device *m_maincpu; devcb_resolved_write_line m_out_int_func; devcb_resolved_write_line m_out_nmi_func; diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c index f6567b45984..3f12124f5cf 100644 --- a/src/mess/machine/sms.c +++ b/src/mess/machine/sms.c @@ -2104,7 +2104,7 @@ WRITE8_MEMBER(sms_state::sms_store_control_w) WRITE_LINE_DEVICE_HANDLER( sms_store_int_callback ) { sms_state *driver_state = device->machine().driver_data<sms_state>(); - device_set_input_line(driver_state->m_store_control & 0x01 ? driver_state->m_control_cpu : driver_state->m_main_cpu, 0, state); + (driver_state->m_store_control & 0x01 ? driver_state->m_control_cpu : driver_state->m_main_cpu)->execute().set_input_line(0, state); } diff --git a/src/mess/machine/southbridge.c b/src/mess/machine/southbridge.c index 9226e432087..0dc4950c43d 100644 --- a/src/mess/machine/southbridge.c +++ b/src/mess/machine/southbridge.c @@ -209,7 +209,7 @@ void southbridge_device::device_start() m_at_offset1 = 0xff; - //device_set_irq_callback(machine().device(":maincpu"), at_irq_callback); + //machine().device(":maincpu")->execute().set_irq_acknowledge_callback(at_irq_callback); } //------------------------------------------------- @@ -330,7 +330,7 @@ WRITE8_MEMBER( southbridge_device::at_page8_w ) WRITE_LINE_MEMBER( southbridge_device::pc_dma_hrq_changed ) { - device_set_input_line(m_maincpu, INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); + m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); /* Assert HLDA */ i8237_hlda_w( m_dma8237_2, state ); diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c index f3a33f378b5..6fc8f16aa4b 100644 --- a/src/mess/machine/svi318.c +++ b/src/mess/machine/svi318.c @@ -540,7 +540,7 @@ DRIVER_INIT_MEMBER(svi318_state,svi318) m_svi.svi318 = 1; } - device_set_input_line_vector(machine().device("maincpu"), 0, 0xff); + machine().device("maincpu")->execute().set_input_line_vector(0, 0xff); /* memory */ m_svi.empty_bank = auto_alloc_array(machine(), UINT8, 0x8000); diff --git a/src/mess/machine/tf20.c b/src/mess/machine/tf20.c index d0633a3c3a3..b198e350fb8 100644 --- a/src/mess/machine/tf20.c +++ b/src/mess/machine/tf20.c @@ -330,7 +330,7 @@ static DEVICE_START( tf20 ) device_t *cpu = device->subdevice("tf20"); address_space *prg = cpu->memory().space(AS_PROGRAM); - device_set_irq_callback(cpu, tf20_irq_ack); + cpu->execute().set_irq_acknowledge_callback(tf20_irq_ack); /* ram device */ tf20->ram = device->subdevice<ram_device>("ram"); diff --git a/src/mess/machine/ti85.c b/src/mess/machine/ti85.c index e20dd77cef5..2c3200c43ca 100644 --- a/src/mess/machine/ti85.c +++ b/src/mess/machine/ti85.c @@ -22,7 +22,7 @@ static TIMER_CALLBACK(ti85_timer_callback) { if (state->m_ON_interrupt_mask && !state->m_ON_pressed) { - device_set_input_line(state->m_maincpu, 0, HOLD_LINE); + state->m_maincpu->set_input_line(0, HOLD_LINE); state->m_ON_interrupt_status = 1; if (!state->m_timer_interrupt_mask) state->m_timer_interrupt_mask = 1; } @@ -33,7 +33,7 @@ static TIMER_CALLBACK(ti85_timer_callback) state->m_ON_pressed = 0; if (state->m_timer_interrupt_mask) { - device_set_input_line(state->m_maincpu, 0, HOLD_LINE); + state->m_maincpu->set_input_line(0, HOLD_LINE); state->m_timer_interrupt_status = 1; } } @@ -604,9 +604,9 @@ static void ti8x_snapshot_setup_registers (running_machine &machine, UINT8 * dat state->m_maincpu->set_state_int(Z80_R, (reg[0x44]&0x7f) | (reg[0x48]&0x80)); - device_set_input_line(state->m_maincpu, 0, 0); - device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, 0); - device_set_input_line(state->m_maincpu, INPUT_LINE_HALT, 0); + state->m_maincpu->set_input_line(0, 0); + state->m_maincpu->set_input_line(INPUT_LINE_NMI, 0); + state->m_maincpu->set_input_line(INPUT_LINE_HALT, 0); } static void ti85_setup_snapshot (running_machine &machine, UINT8 * data) diff --git a/src/mess/machine/ti99/spchsyn.c b/src/mess/machine/ti99/spchsyn.c index 10e38352932..478d9cdbde5 100644 --- a/src/mess/machine/ti99/spchsyn.c +++ b/src/mess/machine/ti99/spchsyn.c @@ -108,7 +108,7 @@ READ8Z_MEMBER( ti_speech_synthesizer_device::readz ) { if ((offset & m_select_mask)==m_select_value) { - device_adjust_icount(machine().device("maincpu"),-(18+3)); /* this is just a minimum, it can be more */ + machine().device("maincpu")->execute().adjust_icount(-(18+3)); /* this is just a minimum, it can be more */ *value = m_vsp->read(space, offset, 0xff) & 0xff; if (VERBOSE>4) LOG("spchsyn: read value = %02x\n", *value); } @@ -121,7 +121,7 @@ WRITE8_MEMBER( ti_speech_synthesizer_device::write ) { if ((offset & m_select_mask)==(m_select_value | 0x0400)) { - device_adjust_icount(machine().device("maincpu"),-(54+3)); /* this is just an approx. minimum, it can be much more */ + machine().device("maincpu")->execute().adjust_icount(-(54+3)); /* this is just an approx. minimum, it can be much more */ /* RN: the stupid design of the tms5220 core means that ready is cleared */ /* when there are 15 bytes in FIFO. It should be 16. Of course, if */ @@ -133,7 +133,7 @@ WRITE8_MEMBER( ti_speech_synthesizer_device::write ) int cycles_to_ready = machine().device<cpu_device>("maincpu")->attotime_to_cycles(time_to_ready); if (VERBOSE>8) LOG("spchsyn: time to ready: %f -> %d\n", time_to_ready.as_double(), (int) cycles_to_ready); - device_adjust_icount(machine().device("maincpu"),-cycles_to_ready); + machine().device("maincpu")->execute().adjust_icount(-cycles_to_ready); machine().scheduler().timer_set(attotime::zero, FUNC_NULL); } if (VERBOSE>4) LOG("spchsyn: write value = %02x\n", data); diff --git a/src/mess/machine/ti99/speech8.c b/src/mess/machine/ti99/speech8.c index 0e725931b2e..6f10b12e5a2 100644 --- a/src/mess/machine/ti99/speech8.c +++ b/src/mess/machine/ti99/speech8.c @@ -72,7 +72,7 @@ READ8Z_MEMBER( ti998_spsyn_device::readz ) { if ((offset & m_select_mask)==m_select_value) { - device_adjust_icount(machine().device("maincpu"),-(18+3)); /* this is just a minimum, it can be more */ + machine().device("maincpu")->execute().adjust_icount(-(18+3)); /* this is just a minimum, it can be more */ *value = m_vsp->read(space, offset, 0xff) & 0xff; if (VERBOSE>4) LOG("speech8: read value = %02x\n", *value); } @@ -85,7 +85,7 @@ WRITE8_MEMBER( ti998_spsyn_device::write ) { if ((offset & m_select_mask)==(m_select_value | 0x0400)) { - device_adjust_icount(machine().device("maincpu"),-(54+3)); /* this is just an approx. minimum, it can be much more */ + machine().device("maincpu")->execute().adjust_icount(-(54+3)); /* this is just an approx. minimum, it can be much more */ /* RN: the stupid design of the tms5220 core means that ready is cleared */ /* when there are 15 bytes in FIFO. It should be 16. Of course, if */ @@ -97,7 +97,7 @@ WRITE8_MEMBER( ti998_spsyn_device::write ) int cycles_to_ready = machine().device<cpu_device>("maincpu")->attotime_to_cycles(time_to_ready); if (VERBOSE>8) LOG("speech8: time to ready: %f -> %d\n", time_to_ready.as_double(), (int) cycles_to_ready); - device_adjust_icount(machine().device("maincpu"),-cycles_to_ready); + machine().device("maincpu")->execute().adjust_icount(-cycles_to_ready); machine().scheduler().timer_set(attotime::zero, FUNC_NULL); } if (VERBOSE>4) LOG("speech8: write value = %02x\n", data); diff --git a/src/mess/machine/trs80.c b/src/mess/machine/trs80.c index fe65af2549b..ce1fb505a2f 100644 --- a/src/mess/machine/trs80.c +++ b/src/mess/machine/trs80.c @@ -636,13 +636,13 @@ INTERRUPT_GEN( trs80_rtc_interrupt ) if (state->m_mask & IRQ_M4_RTC) { state->m_irq |= IRQ_M4_RTC; - device_set_input_line(device, 0, HOLD_LINE); + device->execute().set_input_line(0, HOLD_LINE); } } else // Model 1 { state->m_irq |= IRQ_M1_RTC; - device_set_input_line(device, 0, HOLD_LINE); + device->execute().set_input_line(0, HOLD_LINE); } } diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c index 32c18d598b8..3c2a4251ba8 100644 --- a/src/mess/machine/vector06.c +++ b/src/mess/machine/vector06.c @@ -127,7 +127,7 @@ INTERRUPT_GEN( vector06_interrupt ) vector06_state *state = device->machine().driver_data<vector06_state>(); state->m_vblank_state++; if (state->m_vblank_state>1) state->m_vblank_state=0; - device_set_input_line(device,0,state->m_vblank_state ? HOLD_LINE : CLEAR_LINE); + device->execute().set_input_line(0,state->m_vblank_state ? HOLD_LINE : CLEAR_LINE); } @@ -173,7 +173,7 @@ MACHINE_RESET( vector06 ) vector06_state *state = machine.driver_data<vector06_state>(); address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); - device_set_irq_callback(machine.device("maincpu"), vector06_irq_callback); + machine.device("maincpu")->execute().set_irq_acknowledge_callback(vector06_irq_callback); space->install_read_bank (0x0000, 0x7fff, "bank1"); space->install_write_bank(0x0000, 0x7fff, "bank2"); space->install_read_bank (0x8000, 0xffff, "bank3"); diff --git a/src/mess/machine/x68k_neptunex.c b/src/mess/machine/x68k_neptunex.c index d616dbb7029..58fb3868162 100644 --- a/src/mess/machine/x68k_neptunex.c +++ b/src/mess/machine/x68k_neptunex.c @@ -146,7 +146,7 @@ WRITE8_MEMBER(x68k_neptune_device::x68k_neptune_mem_write) WRITE_LINE_MEMBER(x68k_neptune_device::x68k_neptune_irq_w) { - device_set_input_line_vector(machine().device("maincpu"),2, NEPTUNE_IRQ_VECTOR); + machine().device("maincpu")->execute().set_input_line_vector(2, NEPTUNE_IRQ_VECTOR); m_slot->irq2_w(state); logerror("Neptune: IRQ2 set to %i\n",state); } diff --git a/src/mess/machine/zx.c b/src/mess/machine/zx.c index 3ced7842752..fb51fafd391 100644 --- a/src/mess/machine/zx.c +++ b/src/mess/machine/zx.c @@ -388,7 +388,7 @@ WRITE8_MEMBER( zx_state::zx81_io_w ) zx_ula_bkgnd(1); if (m_ula_frame_vsync == 2) { - device_spin_until_time(&mem->device(),machine().primary_screen->time_until_pos(height - 1, 0)); + mem->device().execute().spin_until_time(machine().primary_screen->time_until_pos(height - 1, 0)); m_ula_scanline_count = height - 1; logerror ("S: %d B: %d\n", machine().primary_screen->vpos(), machine().primary_screen->hpos()); } |