mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
svi3x8/expander: Implement device_mixer_interface
This commit is contained in:
parent
f1bba83c9a
commit
5e8ec1710e
@ -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));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -39,16 +39,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// forward declaration
|
||||
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>
|
||||
//**************************************************************************
|
||||
// BUS DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
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
|
||||
|
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user