summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Nigel Barnes <Pernod70@users.noreply.github.com>2018-09-22 14:32:54 +0100
committer Nigel Barnes <Pernod70@users.noreply.github.com>2018-09-22 14:43:26 +0100
commitbd1fc3d9dc55d640e0512be02868089deb0a5d92 (patch)
treea3d80e7e68fa22a61a6434a1a46a29b61317bc7b /src/devices
parent63f29019c4e069c331f85e2c661935a57de036a9 (diff)
spectrum: Removed machine().device from expansion devices (nw)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/spectrum/exp.cpp28
-rw-r--r--src/devices/bus/spectrum/exp.h52
-rw-r--r--src/devices/bus/spectrum/fuller.cpp24
-rw-r--r--src/devices/bus/spectrum/intf1.cpp31
-rw-r--r--src/devices/bus/spectrum/intf2.cpp31
-rw-r--r--src/devices/bus/spectrum/intf2.h1
-rw-r--r--src/devices/bus/spectrum/kempjoy.cpp5
-rw-r--r--src/devices/bus/spectrum/melodik.cpp22
-rw-r--r--src/devices/bus/spectrum/mikroplus.cpp5
-rw-r--r--src/devices/bus/spectrum/plus2test.cpp10
-rw-r--r--src/devices/bus/spectrum/plus2test.h1
-rw-r--r--src/devices/bus/spectrum/protek.cpp10
-rw-r--r--src/devices/bus/spectrum/protek.h1
-rw-r--r--src/devices/bus/spectrum/uslot.cpp20
-rw-r--r--src/devices/bus/spectrum/usource.cpp1
-rw-r--r--src/devices/bus/spectrum/uspeech.cpp1
16 files changed, 97 insertions, 146 deletions
diff --git a/src/devices/bus/spectrum/exp.cpp b/src/devices/bus/spectrum/exp.cpp
index c885bfde089..73e1d4a3a9a 100644
--- a/src/devices/bus/spectrum/exp.cpp
+++ b/src/devices/bus/spectrum/exp.cpp
@@ -32,15 +32,6 @@ device_spectrum_expansion_interface::device_spectrum_expansion_interface(const m
}
-//-------------------------------------------------
-// ~device_spectrum_expansion_interface - destructor
-//-------------------------------------------------
-
-device_spectrum_expansion_interface::~device_spectrum_expansion_interface()
-{
-}
-
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -52,6 +43,7 @@ device_spectrum_expansion_interface::~device_spectrum_expansion_interface()
spectrum_expansion_slot_device::spectrum_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SPECTRUM_EXPANSION_SLOT, tag, owner, clock),
device_slot_interface(mconfig, *this),
+ m_io(nullptr),
m_card(nullptr),
m_irq_handler(*this),
m_nmi_handler(*this)
@@ -60,15 +52,6 @@ spectrum_expansion_slot_device::spectrum_expansion_slot_device(const machine_con
//-------------------------------------------------
-// expansion_slot_device - destructor
-//-------------------------------------------------
-
-spectrum_expansion_slot_device::~spectrum_expansion_slot_device()
-{
-}
-
-
-//-------------------------------------------------
// device_validity_check - device-specific checks
//-------------------------------------------------
@@ -104,6 +87,15 @@ void spectrum_expansion_slot_device::device_reset()
}
//-------------------------------------------------
+// set_io_space - set address space we are attached to
+//-------------------------------------------------
+
+void spectrum_expansion_slot_device::set_io_space(address_space *io)
+{
+ m_io = io;
+}
+
+//-------------------------------------------------
// port_fe_r
//-------------------------------------------------
diff --git a/src/devices/bus/spectrum/exp.h b/src/devices/bus/spectrum/exp.h
index f795fc05ad8..1d8eb5f21f2 100644
--- a/src/devices/bus/spectrum/exp.h
+++ b/src/devices/bus/spectrum/exp.h
@@ -46,33 +46,6 @@
//**************************************************************************
-// CONSTANTS
-//**************************************************************************
-
-#define SPECTRUM_EXPANSION_SLOT_TAG "exp"
-
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_SPECTRUM_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, SPECTRUM_EXPANSION_SLOT, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
-#define MCFG_SPECTRUM_PASSTHRU_EXPANSION_SLOT_ADD() \
- MCFG_SPECTRUM_EXPANSION_SLOT_ADD(SPECTRUM_EXPANSION_SLOT_TAG, spectrum_expansion_devices, nullptr) \
- MCFG_SPECTRUM_EXPANSION_SLOT_IRQ_HANDLER(WRITELINE(DEVICE_SELF_OWNER, spectrum_expansion_slot_device, irq_w)) \
- MCFG_SPECTRUM_EXPANSION_SLOT_NMI_HANDLER(WRITELINE(DEVICE_SELF_OWNER, spectrum_expansion_slot_device, nmi_w))
-
-#define MCFG_SPECTRUM_EXPANSION_SLOT_IRQ_HANDLER(_devcb) \
- downcast<spectrum_expansion_slot_device &>(*device).set_irq_handler(DEVCB_##_devcb);
-
-#define MCFG_SPECTRUM_EXPANSION_SLOT_NMI_HANDLER(_devcb) \
- downcast<spectrum_expansion_slot_device &>(*device).set_nmi_handler(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -84,12 +57,23 @@ class spectrum_expansion_slot_device : public device_t, public device_slot_inter
{
public:
// construction/destruction
- spectrum_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- virtual ~spectrum_expansion_slot_device();
+ template <typename T>
+ spectrum_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&slot_options, const char *default_option)
+ : spectrum_expansion_slot_device(mconfig, tag, owner)
+ {
+ option_reset();
+ slot_options(*this);
+ set_default_option(default_option);
+ set_fixed(false);
+ }
+
+ spectrum_expansion_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock = 0);
+
+ void set_io_space(address_space *io);
// callbacks
- template <class Object> devcb_base &set_irq_handler(Object &&cb) { return m_irq_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_nmi_handler(Object &&cb) { return m_nmi_handler.set_callback(std::forward<Object>(cb)); }
+ auto irq_handler() { return m_irq_handler.bind(); }
+ auto nmi_handler() { return m_nmi_handler.bind(); }
DECLARE_READ8_MEMBER( mreq_r );
DECLARE_WRITE8_MEMBER( mreq_w );
@@ -99,6 +83,8 @@ public:
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_handler(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
+ address_space *m_io;
+
protected:
// device-level overrides
virtual void device_validity_check(validity_checker &valid) const override;
@@ -119,7 +105,7 @@ class device_spectrum_expansion_interface : public device_slot_card_interface
{
public:
// construction/destruction
- virtual ~device_spectrum_expansion_interface();
+ device_spectrum_expansion_interface(const machine_config &mconfig, device_t &device);
// reading and writing
virtual DECLARE_READ8_MEMBER(mreq_r) { return 0xff; }
@@ -128,7 +114,7 @@ public:
virtual DECLARE_READ_LINE_MEMBER(romcs) { return 0; }
protected:
- device_spectrum_expansion_interface(const machine_config &mconfig, device_t &device);
+ address_space &io_space() { return *m_slot->m_io; }
spectrum_expansion_slot_device *m_slot;
};
diff --git a/src/devices/bus/spectrum/fuller.cpp b/src/devices/bus/spectrum/fuller.cpp
index 4dd24161105..36275ccc4cd 100644
--- a/src/devices/bus/spectrum/fuller.cpp
+++ b/src/devices/bus/spectrum/fuller.cpp
@@ -44,15 +44,18 @@ ioport_constructor spectrum_fuller_device::device_input_ports() const
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(spectrum_fuller_device::device_add_mconfig)
+void spectrum_fuller_device::device_add_mconfig(machine_config &config)
+{
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay8912", AY8912, XTAL(3'579'545) / 2) // unverified clock
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8912(config, m_psg, 3.579545_MHz_XTAL / 2); // unverified clock
+ m_psg->add_route(ALL_OUTPUTS, "mono", 0.25);
/* passthru */
- MCFG_SPECTRUM_PASSTHRU_EXPANSION_SLOT_ADD()
-MACHINE_CONFIG_END
+ SPECTRUM_EXPANSION_SLOT(config, m_exp, spectrum_expansion_devices, nullptr);
+ m_exp->irq_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::irq_w));
+ m_exp->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w));
+}
//**************************************************************************
// LIVE DEVICE
@@ -78,12 +81,6 @@ spectrum_fuller_device::spectrum_fuller_device(const machine_config &mconfig, co
void spectrum_fuller_device::device_start()
{
- address_space& spaceio = machine().device("maincpu")->memory().space(AS_IO);
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
-
- spaceio.install_write_handler(0x3f, 0x3f, 0, 0xff00, 0, write8_delegate(FUNC(ay8910_device::address_w), (ay8910_device*)m_psg));
- spaceio.install_readwrite_handler(0x5f, 0x5f, 0, 0xff00, 0, read8_delegate(FUNC(ay8910_device::data_r), (ay8910_device*)m_psg), write8_delegate(FUNC(ay8910_device::data_w), (ay8910_device*)m_psg));
- spaceio.install_read_handler(0x7f, 0x7f, 0, 0xff00, 0, read8_delegate(FUNC(spectrum_fuller_device::joystick_r), this));
}
@@ -93,6 +90,11 @@ void spectrum_fuller_device::device_start()
void spectrum_fuller_device::device_reset()
{
+ m_exp->set_io_space(&io_space());
+
+ io_space().install_write_handler(0x3f, 0x3f, 0, 0xff00, 0, write8_delegate(FUNC(ay8910_device::address_w), m_psg.target()));
+ io_space().install_readwrite_handler(0x5f, 0x5f, 0, 0xff00, 0, read8_delegate(FUNC(ay8910_device::data_r), m_psg.target()), write8_delegate(FUNC(ay8910_device::data_w), m_psg.target()));
+ io_space().install_read_handler(0x7f, 0x7f, 0, 0xff00, 0, read8_delegate(FUNC(spectrum_fuller_device::joystick_r), this));
}
diff --git a/src/devices/bus/spectrum/intf1.cpp b/src/devices/bus/spectrum/intf1.cpp
index 5579409f9e8..d8245554976 100644
--- a/src/devices/bus/spectrum/intf1.cpp
+++ b/src/devices/bus/spectrum/intf1.cpp
@@ -41,7 +41,7 @@ ROM_END
MACHINE_CONFIG_START(spectrum_intf1_device::device_add_mconfig)
/* rs232 */
- MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr)
+ RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
/* microdrive */
MCFG_MICRODRIVE_ADD("mdv1")
@@ -49,7 +49,9 @@ MACHINE_CONFIG_START(spectrum_intf1_device::device_add_mconfig)
MCFG_MICRODRIVE_ADD("mdv2")
/* passthru */
- MCFG_SPECTRUM_PASSTHRU_EXPANSION_SLOT_ADD()
+ SPECTRUM_EXPANSION_SLOT(config, m_exp, spectrum_expansion_devices, nullptr);
+ m_exp->irq_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::irq_w));
+ m_exp->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w));
MACHINE_CONFIG_END
const tiny_rom_entry *spectrum_intf1_device::device_rom_region() const
@@ -66,13 +68,13 @@ const tiny_rom_entry *spectrum_intf1_device::device_rom_region() const
//-------------------------------------------------
spectrum_intf1_device::spectrum_intf1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, SPECTRUM_INTF1, tag, owner, clock),
- device_spectrum_expansion_interface(mconfig, *this),
- m_exp(*this, "exp"),
- m_rs232(*this, "rs232"),
- m_mdv1(*this, "mdv1"),
- m_mdv2(*this, "mdv2"),
- m_rom(*this, "rom")
+ : device_t(mconfig, SPECTRUM_INTF1, tag, owner, clock)
+ , device_spectrum_expansion_interface(mconfig, *this)
+ , m_exp(*this, "exp")
+ , m_rs232(*this, "rs232")
+ , m_mdv1(*this, "mdv1")
+ , m_mdv2(*this, "mdv2")
+ , m_rom(*this, "rom")
{
}
@@ -82,7 +84,6 @@ spectrum_intf1_device::spectrum_intf1_device(const machine_config &mconfig, cons
void spectrum_intf1_device::device_start()
{
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
}
//-------------------------------------------------
@@ -91,6 +92,8 @@ void spectrum_intf1_device::device_start()
void spectrum_intf1_device::device_reset()
{
+ m_exp->set_io_space(&io_space());
+
m_romcs = 0;
}
@@ -112,8 +115,6 @@ READ8_MEMBER(spectrum_intf1_device::mreq_r)
{
if (offset == 0x0008 || offset == 0x1708)
m_romcs = 1;
- if (offset == 0x0700)
- m_romcs = 0;
}
temp = m_exp->mreq_r(space, offset);
@@ -123,6 +124,12 @@ READ8_MEMBER(spectrum_intf1_device::mreq_r)
if (m_romcs)
data &= m_rom->base()[offset & 0x1fff];
+ if (!machine().side_effects_disabled())
+ {
+ if (offset == 0x0700)
+ m_romcs = 0;
+ }
+
return data;
}
diff --git a/src/devices/bus/spectrum/intf2.cpp b/src/devices/bus/spectrum/intf2.cpp
index 0921d50b0bc..2700c2787d0 100644
--- a/src/devices/bus/spectrum/intf2.cpp
+++ b/src/devices/bus/spectrum/intf2.cpp
@@ -54,14 +54,14 @@ ioport_constructor spectrum_intf2_device::device_input_ports() const
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(spectrum_intf2_device::device_add_mconfig)
+void spectrum_intf2_device::device_add_mconfig(machine_config &config)
+{
/* cartridge */
- MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "spectrum_cart")
- MCFG_GENERIC_EXTENSIONS("bin,rom")
- MCFG_GENERIC_LOAD(spectrum_intf2_device, spectrum_cart)
+ GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "spectrum_cart", "bin,rom");
+ m_cart->set_device_load(device_image_load_delegate(&spectrum_intf2_device::device_image_load_spectrum_cart, this));
- MCFG_SOFTWARE_LIST_ADD("cart_list", "spectrum_cart")
-MACHINE_CONFIG_END
+ SOFTWARE_LIST(config, "cart_list").set_original("spectrum_cart");
+}
//**************************************************************************
// LIVE DEVICE
@@ -72,11 +72,11 @@ MACHINE_CONFIG_END
//-------------------------------------------------
spectrum_intf2_device::spectrum_intf2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, SPECTRUM_INTF2, tag, owner, clock),
- device_spectrum_expansion_interface(mconfig, *this),
- m_cart(*this, "cartslot"),
- m_exp_line3(*this, "LINE3"),
- m_exp_line4(*this, "LINE4")
+ : device_t(mconfig, SPECTRUM_INTF2, tag, owner, clock)
+ , device_spectrum_expansion_interface(mconfig, *this)
+ , m_cart(*this, "cartslot")
+ , m_exp_line3(*this, "LINE3")
+ , m_exp_line4(*this, "LINE4")
{
}
@@ -86,15 +86,6 @@ spectrum_intf2_device::spectrum_intf2_device(const machine_config &mconfig, cons
void spectrum_intf2_device::device_start()
{
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void spectrum_intf2_device::device_reset()
-{
}
diff --git a/src/devices/bus/spectrum/intf2.h b/src/devices/bus/spectrum/intf2.h
index 54316ef88c5..826e4b8fb3e 100644
--- a/src/devices/bus/spectrum/intf2.h
+++ b/src/devices/bus/spectrum/intf2.h
@@ -29,7 +29,6 @@ public:
protected:
virtual void device_start() override;
- virtual void device_reset() override;
// optional information overrides
virtual void device_add_mconfig(machine_config &config) override;
diff --git a/src/devices/bus/spectrum/kempjoy.cpp b/src/devices/bus/spectrum/kempjoy.cpp
index 4f13fdc482f..ac7d5698bd7 100644
--- a/src/devices/bus/spectrum/kempjoy.cpp
+++ b/src/devices/bus/spectrum/kempjoy.cpp
@@ -62,10 +62,6 @@ spectrum_kempjoy_device::spectrum_kempjoy_device(const machine_config &mconfig,
void spectrum_kempjoy_device::device_start()
{
- address_space& spaceio = machine().device("maincpu")->memory().space(AS_IO);
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
-
- spaceio.install_read_handler(0x1f, 0x1f, 0, 0xff00, 0, read8_delegate(FUNC(spectrum_kempjoy_device::joystick_r), this));
}
@@ -75,6 +71,7 @@ void spectrum_kempjoy_device::device_start()
void spectrum_kempjoy_device::device_reset()
{
+ io_space().install_read_handler(0x1f, 0x1f, 0, 0xff00, 0, read8_delegate(FUNC(spectrum_kempjoy_device::joystick_r), this));
}
diff --git a/src/devices/bus/spectrum/melodik.cpp b/src/devices/bus/spectrum/melodik.cpp
index 5b7ee40c040..8303d4c436c 100644
--- a/src/devices/bus/spectrum/melodik.cpp
+++ b/src/devices/bus/spectrum/melodik.cpp
@@ -21,15 +21,18 @@ DEFINE_DEVICE_TYPE(SPECTRUM_MELODIK, spectrum_melodik_device, "spectrum_melodik"
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(spectrum_melodik_device::device_add_mconfig)
+void spectrum_melodik_device::device_add_mconfig(machine_config &config)
+{
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay8912", AY8912, XTAL(3'579'545) / 2)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ AY8912(config, m_psg, 3.579545_MHz_XTAL / 2);
+ m_psg->add_route(ALL_OUTPUTS, "mono", 0.25);
/* passthru */
- MCFG_SPECTRUM_PASSTHRU_EXPANSION_SLOT_ADD()
-MACHINE_CONFIG_END
+ SPECTRUM_EXPANSION_SLOT(config, m_exp, spectrum_expansion_devices, nullptr);
+ m_exp->irq_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::irq_w));
+ m_exp->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w));
+}
//**************************************************************************
// LIVE DEVICE
@@ -54,11 +57,6 @@ spectrum_melodik_device::spectrum_melodik_device(const machine_config &mconfig,
void spectrum_melodik_device::device_start()
{
- address_space& spaceio = machine().device("maincpu")->memory().space(AS_IO);
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
-
- spaceio.install_write_handler(0x8000, 0x8000, 0, 0x3ffd, 0, write8_delegate(FUNC(ay8910_device::address_w), (ay8910_device*)m_psg));
- spaceio.install_readwrite_handler(0xc000, 0xc000, 0, 0x3ffd, 0, read8_delegate(FUNC(ay8910_device::data_r), (ay8910_device*)m_psg), write8_delegate(FUNC(ay8910_device::data_w), (ay8910_device*)m_psg));
}
@@ -68,6 +66,10 @@ void spectrum_melodik_device::device_start()
void spectrum_melodik_device::device_reset()
{
+ m_exp->set_io_space(&io_space());
+
+ io_space().install_write_handler(0x8000, 0x8000, 0, 0x3ffd, 0, write8_delegate(FUNC(ay8910_device::address_w), m_psg.target()));
+ io_space().install_readwrite_handler(0xc000, 0xc000, 0, 0x3ffd, 0, read8_delegate(FUNC(ay8910_device::data_r), m_psg.target()), write8_delegate(FUNC(ay8910_device::data_w), m_psg.target()));
}
//**************************************************************************
diff --git a/src/devices/bus/spectrum/mikroplus.cpp b/src/devices/bus/spectrum/mikroplus.cpp
index 97b6606d6df..b0f0676aaee 100644
--- a/src/devices/bus/spectrum/mikroplus.cpp
+++ b/src/devices/bus/spectrum/mikroplus.cpp
@@ -82,10 +82,6 @@ spectrum_mikroplus_device::spectrum_mikroplus_device(const machine_config &mconf
void spectrum_mikroplus_device::device_start()
{
- address_space& spaceio = machine().device("maincpu")->memory().space(AS_IO);
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
-
- spaceio.install_read_handler(0xdf, 0xdf, 0, 0xff00, 0, read8_delegate(FUNC(spectrum_mikroplus_device::joystick_r), this));
}
@@ -95,6 +91,7 @@ void spectrum_mikroplus_device::device_start()
void spectrum_mikroplus_device::device_reset()
{
+ io_space().install_read_handler(0xdf, 0xdf, 0, 0xff00, 0, read8_delegate(FUNC(spectrum_mikroplus_device::joystick_r), this));
}
diff --git a/src/devices/bus/spectrum/plus2test.cpp b/src/devices/bus/spectrum/plus2test.cpp
index 9e42d711098..a734a76f775 100644
--- a/src/devices/bus/spectrum/plus2test.cpp
+++ b/src/devices/bus/spectrum/plus2test.cpp
@@ -56,16 +56,6 @@ spectrum_plus2test_device::spectrum_plus2test_device(const machine_config &mconf
void spectrum_plus2test_device::device_start()
{
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void spectrum_plus2test_device::device_reset()
-{
}
diff --git a/src/devices/bus/spectrum/plus2test.h b/src/devices/bus/spectrum/plus2test.h
index 22158c7efc3..234e82a95f0 100644
--- a/src/devices/bus/spectrum/plus2test.h
+++ b/src/devices/bus/spectrum/plus2test.h
@@ -31,7 +31,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
// optional information overrides
virtual const tiny_rom_entry *device_rom_region() const override;
diff --git a/src/devices/bus/spectrum/protek.cpp b/src/devices/bus/spectrum/protek.cpp
index 9f00d61fcbc..a3f3a1838f8 100644
--- a/src/devices/bus/spectrum/protek.cpp
+++ b/src/devices/bus/spectrum/protek.cpp
@@ -65,16 +65,6 @@ spectrum_protek_device::spectrum_protek_device(const machine_config &mconfig, co
void spectrum_protek_device::device_start()
{
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
-}
-
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void spectrum_protek_device::device_reset()
-{
}
diff --git a/src/devices/bus/spectrum/protek.h b/src/devices/bus/spectrum/protek.h
index f215250ecbd..503a041a0d3 100644
--- a/src/devices/bus/spectrum/protek.h
+++ b/src/devices/bus/spectrum/protek.h
@@ -31,7 +31,6 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
- virtual void device_reset() override;
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
diff --git a/src/devices/bus/spectrum/uslot.cpp b/src/devices/bus/spectrum/uslot.cpp
index 178f8ab0941..d2d75d6a72c 100644
--- a/src/devices/bus/spectrum/uslot.cpp
+++ b/src/devices/bus/spectrum/uslot.cpp
@@ -20,16 +20,17 @@ DEFINE_DEVICE_TYPE(SPECTRUM_USLOT, spectrum_uslot_device, "spectrum_uslot", "Spe
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(spectrum_uslot_device::device_add_mconfig)
+void spectrum_uslot_device::device_add_mconfig(machine_config &config)
+{
/* passthru */
- MCFG_SPECTRUM_EXPANSION_SLOT_ADD("exp1", spectrum_expansion_devices, nullptr)
- MCFG_SPECTRUM_EXPANSION_SLOT_IRQ_HANDLER(WRITELINE(DEVICE_SELF_OWNER, spectrum_expansion_slot_device, irq_w))
- MCFG_SPECTRUM_EXPANSION_SLOT_NMI_HANDLER(WRITELINE(DEVICE_SELF_OWNER, spectrum_expansion_slot_device, nmi_w))
+ SPECTRUM_EXPANSION_SLOT(config, m_exp1, spectrum_expansion_devices, nullptr);
+ m_exp1->irq_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::irq_w));
+ m_exp1->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w));
- MCFG_SPECTRUM_EXPANSION_SLOT_ADD("exp2", spectrum_expansion_devices, nullptr)
- MCFG_SPECTRUM_EXPANSION_SLOT_IRQ_HANDLER(WRITELINE(DEVICE_SELF_OWNER, spectrum_expansion_slot_device, irq_w))
- MCFG_SPECTRUM_EXPANSION_SLOT_NMI_HANDLER(WRITELINE(DEVICE_SELF_OWNER, spectrum_expansion_slot_device, nmi_w))
-MACHINE_CONFIG_END
+ SPECTRUM_EXPANSION_SLOT(config, m_exp2, spectrum_expansion_devices, nullptr);
+ m_exp2->irq_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::irq_w));
+ m_exp2->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(spectrum_expansion_slot_device::nmi_w));
+}
//**************************************************************************
// LIVE DEVICE
@@ -54,7 +55,6 @@ spectrum_uslot_device::spectrum_uslot_device(const machine_config &mconfig, cons
void spectrum_uslot_device::device_start()
{
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
}
@@ -64,6 +64,8 @@ void spectrum_uslot_device::device_start()
void spectrum_uslot_device::device_reset()
{
+ m_exp1->set_io_space(&io_space());
+ m_exp2->set_io_space(&io_space());
}
diff --git a/src/devices/bus/spectrum/usource.cpp b/src/devices/bus/spectrum/usource.cpp
index 6df423d9883..b4fb9c5797a 100644
--- a/src/devices/bus/spectrum/usource.cpp
+++ b/src/devices/bus/spectrum/usource.cpp
@@ -60,7 +60,6 @@ spectrum_usource_device::spectrum_usource_device(const machine_config &mconfig,
void spectrum_usource_device::device_start()
{
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
}
diff --git a/src/devices/bus/spectrum/uspeech.cpp b/src/devices/bus/spectrum/uspeech.cpp
index 852ac24c11d..87f66ca0182 100644
--- a/src/devices/bus/spectrum/uspeech.cpp
+++ b/src/devices/bus/spectrum/uspeech.cpp
@@ -76,7 +76,6 @@ spectrum_uspeech_device::spectrum_uspeech_device(const machine_config &mconfig,
void spectrum_uspeech_device::device_start()
{
- m_slot = dynamic_cast<spectrum_expansion_slot_device *>(owner());
}