diff options
author | mooglyguy <therealmogminer@gmail.com> | 2018-06-06 11:33:07 +0200 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-06-06 11:33:30 +0200 |
commit | f5e90f3e045556f3248b173351929e64dae304c3 (patch) | |
tree | 2a59b7b052221a84a675e5614d3381a55b74596f | |
parent | 8026075481becfd9a8d932685a15a53a4c9ac726 (diff) |
Minor cleanups, nw
-rw-r--r-- | src/devices/machine/ds2401.cpp | 10 | ||||
-rw-r--r-- | src/devices/machine/ds2401.h | 9 | ||||
-rw-r--r-- | src/mame/drivers/goldstar.cpp | 6 | ||||
-rw-r--r-- | src/mame/drivers/hornet.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/ksys573.cpp | 40 | ||||
-rw-r--r-- | src/mame/drivers/ti990_10.cpp | 47 | ||||
-rw-r--r-- | src/mame/drivers/tm990189.cpp | 106 | ||||
-rw-r--r-- | src/mame/machine/k573cass.cpp | 11 | ||||
-rw-r--r-- | src/mame/machine/k573dio.cpp | 4 | ||||
-rw-r--r-- | src/mame/machine/zs01.h | 10 |
10 files changed, 131 insertions, 114 deletions
diff --git a/src/devices/machine/ds2401.cpp b/src/devices/machine/ds2401.cpp index bb1a3064dad..a5fea5b189b 100644 --- a/src/devices/machine/ds2401.cpp +++ b/src/devices/machine/ds2401.cpp @@ -31,8 +31,14 @@ DEFINE_DEVICE_TYPE(DS2401, ds2401_device, "ds2401", "DS2401 Silicon Serial Numbe ds2401_device::ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS2401, tag, owner, clock) - , m_state(0), m_bit(0), m_shift(0), m_byte(0), m_rx(false), m_tx(false) - , m_timer_main(nullptr), m_timer_reset(nullptr) + , m_state(0) + , m_bit(0) + , m_shift(0) + , m_byte(0) + , m_rx(false) + , m_tx(false) + , m_timer_main(nullptr) + , m_timer_reset(nullptr) { } diff --git a/src/devices/machine/ds2401.h b/src/devices/machine/ds2401.h index 44f8d1485a1..8b74c603cf9 100644 --- a/src/devices/machine/ds2401.h +++ b/src/devices/machine/ds2401.h @@ -13,14 +13,15 @@ #pragma once -#define MCFG_DS2401_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, DS2401, 0) - - class ds2401_device : public device_t { public: // construction/destruction + ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner) + : ds2401_device(mconfig, tag, owner, uint32_t(0)) + { + } + ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( write ); diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index ae9793cc5c5..00137e21ff5 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -8662,7 +8662,7 @@ MACHINE_CONFIG_START(wingco_state::flam7_w4) MCFG_DEVICE_MODIFY("ppi8255_0") MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, fl7w4_outc802_w)) - MCFG_DS2401_ADD("fl7w4_id") + MCFG_DEVICE_ADD(m_fl7w4_id, DS2401) MACHINE_CONFIG_END MACHINE_CONFIG_START(wingco_state::flaming7) @@ -8677,7 +8677,7 @@ MACHINE_CONFIG_START(wingco_state::flaming7) MCFG_DEVICE_MODIFY("ppi8255_0") MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, fl7w4_outc802_w)) - MCFG_DS2401_ADD("fl7w4_id") + MCFG_DEVICE_ADD(m_fl7w4_id, DS2401) MACHINE_CONFIG_END MACHINE_CONFIG_START(wingco_state::flam7_tw) @@ -8692,7 +8692,7 @@ MACHINE_CONFIG_START(wingco_state::flam7_tw) MCFG_DEVICE_MODIFY("ppi8255_0") MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, wingco_state, fl7w4_outc802_w)) - MCFG_DS2401_ADD("fl7w4_id") + MCFG_DEVICE_ADD(m_fl7w4_id, DS2401) MACHINE_CONFIG_END MACHINE_CONFIG_START(wingco_state::mbstar) diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp index 490940decc5..f8804bb3d46 100644 --- a/src/mame/drivers/hornet.cpp +++ b/src/mame/drivers/hornet.cpp @@ -1186,7 +1186,7 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(hornet_state::sscope2) hornet_2board_v2(config); - MCFG_DS2401_ADD("lan_serial_id") + MCFG_DEVICE_ADD("lan_serial_id", DS2401) MCFG_EEPROM_SERIAL_93C46_ADD("lan_eeprom") MACHINE_CONFIG_END diff --git a/src/mame/drivers/ksys573.cpp b/src/mame/drivers/ksys573.cpp index dd61e7a96c8..122e163af87 100644 --- a/src/mame/drivers/ksys573.cpp +++ b/src/mame/drivers/ksys573.cpp @@ -384,6 +384,7 @@ public: m_analog3(*this, "analog3"), m_psxirq(*this, "maincpu:irq"), m_ata(*this, "ata"), + m_image(*this, "ata:0:cr589"), m_h8_response(*this, "h8_response"), m_maincpu(*this, "maincpu"), m_ram(*this, "maincpu:ram"), @@ -397,6 +398,7 @@ public: m_sensor(*this, "SENSOR"), m_encoder(*this, "ENCODER"), m_gunmania_id(*this, "gunmania_id"), + m_duart(*this, "mb89371"), m_lamps(*this, "lamp%u", 0U) { } @@ -546,6 +548,7 @@ private: required_device<psxirq_device> m_psxirq; required_device<ata_interface_device> m_ata; + optional_device<atapi_hle_device> m_image; cdrom_file *m_available_cdroms[ 2 ]; emu_timer *m_atapi_timer; int m_atapi_xferbase; @@ -601,6 +604,7 @@ private: optional_ioport m_sensor; optional_ioport m_encoder; optional_device<ds2401_device> m_gunmania_id; + optional_device<mb89371_device> m_duart; output_finder<2> m_lamps; }; @@ -630,7 +634,7 @@ void ksys573_state::konami573_map(address_map &map) map(0x1f5c0000, 0x1f5c0003).nopw(); // watchdog? map(0x1f600000, 0x1f600003).portw("LAMPS"); map(0x1f620000, 0x1f623fff).rw("m48t58", FUNC(timekeeper_device::read), FUNC(timekeeper_device::write)).umask32(0x00ff00ff); - map(0x1f680000, 0x1f68001f).rw("mb89371", FUNC(mb89371_device::read), FUNC(mb89371_device::write)).umask32(0x00ff00ff); + map(0x1f680000, 0x1f68001f).rw(m_duart, FUNC(mb89371_device::read), FUNC(mb89371_device::write)).umask32(0x00ff00ff); map(0x1f6a0000, 0x1f6a0001).rw(this, FUNC(ksys573_state::security_r), FUNC(ksys573_state::security_w)); } @@ -774,17 +778,16 @@ void ksys573_state::update_disc() new_cdrom = m_available_cdroms[ 0 ]; } - atapi_hle_device *image = machine().device<atapi_hle_device>( "ata:0:cr589" ); - if( image != nullptr ) + if( m_image != nullptr ) { void *current_cdrom = nullptr; - image->GetDevice( ¤t_cdrom ); + m_image->GetDevice( ¤t_cdrom ); if( current_cdrom != new_cdrom ) { current_cdrom = new_cdrom; - image->SetDevice( new_cdrom ); + m_image->SetDevice( new_cdrom ); } } } @@ -2077,7 +2080,7 @@ void ksys573_state::cr589_config(device_t *device) MACHINE_CONFIG_START(ksys573_state::konami573) /* basic machine hardware */ - MCFG_DEVICE_ADD( "maincpu", CXD8530CQ, XTAL(67'737'600) ) + MCFG_DEVICE_ADD( m_maincpu, CXD8530CQ, XTAL(67'737'600) ) MCFG_DEVICE_PROGRAM_MAP( konami573_map ) MCFG_RAM_MODIFY( "maincpu:ram" ) @@ -2088,9 +2091,9 @@ MACHINE_CONFIG_START(ksys573_state::konami573) MCFG_MACHINE_RESET_OVERRIDE( ksys573_state, konami573 ) - MCFG_DEVICE_ADD( "mb89371", MB89371, 0 ) + MCFG_DEVICE_ADD( m_duart, MB89371, 0 ) - MCFG_DEVICE_ADD( "ata", ATA_INTERFACE, 0 ) + MCFG_DEVICE_ADD( m_ata, ATA_INTERFACE, 0 ) MCFG_ATA_INTERFACE_IRQ_HANDLER( WRITELINE( *this, ksys573_state, ata_interrupt ) ) MCFG_DEVICE_MODIFY( "ata:0" ) @@ -2114,7 +2117,7 @@ MACHINE_CONFIG_START(ksys573_state::konami573) MCFG_DEVICE_ADD( "pccard1", PCCARD_SLOT, 0 ) MCFG_DEVICE_ADD( "pccard2", PCCARD_SLOT, 0 ) - MCFG_DEVICE_ADD( "flashbank", ADDRESS_MAP_BANK, 0 ) + MCFG_DEVICE_ADD( m_flashbank, ADDRESS_MAP_BANK, 0 ) MCFG_DEVICE_PROGRAM_MAP( flashbank_map ) MCFG_ADDRESS_MAP_BANK_ENDIANNESS( ENDIANNESS_LITTLE ) MCFG_ADDRESS_MAP_BANK_DATA_WIDTH( 16 ) @@ -2141,16 +2144,14 @@ MACHINE_CONFIG_END // Variants with additional digital sound board MACHINE_CONFIG_START(ksys573_state::k573d) konami573(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP( konami573d_map ) + m_maincpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::konami573d_map, tag(), this)); MCFG_KONAMI_573_DIGITAL_IO_BOARD_ADD( "k573dio", XTAL(19'660'800) ) MACHINE_CONFIG_END // Variants with additional analogue i/o board MACHINE_CONFIG_START(ksys573_state::k573a) konami573(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP( konami573a_map ) + m_maincpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::konami573a_map, tag(), this)); MACHINE_CONFIG_END MACHINE_CONFIG_START(ksys573_state::pccard1_16mb) @@ -2408,10 +2409,9 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(ksys573_state::fbaitbc) konami573(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP( fbaitbc_map ) + m_maincpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::fbaitbc_map, tag(), this)); - MCFG_DEVICE_ADD("upd4701", UPD4701A, 0) + MCFG_DEVICE_ADD(m_upd4701, UPD4701A, 0) MCFG_UPD4701_PORTY("uPD4701_y") cassx(config); @@ -2449,8 +2449,7 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(ksys573_state::pnchmn) konami573(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP( konami573a_map ) + m_maincpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::konami573a_map, tag(), this)); cassxi(config); pccard1_32mb(config); @@ -2466,10 +2465,9 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(ksys573_state::gunmania) konami573(config); - MCFG_DEVICE_MODIFY( "maincpu" ) - MCFG_DEVICE_PROGRAM_MAP( gunmania_map ) + m_maincpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::gunmania_map, tag(), this)); - MCFG_DS2401_ADD( "gunmania_id" ) + DS2401( config, "gunmania_id" ); pccard2_32mb(config); MACHINE_CONFIG_END diff --git a/src/mame/drivers/ti990_10.cpp b/src/mame/drivers/ti990_10.cpp index d67e9eeeedd..942a2acfa53 100644 --- a/src/mame/drivers/ti990_10.cpp +++ b/src/mame/drivers/ti990_10.cpp @@ -71,10 +71,10 @@ TODO : #include "emu.h" -#include "cpu/tms9900/ti990_10.h" -#include "sound/beep.h" #include "bus/ti99x/990_hd.h" #include "bus/ti99x/990_tap.h" +#include "cpu/tms9900/ti990_10.h" +#include "sound/beep.h" #include "video/911_vdt.h" @@ -82,31 +82,37 @@ class ti990_10_state : public driver_device { public: ti990_10_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) , - m_maincpu(*this, "maincpu"), - m_intlines(0), - m_ckon_state(0) { } + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_terminal(*this, "vdt911") + , m_intlines(0) + , m_ckon_state(0) { } - device_t *m_terminal; void init_ti990_10(); + + void ti990_10(machine_config &config); + +protected: virtual void machine_reset() override; - virtual void video_start() override; - DECLARE_WRITE_LINE_MEMBER( key_interrupt ); - DECLARE_WRITE_LINE_MEMBER( line_interrupt ); - DECLARE_WRITE_LINE_MEMBER( tape_interrupt ); - void ti990_set_int_line(int line, int state); +private: + WRITE_LINE_MEMBER( key_interrupt ); + WRITE_LINE_MEMBER( line_interrupt ); + WRITE_LINE_MEMBER( tape_interrupt ); WRITE_LINE_MEMBER(ti990_set_int13); - TIMER_CALLBACK_MEMBER(clear_load); - void ti990_hold_load(); WRITE_LINE_MEMBER(ti990_ckon_ckof_callback); READ8_MEMBER( ti990_panel_read ); WRITE8_MEMBER( ti990_panel_write ); + TIMER_CALLBACK_MEMBER(clear_load); + + void ti990_hold_load(); + void ti990_set_int_line(int line, int state); + required_device<cpu_device> m_maincpu; + required_device<vdt911_device> m_terminal; uint16_t m_intlines; int m_ckon_state; - void ti990_10(machine_config &config); void ti990_10_io(address_map &map); void ti990_10_memmap(address_map &map); }; @@ -263,11 +269,6 @@ void ti990_10_state::lrex_callback) We emulate a single VDT911 CRT terminal. */ -void ti990_10_state::video_start() -{ - m_terminal = machine().device("vdt911"); -} - WRITE_LINE_MEMBER(ti990_10_state::key_interrupt) { // set_int10(state); @@ -297,8 +298,8 @@ void ti990_10_state::ti990_10_memmap(address_map &map) void ti990_10_state::ti990_10_io(address_map &map) { - map(0x10, 0x11).r("vdt911", FUNC(vdt911_device::cru_r)); - map(0x80, 0x8f).w("vdt911", FUNC(vdt911_device::cru_w)); + map(0x10, 0x11).r(m_terminal, FUNC(vdt911_device::cru_r)); + map(0x80, 0x8f).w(m_terminal, FUNC(vdt911_device::cru_w)); map(0x1fa, 0x1fb).noprw(); // AM_READ(ti990_10_mapper_cru_r) map(0x1fc, 0x1fd).noprw(); // AM_READ(ti990_10_eir_cru_r) map(0x1fe, 0x1ff).r(this, FUNC(ti990_10_state::ti990_panel_read)); @@ -322,7 +323,7 @@ MACHINE_CONFIG_START(ti990_10_state::ti990_10) MCFG_TMS99xx_ADD("maincpu", TI990_10, 4000000, ti990_10_memmap, ti990_10_io ) // VDT 911 terminal - MCFG_DEVICE_ADD("vdt911", VDT911, 0) + MCFG_DEVICE_ADD(m_terminal, VDT911, 0) MCFG_VDT911_KEYINT_HANDLER(WRITELINE(*this, ti990_10_state, key_interrupt)) MCFG_VDT911_LINEINT_HANDLER(WRITELINE(*this, ti990_10_state, line_interrupt)) diff --git a/src/mame/drivers/tm990189.cpp b/src/mame/drivers/tm990189.cpp index 77a37924400..c148463760b 100644 --- a/src/mame/drivers/tm990189.cpp +++ b/src/mame/drivers/tm990189.cpp @@ -81,6 +81,8 @@ class tm990189_state : public driver_device { + friend class tm990_189_rs232_image_device; + public: tm990189_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) @@ -90,34 +92,14 @@ public: , m_tms9918(*this, "tms9918") , m_tms9901_usr(*this, TMS9901_0_TAG) , m_tms9901_sys(*this, TMS9901_1_TAG) + , m_tms9902(*this, "tms9902") , m_digits(*this, "digit%u", 0U) { } - required_device<tms9980a_device> m_tms9980a; - required_device<speaker_sound_device> m_speaker; - required_device<cassette_image_device> m_cass; - optional_device<tms9918_device> m_tms9918; - DECLARE_READ8_MEMBER(video_vdp_r); DECLARE_WRITE8_MEMBER(video_vdp_w); DECLARE_READ8_MEMBER(video_joy_r); DECLARE_WRITE8_MEMBER(video_joy_w); - int m_load_state; - - int m_digitsel; - int m_segment; - emu_timer *m_displayena_timer; - uint8_t m_segment_state[10]; - uint8_t m_old_segment_state[10]; - uint8_t m_LED_state; - emu_timer *m_joy1x_timer; - emu_timer *m_joy1y_timer; - emu_timer *m_joy2x_timer; - emu_timer *m_joy2y_timer; - device_image_interface *m_rs232_fp; - uint8_t m_rs232_rts; - emu_timer *m_rs232_input_timer; - uint8_t m_bogus_read_save; DECLARE_WRITE8_MEMBER( external_operation ); @@ -156,22 +138,51 @@ public: DECLARE_MACHINE_START(tm990_189_v); DECLARE_MACHINE_RESET(tm990_189_v); - TIMER_DEVICE_CALLBACK_MEMBER(display_callback); - TIMER_CALLBACK_MEMBER(clear_load); - void hold_load(); void tm990_189_v(machine_config &config); void tm990_189(machine_config &config); + +protected: + emu_timer *m_rs232_input_timer; + +private: void tm990_189_cru_map(address_map &map); void tm990_189_memmap(address_map &map); void tm990_189_v_memmap(address_map &map); -private: + void draw_digit(void); void led_set(int number, bool state); void segment_set(int offset, bool state); void digitsel(int offset, bool state); - required_device<tms9901_device> m_tms9901_usr; - required_device<tms9901_device> m_tms9901_sys; + + TIMER_DEVICE_CALLBACK_MEMBER(display_callback); + TIMER_CALLBACK_MEMBER(clear_load); + void hold_load(); + + required_device<tms9980a_device> m_tms9980a; + required_device<speaker_sound_device> m_speaker; + required_device<cassette_image_device> m_cass; + optional_device<tms9918_device> m_tms9918; + + required_device<tms9901_device> m_tms9901_usr; + required_device<tms9901_device> m_tms9901_sys; + required_device<tms9902_device> m_tms9902; output_finder<10> m_digits; + + int m_load_state; + + int m_digitsel; + int m_segment; + emu_timer *m_displayena_timer; + uint8_t m_segment_state[10]; + uint8_t m_old_segment_state[10]; + uint8_t m_LED_state; + emu_timer *m_joy1x_timer; + emu_timer *m_joy1y_timer; + emu_timer *m_joy2x_timer; + emu_timer *m_joy2y_timer; + device_image_interface *m_rs232_fp; + uint8_t m_rs232_rts; + uint8_t m_bogus_read_save; }; @@ -313,7 +324,6 @@ WRITE_LINE_MEMBER( tm990189_state::usr9901_led3_w ) WRITE8_MEMBER( tm990189_state::sys9901_interrupt_callback ) { - // machine().device<tms9901_device>("tms9901_0")->set_single_int(5, (data!=0)? ASSERT_LINE:CLEAR_LINE); // TODO: Check this m_tms9901_usr->set_single_int(5, (data!=0)? ASSERT_LINE:CLEAR_LINE); } @@ -435,11 +445,16 @@ WRITE_LINE_MEMBER( tm990189_state::sys9901_tapewdata_w ) m_cass->output(state ? +1.0 : -1.0); } -class tm990_189_rs232_image_device : public device_t, - public device_image_interface +class tm990_189_rs232_image_device : public device_t, public device_image_interface { public: // construction/destruction + template <typename T> tm990_189_rs232_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&tms_tag) + : tm990_189_rs232_image_device(mconfig, tag, owner, clock) + { + m_tms9902.set_tag(std::forward<T>(tms_tag)); + } + tm990_189_rs232_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // image-level overrides @@ -456,9 +471,12 @@ public: virtual image_init_result call_load() override; virtual void call_unload() override; + protected: // device-level overrides virtual void device_start() override; + + required_device<tms9902_device> m_tms9902; }; DEFINE_DEVICE_TYPE(TM990_189_RS232, tm990_189_rs232_image_device, "tm990_189_rs232_image", "TM990/189 RS232 port") @@ -466,6 +484,7 @@ DEFINE_DEVICE_TYPE(TM990_189_RS232, tm990_189_rs232_image_device, "tm990_189_rs2 tm990_189_rs232_image_device::tm990_189_rs232_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TM990_189_RS232, tag, owner, clock) , device_image_interface(mconfig, *this) + , m_tms9902(*this, finder_base::DUMMY_TAG) { } @@ -475,21 +494,18 @@ void tm990_189_rs232_image_device::device_start() void tm990_189_rs232_image_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - //tm990189_state *state = machine.driver_data<tm990189_state>(); uint8_t buf; - if (/*state->m_rs232_rts &&*/ /*(mame_ftell(state->m_rs232_fp) < mame_fsize(state->m_rs232_fp))*/1) + if (/*m_rs232_rts &&*/ /*(mame_ftell(m_rs232_fp) < mame_fsize(m_rs232_fp))*/1) { - tms9902_device* tms9902 = static_cast<tms9902_device*>(machine().device("tms9902")); if (fread(&buf, 1) == 1) - tms9902->rcv_data(buf); + m_tms9902->rcv_data(buf); } } image_init_result tm990_189_rs232_image_device::call_load() { tm990189_state *state = machine().driver_data<tm990189_state>(); - tms9902_device* tms9902 = static_cast<tms9902_device*>(machine().device("tms9902")); - tms9902->rcv_dsr(ASSERT_LINE); + m_tms9902->rcv_dsr(ASSERT_LINE); state->m_rs232_input_timer = timer_alloc(); state->m_rs232_input_timer->adjust(attotime::zero, 0, attotime::from_msec(10)); return image_init_result::PASS; @@ -499,15 +515,11 @@ image_init_result tm990_189_rs232_image_device::call_load() void tm990_189_rs232_image_device::call_unload() { tm990189_state *state = machine().driver_data<tm990189_state>(); - tms9902_device* tms9902 = static_cast<tms9902_device*>(machine().device("tms9902")); - tms9902->rcv_dsr(CLEAR_LINE); + m_tms9902->rcv_dsr(CLEAR_LINE); state->m_rs232_input_timer->reset(); /* FIXME - timers should only be allocated once */ } -#define MCFG_TM990_189_RS232_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, TM990_189_RS232, 0) - /* static TMS9902_RTS_CALLBACK( rts_callback ) { @@ -804,11 +816,11 @@ void tm990189_state::tm990_189_cru_map(address_map &map) { map(0x0000, 0x003f).r(m_tms9901_usr, FUNC(tms9901_device::read)); /* user I/O tms9901 */ map(0x0040, 0x006f).r(m_tms9901_sys, FUNC(tms9901_device::read)); /* system I/O tms9901 */ - map(0x0080, 0x00cf).r("tms9902", FUNC(tms9902_device::cruread)); /* optional tms9902 */ + map(0x0080, 0x00cf).r(m_tms9902, FUNC(tms9902_device::cruread)); /* optional tms9902 */ map(0x0000, 0x01ff).w(m_tms9901_usr, FUNC(tms9901_device::write)); /* user I/O tms9901 */ map(0x0200, 0x03ff).w(m_tms9901_sys, FUNC(tms9901_device::write)); /* system I/O tms9901 */ - map(0x0400, 0x05ff).w("tms9902", FUNC(tms9902_device::cruwrite)); /* optional tms9902 */ + map(0x0400, 0x05ff).w(m_tms9902, FUNC(tms9902_device::cruwrite)); /* optional tms9902 */ } MACHINE_CONFIG_START(tm990189_state::tm990_189) @@ -857,9 +869,9 @@ MACHINE_CONFIG_START(tm990189_state::tm990_189) MCFG_TMS9901_P15_HANDLER( WRITELINE( *this, tm990189_state, sys9901_tapewdata_w) ) MCFG_TMS9901_INTLEVEL_HANDLER( WRITE8( *this, tm990189_state, sys9901_interrupt_callback) ) - MCFG_DEVICE_ADD("tms9902", TMS9902, 2000000) // MZ: needs to be fixed once the RS232 support is complete + MCFG_DEVICE_ADD(m_tms9902, TMS9902, 2000000) // MZ: needs to be fixed once the RS232 support is complete MCFG_TMS9902_XMIT_CB(WRITE8(*this, tm990189_state, xmit_callback)) /* called when a character is transmitted */ - MCFG_TM990_189_RS232_ADD("rs232") + MCFG_DEVICE_ADD("rs232", TM990_189_RS232, 0, m_tms9902) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_timer", tm990189_state, display_callback, attotime::from_hz(30)) // Need to delay the timer, or it will spoil the initial LOAD // TODO: Fix this, probably inside CPU @@ -915,9 +927,9 @@ MACHINE_CONFIG_START(tm990189_state::tm990_189_v) MCFG_TMS9901_P15_HANDLER( WRITELINE( *this, tm990189_state, sys9901_tapewdata_w) ) MCFG_TMS9901_INTLEVEL_HANDLER( WRITE8( *this, tm990189_state, sys9901_interrupt_callback) ) - MCFG_DEVICE_ADD("tms9902", TMS9902, 2000000) // MZ: needs to be fixed once the RS232 support is complete + MCFG_DEVICE_ADD(m_tms9902, TMS9902, 2000000) // MZ: needs to be fixed once the RS232 support is complete MCFG_TMS9902_XMIT_CB(WRITE8(*this, tm990189_state, xmit_callback)) /* called when a character is transmitted */ - MCFG_TM990_189_RS232_ADD("rs232") + MCFG_DEVICE_ADD("rs232", TM990_189_RS232, 0, m_tms9902) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_timer", tm990189_state, display_callback, attotime::from_hz(30)) MCFG_TIMER_START_DELAY(attotime::from_msec(150)) MACHINE_CONFIG_END diff --git a/src/mame/machine/k573cass.cpp b/src/mame/machine/k573cass.cpp index d9f270dad7b..48bcf915e96 100644 --- a/src/mame/machine/k573cass.cpp +++ b/src/mame/machine/k573cass.cpp @@ -121,8 +121,8 @@ konami573_cassette_xi_device::konami573_cassette_xi_device(const machine_config } MACHINE_CONFIG_START(konami573_cassette_xi_device::device_add_mconfig) - MCFG_X76F041_ADD( "eeprom" ) - MCFG_DS2401_ADD( "id" ) + MCFG_X76F041_ADD( "eeprom" ); + DS2401( config, "id" ); MCFG_DEVICE_ADD( "adc0838", ADC0838, 0 ) MACHINE_CONFIG_END @@ -266,7 +266,7 @@ konami573_cassette_yi_device::konami573_cassette_yi_device(const machine_config MACHINE_CONFIG_START(konami573_cassette_yi_device::device_add_mconfig) MCFG_X76F100_ADD( "eeprom" ) - MCFG_DS2401_ADD( "id" ) + DS2401( config, "id" ); MACHINE_CONFIG_END WRITE_LINE_MEMBER(konami573_cassette_yi_device::write_line_d4) @@ -293,9 +293,8 @@ konami573_cassette_zi_device::konami573_cassette_zi_device(const machine_config } MACHINE_CONFIG_START(konami573_cassette_zi_device::device_add_mconfig) - MCFG_DS2401_ADD( "id" ) - MCFG_ZS01_ADD( "eeprom" ) - MCFG_ZS01_DS2401( "id" ) + DS2401( config, "id" ); + ZS01( config, "eeprom" ).set_ds2401_tag( "id" ); MACHINE_CONFIG_END void konami573_cassette_zi_device::device_start() diff --git a/src/mame/machine/k573dio.cpp b/src/mame/machine/k573dio.cpp index 784e9f0e421..9a8ebe22735 100644 --- a/src/mame/machine/k573dio.cpp +++ b/src/mame/machine/k573dio.cpp @@ -133,8 +133,8 @@ const tiny_rom_entry *k573dio_device::device_rom_region() const } MACHINE_CONFIG_START(k573dio_device::device_add_mconfig) - MCFG_MAS3507D_ADD( "mpeg" ) - MCFG_DS2401_ADD( "digital_id" ) + MCFG_MAS3507D_ADD( "mpeg" ); + DS2401( config, "digital_id" ); MACHINE_CONFIG_END void k573dio_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) diff --git a/src/mame/machine/zs01.h b/src/mame/machine/zs01.h index a1c98f7c686..19bb82b2296 100644 --- a/src/mame/machine/zs01.h +++ b/src/mame/machine/zs01.h @@ -14,16 +14,16 @@ #include "machine/ds2401.h" -#define MCFG_ZS01_ADD( _tag ) \ - MCFG_DEVICE_ADD( _tag, ZS01, 0 ) -#define MCFG_ZS01_DS2401( ds2401_tag ) \ - downcast<zs01_device &>(*device).set_ds2401_tag( ds2401_tag ); - class zs01_device : public device_t, public device_nvram_interface { public: // construction/destruction + zs01_device( const machine_config &mconfig, const char *tag, device_t *owner) + : zs01_device(mconfig, tag, owner, uint32_t(0)) + { + } + zs01_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); // inline configuration helpers |