summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2024-04-20 15:51:14 +0200
committer Dirk Best <mail@dirk-best.de>2024-04-20 15:52:47 +0200
commit5e8ec1710ecb0a7bcd487b59f66f06f34ef84d21 (patch)
tree9c6b9e61c70e0f3f848f4439b7f989591b0decd7
parentf1bba83c9a8756ffa5fbc0e6cb622d0350de2dac (diff)
svi3x8/expander: Implement device_mixer_interface
-rw-r--r--src/devices/bus/svi3x8/expander/expander.cpp7
-rw-r--r--src/devices/bus/svi3x8/expander/expander.h23
-rw-r--r--src/devices/bus/svi3x8/expander/sv603.cpp5
-rw-r--r--src/devices/bus/svi3x8/expander/sv603.h4
-rw-r--r--src/mame/svi/svi318.cpp1
5 files changed, 25 insertions, 15 deletions
diff --git a/src/devices/bus/svi3x8/expander/expander.cpp b/src/devices/bus/svi3x8/expander/expander.cpp
index b04c456fd95..652e32467b5 100644
--- a/src/devices/bus/svi3x8/expander/expander.cpp
+++ b/src/devices/bus/svi3x8/expander/expander.cpp
@@ -30,6 +30,7 @@ DEFINE_DEVICE_TYPE(SVI_EXPANDER, svi_expander_device, "svi_expander", "SVI 318/3
svi_expander_device::svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, SVI_EXPANDER, tag, owner, clock),
device_single_card_slot_interface<device_svi_expander_interface>(mconfig, *this),
+ device_mixer_interface(mconfig, *this),
m_module(nullptr),
m_int_handler(*this),
m_romdis_handler(*this),
@@ -37,7 +38,8 @@ svi_expander_device::svi_expander_device(const machine_config &mconfig, const ch
m_ctrl1_handler(*this),
m_ctrl2_handler(*this),
m_excsr_handler(*this, 0xff),
- m_excsw_handler(*this)
+ m_excsw_handler(*this),
+ m_dummy(0)
{
}
@@ -57,6 +59,9 @@ void svi_expander_device::device_start()
{
// get inserted module
m_module = get_card_device();
+
+ // register for save states
+ save_item(NAME(m_dummy));
}
//-------------------------------------------------
diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h
index 5e63daaadbb..62fc16a337c 100644
--- a/src/devices/bus/svi3x8/expander/expander.h
+++ b/src/devices/bus/svi3x8/expander/expander.h
@@ -39,16 +39,18 @@
#pragma once
+// forward declaration
+class device_svi_expander_interface;
+
//**************************************************************************
-// TYPE DEFINITIONS
+// BUS DEVICE
//**************************************************************************
-class device_svi_expander_interface;
-
-// ======================> svi_expander_device
-
-class svi_expander_device : public device_t, public device_single_card_slot_interface<device_svi_expander_interface>
+class svi_expander_device :
+ public device_t,
+ public device_single_card_slot_interface<device_svi_expander_interface>,
+ public device_mixer_interface
{
public:
// construction/destruction
@@ -110,9 +112,14 @@ private:
devcb_read8 m_excsr_handler;
devcb_write8 m_excsw_handler;
+
+ uint8_t m_dummy; // needed for save-state support
};
-// ======================> device_svi_expander_interface
+
+//**************************************************************************
+// CARD INTERFACE
+//**************************************************************************
class device_svi_expander_interface : public device_interface
{
@@ -136,7 +143,7 @@ protected:
svi_expander_device *m_expander;
};
-// device type definition
+// device type declaration
DECLARE_DEVICE_TYPE(SVI_EXPANDER, svi_expander_device)
// include here so drivers don't need to
diff --git a/src/devices/bus/svi3x8/expander/sv603.cpp b/src/devices/bus/svi3x8/expander/sv603.cpp
index d64b5ef13a2..c52902cc69c 100644
--- a/src/devices/bus/svi3x8/expander/sv603.cpp
+++ b/src/devices/bus/svi3x8/expander/sv603.cpp
@@ -9,7 +9,6 @@
#include "emu.h"
#include "sv603.h"
#include "softlist_dev.h"
-#include "speaker.h"
//**************************************************************************
@@ -38,8 +37,8 @@ const tiny_rom_entry *sv603_device::device_rom_region() const
void sv603_device::device_add_mconfig(machine_config &config)
{
- SPEAKER(config, "mono").front_center();
- SN76489A(config, m_snd, XTAL(10'738'635) / 3).add_route(ALL_OUTPUTS, "mono", 1.00);
+ SN76489A(config, m_snd, XTAL(10'738'635) / 3);
+ m_snd->add_route(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0);
// controller ports
COLECOVISION_CONTROL_PORT(config, m_joy[0], colecovision_control_port_devices, "hand");
diff --git a/src/devices/bus/svi3x8/expander/sv603.h b/src/devices/bus/svi3x8/expander/sv603.h
index 2cde9ebf3b7..a0bc5297835 100644
--- a/src/devices/bus/svi3x8/expander/sv603.h
+++ b/src/devices/bus/svi3x8/expander/sv603.h
@@ -21,8 +21,6 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> sv603_device
-
class sv603_device : public device_t, public device_svi_expander_interface
{
public:
@@ -50,7 +48,7 @@ private:
required_device<colecovision_cartridge_slot_device> m_cart;
};
-// device type definition
+// device type declaration
DECLARE_DEVICE_TYPE(SV603, sv603_device)
#endif // MAME_BUS_SVI3X8_EXPANDER_SV603_H
diff --git a/src/mame/svi/svi318.cpp b/src/mame/svi/svi318.cpp
index a6b1dd66f14..1d643dbcfc5 100644
--- a/src/mame/svi/svi318.cpp
+++ b/src/mame/svi/svi318.cpp
@@ -560,6 +560,7 @@ void svi3x8_state::svi318(machine_config &config)
m_expander->ctrl1_handler().set(FUNC(svi3x8_state::ctrl1_w));
m_expander->excsr_handler().set(m_vdp, FUNC(tms9928a_device::read));
m_expander->excsw_handler().set(m_vdp, FUNC(tms9928a_device::write));
+ m_expander->add_route(ALL_OUTPUTS, "mono", 1.00);
}
void svi3x8_state::svi318p(machine_config &config)