diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp index 109f8606bb1..240133d0879 100644 --- a/src/mame/drivers/ibmpcjr.cpp +++ b/src/mame/drivers/ibmpcjr.cpp @@ -628,7 +628,7 @@ MACHINE_CONFIG_START(pcjr_state::ibmpcjr) MCFG_RS232_CTS_HANDLER(WRITELINE("ins8250", ins8250_uart_device, cts_w)) /* video hardware */ - MCFG_PCVIDEO_PCJR_ADD("pcvideo_pcjr") + MCFG_DEVICE_ADD("pcvideo_pcjr", PCVIDEO_PCJR, 0) MCFG_VIDEO_SET_SCREEN("pcvideo_pcjr:screen") MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "pcvideo_pcjr:palette", gfx_pcjr) diff --git a/src/mame/drivers/mz700.cpp b/src/mame/drivers/mz700.cpp index aa49256728b..55ccf7ffe34 100644 --- a/src/mame/drivers/mz700.cpp +++ b/src/mame/drivers/mz700.cpp @@ -83,7 +83,6 @@ #include "includes/mz700.h" #include "cpu/z80/z80.h" -#include "machine/74145.h" #include "sound/sn76496.h" #include "sound/wave.h" @@ -99,7 +98,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mz_state::ne556_cursor_callback) { - m_cursor_timer ^= 1; + m_cursor_bit ^= 1; } TIMER_DEVICE_CALLBACK_MEMBER(mz_state::ne556_other_callback) diff --git a/src/mame/drivers/tandy1t.cpp b/src/mame/drivers/tandy1t.cpp index d9bf6c9bf88..6ae120166e9 100644 --- a/src/mame/drivers/tandy1t.cpp +++ b/src/mame/drivers/tandy1t.cpp @@ -651,7 +651,7 @@ MACHINE_CONFIG_START(tandy1000_state::tandy1000_common) downcast(*device).set_cputag("maincpu"); /* video hardware */ - MCFG_PCVIDEO_T1000_ADD("pcvideo_t1000") + MCFG_DEVICE_ADD("pcvideo_t1000", PCVIDEO_T1000, 0) MCFG_VIDEO_SET_SCREEN("pcvideo_t1000:screen") MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "pcvideo_t1000:palette", gfx_t1000) diff --git a/src/mame/drivers/toaplan1.cpp b/src/mame/drivers/toaplan1.cpp index 6cde6c5486b..26c29eb323e 100644 --- a/src/mame/drivers/toaplan1.cpp +++ b/src/mame/drivers/toaplan1.cpp @@ -613,7 +613,6 @@ Stephh's and AWJ's notes (based on the games M68000 and Z80 code and some tests) #include "cpu/z80/z80.h" #include "cpu/z180/z180.h" #include "machine/74259.h" -#include "sound/3812intf.h" #include "speaker.h" diff --git a/src/mame/includes/mz700.h b/src/mame/includes/mz700.h index fb499e9d70e..348499a7506 100644 --- a/src/mame/includes/mz700.h +++ b/src/mame/includes/mz700.h @@ -13,6 +13,7 @@ #include "bus/centronics/ctronics.h" #include "imagedev/cassette.h" #include "machine/bankdev.h" +#include "machine/74145.h" #include "machine/i8255.h" #include "machine/pit8253.h" #include "machine/ram.h" @@ -37,6 +38,8 @@ public: , m_screen(*this, "screen") , m_banke(*this, "banke") , m_bankf(*this, "bankf") + , m_ls145(*this, "ls145") + , m_cursor_timer(*this, "cursor") { } DECLARE_READ8_MEMBER(mz700_e008_r); @@ -90,10 +93,11 @@ public: void mz800_bankf(address_map &map); void mz800_io(address_map &map); void mz800_mem(address_map &map); + private: int m_mz700; /* 1 if running on an mz700 */ - int m_cursor_timer; + int m_cursor_bit; int m_other_timer; int m_intmsk; /* PPI8255 pin PC2 */ @@ -134,6 +138,9 @@ private: required_device m_screen; optional_device m_banke; optional_device m_bankf; + + required_device m_ls145; + required_device m_cursor_timer; }; #endif // MAME_INCLUDES_MZ700_H diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h index a2d8ffa8ceb..1351db0e469 100644 --- a/src/mame/includes/n64.h +++ b/src/mame/includes/n64.h @@ -12,6 +12,7 @@ /*----------- driver state -----------*/ class n64_rdp; +class n64_periphs; class n64_state : public driver_device { @@ -24,6 +25,7 @@ public: , m_rdram(*this, "rdram") , m_rsp_imem(*this, "rsp_imem") , m_rsp_dmem(*this, "rsp_dmem") + , m_rcp_periphs(*this, "rcp") { } @@ -51,6 +53,8 @@ protected: required_shared_ptr m_rsp_imem; required_shared_ptr m_rsp_dmem; + required_device m_rcp_periphs; + /* video-related */ n64_rdp *m_rdp; }; diff --git a/src/mame/includes/primo.h b/src/mame/includes/primo.h index bc524e1406f..35aa9c55923 100644 --- a/src/mame/includes/primo.h +++ b/src/mame/includes/primo.h @@ -31,7 +31,9 @@ public: m_cassette(*this, "cassette"), m_cart1(*this, "cartslot1"), m_cart2(*this, "cartslot2"), - m_screen(*this, "screen") + m_screen(*this, "screen"), + m_mem_exp_port(*this, "MEMORY_EXPANSION"), + m_clock_port(*this, "CPU_CLOCK") { } void init_primo48(); @@ -80,6 +82,8 @@ private: required_device m_cart1; required_device m_cart2; required_device m_screen; + required_ioport m_mem_exp_port; + required_ioport m_clock_port; memory_region *m_cart1_rom; memory_region *m_cart2_rom; diff --git a/src/mame/includes/toaplan1.h b/src/mame/includes/toaplan1.h index 195d5f47c60..b87151ea375 100644 --- a/src/mame/includes/toaplan1.h +++ b/src/mame/includes/toaplan1.h @@ -6,6 +6,7 @@ ****************************************************************************/ #include "cpu/m68000/m68000.h" +#include "sound/3812intf.h" #include "video/toaplan_scu.h" #include "screen.h" @@ -20,6 +21,7 @@ public: m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), + m_ymsnd(*this, "ymsnd"), m_dsp(*this, "dsp"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), @@ -159,6 +161,7 @@ public: DECLARE_WRITE_LINE_MEMBER(toaplan1_reset_callback); required_device m_maincpu; required_device m_audiocpu; + required_device m_ymsnd; optional_device m_dsp; required_device m_gfxdecode; required_device m_screen; diff --git a/src/mame/machine/mz700.cpp b/src/mame/machine/mz700.cpp index e7db1cb4cbe..5ca4bdb4f38 100644 --- a/src/mame/machine/mz700.cpp +++ b/src/mame/machine/mz700.cpp @@ -471,15 +471,13 @@ WRITE_LINE_MEMBER(mz_state::pit_irq_2) READ8_MEMBER(mz_state::pio_port_b_r) { - device_t *device = machine().device("ls145"); - int key_line = dynamic_cast(device)->read(); + const int key_line = m_ls145->read(); const char *const keynames[10] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" }; - int i; uint8_t res = 0; - for(i=0;i<10;i++) + for (int i = 0; i < 10; i++) { - if(key_line & (1 << i)) + if (key_line & (1 << i)) res |= ioport(keynames[i])->read(); } @@ -503,7 +501,7 @@ READ8_MEMBER(mz_state::pio_port_c_r) if ((m_cassette)->input() > 0.0038) data |= 0x20; /* set the RDATA status */ - data |= m_cursor_timer << 6; + data |= m_cursor_bit << 6; data |= m_screen->vblank() << 7; LOG(2,"mz700_pio_port_c_r",("%02X\n", data),machine()); @@ -514,16 +512,13 @@ READ8_MEMBER(mz_state::pio_port_c_r) WRITE8_MEMBER(mz_state::pio_port_a_w) { - device_t *device = machine().device("ls145"); - timer_device *timer = machine().device("cursor"); - LOG(2,"mz700_pio_port_a_w",("%02X\n", data),machine()); /* the ls145 is connected to PA0-PA3 */ - dynamic_cast(device)->write(data & 0x0f); + m_ls145->write(data & 0x0f); /* ne556 reset is connected to PA7 */ - timer->enable(BIT(data, 7)); + m_cursor_timer->enable(BIT(data, 7)); } diff --git a/src/mame/machine/poly88.cpp b/src/mame/machine/poly88.cpp index 6e1c431c0ad..6b2b022a9d0 100644 --- a/src/mame/machine/poly88.cpp +++ b/src/mame/machine/poly88.cpp @@ -327,6 +327,6 @@ SNAPSHOT_LOAD_MEMBER( poly88_state, poly88 ) } pos+=recordLen; } - machine().device("uart")->reset(); + m_uart->reset(); return image_init_result::PASS; } diff --git a/src/mame/machine/primo.cpp b/src/mame/machine/primo.cpp index 99a235ec987..40f7cb1c396 100644 --- a/src/mame/machine/primo.cpp +++ b/src/mame/machine/primo.cpp @@ -229,12 +229,12 @@ void primo_state::init_primo64() *******************************************************************************/ -void primo_state::primo_common_machine_init () +void primo_state::primo_common_machine_init() { - if (ioport("MEMORY_EXPANSION")->read()) + if (m_mem_exp_port->read()) m_port_FD = 0x00; primo_update_memory(); - machine().device("maincpu")->set_clock_scale(ioport("CPU_CLOCK")->read() ? 1.5 : 1.0); + m_maincpu->set_clock_scale(m_clock_port->read() ? 1.5 : 1.0); } void primo_state::machine_start() diff --git a/src/mame/machine/rm380z.cpp b/src/mame/machine/rm380z.cpp index 966eaf61590..2a3aa0690ab 100644 --- a/src/mame/machine/rm380z.cpp +++ b/src/mame/machine/rm380z.cpp @@ -287,7 +287,7 @@ void rm380z_state::machine_reset() memset(m_vram,0,RM380Z_SCREENSIZE); config_memory_map(); - machine().device("wd1771")->reset(); + m_fdc->reset(); init_graphic_chars(); } diff --git a/src/mame/machine/rmnimbus.cpp b/src/mame/machine/rmnimbus.cpp index 718efce47be..6dd1afdf2b8 100644 --- a/src/mame/machine/rmnimbus.cpp +++ b/src/mame/machine/rmnimbus.cpp @@ -895,7 +895,7 @@ static const nimbus_blocks ramblocks[] = void rmnimbus_state::nimbus_bank_memory() { - address_space &space = machine().device( MAINCPU_TAG)->memory().space( AS_PROGRAM ); + address_space &space = m_maincpu->space(AS_PROGRAM); int ramsize = m_ram->size(); int ramblock = 0; int blockno; diff --git a/src/mame/machine/toaplan1.cpp b/src/mame/machine/toaplan1.cpp index dc0d4abf08a..51ec990975f 100644 --- a/src/mame/machine/toaplan1.cpp +++ b/src/mame/machine/toaplan1.cpp @@ -172,7 +172,7 @@ void toaplan1_state::toaplan1_reset_sound() /* Reset the secondary CPU and sound chip */ /* rallybik, truxton, hellfire, demonwld write to a port to cause a reset */ /* zerowing, fireshrk, outzone, vimana use a RESET instruction instead */ - machine().device("ymsnd")->reset(); + m_ymsnd->reset(); m_audiocpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); } diff --git a/src/mame/video/n64.cpp b/src/mame/video/n64.cpp index d12787bb9b0..f951d0ad280 100644 --- a/src/mame/video/n64.cpp +++ b/src/mame/video/n64.cpp @@ -95,7 +95,7 @@ void n64_state::video_start() m_rdp->set_machine(machine()); m_rdp->init_internal_state(); - m_rdp->set_n64_periphs(machine().device("rcp")); + m_rdp->set_n64_periphs(m_rcp_periphs); m_rdp->m_blender.set_machine(machine()); m_rdp->m_blender.set_processor(m_rdp); diff --git a/src/mame/video/pc_t1t.h b/src/mame/video/pc_t1t.h index 31917bb31bf..af219d5f567 100644 --- a/src/mame/video/pc_t1t.h +++ b/src/mame/video/pc_t1t.h @@ -147,8 +147,4 @@ private: DECLARE_DEVICE_TYPE(PCVIDEO_PCJR, pcvideo_pcjr_device) -#define MCFG_PCVIDEO_PCJR_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, PCVIDEO_PCJR, 0) - - #endif // MAME_VIDEO_PC_T1T_H