diff options
author | 2013-04-11 13:42:00 +0000 | |
---|---|---|
committer | 2013-04-11 13:42:00 +0000 | |
commit | 418993573e586357ec6d30bc76d182b533c1b61c (patch) | |
tree | fb2a5a85ef3282b68e8f385042c85b138972c194 /src | |
parent | d1b0e375a35ccdcebd02c1c9005b9e51f4def28d (diff) |
some cleanup (nw)
Diffstat (limited to 'src')
127 files changed, 388 insertions, 348 deletions
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c index 4e7c097f3cb..65fc012458f 100644 --- a/src/mame/drivers/40love.c +++ b/src/mame/drivers/40love.c @@ -1025,7 +1025,7 @@ MACHINE_RESET_MEMBER(fortyl_state,common) MACHINE_RESET_MEMBER(fortyl_state,40love) { - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); MACHINE_RESET_CALL_MEMBER(common); } diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c index de065ddd381..748d9e4d985 100644 --- a/src/mame/drivers/airbustr.c +++ b/src/mame/drivers/airbustr.c @@ -260,7 +260,7 @@ READ8_MEMBER(airbustr_state::devram_r) WRITE8_MEMBER(airbustr_state::master_nmi_trigger_w) { - m_slave->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_slave->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } WRITE8_MEMBER(airbustr_state::master_bankswitch_w) @@ -550,11 +550,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(airbustr_state::airbustr_scanline) int scanline = param; if(scanline == 240) // vblank-out irq - machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); + m_master->set_input_line_and_vector(0, HOLD_LINE, 0xff); /* Pandora "sprite end dma" irq? TODO: timing is likely off */ if(scanline == 64) - machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd); + m_master->set_input_line_and_vector(0, HOLD_LINE, 0xfd); } /* Sub Z80 uses IM2 too, but 0xff irq routine just contains an irq ack in it */ @@ -578,8 +578,6 @@ void airbustr_state::machine_start() membank("bank3")->configure_entries(0, 3, &AUDIO[0x00000], 0x4000); membank("bank3")->configure_entries(3, 5, &AUDIO[0x10000], 0x4000); - m_master = machine().device("master"); - m_slave = machine().device("slave"); m_pandora = machine().device("pandora"); save_item(NAME(m_soundlatch_status)); @@ -778,7 +776,7 @@ ROM_END DRIVER_INIT_MEMBER(airbustr_state,airbustr) { - machine().device("master")->memory().space(AS_PROGRAM).install_read_handler(0xe000, 0xefff, read8_delegate(FUNC(airbustr_state::devram_r),this)); // protection device lives here + m_master->space(AS_PROGRAM).install_read_handler(0xe000, 0xefff, read8_delegate(FUNC(airbustr_state::devram_r),this)); // protection device lives here } diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c index bdb1e200593..7afb88d47be 100644 --- a/src/mame/drivers/arabian.c +++ b/src/mame/drivers/arabian.c @@ -80,8 +80,8 @@ WRITE8_MEMBER(arabian_state::ay8910_portb_w) bit 0 = coin 1 counter */ - machine().device("mcu")->execute().set_input_line(MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); /* clock the coin counters */ coin_counter_w(machine(), 1, ~data & 0x02); diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c index 0e8f42f89f8..2be920bd30b 100644 --- a/src/mame/drivers/arkanoid.c +++ b/src/mame/drivers/arkanoid.c @@ -948,8 +948,6 @@ static const ay8910_interface hexa_ay8910_config = MACHINE_START_MEMBER(arkanoid_state,arkanoid) { - m_mcu = machine().device("mcu"); - save_item(NAME(m_bootleg_cmd)); save_item(NAME(m_paddle_select)); diff --git a/src/mame/drivers/ataxx.c b/src/mame/drivers/ataxx.c index 187d820c5fb..5fb6ecce6f6 100644 --- a/src/mame/drivers/ataxx.c +++ b/src/mame/drivers/ataxx.c @@ -711,7 +711,7 @@ DRIVER_INIT_MEMBER(leland_state,ataxx) leland_rotate_memory("slave"); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this)); + m_master->space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this)); } @@ -721,7 +721,7 @@ DRIVER_INIT_MEMBER(leland_state,ataxxj) leland_rotate_memory("slave"); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this)); + m_master->space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this)); } @@ -731,9 +731,9 @@ DRIVER_INIT_MEMBER(leland_state,wsf) leland_rotate_memory("slave"); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P1_P2"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P3_P4"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "BUTTONS"); + m_master->space(AS_IO).install_read_port(0x0d, 0x0d, "P1_P2"); + m_master->space(AS_IO).install_read_port(0x0e, 0x0e, "P3_P4"); + m_master->space(AS_IO).install_read_port(0x0f, 0x0f, "BUTTONS"); } @@ -743,14 +743,14 @@ DRIVER_INIT_MEMBER(leland_state,indyheat) leland_rotate_memory("slave"); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0x00, 0x02, read8_delegate(FUNC(leland_state::indyheat_wheel_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0x08, 0x0b, read8_delegate(FUNC(leland_state::indyheat_analog_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P1"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P2"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); + m_master->space(AS_IO).install_read_handler(0x00, 0x02, read8_delegate(FUNC(leland_state::indyheat_wheel_r),this)); + m_master->space(AS_IO).install_read_handler(0x08, 0x0b, read8_delegate(FUNC(leland_state::indyheat_analog_r),this)); + m_master->space(AS_IO).install_read_port(0x0d, 0x0d, "P1"); + m_master->space(AS_IO).install_read_port(0x0e, 0x0e, "P2"); + m_master->space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); /* set up additional output ports */ - machine().device("master")->memory().space(AS_IO).install_write_handler(0x08, 0x0b, write8_delegate(FUNC(leland_state::indyheat_analog_w),this)); + m_master->space(AS_IO).install_write_handler(0x08, 0x0b, write8_delegate(FUNC(leland_state::indyheat_analog_w),this)); } @@ -760,9 +760,9 @@ DRIVER_INIT_MEMBER(leland_state,brutforc) leland_rotate_memory("slave"); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P2"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P1"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); + m_master->space(AS_IO).install_read_port(0x0d, 0x0d, "P2"); + m_master->space(AS_IO).install_read_port(0x0e, 0x0e, "P1"); + m_master->space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); } @@ -772,12 +772,12 @@ DRIVER_INIT_MEMBER(leland_state,asylum) leland_rotate_memory("slave"); /* asylum appears to have some extra RAM for the slave CPU */ - machine().device("slave")->memory().space(AS_PROGRAM).install_ram(0xf000, 0xfffb); + m_slave->space(AS_PROGRAM).install_ram(0xf000, 0xfffb); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x0d, 0x0d, "P2"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0e, 0x0e, "P1"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); + m_master->space(AS_IO).install_read_port(0x0d, 0x0d, "P2"); + m_master->space(AS_IO).install_read_port(0x0e, 0x0e, "P1"); + m_master->space(AS_IO).install_read_port(0x0f, 0x0f, "P3"); } diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c index 8ee8cb486e8..78b7a7fdfb5 100644 --- a/src/mame/drivers/bigevglf.c +++ b/src/mame/drivers/bigevglf.c @@ -414,8 +414,6 @@ static const msm5232_interface msm5232_config = void bigevglf_state::machine_start() { - m_mcu = machine().device("mcu"); - save_item(NAME(m_vidram_bank)); save_item(NAME(m_plane_selected)); save_item(NAME(m_plane_visible)); diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c index 1a7f091103e..1397b248a28 100644 --- a/src/mame/drivers/bking.c +++ b/src/mame/drivers/bking.c @@ -169,7 +169,7 @@ WRITE8_MEMBER(bking_state::bking3_68705_port_b_w) if (~data & 0x02) { m_port_a_in = from_main; - if (main_sent) machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + if (main_sent) m_mcu->set_input_line(0, CLEAR_LINE); main_sent = 0; } @@ -448,7 +448,7 @@ void bking_state::machine_reset() MACHINE_RESET_MEMBER(bking_state,bking3) { - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); bking_state::machine_reset(); diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c index 622a6f7df88..d27ac50c4ac 100644 --- a/src/mame/drivers/blktiger.c +++ b/src/mame/drivers/blktiger.c @@ -33,13 +33,13 @@ READ8_MEMBER(blktiger_state::blktiger_from_mcu_r) WRITE8_MEMBER(blktiger_state::blktiger_to_mcu_w) { - m_mcu->execute().set_input_line(MCS51_INT1_LINE, ASSERT_LINE); + m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE); m_z80_latch = data; } READ8_MEMBER(blktiger_state::blktiger_from_main_r) { - m_mcu->execute().set_input_line(MCS51_INT1_LINE, CLEAR_LINE); + m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE); //printf("%02x read\n",latch); return m_z80_latch; } @@ -276,8 +276,6 @@ static const ym2203_interface ym2203_config = void blktiger_state::machine_start() { - m_mcu = machine().device("mcu"); - /* configure bankswitching */ membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000); diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c index 6236d34fbd1..d2e7ec40a01 100644 --- a/src/mame/drivers/bublbobl.c +++ b/src/mame/drivers/bublbobl.c @@ -721,9 +721,6 @@ static const ym2203_interface ym2203_config = MACHINE_START_MEMBER(bublbobl_state,common) { - m_mcu = machine().device("mcu"); - m_slave = machine().device("slave"); - save_item(NAME(m_sound_nmi_enable)); save_item(NAME(m_pending_nmi)); save_item(NAME(m_sound_status)); diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c index 696ffe31385..13e5dab75c9 100644 --- a/src/mame/drivers/buggychl.c +++ b/src/mame/drivers/buggychl.c @@ -374,7 +374,7 @@ void buggychl_state::machine_start() void buggychl_state::machine_reset() { - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_sound_nmi_enable = 0; m_pending_nmi = 0; diff --git a/src/mame/drivers/byvid.c b/src/mame/drivers/byvid.c index 9e24dced6c2..a91db1289cb 100644 --- a/src/mame/drivers/byvid.c +++ b/src/mame/drivers/byvid.c @@ -104,7 +104,7 @@ INPUT_PORTS_END WRITE_LINE_MEMBER(by133_state::vdp_interrupt) { - machine().device("videocpu")->execute().set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); + m_videocpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } static TMS9928A_INTERFACE(byvid_tms9928a_interface) diff --git a/src/mame/drivers/cchance.c b/src/mame/drivers/cchance.c index 750b3024bb5..9b6110d3652 100644 --- a/src/mame/drivers/cchance.c +++ b/src/mame/drivers/cchance.c @@ -196,8 +196,6 @@ static const ay8910_interface ay8910_config = MACHINE_START_MEMBER(cchance_state,cchance) { - m_mcu = NULL; - save_item(NAME(m_screenflip)); save_item(NAME(m_hop_io)); save_item(NAME(m_bell_io)); diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c index 63740a97f50..ffe7c3623c3 100644 --- a/src/mame/drivers/champbas.c +++ b/src/mame/drivers/champbas.c @@ -176,7 +176,7 @@ WRITE8_MEMBER(champbas_state::champbas_mcu_halt_w) return; data &= 1; - m_mcu->execute().set_input_line(INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); + m_mcu->set_input_line(INPUT_LINE_HALT, data ? ASSERT_LINE : CLEAR_LINE); } @@ -574,8 +574,6 @@ GFXDECODE_END MACHINE_START_MEMBER(champbas_state,champbas) { - m_mcu = machine().device(CPUTAG_MCU); - save_item(NAME(m_watchdog_count)); save_item(NAME(m_palette_bank)); save_item(NAME(m_gfx_bank)); diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c index c8c100babda..53456058366 100644 --- a/src/mame/drivers/champbwl.c +++ b/src/mame/drivers/champbwl.c @@ -438,8 +438,6 @@ MACHINE_START_MEMBER(champbwl_state,champbwl) { UINT8 *ROM = memregion("maincpu")->base(); - m_mcu = NULL; - membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); save_item(NAME(m_screenflip)); diff --git a/src/mame/drivers/changela.c b/src/mame/drivers/changela.c index 8709ec214dc..96268f5c739 100644 --- a/src/mame/drivers/changela.c +++ b/src/mame/drivers/changela.c @@ -413,13 +413,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(changela_state::changela_scanline) INTERRUPT_GEN_MEMBER(changela_state::chl_mcu_irq) { - generic_pulse_irq_line(m_mcu->execute(), 0, 1); + generic_pulse_irq_line(m_mcu, 0, 1); } void changela_state::machine_start() { - m_mcu = machine().device("mcu"); - /* video */ save_item(NAME(m_slopeROM_bank)); save_item(NAME(m_tree_en)); diff --git a/src/mame/drivers/cloak.c b/src/mame/drivers/cloak.c index c67c30f598a..1e555ee98e9 100644 --- a/src/mame/drivers/cloak.c +++ b/src/mame/drivers/cloak.c @@ -147,7 +147,7 @@ WRITE8_MEMBER(cloak_state::cloak_irq_reset_0_w) WRITE8_MEMBER(cloak_state::cloak_irq_reset_1_w) { - machine().device("slave")->execute().set_input_line(0, CLEAR_LINE); + m_slave->set_input_line(0, CLEAR_LINE); } WRITE8_MEMBER(cloak_state::cloak_nvram_enable_w) diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c index 8fec0e3ddcf..b3c8b839507 100644 --- a/src/mame/drivers/cubeqst.c +++ b/src/mame/drivers/cubeqst.c @@ -30,13 +30,19 @@ class cubeqst_state : public driver_device public: cubeqst_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_laserdisc(*this, "laserdisc") { } + m_laserdisc(*this, "laserdisc"), + m_rotatecpu(*this, "rotate_cpu"), + m_linecpu(*this, "line_cpu"), + m_soundcpu(*this, "sound_cpu") { } UINT8 *m_depth_buffer; int m_video_field; UINT8 m_io_latch; UINT8 m_reset_latch; required_device<simutrek_special_device> m_laserdisc; + required_device<cpu_device> m_rotatecpu; + required_device<cpu_device> m_linecpu; + required_device<cpu_device> m_soundcpu; rgb_t *m_colormap; DECLARE_WRITE16_MEMBER(palette_w); DECLARE_READ16_MEMBER(line_r); @@ -130,8 +136,8 @@ UINT32 cubeqst_state::screen_update_cubeqst(screen_device &screen, bitmap_rgb32 for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { int i; - int num_entries = cubeqcpu_get_ptr_ram_val(machine().device("line_cpu"), y); - UINT32 *stk_ram = cubeqcpu_get_stack_ram(machine().device("line_cpu")); + int num_entries = cubeqcpu_get_ptr_ram_val(m_linecpu, y); + UINT32 *stk_ram = cubeqcpu_get_stack_ram(m_linecpu); UINT32 *dest = &bitmap.pix32(y); UINT32 pen; @@ -260,10 +266,10 @@ WRITE16_MEMBER(cubeqst_state::control_w) TIMER_CALLBACK_MEMBER(cubeqst_state::delayed_bank_swap) { - cubeqcpu_swap_line_banks(machine().device("line_cpu")); + cubeqcpu_swap_line_banks(m_linecpu); /* TODO: This is a little dubious */ - cubeqcpu_clear_stack(machine().device("line_cpu")); + cubeqcpu_clear_stack(m_linecpu); } @@ -284,9 +290,9 @@ void cubeqst_state::swap_linecpu_banks() */ WRITE16_MEMBER(cubeqst_state::reset_w) { - machine().device("rotate_cpu")->execute().set_input_line(INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); - machine().device("line_cpu")->execute().set_input_line(INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); - machine().device("sound_cpu")->execute().set_input_line(INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); + m_rotatecpu->set_input_line(INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); + m_linecpu->set_input_line(INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE); + m_soundcpu->set_input_line(INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); /* Swap stack and pointer RAM banks on rising edge of display reset */ if (!BIT(m_reset_latch, 0) && BIT(data, 0)) @@ -395,22 +401,22 @@ INPUT_PORTS_END READ16_MEMBER(cubeqst_state::read_rotram) { - return cubeqcpu_rotram_r(machine().device("rotate_cpu"), space, offset, mem_mask); + return cubeqcpu_rotram_r(m_rotatecpu, space, offset, mem_mask); } WRITE16_MEMBER(cubeqst_state::write_rotram) { - cubeqcpu_rotram_w(machine().device("rotate_cpu"), space, offset, data, mem_mask); + cubeqcpu_rotram_w(m_rotatecpu, space, offset, data, mem_mask); } READ16_MEMBER(cubeqst_state::read_sndram) { - return cubeqcpu_sndram_r(machine().device("sound_cpu"), space, offset, mem_mask); + return cubeqcpu_sndram_r(m_soundcpu, space, offset, mem_mask); } WRITE16_MEMBER(cubeqst_state::write_sndram) { - cubeqcpu_sndram_w(machine().device("sound_cpu"), space, offset, data, mem_mask); + cubeqcpu_sndram_w(m_soundcpu, space, offset, data, mem_mask); } static ADDRESS_MAP_START( m68k_program_map, AS_PROGRAM, 16, cubeqst_state ) @@ -454,9 +460,9 @@ void cubeqst_state::machine_reset() m_reset_latch = 0; /* Auxillary CPUs are held in reset */ - machine().device("sound_cpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - machine().device("rotate_cpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - machine().device("line_cpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_rotatecpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_linecpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c index df2c289bf38..6dee38c8eaa 100644 --- a/src/mame/drivers/dec8.c +++ b/src/mame/drivers/dec8.c @@ -136,7 +136,7 @@ TIMER_CALLBACK_MEMBER(dec8_state::dec8_i8751_timer_callback) { // The schematics show a clocked LS194 shift register (3A) is used to automatically // clear the IRQ request. The MCU does not clear it itself. - m_mcu->execute().set_input_line(MCS51_INT1_LINE, CLEAR_LINE); + m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE); } WRITE8_MEMBER(dec8_state::dec8_i8751_w) @@ -145,7 +145,7 @@ WRITE8_MEMBER(dec8_state::dec8_i8751_w) { case 0: /* High byte - SECIRQ is trigged on activating this latch */ m_i8751_value = (m_i8751_value & 0xff) | (data << 8); - m_mcu->execute().set_input_line(MCS51_INT1_LINE, ASSERT_LINE); + m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE); machine().scheduler().timer_set(m_mcu->clocks_to_attotime(64), timer_expired_delegate(FUNC(dec8_state::dec8_i8751_timer_callback),this)); // 64 clocks not confirmed break; case 1: /* Low byte */ @@ -1949,8 +1949,6 @@ INTERRUPT_GEN_MEMBER(dec8_state::oscar_interrupt) void dec8_state::machine_start() { - m_mcu = machine().device("mcu"); - save_item(NAME(m_latch)); save_item(NAME(m_nmi_enable)); save_item(NAME(m_i8751_port0)); diff --git a/src/mame/drivers/deniam.c b/src/mame/drivers/deniam.c index 9f981e21756..d48521eb927 100644 --- a/src/mame/drivers/deniam.c +++ b/src/mame/drivers/deniam.c @@ -54,7 +54,7 @@ WRITE16_MEMBER(deniam_state::sound_command_w) if (ACCESSING_BITS_8_15) { soundlatch_byte_w(space,offset, (data >> 8) & 0xff); - m_audio_cpu->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } } @@ -228,8 +228,8 @@ GFXDECODE_END WRITE_LINE_MEMBER(deniam_state::irqhandler) { /* system 16c doesn't have the sound CPU */ - if (m_audio_cpu != NULL) - m_audio_cpu->execute().set_input_line(0, state); + if (m_audiocpu != NULL) + m_audiocpu->set_input_line(0, state); } static const ym3812_interface ym3812_config = @@ -241,8 +241,6 @@ static const ym3812_interface ym3812_config = void deniam_state::machine_start() { - m_audio_cpu = m_audiocpu; - save_item(NAME(m_display_enable)); save_item(NAME(m_coinctrl)); diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c index 45e4c517b1f..64da90ab1ad 100644 --- a/src/mame/drivers/equites.c +++ b/src/mame/drivers/equites.c @@ -686,12 +686,12 @@ WRITE16_MEMBER(equites_state::mcu_w) WRITE16_MEMBER(equites_state::mcu_halt_assert_w) { - m_mcu->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); } WRITE16_MEMBER(equites_state::mcu_halt_clear_w) { - m_mcu->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + m_mcu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); } @@ -1184,7 +1184,6 @@ MACHINE_CONFIG_END MACHINE_START_MEMBER(equites_state,equites) { - m_mcu = machine().device("mcu"); m_msm = machine().device<msm5232_device>("msm"); m_dac_1 = machine().device<dac_device>("dac1"); m_dac_2 = machine().device<dac_device>("dac2"); diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c index 3aa0edef47a..1ee897aa40e 100644 --- a/src/mame/drivers/esd16.c +++ b/src/mame/drivers/esd16.c @@ -86,7 +86,7 @@ WRITE16_MEMBER(esd16_state::esd16_sound_command_w) if (ACCESSING_BITS_0_7) { soundlatch_byte_w(space, 0, data & 0xff); - m_audio_cpu->execute().set_input_line(0, ASSERT_LINE); // Generate an IRQ + m_audiocpu->set_input_line(0, ASSERT_LINE); // Generate an IRQ space.device().execute().spin_until_time(attotime::from_usec(50)); // Allow the other CPU to reply } } @@ -247,7 +247,7 @@ ADDRESS_MAP_END READ8_MEMBER(esd16_state::esd16_sound_command_r) { /* Clear IRQ only after reading the command, or some get lost */ - m_audio_cpu->execute().set_input_line(0, CLEAR_LINE); + m_audiocpu->set_input_line(0, CLEAR_LINE); return soundlatch_byte_r(space, 0); } @@ -584,7 +584,6 @@ void esd16_state::machine_start() membank("bank1")->configure_entries(0, 16, &AUDIO[0x0000], 0x4000); - m_audio_cpu = m_audiocpu; m_eeprom = machine().device<eeprom_device>("eeprom"); save_item(NAME(m_tilemap0_color)); diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c index 4458bdbf5ba..2e4cfa5b149 100644 --- a/src/mame/drivers/esripsys.c +++ b/src/mame/drivers/esripsys.c @@ -43,7 +43,7 @@ WRITE_LINE_MEMBER(esripsys_state::ptm_irq) { - machine().device("sound_cpu")->execute().set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); + m_soundcpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } static const ptm6840_interface ptm_intf = @@ -111,14 +111,14 @@ WRITE8_MEMBER(esripsys_state::g_status_w) bankaddress = 0x10000 + (data & 0x03) * 0x10000; membank("bank1")->set_base(&rom[bankaddress]); - machine().device("frame_cpu")->execute().set_input_line(M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); - machine().device("frame_cpu")->execute().set_input_line(INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE); + m_framecpu->set_input_line(M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE); + m_framecpu->set_input_line(INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE); - machine().device("video_cpu")->execute().set_input_line(INPUT_LINE_RESET, data & 0x40 ? CLEAR_LINE : ASSERT_LINE); + m_videocpu->set_input_line(INPUT_LINE_RESET, data & 0x40 ? CLEAR_LINE : ASSERT_LINE); /* /VBLANK IRQ acknowledge */ if (!(data & 0x20)) - machine().device("game_cpu")->execute().set_input_line(M6809_IRQ_LINE, CLEAR_LINE); + m_gamecpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); } @@ -346,7 +346,7 @@ WRITE8_MEMBER(esripsys_state::g_ioadd_w) } case 0x02: { - machine().device("sound_cpu")->execute().set_input_line(INPUT_LINE_NMI, m_g_iodata & 4 ? CLEAR_LINE : ASSERT_LINE); + m_soundcpu->set_input_line(INPUT_LINE_NMI, m_g_iodata & 4 ? CLEAR_LINE : ASSERT_LINE); if (!(m_g_to_s_latch2 & 1) && (m_g_iodata & 1)) { @@ -354,7 +354,7 @@ WRITE8_MEMBER(esripsys_state::g_ioadd_w) m_u56a = 1; /*...causing a sound CPU /IRQ */ - machine().device("sound_cpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); + m_soundcpu->set_input_line(M6809_IRQ_LINE, ASSERT_LINE); } if (m_g_iodata & 2) @@ -407,7 +407,7 @@ INPUT_CHANGED_MEMBER(esripsys_state::keypad_interrupt) { m_io_firq_status |= 2; m_keypad_status |= 0x20; - machine().device("game_cpu")->execute().set_input_line(M6809_FIRQ_LINE, HOLD_LINE); + m_gamecpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE); } } @@ -417,7 +417,7 @@ INPUT_CHANGED_MEMBER(esripsys_state::coin_interrupt) { m_io_firq_status |= 2; m_coin_latch = ioport("COINS")->read() << 2; - machine().device("game_cpu")->execute().set_input_line(M6809_FIRQ_LINE, HOLD_LINE); + m_gamecpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE); } } @@ -498,7 +498,7 @@ WRITE8_MEMBER(esripsys_state::s_200f_w) if (m_s_to_g_latch2 & 0x40) { m_u56a = 0; - machine().device("sound_cpu")->execute().set_input_line(M6809_IRQ_LINE, CLEAR_LINE); + m_soundcpu->set_input_line(M6809_IRQ_LINE, CLEAR_LINE); } if (!(m_s_to_g_latch2 & 0x80) && (data & 0x80)) @@ -522,11 +522,10 @@ READ8_MEMBER(esripsys_state::tms5220_r) if (offset == 0) { /* TMS5220 core returns status bits in D7-D6 */ - device_t *tms = machine().device("tms5220nl"); - UINT8 status = tms5220_status_r(tms, space, 0); + UINT8 status = tms5220_status_r(m_tms, space, 0); status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5); - return (tms5220_readyq_r(tms) << 7) | (tms5220_intq_r(tms) << 6) | status; + return (tms5220_readyq_r(m_tms) << 7) | (tms5220_intq_r(m_tms) << 6) | status; } return 0xff; @@ -535,16 +534,15 @@ READ8_MEMBER(esripsys_state::tms5220_r) /* TODO: Implement correctly using the state PROM */ WRITE8_MEMBER(esripsys_state::tms5220_w) { - device_t *tms = machine().device("tms5220nl"); if (offset == 0) { m_tms_data = data; - tms5220_data_w(tms, space, 0, m_tms_data); + tms5220_data_w(m_tms, space, 0, m_tms_data); } #if 0 if (offset == 1) { - tms5220_data_w(tms, space, 0, m_tms_data); + tms5220_data_w(m_tms, space, 0, m_tms_data); } #endif } diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c index a486b08a0d3..1998f4ce62b 100644 --- a/src/mame/drivers/exprraid.c +++ b/src/mame/drivers/exprraid.c @@ -232,7 +232,7 @@ READ8_MEMBER(exprraid_state::exprraid_protection_r) WRITE8_MEMBER(exprraid_state::sound_cpu_command_w) { soundlatch_byte_w(space, 0, data); - m_slave->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_slave->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } READ8_MEMBER(exprraid_state::vblank_r) @@ -436,7 +436,7 @@ GFXDECODE_END /* handler called by the 3812 emulator when the internal timers cause an IRQ */ WRITE_LINE_MEMBER(exprraid_state::irqhandler) { - m_slave->execute().set_input_line_and_vector(0, state, 0xff); + m_slave->set_input_line_and_vector(0, state, 0xff); } static const ym3526_interface ym3526_config = @@ -467,8 +467,6 @@ INTERRUPT_GEN_MEMBER(exprraid_state::exprraid_interrupt) void exprraid_state::machine_start() { - m_slave = machine().device("slave"); - save_item(NAME(m_bg_index)); } diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c index 26e9b98312c..7c7cc010fda 100644 --- a/src/mame/drivers/exterm.c +++ b/src/mame/drivers/exterm.c @@ -159,7 +159,7 @@ WRITE16_MEMBER(exterm_state::exterm_output_port_0_w) { /* Bit 13 = Resets the slave CPU */ if ((data & 0x2000) && !(m_last & 0x2000)) - machine().device("slave")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); + m_slave->set_input_line(INPUT_LINE_RESET, PULSE_LINE); /* Bits 14-15 = Coin counters */ coin_counter_w(machine(), 0, data & 0x8000); diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c index 858d7a097de..3b01d0fee03 100644 --- a/src/mame/drivers/fantland.c +++ b/src/mame/drivers/fantland.c @@ -76,7 +76,7 @@ WRITE16_MEMBER(fantland_state::fantland_nmi_enable_16_w) WRITE8_MEMBER(fantland_state::fantland_soundlatch_w) { soundlatch_byte_w(space, 0, data); - m_audio_cpu->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } WRITE16_MEMBER(fantland_state::fantland_soundlatch_16_w) @@ -815,8 +815,6 @@ GFXDECODE_END MACHINE_START_MEMBER(fantland_state,fantland) { - m_audio_cpu = m_audiocpu; - save_item(NAME(m_nmi_enable)); } @@ -880,7 +878,7 @@ MACHINE_CONFIG_END WRITE_LINE_MEMBER(fantland_state::galaxygn_sound_irq) { - m_audio_cpu->execute().set_input_line_and_vector(0, state ? ASSERT_LINE : CLEAR_LINE, 0x80/4); + m_audiocpu->set_input_line_and_vector(0, state ? ASSERT_LINE : CLEAR_LINE, 0x80/4); } static MACHINE_CONFIG_START( galaxygn, fantland_state ) diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c index d5806fe53bc..15a3a3f498e 100644 --- a/src/mame/drivers/finalizr.c +++ b/src/mame/drivers/finalizr.c @@ -49,7 +49,7 @@ WRITE8_MEMBER(finalizr_state::finalizr_flipscreen_w) WRITE8_MEMBER(finalizr_state::finalizr_i8039_irq_w) { - m_audio_cpu->execute().set_input_line(0, ASSERT_LINE); + m_audiocpu->set_input_line(0, ASSERT_LINE); } WRITE8_MEMBER(finalizr_state::i8039_irqen_w) @@ -60,7 +60,7 @@ WRITE8_MEMBER(finalizr_state::i8039_irqen_w) */ if ((data & 0x80) == 0) - m_audio_cpu->execute().set_input_line(0, CLEAR_LINE); + m_audiocpu->set_input_line(0, CLEAR_LINE); } READ8_MEMBER(finalizr_state::i8039_T1_r) @@ -251,8 +251,6 @@ static const sn76496_config psg_intf = void finalizr_state::machine_start() { - m_audio_cpu = m_audiocpu; - save_item(NAME(m_spriterambank)); save_item(NAME(m_charbank)); save_item(NAME(m_T1_line)); diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c index e6293856d6b..0971c3b72e0 100644 --- a/src/mame/drivers/flstory.c +++ b/src/mame/drivers/flstory.c @@ -1002,8 +1002,6 @@ static const msm5232_interface msm5232_config = void flstory_state::machine_start() { - m_mcu = machine().device("mcu"); - /* video */ save_item(NAME(m_char_bank)); save_item(NAME(m_palette_bank)); diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c index fcbc5dc9638..5d70edb47ae 100644 --- a/src/mame/drivers/hvyunit.c +++ b/src/mame/drivers/hvyunit.c @@ -78,6 +78,8 @@ public: : driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), + m_mastercpu(*this, "master"), + m_slavecpu(*this, "slave"), m_soundcpu(*this, "soundcpu"){ } /* Video */ @@ -97,9 +99,8 @@ public: UINT8 m_mermaid_p[4]; /* Devices */ - device_t *m_master_cpu; - device_t *m_slave_cpu; - device_t *m_sound_cpu; + required_device<cpu_device> m_mastercpu; + required_device<cpu_device> m_slavecpu; device_t *m_mermaid; device_t *m_pandora; DECLARE_WRITE8_MEMBER(trigger_nmi_on_slave_cpu); @@ -142,9 +143,6 @@ public: void hvyunit_state::machine_start() { - m_master_cpu = machine().device("master"); - m_slave_cpu = machine().device("slave"); - m_sound_cpu = m_soundcpu; m_mermaid = machine().device("mermaid"); m_pandora = machine().device("pandora"); @@ -211,7 +209,7 @@ void hvyunit_state::screen_eof_hvyunit(screen_device &screen, bool state) WRITE8_MEMBER(hvyunit_state::trigger_nmi_on_slave_cpu) { - m_slave_cpu->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_slavecpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } WRITE8_MEMBER(hvyunit_state::master_bankswitch_w) @@ -251,7 +249,7 @@ READ8_MEMBER(hvyunit_state::mermaid_status_r) WRITE8_MEMBER(hvyunit_state::trigger_nmi_on_sound_cpu2) { soundlatch_byte_w(space, 0, data); - m_sound_cpu->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } WRITE8_MEMBER(hvyunit_state::hu_videoram_w) @@ -390,7 +388,7 @@ READ8_MEMBER(hvyunit_state::mermaid_p3_r) WRITE8_MEMBER(hvyunit_state::mermaid_p3_w) { m_mermaid_p[3] = data; - m_slave_cpu->execute().set_input_line(INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); + m_slavecpu->set_input_line(INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE); } @@ -615,11 +613,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_state::hvyunit_scanline) int scanline = param; if(scanline == 240) // vblank-out irq - m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd); + m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xfd); /* Pandora "sprite end dma" irq? TODO: timing is likely off */ if(scanline == 64) - m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); + m_mastercpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); } static const kaneko_pandora_interface hvyunit_pandora_config = diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c index 2345380173a..7ebeaaafcf0 100644 --- a/src/mame/drivers/jackal.c +++ b/src/mame/drivers/jackal.c @@ -339,7 +339,7 @@ void jackal_state::machine_reset() // HACK: running at the nominal clock rate, music stops working // at the beginning of the game. This fixes it. - machine().device("slave")->set_clock_scale(1.2f); + m_slavecpu->set_clock_scale(1.2f); m_rambank = rgn; m_spritebank = rgn; diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c index e199bd79364..9d2e37606f6 100644 --- a/src/mame/drivers/kingobox.c +++ b/src/mame/drivers/kingobox.c @@ -40,7 +40,7 @@ WRITE8_MEMBER(kingofb_state::scroll_interrupt_w) WRITE8_MEMBER(kingofb_state::sound_command_w) { soundlatch_byte_w(space, 0, data); - m_audio_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); + m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); } @@ -452,7 +452,6 @@ void kingofb_state::machine_start() { m_video_cpu = machine().device("video"); m_sprite_cpu = machine().device("sprite"); - m_audio_cpu = m_audiocpu; save_item(NAME(m_nmi_enable)); save_item(NAME(m_palette_bank)); diff --git a/src/mame/drivers/leland.c b/src/mame/drivers/leland.c index 23b5151b096..7393b62d968 100644 --- a/src/mame/drivers/leland.c +++ b/src/mame/drivers/leland.c @@ -1981,11 +1981,11 @@ ROM_END void leland_state::init_master_ports(UINT8 mvram_base, UINT8 io_base) { /* set up the master CPU VRAM I/O */ - machine().device("master")->memory().space(AS_IO).install_readwrite_handler(mvram_base, mvram_base + 0x1f, read8_delegate(FUNC(leland_state::leland_mvram_port_r),this), write8_delegate(FUNC(leland_state::leland_mvram_port_w),this)); + m_master->space(AS_IO).install_readwrite_handler(mvram_base, mvram_base + 0x1f, read8_delegate(FUNC(leland_state::leland_mvram_port_r),this), write8_delegate(FUNC(leland_state::leland_mvram_port_w),this)); /* set up the master CPU I/O ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(io_base, io_base + 0x1f, read8_delegate(FUNC(leland_state::leland_master_input_r),this)); - machine().device("master")->memory().space(AS_IO).install_write_handler(io_base, io_base + 0x0f, write8_delegate(FUNC(leland_state::leland_master_output_w),this)); + m_master->space(AS_IO).install_read_handler(io_base, io_base + 0x1f, read8_delegate(FUNC(leland_state::leland_master_input_r),this)); + m_master->space(AS_IO).install_write_handler(io_base, io_base + 0x0f, write8_delegate(FUNC(leland_state::leland_master_output_w),this)); } @@ -2001,8 +2001,8 @@ DRIVER_INIT_MEMBER(leland_state,cerberus) init_master_ports(0x40, 0x80); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0x80, 0x80, read8_delegate(FUNC(leland_state::cerberus_dial_1_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0x90, 0x90, read8_delegate(FUNC(leland_state::cerberus_dial_2_r),this)); + m_master->space(AS_IO).install_read_handler(0x80, 0x80, read8_delegate(FUNC(leland_state::cerberus_dial_1_r),this)); + m_master->space(AS_IO).install_read_handler(0x90, 0x90, read8_delegate(FUNC(leland_state::cerberus_dial_2_r),this)); } @@ -2047,7 +2047,7 @@ DRIVER_INIT_MEMBER(leland_state,alleymas) /* kludge warning: the game uses location E0CA to determine if the joysticks are available */ /* it gets cleared by the code, but there is no obvious way for the value to be set to a */ /* non-zero value. If the value is zero, the joystick is never read. */ - m_alleymas_kludge_mem = machine().device("master")->memory().space(AS_PROGRAM).install_write_handler(0xe0ca, 0xe0ca, write8_delegate(FUNC(leland_state::alleymas_joystick_kludge),this)); + m_alleymas_kludge_mem = m_master->space(AS_PROGRAM).install_write_handler(0xe0ca, 0xe0ca, write8_delegate(FUNC(leland_state::alleymas_joystick_kludge),this)); } @@ -2070,9 +2070,9 @@ DRIVER_INIT_MEMBER(leland_state,dangerz) init_master_ports(0x40, 0x80); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0xf4, 0xf4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); + m_master->space(AS_IO).install_read_handler(0xf4, 0xf4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); + m_master->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); + m_master->space(AS_IO).install_read_handler(0xfc, 0xfc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); } @@ -2117,10 +2117,10 @@ DRIVER_INIT_MEMBER(leland_state,redlin2p) init_master_ports(0x00, 0xc0); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(leland_state::redline_pedal_1_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xd0, 0xd0, read8_delegate(FUNC(leland_state::redline_pedal_2_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::redline_wheel_2_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::redline_wheel_1_r),this)); + m_master->space(AS_IO).install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(leland_state::redline_pedal_1_r),this)); + m_master->space(AS_IO).install_read_handler(0xd0, 0xd0, read8_delegate(FUNC(leland_state::redline_pedal_2_r),this)); + m_master->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::redline_wheel_2_r),this)); + m_master->space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::redline_wheel_1_r),this)); } @@ -2149,9 +2149,9 @@ DRIVER_INIT_MEMBER(leland_state,viper) init_master_ports(0x00, 0xc0); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0xa4, 0xa4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xb8, 0xb8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xbc, 0xbc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); + m_master->space(AS_IO).install_read_handler(0xa4, 0xa4, read8_delegate(FUNC(leland_state::dangerz_input_upper_r),this)); + m_master->space(AS_IO).install_read_handler(0xb8, 0xb8, read8_delegate(FUNC(leland_state::dangerz_input_y_r),this)); + m_master->space(AS_IO).install_read_handler(0xbc, 0xbc, read8_delegate(FUNC(leland_state::dangerz_input_x_r),this)); } @@ -2168,8 +2168,8 @@ DRIVER_INIT_MEMBER(leland_state,teamqb) init_master_ports(0x40, 0x80); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); + m_master->space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); + m_master->space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); } @@ -2186,8 +2186,8 @@ DRIVER_INIT_MEMBER(leland_state,aafb) init_master_ports(0x00, 0xc0); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); + m_master->space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); + m_master->space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); } @@ -2204,8 +2204,8 @@ DRIVER_INIT_MEMBER(leland_state,aafbb) init_master_ports(0x80, 0x40); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); + m_master->space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); + m_master->space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); } @@ -2222,8 +2222,8 @@ DRIVER_INIT_MEMBER(leland_state,aafbd2p) init_master_ports(0x00, 0x40); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); - machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); + m_master->space(AS_IO).install_read_port(0x7c, 0x7c, "IN4"); + m_master->space(AS_IO).install_read_port(0x7f, 0x7f, "IN5"); } @@ -2241,9 +2241,9 @@ DRIVER_INIT_MEMBER(leland_state,offroad) init_master_ports(0x40, 0x80); /* yes, this is intentional */ /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); + m_master->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); + m_master->space(AS_IO).install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); + m_master->space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); } @@ -2260,9 +2260,9 @@ DRIVER_INIT_MEMBER(leland_state,offroadt) init_master_ports(0x80, 0x40); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); - machine().device("master")->memory().space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); + m_master->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(leland_state::offroad_wheel_3_r),this)); + m_master->space(AS_IO).install_read_handler(0xf9, 0xf9, read8_delegate(FUNC(leland_state::offroad_wheel_1_r),this)); + m_master->space(AS_IO).install_read_handler(0xfb, 0xfb, read8_delegate(FUNC(leland_state::offroad_wheel_2_r),this)); } @@ -2279,7 +2279,7 @@ DRIVER_INIT_MEMBER(leland_state,pigout) init_master_ports(0x00, 0x40); /* set up additional input ports */ - machine().device("master")->memory().space(AS_IO).install_read_port(0x7f, 0x7f, "IN4"); + m_master->space(AS_IO).install_read_port(0x7f, 0x7f, "IN4"); } diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c index 55eef70cd35..cddd12b214f 100644 --- a/src/mame/drivers/lkage.c +++ b/src/mame/drivers/lkage.c @@ -491,8 +491,6 @@ static const ym2203_interface ym2203_config = void lkage_state::machine_start() { - m_mcu = machine().device("mcu"); - save_item(NAME(m_bg_tile_bank)); save_item(NAME(m_fg_tile_bank)); save_item(NAME(m_tx_tile_bank)); diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c index 249592acb28..1ee3f9f8151 100644 --- a/src/mame/drivers/lsasquad.c +++ b/src/mame/drivers/lsasquad.c @@ -568,8 +568,6 @@ MACHINE_START_MEMBER(lsasquad_state,lsasquad) membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000); - m_mcu = machine().device("mcu"); - save_item(NAME(m_port_a_in)); save_item(NAME(m_port_a_out)); save_item(NAME(m_ddr_a)); diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c index 8154181550e..d2b601aab49 100644 --- a/src/mame/drivers/m72.c +++ b/src/mame/drivers/m72.c @@ -231,7 +231,7 @@ WRITE16_MEMBER(m72_state::m72_main_mcu_sound_w) if (ACCESSING_BITS_0_7) { m_mcu_snd_cmd_latch = data; - machine().device("mcu")->execute().set_input_line(1, ASSERT_LINE); + m_mcu->set_input_line(1, ASSERT_LINE); } } @@ -248,7 +248,7 @@ WRITE16_MEMBER(m72_state::m72_main_mcu_w) if (offset == 0x0fff/2 && ACCESSING_BITS_8_15) { m_protection_ram[offset] = val; - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); /* Line driven, most likely by write line */ //machine().scheduler().timer_set(machine().device<cpu_device>("mcu")->cycles_to_attotime(2), FUNC(mcu_irq0_clear)); //machine().scheduler().timer_set(machine().device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise)); @@ -272,7 +272,7 @@ READ8_MEMBER(m72_state::m72_mcu_data_r) if (offset == 0x0fff || offset == 0x0ffe) { - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); } if (offset&1) ret = (m_protection_ram[offset/2] & 0xff00)>>8; @@ -297,7 +297,7 @@ READ8_MEMBER(m72_state::m72_mcu_sample_r) WRITE8_MEMBER(m72_state::m72_mcu_ack_w) { - machine().device("mcu")->execute().set_input_line(1, CLEAR_LINE); + m_mcu->set_input_line(1, CLEAR_LINE); m_mcu_snd_cmd_latch = 0; } diff --git a/src/mame/drivers/matmania.c b/src/mame/drivers/matmania.c index 42d5b82e9c2..218b4121fdd 100644 --- a/src/mame/drivers/matmania.c +++ b/src/mame/drivers/matmania.c @@ -298,7 +298,6 @@ GFXDECODE_END MACHINE_START_MEMBER(matmania_state,matmania) { - m_mcu = machine().device("mcu"); } static MACHINE_CONFIG_START( matmania, matmania_state ) diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c index 61cda408e6c..fbc90db8c41 100644 --- a/src/mame/drivers/maxaflex.c +++ b/src/mame/drivers/maxaflex.c @@ -27,7 +27,8 @@ class maxaflex_state : public driver_device public: maxaflex_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } UINT8 m_portA_in; UINT8 m_portA_out; @@ -63,6 +64,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(mcu_timer_proc); int atari_input_disabled(); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; @@ -116,7 +118,7 @@ WRITE8_MEMBER(maxaflex_state::mcu_portB_w) /* clear coin interrupt */ if (data & 0x04) - machine().device("mcu")->execute().set_input_line(M6805_IRQ_LINE, CLEAR_LINE ); + m_mcu->set_input_line(M6805_IRQ_LINE, CLEAR_LINE ); /* AUDMUTE */ machine().sound().system_enable((data >> 5) & 1); @@ -191,7 +193,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(maxaflex_state::mcu_timer_proc) if ( (m_tcr & 0x40) == 0 ) { //timer interrupt! - generic_pulse_irq_line(machine().device("mcu")->execute(), M68705_INT_TIMER, 1); + generic_pulse_irq_line(m_mcu, M68705_INT_TIMER, 1); } } } @@ -263,7 +265,7 @@ MACHINE_RESET_MEMBER(maxaflex_state,supervisor_board) INPUT_CHANGED_MEMBER(maxaflex_state::coin_inserted) { if (!newval) - machine().device("mcu")->execute().set_input_line(M6805_IRQ_LINE, HOLD_LINE ); + m_mcu->set_input_line(M6805_IRQ_LINE, HOLD_LINE ); } int maxaflex_state::atari_input_disabled() diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c index 1771dfba7f6..04061fa0abe 100644 --- a/src/mame/drivers/mexico86.c +++ b/src/mame/drivers/mexico86.c @@ -425,8 +425,6 @@ void mexico86_state::machine_start() membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000); - m_mcu = machine().device("mcu"); - save_item(NAME(m_port_a_in)); save_item(NAME(m_port_a_out)); save_item(NAME(m_ddr_a)); diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c index 9dd75937496..cdc7d419b3e 100644 --- a/src/mame/drivers/missb2.c +++ b/src/mame/drivers/missb2.c @@ -438,9 +438,6 @@ INTERRUPT_GEN_MEMBER(missb2_state::missb2_interrupt) MACHINE_START_MEMBER(missb2_state,missb2) { - m_slave = machine().device("slave"); - m_mcu = NULL; - save_item(NAME(m_sound_nmi_enable)); save_item(NAME(m_pending_nmi)); save_item(NAME(m_sound_status)); diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c index cb3b5fa4c34..43eec1e5a2d 100644 --- a/src/mame/drivers/msisaac.c +++ b/src/mame/drivers/msisaac.c @@ -462,7 +462,7 @@ void msisaac_state::machine_reset() m_snd_ctrl1 = 0; #ifdef USE_MCU - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); #else m_mcu_val = 0; m_direction = 0; diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c index 3ddc6358fa9..d7a1ed2d7a0 100644 --- a/src/mame/drivers/namcona1.c +++ b/src/mame/drivers/namcona1.c @@ -719,7 +719,7 @@ WRITE16_MEMBER(namcona1_state::mcu_mailbox_w_68k) // logerror("mailbox_w_68k: %x @ %x\n", data, offset); if (offset == 4) - machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ0, HOLD_LINE); + m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE); COMBINE_DATA(&m_mcu_mailbox[offset%8]); diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c index 75259e4ea47..8f14820dee1 100644 --- a/src/mame/drivers/namconb1.c +++ b/src/mame/drivers/namconb1.c @@ -288,11 +288,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(namconb1_state::mcu_interrupt) /* TODO: real sources of these */ if (scanline == 224) - machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ0, HOLD_LINE); + m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE); else if (scanline == 0) - machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ2, HOLD_LINE); + m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE); else if (scanline == 128) - machine().device("mcu")->execute().set_input_line(M37710_LINE_ADC, HOLD_LINE); + m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE); } diff --git a/src/mame/drivers/namcos2.c b/src/mame/drivers/namcos2.c index 5d3d9c0ae09..11f23ce3ae4 100644 --- a/src/mame/drivers/namcos2.c +++ b/src/mame/drivers/namcos2.c @@ -5242,7 +5242,7 @@ DRIVER_INIT_MEMBER(namcos2_state,assaultp_hack) // // This is used in conjunction with the interleave increase in the // MACHINE_DRIVER - machine().device("mcu")->set_clock_scale(4.0f); + m_mcu->set_clock_scale(4.0f); DRIVER_INIT_CALL(assaultp); } diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c index e46be1c82cd..087e008e515 100644 --- a/src/mame/drivers/nycaptor.c +++ b/src/mame/drivers/nycaptor.c @@ -762,8 +762,6 @@ GFXDECODE_END void nycaptor_state::machine_start() { - m_mcu = machine().device("mcu"); - save_item(NAME(m_generic_control_reg)); save_item(NAME(m_sound_nmi_enable)); save_item(NAME(m_pending_nmi)); diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c index e4cac519e8f..d2c413fb4f3 100644 --- a/src/mame/drivers/nyny.c +++ b/src/mame/drivers/nyny.c @@ -94,7 +94,8 @@ public: m_videoram2(*this, "videoram2"), m_colorram2(*this, "colorram2"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_audiocpu2(*this, "audio2"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram1; @@ -111,7 +112,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; - device_t *m_audiocpu2; + required_device<cpu_device> m_audiocpu2; device_t *m_ic48_1; mc6845_device *m_mc6845; pia6821_device *m_pia1; @@ -501,7 +502,7 @@ static const ay8910_interface ay8910_64_interface = WRITE8_MEMBER(nyny_state::audio_2_command_w) { soundlatch2_byte_w(space, 0, (data & 0x60) >> 5); - m_audiocpu2->execute().set_input_line(M6800_IRQ_LINE, BIT(data, 7) ? CLEAR_LINE : ASSERT_LINE); + m_audiocpu2->set_input_line(M6800_IRQ_LINE, BIT(data, 7) ? CLEAR_LINE : ASSERT_LINE); } @@ -674,7 +675,6 @@ INPUT_PORTS_END void nyny_state::machine_start() { - m_audiocpu2 = machine().device("audio2"); m_ic48_1 = machine().device("ic48_1"); m_mc6845 = machine().device<mc6845_device>("crtc"); m_pia1 = machine().device<pia6821_device>("pia1"); diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c index a2872c61ddf..06892a95557 100644 --- a/src/mame/drivers/pacland.c +++ b/src/mame/drivers/pacland.c @@ -181,7 +181,7 @@ Notes: WRITE8_MEMBER(pacland_state::pacland_subreset_w) { int bit = !BIT(offset,11); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); } WRITE8_MEMBER(pacland_state::pacland_flipscreen_w) @@ -230,7 +230,7 @@ WRITE8_MEMBER(pacland_state::pacland_irq_2_ctrl_w) int bit = !BIT(offset, 13); m_mcu_irq_mask = bit; if (!bit) - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); } @@ -405,7 +405,7 @@ INTERRUPT_GEN_MEMBER(pacland_state::main_vblank_irq) INTERRUPT_GEN_MEMBER(pacland_state::mcu_vblank_irq) { if(m_mcu_irq_mask) - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } static MACHINE_CONFIG_START( pacland, pacland_state ) diff --git a/src/mame/drivers/pushman.c b/src/mame/drivers/pushman.c index a15feefcc43..602c0e552ae 100644 --- a/src/mame/drivers/pushman.c +++ b/src/mame/drivers/pushman.c @@ -72,7 +72,7 @@ WRITE16_MEMBER(pushman_state::pushman_68705_w) if (offset == 1) { - m_mcu->execute().set_input_line(M68705_IRQ_LINE, HOLD_LINE); + m_mcu->set_input_line(M68705_IRQ_LINE, HOLD_LINE); space.device().execute().spin(); m_new_latch = 0; } @@ -396,8 +396,6 @@ static const ym2203_interface ym2203_config = void pushman_state::machine_start() { - m_mcu = machine().device("mcu"); - save_item(NAME(m_control)); save_item(NAME(m_shared_ram)); save_item(NAME(m_latch)); diff --git a/src/mame/drivers/rbmk.c b/src/mame/drivers/rbmk.c index 1c1b9b9d285..7af1c06c8be 100644 --- a/src/mame/drivers/rbmk.c +++ b/src/mame/drivers/rbmk.c @@ -64,7 +64,8 @@ public: : driver_device(mconfig, type, tag), m_gms_vidram2(*this, "gms_vidram2"), m_gms_vidram(*this, "gms_vidram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } required_shared_ptr<UINT16> m_gms_vidram2; required_shared_ptr<UINT16> m_gms_vidram; @@ -82,6 +83,7 @@ public: UINT32 screen_update_rbmk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mcu_irq); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; @@ -532,7 +534,7 @@ UINT32 rbmk_state::screen_update_rbmk(screen_device &screen, bitmap_ind16 &bitma INTERRUPT_GEN_MEMBER(rbmk_state::mcu_irq) { - machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_mcu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } static MACHINE_CONFIG_START( rbmk, rbmk_state ) diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c index 7e9c6aeca81..ee008126f20 100644 --- a/src/mame/drivers/renegade.c +++ b/src/mame/drivers/renegade.c @@ -356,7 +356,7 @@ WRITE8_MEMBER(renegade_state::renegade_68705_port_b_w) m_port_a_in = m_from_main; if (m_main_sent) - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; } @@ -413,7 +413,7 @@ READ8_MEMBER(renegade_state::mcu_reset_r) } else { - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); } return 0; } @@ -443,7 +443,7 @@ WRITE8_MEMBER(renegade_state::mcu_w) { m_from_main = data; m_main_sent = 1; - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } } diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c index 80e68c2bf2b..b5f3b1d862d 100644 --- a/src/mame/drivers/seicross.c +++ b/src/mame/drivers/seicross.c @@ -76,7 +76,7 @@ static NVRAM_HANDLER( seicross ) void seicross_state::machine_reset() { /* start with the protection mcu halted */ - machine().device("mcu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); } @@ -98,8 +98,8 @@ WRITE8_MEMBER(seicross_state::friskyt_portB_w) if (((m_portb & 4) == 0) && (data & 4)) { /* reset and start the protection mcu */ - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); + m_mcu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); } /* other bits unknown */ diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c index 78be5ce2771..709ab93e382 100644 --- a/src/mame/drivers/shougi.c +++ b/src/mame/drivers/shougi.c @@ -94,7 +94,8 @@ public: : driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_mcu(*this, "mcu") { } required_shared_ptr<UINT8> m_videoram; int m_nmi_enabled; @@ -117,6 +118,7 @@ public: INTERRUPT_GEN_MEMBER(shougi_vblank_nmi); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_subcpu; + required_device<cpu_device> m_mcu; }; @@ -252,13 +254,13 @@ WRITE8_MEMBER(shougi_state::shougi_watchdog_reset_w) WRITE8_MEMBER(shougi_state::shougi_mcu_halt_off_w) { /* logerror("mcu HALT OFF"); */ - machine().device("mcu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + m_mcu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); } WRITE8_MEMBER(shougi_state::shougi_mcu_halt_on_w) { /* logerror("mcu HALT ON"); */ - machine().device("mcu")->execute().set_input_line(INPUT_LINE_HALT,ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_HALT,ASSERT_LINE); } diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c index 12a99974355..80a1267aa9c 100644 --- a/src/mame/drivers/skykid.c +++ b/src/mame/drivers/skykid.c @@ -64,7 +64,7 @@ WRITE8_MEMBER(skykid_state::skykid_led_w) WRITE8_MEMBER(skykid_state::skykid_subreset_w) { int bit = !BIT(offset,11); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); } WRITE8_MEMBER(skykid_state::skykid_bankswitch_w) @@ -85,7 +85,7 @@ WRITE8_MEMBER(skykid_state::skykid_irq_2_ctrl_w) int bit = !BIT(offset,13); m_mcu_irq_mask = bit; if (!bit) - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); } void skykid_state::machine_start() diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c index dd0ce1c2295..07749697524 100644 --- a/src/mame/drivers/stv.c +++ b/src/mame/drivers/stv.c @@ -1025,7 +1025,7 @@ MACHINE_RESET_MEMBER(stv_state,stv) m_port_sel = m_mux_data = 0; m_maincpu->set_unscaled_clock(MASTER_CLOCK_320/2); - machine().device("slave")->set_unscaled_clock(MASTER_CLOCK_320/2); + m_slave->set_unscaled_clock(MASTER_CLOCK_320/2); stvcd_reset(); diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c index 8401266fa94..809ff119a6d 100644 --- a/src/mame/drivers/superqix.c +++ b/src/mame/drivers/superqix.c @@ -367,7 +367,7 @@ TIMER_CALLBACK_MEMBER(superqix_state::delayed_z80_mcu_w) // logerror("Z80 sends command %02x\n",param); m_from_z80 = param; m_from_mcu_pending = 0; - machine().device("mcu")->execute().set_input_line(0, HOLD_LINE); + m_mcu->set_input_line(0, HOLD_LINE); machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); } diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c index d5505368d6d..31a38e392fb 100644 --- a/src/mame/drivers/system1.c +++ b/src/mame/drivers/system1.c @@ -669,7 +669,7 @@ READ8_MEMBER(system1_state::nob_maincpu_latch_r) WRITE8_MEMBER(system1_state::nob_maincpu_latch_w) { m_nob_maincpu_latch = data; - machine().device("mcu")->execute().set_input_line(MCS51_INT0_LINE, ASSERT_LINE); + m_mcu->set_input_line(MCS51_INT0_LINE, ASSERT_LINE); machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); } diff --git a/src/mame/drivers/tubep.c b/src/mame/drivers/tubep.c index cac88e9c77e..2e8de95c735 100644 --- a/src/mame/drivers/tubep.c +++ b/src/mame/drivers/tubep.c @@ -191,7 +191,7 @@ ADDRESS_MAP_END WRITE8_MEMBER(tubep_state::second_cpu_irq_line_clear_w) { - machine().device("slave")->execute().set_input_line(0, CLEAR_LINE); + m_slave->set_input_line(0, CLEAR_LINE); logerror("CPU#1 VBLANK int clear at scanline=%3i\n", m_curr_scanline); return; } @@ -274,7 +274,7 @@ TIMER_CALLBACK_MEMBER(tubep_state::tubep_scanline_callback) if (scanline == 16) { logerror("/VBLANK CPU#1\n"); - machine().device("slave")->execute().set_input_line(0, ASSERT_LINE); + m_slave->set_input_line(0, ASSERT_LINE); } @@ -284,14 +284,14 @@ TIMER_CALLBACK_MEMBER(tubep_state::tubep_scanline_callback) { logerror("/nmi CPU#3\n"); tubep_vblank_end(); /* switch buffered sprite RAM page */ - machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } /* CPU #3 MS2010-A NMI */ /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ if (scanline == 240) { logerror("CPU#3 nmi clear\n"); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + m_mcu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } @@ -455,7 +455,7 @@ TIMER_CALLBACK_MEMBER(tubep_state::rjammer_scanline_callback) if (scanline == 16) { logerror("/VBLANK CPU#1\n"); - machine().device("slave")->execute().set_input_line(0, HOLD_LINE); + m_slave->set_input_line(0, HOLD_LINE); } @@ -465,14 +465,14 @@ TIMER_CALLBACK_MEMBER(tubep_state::rjammer_scanline_callback) { logerror("/nmi CPU#3\n"); tubep_vblank_end(); /* switch buffered sprite RAM page */ - machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } /* CPU #3 MS2010-A NMI */ /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ if (scanline == 240) { logerror("CPU#3 nmi clear\n"); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + m_mcu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } diff --git a/src/mame/drivers/tx1.c b/src/mame/drivers/tx1.c index 542f75bd02e..0caf66ede80 100644 --- a/src/mame/drivers/tx1.c +++ b/src/mame/drivers/tx1.c @@ -61,23 +61,23 @@ /* Main CPU and Z80 synchronisation */ WRITE16_MEMBER(tx1_state::z80_busreq_w) { - machine().device("audio_cpu")->execute().set_input_line(INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE); + m_audiocpu->set_input_line(INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE); } WRITE16_MEMBER(tx1_state::resume_math_w) { - machine().device("math_cpu")->execute().set_input_line(INPUT_LINE_TEST, ASSERT_LINE); + m_mathcpu->set_input_line(INPUT_LINE_TEST, ASSERT_LINE); } WRITE16_MEMBER(tx1_state::halt_math_w) { - machine().device("math_cpu")->execute().set_input_line(INPUT_LINE_TEST, CLEAR_LINE); + m_mathcpu->set_input_line(INPUT_LINE_TEST, CLEAR_LINE); } /* Z80 can trigger its own interrupts */ WRITE8_MEMBER(tx1_state::z80_intreq_w) { - machine().device("audio_cpu")->execute().set_input_line(0, HOLD_LINE); + m_audiocpu->set_input_line(0, HOLD_LINE); } /* Periodic Z80 interrupt */ diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c index 514ef713283..07cf1691893 100644 --- a/src/mame/drivers/xain.c +++ b/src/mame/drivers/xain.c @@ -267,7 +267,7 @@ WRITE8_MEMBER(xain_state::xain_68705_w) m_mcu_accept = 0; if (machine().device("mcu") != NULL) - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } CUSTOM_INPUT_MEMBER(xain_state::xain_vblank_r) @@ -312,7 +312,7 @@ WRITE8_MEMBER(xain_state::xain_68705_port_b_w) else if ((m_ddr_b & 0x02) && (~m_port_b_out & 0x02) && (data & 0x02)) { m_mcu_accept = 1; - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); } /* Rising edge of PB2 */ @@ -377,7 +377,7 @@ READ8_MEMBER(xain_state::mcu_comm_reset_r) m_mcu_accept = 1; if (machine().device("mcu") != NULL) - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); return 0xff; } diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h index a676c6ee39f..a4b06d1e849 100644 --- a/src/mame/includes/40love.h +++ b/src/mame/includes/40love.h @@ -10,7 +10,8 @@ public: m_spriteram2(*this, "spriteram2"), m_mcu_ram(*this, "mcu_ram"), m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -105,4 +106,5 @@ public: void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_pixram( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device<cpu_device> m_maincpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/airbustr.h b/src/mame/includes/airbustr.h index 6e4941bdaa9..40c10a6f9cc 100644 --- a/src/mame/includes/airbustr.h +++ b/src/mame/includes/airbustr.h @@ -15,6 +15,8 @@ public: m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_paletteram(*this, "paletteram"), + m_master(*this, "master"), + m_slave(*this, "slave"), m_audiocpu(*this, "audiocpu"){ } /* memory pointers */ @@ -40,8 +42,8 @@ public: int m_soundlatch2_status; /* devices */ - device_t *m_master; - device_t *m_slave; + required_device<cpu_device> m_master; + required_device<cpu_device> m_slave; required_device<cpu_device> m_audiocpu; device_t *m_pandora; DECLARE_READ8_MEMBER(devram_r); diff --git a/src/mame/includes/arabian.h b/src/mame/includes/arabian.h index c3031795b47..705790e8885 100644 --- a/src/mame/includes/arabian.h +++ b/src/mame/includes/arabian.h @@ -13,7 +13,8 @@ public: : driver_device(mconfig, type, tag), m_custom_cpu_ram(*this, "custom_cpu_ram"), m_blitter(*this, "blitter"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } /* memory pointers */ required_shared_ptr<UINT8> m_custom_cpu_ram; @@ -46,4 +47,5 @@ public: UINT32 screen_update_arabian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void blit_area( UINT8 plane, UINT16 src, UINT8 x, UINT8 y, UINT8 sx, UINT8 sy ); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/arkanoid.h b/src/mame/includes/arkanoid.h index cd8af962e9a..8664587ff3d 100644 --- a/src/mame/includes/arkanoid.h +++ b/src/mame/includes/arkanoid.h @@ -18,6 +18,7 @@ public: m_videoram(*this,"videoram"), m_spriteram(*this,"spriteram"), m_protram(*this,"protram"), + m_mcu(*this, "mcu"), m_maincpu(*this, "maincpu") { } /* memory pointers */ @@ -47,7 +48,7 @@ public: UINT8 m_bootleg_cmd; /* devices */ - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_READ8_MEMBER(arkanoid_Z80_mcu_r); DECLARE_WRITE8_MEMBER(arkanoid_Z80_mcu_w); DECLARE_READ8_MEMBER(arkanoid_68705_port_a_r); diff --git a/src/mame/includes/bigevglf.h b/src/mame/includes/bigevglf.h index c4428ef7dbf..634012b7dcf 100644 --- a/src/mame/includes/bigevglf.h +++ b/src/mame/includes/bigevglf.h @@ -8,6 +8,7 @@ public: m_spriteram1(*this, "spriteram1"), m_spriteram2(*this, "spriteram2"), m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"), m_maincpu(*this, "maincpu") { } /* memory pointers */ @@ -51,7 +52,7 @@ public: /* devices */ required_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_WRITE8_MEMBER(beg_banking_w); DECLARE_WRITE8_MEMBER(beg_fromsound_w); DECLARE_READ8_MEMBER(beg_fromsound_r); diff --git a/src/mame/includes/bking.h b/src/mame/includes/bking.h index 95c5b318343..34e7bdc9085 100644 --- a/src/mame/includes/bking.h +++ b/src/mame/includes/bking.h @@ -4,7 +4,8 @@ public: bking_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_playfield_ram(*this, "playfield_ram"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"){ } /* memory pointers */ required_shared_ptr<UINT8> m_playfield_ram; @@ -39,6 +40,7 @@ public: /* devices */ required_device<cpu_device> m_audiocpu; + optional_device<cpu_device> m_mcu; #if 0 /* 68705 */ diff --git a/src/mame/includes/blktiger.h b/src/mame/includes/blktiger.h index 94bdfa7e69f..300befe29fd 100644 --- a/src/mame/includes/blktiger.h +++ b/src/mame/includes/blktiger.h @@ -13,6 +13,7 @@ public: : driver_device(mconfig, type, tag), m_spriteram(*this, "spriteram") , m_txvideoram(*this, "txvideoram"), + m_mcu(*this, "mcu"), m_audiocpu(*this, "audiocpu"), m_maincpu(*this, "maincpu") { } @@ -40,7 +41,7 @@ public: UINT8 m_i8751_latch; /* devices */ - device_t *m_mcu; + optional_device<cpu_device> m_mcu; required_device<cpu_device> m_audiocpu; DECLARE_READ8_MEMBER(blktiger_from_mcu_r); DECLARE_WRITE8_MEMBER(blktiger_to_mcu_w); diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h index 6b854ada144..03718a2003e 100644 --- a/src/mame/includes/bublbobl.h +++ b/src/mame/includes/bublbobl.h @@ -8,7 +8,9 @@ public: m_objectram(*this, "objectram"), m_mcu_sharedram(*this, "mcu_sharedram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_mcu(*this, "mcu"), + m_audiocpu(*this, "audiocpu"), + m_slave(*this, "slave"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -55,9 +57,9 @@ public: /* devices */ required_device<cpu_device> m_maincpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; required_device<cpu_device> m_audiocpu; - device_t *m_slave; + required_device<cpu_device> m_slave; DECLARE_WRITE8_MEMBER(bublbobl_bankswitch_w); DECLARE_WRITE8_MEMBER(tokio_bankswitch_w); DECLARE_WRITE8_MEMBER(tokio_videoctrl_w); diff --git a/src/mame/includes/buggychl.h b/src/mame/includes/buggychl.h index 229f3cdde1f..166e621b867 100644 --- a/src/mame/includes/buggychl.h +++ b/src/mame/includes/buggychl.h @@ -13,7 +13,8 @@ public: m_scrollv(*this, "scrollv"), m_scrollh(*this, "scrollh"), m_audiocpu(*this, "audiocpu"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } /* memory pointers */ required_shared_ptr<UINT8> m_charram; @@ -64,4 +65,5 @@ public: void draw_fg( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h index 50f5fb1a24c..8434a93c3c3 100644 --- a/src/mame/includes/champbas.h +++ b/src/mame/includes/champbas.h @@ -17,7 +17,8 @@ public: m_spriteram(*this, "spriteram"), m_spriteram_2(*this, "spriteram_2"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, CPUTAG_MCU){ } /* memory pointers */ required_shared_ptr<UINT8> m_bg_videoram; @@ -35,7 +36,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; UINT8 m_irq_mask; DECLARE_WRITE8_MEMBER(champbas_watchdog_reset_w); diff --git a/src/mame/includes/changela.h b/src/mame/includes/changela.h index 1429707c231..05883ebc4db 100644 --- a/src/mame/includes/changela.h +++ b/src/mame/includes/changela.h @@ -8,6 +8,7 @@ public: m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), + m_mcu(*this, "mcu"), m_maincpu(*this, "maincpu") { } /* memory pointers */ @@ -58,7 +59,7 @@ public: UINT8 m_mcu_pc_0; /* devices */ - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_READ8_MEMBER(mcu_r); DECLARE_WRITE8_MEMBER(mcu_w); DECLARE_READ8_MEMBER(changela_68705_port_a_r); diff --git a/src/mame/includes/cloak.h b/src/mame/includes/cloak.h index 414a2dcc757..0a176133d69 100644 --- a/src/mame/includes/cloak.h +++ b/src/mame/includes/cloak.h @@ -11,7 +11,8 @@ public: : driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_slave(*this, "slave") { } required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_spriteram; @@ -46,4 +47,5 @@ public: void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_slave; }; diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h index 143fdf5e652..d69516d170d 100644 --- a/src/mame/includes/dec0.h +++ b/src/mame/includes/dec0.h @@ -15,7 +15,8 @@ public: m_spritegen(*this, "spritegen"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_mcu(*this, "mcu") { } required_shared_ptr<UINT16> m_ram; required_shared_ptr<UINT16> m_spriteram; @@ -96,6 +97,7 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_subcpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h index ad3619b7778..3278eeaee6f 100644 --- a/src/mame/includes/dec8.h +++ b/src/mame/includes/dec8.h @@ -8,15 +8,16 @@ public: m_maincpu(*this, "maincpu"), m_subcpu(*this, "sub"), m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"), m_spriteram(*this, "spriteram") , m_videoram(*this, "videoram"), - m_bg_data(*this, "bg_data"){ } + m_bg_data(*this, "bg_data") { } /* devices */ required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_subcpu; required_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; required_device<buffered_spriteram8_device> m_spriteram; /* memory pointers */ diff --git a/src/mame/includes/deniam.h b/src/mame/includes/deniam.h index 84e89961a9b..fb23dbb5dad 100644 --- a/src/mame/includes/deniam.h +++ b/src/mame/includes/deniam.h @@ -43,7 +43,6 @@ public: UINT16 m_coinctrl; /* devices */ - device_t *m_audio_cpu; // system 16c does not have sound CPU DECLARE_WRITE16_MEMBER(sound_command_w); DECLARE_WRITE16_MEMBER(deniam_irq_ack_w); DECLARE_WRITE16_MEMBER(deniam_videoram_w); @@ -69,5 +68,5 @@ public: void set_fg_page( int page, int value ); DECLARE_WRITE_LINE_MEMBER(irqhandler); required_device<cpu_device> m_maincpu; - optional_device<cpu_device> m_audiocpu; + optional_device<cpu_device> m_audiocpu; // system 16c does not have sound CPU }; diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h index 3f1a2d468af..03214dc34d1 100644 --- a/src/mame/includes/equites.h +++ b/src/mame/includes/equites.h @@ -15,6 +15,7 @@ public: m_workram(*this, "workram"), m_spriteram_2(*this, "spriteram_2"), m_mcu_ram(*this, "mcu_ram"), + m_mcu(*this, "mcu"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu") { } @@ -56,7 +57,7 @@ public: #endif /* devices */ - device_t *m_mcu; + optional_device<cpu_device> m_mcu; msm5232_device *m_msm; dac_device *m_dac_1; dac_device *m_dac_2; diff --git a/src/mame/includes/esd16.h b/src/mame/includes/esd16.h index 967733c07df..7d7fe9408c2 100644 --- a/src/mame/includes/esd16.h +++ b/src/mame/includes/esd16.h @@ -48,7 +48,6 @@ public: int m_tilemap1_color; /* devices */ - device_t *m_audio_cpu; eeprom_device *m_eeprom; DECLARE_WRITE16_MEMBER(esd16_sound_command_w); DECLARE_WRITE16_MEMBER(hedpanic_platform_w); diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h index 20239604c39..dc47fafafd3 100644 --- a/src/mame/includes/esripsys.h +++ b/src/mame/includes/esripsys.h @@ -35,10 +35,18 @@ class esripsys_state : public driver_device public: esripsys_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_framecpu(*this, "frame_cpu"), m_videocpu(*this, "video_cpu"), + m_gamecpu(*this, "game_cpu"), + m_soundcpu(*this, "sound_cpu"), + m_tms(*this, "tms5220nl"), m_pal_ram(*this, "pal_ram") { } + required_device<cpu_device> m_framecpu; required_device<esrip_device> m_videocpu; + required_device<cpu_device> m_gamecpu; + required_device<cpu_device> m_soundcpu; + required_device<device_t> m_tms; UINT8 m_g_iodata; UINT8 m_g_ioaddr; diff --git a/src/mame/includes/exprraid.h b/src/mame/includes/exprraid.h index fc102ae8d03..f88a5ad5d68 100644 --- a/src/mame/includes/exprraid.h +++ b/src/mame/includes/exprraid.h @@ -14,7 +14,8 @@ public: m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), - m_maincpu(*this, "maincpu"){ } + m_maincpu(*this, "maincpu"), + m_slave(*this, "slave"){ } /* memory pointers */ required_shared_ptr<UINT8> m_main_ram; @@ -32,7 +33,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; - device_t *m_slave; + required_device<cpu_device> m_slave; DECLARE_READ8_MEMBER(exprraid_protection_r); DECLARE_WRITE8_MEMBER(sound_cpu_command_w); DECLARE_READ8_MEMBER(vblank_r); diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h index 699004e1b71..47b551e8ba7 100644 --- a/src/mame/includes/exterm.h +++ b/src/mame/includes/exterm.h @@ -12,7 +12,8 @@ public: m_master_videoram(*this, "master_videoram"), m_slave_videoram(*this, "slave_videoram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_slave(*this, "slave") { } UINT8 m_aimpos[2]; UINT8 m_trackball_old[2]; @@ -41,6 +42,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(master_sound_nmi_callback); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + required_device<cpu_device> m_slave; }; /*----------- defined in video/exterm.c -----------*/ diff --git a/src/mame/includes/fantland.h b/src/mame/includes/fantland.h index e12195d33c4..ae227dc83f9 100644 --- a/src/mame/includes/fantland.h +++ b/src/mame/includes/fantland.h @@ -26,7 +26,6 @@ public: int m_adpcm_nibble[4]; /* devices */ - device_t *m_audio_cpu; device_t *m_msm1; device_t *m_msm2; device_t *m_msm3; diff --git a/src/mame/includes/finalizr.h b/src/mame/includes/finalizr.h index 7ab962e8e39..db5739bc03f 100644 --- a/src/mame/includes/finalizr.h +++ b/src/mame/includes/finalizr.h @@ -40,7 +40,6 @@ public: UINT8 m_irq_enable; /* devices */ - device_t *m_audio_cpu; DECLARE_WRITE8_MEMBER(finalizr_coin_w); DECLARE_WRITE8_MEMBER(finalizr_flipscreen_w); DECLARE_WRITE8_MEMBER(finalizr_i8039_irq_w); diff --git a/src/mame/includes/flstory.h b/src/mame/includes/flstory.h index b6146e2b6d8..d47aaf954f7 100644 --- a/src/mame/includes/flstory.h +++ b/src/mame/includes/flstory.h @@ -9,7 +9,8 @@ public: m_scrlram(*this, "scrlram"), m_workram(*this, "workram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -56,7 +57,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; /* mcu */ UINT8 m_mcu_cmd; diff --git a/src/mame/includes/kingobox.h b/src/mame/includes/kingobox.h index 56938e2344e..3943b4e43bf 100644 --- a/src/mame/includes/kingobox.h +++ b/src/mame/includes/kingobox.h @@ -37,7 +37,6 @@ public: /* devices */ device_t *m_video_cpu; device_t *m_sprite_cpu; - device_t *m_audio_cpu; DECLARE_WRITE8_MEMBER(video_interrupt_w); DECLARE_WRITE8_MEMBER(sprite_interrupt_w); DECLARE_WRITE8_MEMBER(scroll_interrupt_w); diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h index 88be93977c1..e756397abcc 100644 --- a/src/mame/includes/leland.h +++ b/src/mame/includes/leland.h @@ -22,8 +22,13 @@ class leland_state : public driver_device { public: leland_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) { } + : driver_device(mconfig, type, tag), + m_master(*this, "master"), + m_slave(*this, "slave") { } + required_device<cpu_device> m_master; + required_device<cpu_device> m_slave; + UINT8 m_dac_control; UINT8 *m_alleymas_kludge_mem; UINT8 *m_ataxx_qram; diff --git a/src/mame/includes/lkage.h b/src/mame/includes/lkage.h index df272d17488..979d58f38df 100644 --- a/src/mame/includes/lkage.h +++ b/src/mame/includes/lkage.h @@ -9,7 +9,8 @@ public: m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"){ } required_shared_ptr<UINT8> m_vreg; required_shared_ptr<UINT8> m_scroll; @@ -53,7 +54,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_WRITE8_MEMBER(lkage_sound_command_w); DECLARE_WRITE8_MEMBER(lkage_sh_nmi_disable_w); DECLARE_WRITE8_MEMBER(lkage_sh_nmi_enable_w); diff --git a/src/mame/includes/lsasquad.h b/src/mame/includes/lsasquad.h index 48bd3d137c6..e2822813117 100644 --- a/src/mame/includes/lsasquad.h +++ b/src/mame/includes/lsasquad.h @@ -8,7 +8,8 @@ public: m_scrollram(*this, "scrollram"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -37,7 +38,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_WRITE8_MEMBER(lsasquad_bankswitch_w); DECLARE_WRITE8_MEMBER(lsasquad_sh_nmi_disable_w); DECLARE_WRITE8_MEMBER(lsasquad_sh_nmi_enable_w); diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h index abcaf727081..5c72232abe1 100644 --- a/src/mame/includes/m72.h +++ b/src/mame/includes/m72.h @@ -16,7 +16,8 @@ public: m_spriteram2(*this, "spriteram2"), m_soundram(*this, "soundram"), m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu") { } + m_soundcpu(*this, "soundcpu"), + m_mcu(*this, "mcu") { } required_shared_ptr<UINT16> m_spriteram; required_shared_ptr<UINT16> m_videoram1; @@ -136,4 +137,5 @@ public: void install_protection_handler(const UINT8 *code,const UINT8 *crc); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/matmania.h b/src/mame/includes/matmania.h index 5cb80fda280..11a900bf789 100644 --- a/src/mame/includes/matmania.h +++ b/src/mame/includes/matmania.h @@ -15,7 +15,8 @@ public: m_spriteram(*this, "spriteram"), m_paletteram(*this, "paletteram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -52,7 +53,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_WRITE8_MEMBER(matmania_sh_command_w); DECLARE_WRITE8_MEMBER(maniach_sh_command_w); DECLARE_WRITE8_MEMBER(matmania_paletteram_w); diff --git a/src/mame/includes/mexico86.h b/src/mame/includes/mexico86.h index 3ccb597072d..d962578b0e5 100644 --- a/src/mame/includes/mexico86.h +++ b/src/mame/includes/mexico86.h @@ -9,7 +9,8 @@ public: m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub"){ } + m_subcpu(*this, "sub"), + m_mcu(*this, "mcu"){ } /* memory pointers */ required_shared_ptr<UINT8> m_objectram; @@ -38,7 +39,7 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_subcpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; /* queue */ UINT8 m_queue[64]; diff --git a/src/mame/includes/namcond1.h b/src/mame/includes/namcond1.h index 55df8c8a19b..c3952ca9efd 100644 --- a/src/mame/includes/namcond1.h +++ b/src/mame/includes/namcond1.h @@ -12,7 +12,8 @@ public: namcond1_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_shared_ram(*this, "shared_ram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } UINT8 m_h8_irq5_enabled; required_shared_ptr<UINT16> m_shared_ram; @@ -30,4 +31,5 @@ public: virtual void machine_reset(); INTERRUPT_GEN_MEMBER(mcu_interrupt); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h index d9a54bd63fe..0ce13a74681 100644 --- a/src/mame/includes/namcos1.h +++ b/src/mame/includes/namcos1.h @@ -16,7 +16,8 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_mcu(*this, "mcu") { } int m_dac0_value; int m_dac1_value; @@ -101,6 +102,7 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_subcpu; + required_device<cpu_device> m_mcu; }; /*----------- defined in drivers/namcos1.c -----------*/ diff --git a/src/mame/includes/namcos2.h b/src/mame/includes/namcos2.h index 5c8d0e210f7..a886df633a0 100644 --- a/src/mame/includes/namcos2.h +++ b/src/mame/includes/namcos2.h @@ -103,7 +103,9 @@ public: m_c355_obj_gfxbank(0), m_c355_obj_palxor(0), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_slave(*this, "slave"), + m_mcu(*this, "mcu") { } optional_device<m37450_device> m_c68; @@ -211,6 +213,8 @@ public: DECLARE_READ16_MEMBER( namcos21_68k_gpu_C148_r ); required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_audiocpu; + optional_device<cpu_device> m_slave; + optional_device<cpu_device> m_mcu; }; class namcos2_state : public namcos2_shared_state diff --git a/src/mame/includes/nycaptor.h b/src/mame/includes/nycaptor.h index 5b11ab3f9a3..7bd21ef1080 100644 --- a/src/mame/includes/nycaptor.h +++ b/src/mame/includes/nycaptor.h @@ -9,7 +9,8 @@ public: m_sharedram(*this, "sharedram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub"){ } + m_subcpu(*this, "sub"), + m_mcu(*this, "mcu"){ } /* memory pointers */ required_shared_ptr<UINT8> m_videoram; @@ -52,7 +53,7 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_subcpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_WRITE8_MEMBER(sub_cpu_halt_w); DECLARE_READ8_MEMBER(from_snd_r); DECLARE_WRITE8_MEMBER(to_main_w); diff --git a/src/mame/includes/pacland.h b/src/mame/includes/pacland.h index 96cbd9b6c2c..4443c0eb2fd 100644 --- a/src/mame/includes/pacland.h +++ b/src/mame/includes/pacland.h @@ -6,7 +6,8 @@ public: m_videoram(*this, "videoram"), m_videoram2(*this, "videoram2"), m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_videoram2; @@ -45,4 +46,5 @@ public: void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int whichmask); void draw_fg(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/pitnrun.h b/src/mame/includes/pitnrun.h index 304c99937af..ed0e88f713a 100644 --- a/src/mame/includes/pitnrun.h +++ b/src/mame/includes/pitnrun.h @@ -6,7 +6,8 @@ public: m_videoram(*this, "videoram"), m_videoram2(*this, "videoram2"), m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } required_shared_ptr<UINT8> m_videoram; int m_nmi; @@ -61,4 +62,5 @@ public: void pitnrun_spotlights(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/pushman.h b/src/mame/includes/pushman.h index 9e4cec30740..5403e111404 100644 --- a/src/mame/includes/pushman.h +++ b/src/mame/includes/pushman.h @@ -12,7 +12,8 @@ public: m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu"){ } /* memory pointers */ required_shared_ptr<UINT16> m_spriteram; @@ -32,7 +33,7 @@ public: /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_WRITE16_MEMBER(pushman_flipscreen_w); DECLARE_WRITE16_MEMBER(pushman_control_w); DECLARE_READ16_MEMBER(pushman_68705_r); diff --git a/src/mame/includes/qix.h b/src/mame/includes/qix.h index a99a5b5a72d..1c038af836b 100644 --- a/src/mame/includes/qix.h +++ b/src/mame/includes/qix.h @@ -29,6 +29,7 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_videocpu(*this, "videocpu"), + m_mcu(*this, "mcu"), m_pia0(*this, "pia0"), m_pia1(*this, "pia1"), m_pia2(*this, "pia2"), @@ -50,6 +51,7 @@ public: required_device<m6809_device> m_maincpu; optional_device<cpu_device> m_audiocpu; required_device<m6809_device> m_videocpu; + optional_device<cpu_device> m_mcu; required_device<pia6821_device> m_pia0; required_device<pia6821_device> m_pia1; required_device<pia6821_device> m_pia2; diff --git a/src/mame/includes/renegade.h b/src/mame/includes/renegade.h index aa409771ac0..62a18e5d6b7 100644 --- a/src/mame/includes/renegade.h +++ b/src/mame/includes/renegade.h @@ -9,7 +9,8 @@ public: m_videoram2(*this, "videoram2"), m_spriteram(*this, "spriteram"), m_maincpu(*this,"maincpu"), - m_audiocpu(*this, "audiocpu"){ } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu") { } UINT8 m_bank; int m_mcu_sim; @@ -78,4 +79,5 @@ public: void setbank(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device<cpu_device> m_audiocpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/seicross.h b/src/mame/includes/seicross.h index 137d0f76823..2960997b047 100644 --- a/src/mame/includes/seicross.h +++ b/src/mame/includes/seicross.h @@ -9,7 +9,8 @@ public: m_spriteram2(*this, "spriteram2"), m_colorram(*this, "colorram"), m_nvram(*this, "nvram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_videoram; @@ -34,4 +35,5 @@ public: INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/skykid.h b/src/mame/includes/skykid.h index bc36c6b35a2..eefc00aa3c3 100644 --- a/src/mame/includes/skykid.h +++ b/src/mame/includes/skykid.h @@ -6,7 +6,8 @@ public: m_videoram(*this, "videoram"), m_textram(*this, "textram"), m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu") { } + m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu") { } UINT8 m_inputport_selected; required_shared_ptr<UINT8> m_videoram; @@ -46,4 +47,5 @@ public: INTERRUPT_GEN_MEMBER(mcu_vblank_irq); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h index e23bb1755e6..55fc5612ba7 100644 --- a/src/mame/includes/slapfght.h +++ b/src/mame/includes/slapfght.h @@ -26,7 +26,8 @@ public: m_slapfight_scrolly(*this, "scrolly"), m_spriteram(*this, "spriteram") , m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu") { } int m_getstar_id; required_shared_ptr<UINT8> m_slapfight_videoram; @@ -134,6 +135,7 @@ public: void getstar_init( ); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/superqix.h b/src/mame/includes/superqix.h index 2e6f35209af..7c63c460918 100644 --- a/src/mame/includes/superqix.h +++ b/src/mame/includes/superqix.h @@ -4,12 +4,14 @@ public: superqix_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this,"maincpu"), + m_mcu(*this,"mcu"), m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_bitmapram(*this, "bitmapram"), m_bitmapram2(*this, "bitmapram2"){ } required_device<cpu_device> m_maincpu; + optional_device<cpu_device> m_mcu; required_shared_ptr<UINT8> m_spriteram; required_shared_ptr<UINT8> m_videoram; optional_shared_ptr<UINT8> m_bitmapram; diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h index 799fb40f0ff..e4ede2dff2a 100644 --- a/src/mame/includes/system1.h +++ b/src/mame/includes/system1.h @@ -11,7 +11,8 @@ public: m_nob_mcu_latch(*this, "nob_mcu_latch"), m_nob_mcu_status(*this, "nob_mcu_status"), m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu") { } + m_soundcpu(*this, "soundcpu"), + m_mcu(*this, "mcu") { } optional_device<i8255_device> m_ppi8255; required_shared_ptr<UINT8> m_ram; @@ -124,4 +125,5 @@ public: void dakkochn_custom_w(UINT8 data, UINT8 prevdata); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h index 938f5029e91..68e262c490b 100644 --- a/src/mame/includes/taitosj.h +++ b/src/mame/includes/taitosj.h @@ -18,7 +18,8 @@ public: m_collision_reg(*this, "collision_reg"), m_kikstart_scrollram(*this, "kikstart_scroll"), m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu") { } + m_audiocpu(*this, "audiocpu"), + m_mcu(*this, "mcu") { } typedef void (taitosj_state::*copy_layer_func_t)(bitmap_ind16 &, const rectangle &, int, int *, rectangle *); @@ -118,4 +119,5 @@ public: int video_update_common(bitmap_ind16 &bitmap, const rectangle &cliprect, copy_layer_func_t copy_layer_func); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h index 3887b3f4de9..5da8d39a07e 100644 --- a/src/mame/includes/tnzs.h +++ b/src/mame/includes/tnzs.h @@ -21,7 +21,8 @@ public: tnzs_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") , + m_subcpu(*this, "sub"), + m_mcu(*this, "mcu"), m_maincpu(*this, "maincpu") { } /* memory pointers */ @@ -57,7 +58,7 @@ public: /* devices */ optional_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_subcpu; - device_t *m_mcu; + optional_device<cpu_device> m_mcu; DECLARE_WRITE8_MEMBER(tnzsb_sound_command_w); DECLARE_WRITE8_MEMBER(jpopnics_palette_w); DECLARE_WRITE8_MEMBER(jpopnics_subbankswitch_w); diff --git a/src/mame/includes/tubep.h b/src/mame/includes/tubep.h index 4be9f1d246c..cf81ccf3681 100644 --- a/src/mame/includes/tubep.h +++ b/src/mame/includes/tubep.h @@ -8,7 +8,9 @@ public: m_sprite_colorsharedram(*this, "sprite_color"), m_rjammer_backgroundram(*this, "rjammer_bgram"), m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu") { } + m_soundcpu(*this, "soundcpu"), + m_slave(*this, "slave"), + m_mcu(*this, "mcu") { } UINT8 m_sound_latch; UINT8 m_ls74; @@ -89,6 +91,8 @@ public: DECLARE_WRITE_LINE_MEMBER(rjammer_adpcm_vck); required_device<cpu_device> m_maincpu; required_device<cpu_device> m_soundcpu; + required_device<cpu_device> m_slave; + required_device<cpu_device> m_mcu; }; diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h index 1601e8e4741..bb9622501b8 100644 --- a/src/mame/includes/tx1.h +++ b/src/mame/includes/tx1.h @@ -107,7 +107,10 @@ public: m_math_ram(*this, "math_ram"), m_vram(*this, "vram"), m_objram(*this, "objram"), - m_rcram(*this, "rcram") { } + m_rcram(*this, "rcram"), + m_maincpu(*this, "main_cpu"), + m_mathcpu(*this, "math_cpu"), + m_audiocpu(*this, "audio_cpu") { } math_t m_math; sn74s516_t m_sn74s516; @@ -179,6 +182,9 @@ public: void screen_eof_buggyboy(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(z80_irq); TIMER_CALLBACK_MEMBER(interrupt_callback); + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_mathcpu; + required_device<cpu_device> m_audiocpu; }; /*----------- defined in audio/tx1.c -----------*/ diff --git a/src/mame/includes/xain.h b/src/mame/includes/xain.h index db11309e8cb..ac572368222 100644 --- a/src/mame/includes/xain.h +++ b/src/mame/includes/xain.h @@ -9,7 +9,8 @@ public: m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub") { } + m_subcpu(*this, "sub"), + m_mcu(*this, "mcu") { } int m_vblank; int m_from_main; @@ -79,4 +80,5 @@ public: required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_subcpu; + optional_device<cpu_device> m_mcu; }; diff --git a/src/mame/machine/bigevglf.c b/src/mame/machine/bigevglf.c index 1f025b61294..b0aafa15094 100644 --- a/src/mame/machine/bigevglf.c +++ b/src/mame/machine/bigevglf.c @@ -35,7 +35,7 @@ WRITE8_MEMBER(bigevglf_state::bigevglf_68705_port_b_w) { if ((m_ddr_b & 0x02) && (~m_port_b_out & 0x02) && (data & 0x02)) /* positive going transition of the clock */ { - m_mcu->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; } @@ -78,7 +78,7 @@ WRITE8_MEMBER(bigevglf_state::bigevglf_mcu_w) { m_port_a_in = data; m_main_sent = 1; - m_mcu->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index c6d9ab97b77..dac3ec9aca8 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -20,11 +20,11 @@ WRITE8_MEMBER(bublbobl_state::bublbobl_bankswitch_w) /* bit 3 n.c. */ /* bit 4 resets second Z80 */ - m_slave->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); + m_slave->set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); /* bit 5 resets mcu */ if (m_mcu != NULL) // only if we have a MCU - m_mcu->execute().set_input_line(INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); /* bit 6 enables display */ m_video_enable = data & 0x40; @@ -51,7 +51,7 @@ WRITE8_MEMBER(bublbobl_state::tokio_videoctrl_w) WRITE8_MEMBER(bublbobl_state::bublbobl_nmitrigger_w) { - m_slave->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); + m_slave->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -362,7 +362,7 @@ READ8_MEMBER(bublbobl_state::boblbobl_ic43_b_r) ***************************************************************************/ TIMER_CALLBACK_MEMBER(bublbobl_state::bublbobl_m68705_irq_ack) { - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); } INTERRUPT_GEN_MEMBER(bublbobl_state::bublbobl_m68705_interrupt) diff --git a/src/mame/machine/dec0.c b/src/mame/machine/dec0.c index 376bed2ca58..746b7fc0203 100644 --- a/src/mame/machine/dec0.c +++ b/src/mame/machine/dec0.c @@ -193,7 +193,7 @@ WRITE8_MEMBER(dec0_state::dec0_mcu_port_w) if ((data&0x4)==0) m_maincpu->set_input_line(5, HOLD_LINE); if ((data&0x8)==0) - machine().device("mcu")->execute().set_input_line(MCS51_INT1_LINE, CLEAR_LINE); + m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE); if ((data&0x40)==0) m_i8751_return=(m_i8751_return&0xff00)|(m_i8751_ports[0]); if ((data&0x80)==0) @@ -304,7 +304,7 @@ void dec0_state::dec0_i8751_write(int data) m_i8751_command=data; /* Writes to this address cause an IRQ to the i8751 microcontroller */ - if (m_GAME == 1) machine().device("mcu")->execute().set_input_line(MCS51_INT1_LINE, ASSERT_LINE); + if (m_GAME == 1) m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE); if (m_GAME == 2) baddudes_i8751_write(data); if (m_GAME == 3) birdtry_i8751_write(data); diff --git a/src/mame/machine/flstory.c b/src/mame/machine/flstory.c index ec092494c2e..41e3b36491f 100644 --- a/src/mame/machine/flstory.c +++ b/src/mame/machine/flstory.c @@ -61,7 +61,7 @@ WRITE8_MEMBER(flstory_state::flstory_68705_port_b_w) { m_port_a_in = m_from_main; if (m_main_sent) - m_mcu->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; logerror("read command %02x from main cpu\n", m_port_a_in); } @@ -110,7 +110,7 @@ WRITE8_MEMBER(flstory_state::flstory_mcu_w) logerror("%04x: mcu_w %02x\n", space.device().safe_pc(), data); m_from_main = data; m_main_sent = 1; - m_mcu->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } READ8_MEMBER(flstory_state::flstory_mcu_r) diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c index 1775e84bc4e..0b82d82ca80 100644 --- a/src/mame/machine/leland.c +++ b/src/mame/machine/leland.c @@ -420,7 +420,7 @@ TIMER_CALLBACK_MEMBER(leland_state::leland_interrupt_callback) /* interrupts generated on the VA10 line, which is every */ /* 16 scanlines starting with scanline #8 */ - machine().device("master")->execute().set_input_line(0, HOLD_LINE); + m_master->set_input_line(0, HOLD_LINE); /* set a timer for the next one */ scanline += 16; @@ -435,7 +435,7 @@ TIMER_CALLBACK_MEMBER(leland_state::ataxx_interrupt_callback) int scanline = param; /* interrupts generated according to the interrupt control register */ - machine().device("master")->execute().set_input_line(0, HOLD_LINE); + m_master->set_input_line(0, HOLD_LINE); /* set a timer for the next one */ m_master_int_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); @@ -1080,13 +1080,13 @@ READ8_MEMBER(leland_state::leland_master_input_r) case 0x01: /* /GIN1 */ result = ioport("IN1")->read(); - if (machine().device("slave")->state().state_int(Z80_HALT)) + if (m_slave->state_int(Z80_HALT)) result ^= 0x01; break; case 0x02: /* /GIN2 */ case 0x12: - machine().device("master")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + m_master->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); break; case 0x03: /* /IGID */ @@ -1118,10 +1118,10 @@ WRITE8_MEMBER(leland_state::leland_master_output_w) switch (offset) { case 0x09: /* /MCONT */ - machine().device("slave")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); + m_slave->set_input_line(INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); m_wcol_enable = (data & 0x02); - machine().device("slave")->execute().set_input_line(INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); - machine().device("slave")->execute().set_input_line(0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); + m_slave->set_input_line(INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); + m_slave->set_input_line(0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); eeprom = machine().device<eeprom_device>("eeprom"); if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", space.device().safe_pc(), @@ -1162,7 +1162,7 @@ READ8_MEMBER(leland_state::ataxx_master_input_r) case 0x07: /* /SLVBLK */ result = ioport("IN1")->read(); - if (machine().device("slave")->state().state_int(Z80_HALT)) + if (m_slave->state_int(Z80_HALT)) result ^= 0x01; break; @@ -1194,9 +1194,9 @@ WRITE8_MEMBER(leland_state::ataxx_master_output_w) break; case 0x05: /* /SLV0 */ - machine().device("slave")->execute().set_input_line(0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); - machine().device("slave")->execute().set_input_line(INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); - machine().device("slave")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); + m_slave->set_input_line(0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); + m_slave->set_input_line(INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); + m_slave->set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); break; case 0x08: /* */ diff --git a/src/mame/machine/lkage.c b/src/mame/machine/lkage.c index 37761cbbb61..28a8193b274 100644 --- a/src/mame/machine/lkage.c +++ b/src/mame/machine/lkage.c @@ -61,7 +61,7 @@ WRITE8_MEMBER(lkage_state::lkage_68705_port_b_w) { m_port_a_in = m_from_main; if (m_main_sent) - m_mcu->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; logerror("read command %02x from main cpu\n", m_port_a_in); @@ -113,7 +113,7 @@ WRITE8_MEMBER(lkage_state::lkage_mcu_w) logerror("%04x: mcu_w %02x\n", space.device().safe_pc(), data); m_from_main = data; m_main_sent = 1; - m_mcu->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } READ8_MEMBER(lkage_state::lkage_mcu_r) diff --git a/src/mame/machine/lsasquad.c b/src/mame/machine/lsasquad.c index 6a03fc1ce75..e8406d6edf8 100644 --- a/src/mame/machine/lsasquad.c +++ b/src/mame/machine/lsasquad.c @@ -134,7 +134,7 @@ WRITE8_MEMBER(lsasquad_state::lsasquad_68705_port_b_w) { m_port_a_in = m_from_main; if (m_main_sent) - m_mcu->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; //logerror("read command %02x from main cpu\n", m_port_a_in); } @@ -159,7 +159,7 @@ WRITE8_MEMBER(lsasquad_state::lsasquad_mcu_w) //logerror("%04x: mcu_w %02x\n", space.device().safe_pc(), data); m_from_main = data; m_main_sent = 1; - m_mcu->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } READ8_MEMBER(lsasquad_state::lsasquad_mcu_r) diff --git a/src/mame/machine/mexico86.c b/src/mame/machine/mexico86.c index cc555cdfa69..1166744e2fa 100644 --- a/src/mame/machine/mexico86.c +++ b/src/mame/machine/mexico86.c @@ -19,7 +19,7 @@ WRITE8_MEMBER(mexico86_state::mexico86_f008_w) if (m_mcu != NULL) { // mexico 86, knight boy - m_mcu->execute().set_input_line(INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); } else { @@ -299,7 +299,7 @@ WRITE8_MEMBER(mexico86_state::mexico86_68705_port_b_w) { m_maincpu->set_input_line_vector(0, m_protection_ram[0]); m_maincpu->set_input_line(0, HOLD_LINE); // HOLD_LINE works better in Z80 interrupt mode 1. - m_mcu->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); } if (BIT(m_ddr_b, 6) && BIT(~data, 6) && BIT(m_port_b_out, 6)) diff --git a/src/mame/machine/namcond1.c b/src/mame/machine/namcond1.c index 5268329390f..7fc81979383 100644 --- a/src/mame/machine/namcond1.c +++ b/src/mame/machine/namcond1.c @@ -46,7 +46,7 @@ void namcond1_state::machine_reset() m_h8_irq5_enabled = 0; // halt the MCU - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } // instance of the shared ram pointer @@ -93,7 +93,7 @@ WRITE16_MEMBER(namcond1_state::namcond1_cuskey_w) // this is a kludge until we emulate the h8 if ((m_h8_irq5_enabled == 0) && (data != 0x0000)) { - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); } m_h8_irq5_enabled = ( data != 0x0000 ); break; diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c index 34e633c507d..03f6ccc971c 100644 --- a/src/mame/machine/namcos1.c +++ b/src/mame/machine/namcos1.c @@ -580,7 +580,7 @@ WRITE8_MEMBER(namcos1_state::namcos1_cpu_control_w) m_subcpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); } @@ -874,7 +874,7 @@ void namcos1_state::machine_reset() m_maincpu->reset(); m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - machine().device("mcu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); /* mcu patch data clear */ m_mcu_patch_data = 0; @@ -1216,7 +1216,7 @@ DRIVER_INIT_MEMBER(namcos1_state,tankfrc4) }; namcos1_driver_init(machine(), &tankfrce_specific); - machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r)); + m_mcu->space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r)); } /******************************************************************************* @@ -1307,7 +1307,7 @@ static READ8_HANDLER( quester_paddle_r ) DRIVER_INIT_MEMBER(namcos1_state,quester) { namcos1_driver_init(machine(), NULL); - machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(quester_paddle_r)); + m_mcu->space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(quester_paddle_r)); } @@ -1396,7 +1396,7 @@ static READ8_HANDLER( berabohm_buttons_r ) DRIVER_INIT_MEMBER(namcos1_state,berabohm) { namcos1_driver_init(machine(), NULL); - machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(berabohm_buttons_r)); + m_mcu->space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(berabohm_buttons_r)); } @@ -1466,5 +1466,5 @@ static READ8_HANDLER( faceoff_inputs_r ) DRIVER_INIT_MEMBER(namcos1_state,faceoff) { namcos1_driver_init(machine(), NULL); - machine().device("mcu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r)); + m_mcu->space(AS_PROGRAM).install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r)); } diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c index ba7e58fd7f4..0bc187439ae 100644 --- a/src/mame/machine/namcos2.c +++ b/src/mame/machine/namcos2.c @@ -673,7 +673,7 @@ TIMER_CALLBACK_MEMBER(namcos2_shared_state::namcos2_posirq_tick) if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]|namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) { machine().primary_screen->update_partial(param); if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]) m_maincpu->set_input_line(namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); - if (namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) machine().device("slave")->execute().set_input_line(namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); + if (namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) m_slave->set_input_line(namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); } } @@ -776,7 +776,7 @@ WRITE8_MEMBER( namcos2_shared_state::namcos2_mcu_analog_ctrl_w ) /* If the interrupt enable bit is set trigger an A/D IRQ */ if(data & 0x20) { - generic_pulse_irq_line(machine().device("mcu")->execute(), HD63705_INT_ADCONV, 1); + generic_pulse_irq_line(m_mcu, HD63705_INT_ADCONV, 1); } } } diff --git a/src/mame/machine/nycaptor.c b/src/mame/machine/nycaptor.c index 191d964fb05..bcf14b7c5ac 100644 --- a/src/mame/machine/nycaptor.c +++ b/src/mame/machine/nycaptor.c @@ -46,7 +46,7 @@ WRITE8_MEMBER(nycaptor_state::nycaptor_68705_port_b_w) m_port_a_in = m_from_main; if (m_main_sent) - m_mcu->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; } @@ -92,7 +92,7 @@ WRITE8_MEMBER(nycaptor_state::nycaptor_mcu_w) { m_from_main = data; m_main_sent = 1; - m_mcu->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } READ8_MEMBER(nycaptor_state::nycaptor_mcu_r) diff --git a/src/mame/machine/pitnrun.c b/src/mame/machine/pitnrun.c index bab891ce555..da7d8353194 100644 --- a/src/mame/machine/pitnrun.c +++ b/src/mame/machine/pitnrun.c @@ -16,7 +16,7 @@ void pitnrun_state::machine_reset() { m_zaccept = 1; m_zready = 0; - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); } TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_real_data_r) @@ -33,7 +33,7 @@ READ8_MEMBER(pitnrun_state::pitnrun_mcu_data_r) TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_real_data_w) { m_zready = 1; - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); m_fromz80 = param; } @@ -106,7 +106,7 @@ WRITE8_MEMBER(pitnrun_state::pitnrun_68705_portB_w) { /* 68705 is going to read data from the Z80 */ machine().scheduler().synchronize(timer_expired_delegate(FUNC(pitnrun_state::pitnrun_mcu_data_real_r),this)); - machine().device("mcu")->execute().set_input_line(0,CLEAR_LINE); + m_mcu->set_input_line(0,CLEAR_LINE); m_portA_in = m_fromz80; } if (~data & 0x04) diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c index 74004dc3daf..8e4b90fefd8 100644 --- a/src/mame/machine/qix.c +++ b/src/mame/machine/qix.c @@ -339,13 +339,13 @@ WRITE8_MEMBER(qix_state::qixmcu_coinctrl_w) /* if (!(data & 0x04)) */ if (data & 0x04) { - machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, ASSERT_LINE); + m_mcu->set_input_line(M68705_IRQ_LINE, ASSERT_LINE); /* temporarily boost the interleave to sync things up */ /* note: I'm using 50 because 30 is not enough for space dungeon at game over */ machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); } else - machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, CLEAR_LINE); + m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE); /* this is a callback called by pia6821_device::write(), so I don't need to synchronize */ /* the CPUs - they have already been synchronized by qix_pia_w() */ diff --git a/src/mame/machine/slapfght.c b/src/mame/machine/slapfght.c index d5fded1eb7a..d9dc9513ad8 100644 --- a/src/mame/machine/slapfght.c +++ b/src/mame/machine/slapfght.c @@ -115,7 +115,7 @@ WRITE8_MEMBER(slapfght_state::slapfight_68705_portB_w) m_portA_in = m_from_main; if (m_main_sent) - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; } @@ -167,7 +167,7 @@ WRITE8_MEMBER(slapfght_state::slapfight_mcu_w) { m_from_main = data; m_main_sent = 1; - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } READ8_MEMBER(slapfght_state::slapfight_mcu_r) @@ -806,7 +806,7 @@ WRITE8_MEMBER(slapfght_state::tigerh_68705_portB_w) if ((m_ddrB & 0x02) && (~data & 0x02) && (m_portB_out & 0x02)) { m_portA_in = m_from_main; - if (m_main_sent) machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + if (m_main_sent) m_mcu->set_input_line(0, CLEAR_LINE); m_main_sent = 0; } if ((m_ddrB & 0x04) && (data & 0x04) && (~m_portB_out & 0x04)) @@ -847,7 +847,7 @@ WRITE8_MEMBER(slapfght_state::tigerh_mcu_w) m_from_main = data; m_main_sent = 1; m_mcu_sent = 0; - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } READ8_MEMBER(slapfght_state::tigerh_mcu_r) diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c index edd94898dcb..1004f310ff8 100644 --- a/src/mame/machine/taitosj.c +++ b/src/mame/machine/taitosj.c @@ -46,7 +46,7 @@ void taitosj_state::machine_reset() m_zready = 0; m_busreq = 0; if (machine().device("mcu") != NULL) - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_spacecr_prot_value = 0; } @@ -105,7 +105,7 @@ READ8_MEMBER(taitosj_state::taitosj_mcu_data_r) TIMER_CALLBACK_MEMBER(taitosj_state::taitosj_mcu_real_data_w) { m_zready = 1; - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); m_fromz80 = param; } @@ -191,7 +191,7 @@ WRITE8_MEMBER(taitosj_state::taitosj_68705_portB_w) { /* 68705 is going to read data from the Z80 */ machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::taitosj_mcu_data_real_r),this)); - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); m_portA_in = m_fromz80; LOG(("%04x: 68705 <- Z80 %02x\n", space.device().safe_pc(), m_portA_in)); } diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c index de2e3fb6d61..03d50612643 100644 --- a/src/mame/machine/tnzs.c +++ b/src/mame/machine/tnzs.c @@ -677,8 +677,6 @@ MACHINE_START_MEMBER(tnzs_state,jpopnics) membank("subbank")->configure_entries(0, 4, &SUB[0x08000], 0x2000); membank("subbank")->set_entry(m_bank2); - m_mcu = NULL; - m_bank1 = 2; m_bank2 = 0; @@ -694,8 +692,6 @@ MACHINE_START_MEMBER(tnzs_state,tnzs) { MACHINE_START_CALL_MEMBER( jpopnics ); - m_mcu = machine().device("mcu"); - save_item(NAME(m_kageki_csport_sel)); save_item(NAME(m_input_select)); save_item(NAME(m_mcu_readcredits)); @@ -738,7 +734,7 @@ WRITE8_MEMBER(tnzs_state::tnzs_bankswitch1_w) if (data & 0x04) { if (m_mcu != NULL && m_mcu->type() == I8742) - m_mcu->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, PULSE_LINE); } /* Coin count and lockout is handled by the i8742 */ break; diff --git a/src/mame/video/arkanoid.c b/src/mame/video/arkanoid.c index 14eabc4403d..01dfee54f50 100644 --- a/src/mame/video/arkanoid.c +++ b/src/mame/video/arkanoid.c @@ -67,7 +67,7 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_d008_w) which resets itself). This bit is the likely candidate as it is flipped early in bootup just prior to accessing the MCU for the first time. */ if (m_mcu != NULL) // Bootlegs don't have the MCU but still set this bit - m_mcu->execute().set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); + m_mcu->set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c index 7c59b605b06..fe43784cf14 100644 --- a/src/mame/video/leland.c +++ b/src/mame/video/leland.c @@ -285,7 +285,7 @@ WRITE8_MEMBER(leland_state::leland_master_video_addr_w) TIMER_CALLBACK_MEMBER(leland_state::leland_delayed_mvram_w) { - address_space &space = machine().device("master")->memory().space(AS_PROGRAM); + address_space &space = m_master->space(AS_PROGRAM); int num = (param >> 16) & 1; int offset = (param >> 8) & 0xff; diff --git a/src/mame/video/tubep.c b/src/mame/video/tubep.c index 81bc799e231..f24d237f491 100644 --- a/src/mame/video/tubep.c +++ b/src/mame/video/tubep.c @@ -425,7 +425,7 @@ WRITE8_MEMBER(tubep_state::tubep_background_c000_w) TIMER_CALLBACK_MEMBER(tubep_state::sprite_timer_callback) { - machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); + m_mcu->set_input_line(0, ASSERT_LINE); } @@ -554,7 +554,7 @@ WRITE8_MEMBER(tubep_state::tubep_sprite_control_w) /SINT line will be reasserted in m_XSize * m_YSize cycles (RH0 signal cycles) */ /* 1.clear the /SINT interrupt line */ - machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); + m_mcu->set_input_line(0, CLEAR_LINE); /* 2.assert /SINT again after this time */ machine().scheduler().timer_set( attotime::from_hz(19968000/8) * ((m_XSize+1)*(m_YSize+1)), timer_expired_delegate(FUNC(tubep_state::sprite_timer_callback),this)); diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c index 2e3bad2e9d4..1180f840fad 100644 --- a/src/mame/video/tx1.c +++ b/src/mame/video/tx1.c @@ -33,7 +33,7 @@ */ TIMER_CALLBACK_MEMBER(tx1_state::interrupt_callback) { - machine().device("main_cpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); } @@ -2893,7 +2893,7 @@ WRITE16_MEMBER(tx1_state::buggyboy_gas_w) } case 0xe0: { - machine().device("math_cpu")->execute().set_input_line(INPUT_LINE_TEST, CLEAR_LINE); + m_mathcpu->set_input_line(INPUT_LINE_TEST, CLEAR_LINE); vregs.flags = data; break; } |