Route sound relative to current device.

Also, look Ma - no magic prologue!

Slot card additions run in the context of the slot itself, which isn't
entirely intuitive.  Slot configuration needs a bunch of other cleanup
anyway.
This commit is contained in:
Vas Crabb 2018-05-01 21:35:58 +10:00
parent 5470866582
commit 384bf0e510
27 changed files with 258 additions and 182 deletions

View File

@ -49,8 +49,8 @@ WRITE_LINE_MEMBER(isa16_ide_device::ide_interrupt)
void isa16_ide_device::cdrom_headphones(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE(0, "^^^^lheadphone", 1.0)
MCFG_SOUND_ROUTE(1, "^^^^rheadphone", 1.0)
MCFG_SOUND_ROUTE(0, "^^lheadphone", 1.0)
MCFG_SOUND_ROUTE(1, "^^rheadphone", 1.0)
}
static INPUT_PORTS_START( ide )

View File

@ -20,6 +20,7 @@
#include <functional>
#include <iterator>
#include <stdexcept>
#include <string>
#include <type_traits>
//**************************************************************************
@ -249,6 +250,15 @@ public:
/// otherwise.
virtual bool findit(bool isvalidation = false) = 0;
/// \brief Clear temporary binding from configuration
///
/// Concrete derived classes must implement this member function.
/// Object finders may allow temporary binding to the anticipated
/// target during configuration. This needs to be cleared to ensure
/// the correct target is found if a device further up the hierarchy
/// subsequently removes or replaces devices.
virtual void end_configuration() = 0;
/// \brief Get search tag
///
/// Returns the search tag.
@ -287,10 +297,8 @@ public:
/// Some objects must be resolved before memory maps are loaded
/// (devices for instance), some after (memory shares for
/// instance).
///
/// \return True if the target object has to be resolved before
/// memory maps are loaded
/// memory maps are loaded
virtual bool is_pre_map() const { return false; }
/// \brief Dummy tag always treated as not found
@ -412,6 +420,14 @@ template <class ObjectClass, bool Required>
class object_finder_base : public finder_base
{
public:
/// \brief Clear temporary binding from configuration
///
/// Object finders may allow temporary binding to the anticipated
/// target during configuration. This needs to be cleared to ensure
/// the correct target is found if a device further up the hierarchy
/// subsequently removes or replaces devices.
virtual void end_configuration() override { m_target = nullptr; }
/// \brief Get pointer to target object
/// \return Pointer to target object if found, or nullptr otherwise.
ObjectClass *target() const { return m_target; }
@ -494,12 +510,53 @@ public:
/// Some objects must be resolved before memory maps are loaded
/// (devices for instance), some after (memory shares for
/// instance).
///
/// \return True if the target object has to be resolved before
/// memory maps are loaded
/// memory maps are loaded.
virtual bool is_pre_map() const override { return true; }
/// \brief Set target during configuration
///
/// During configuration, device_finder instances may be assigned
/// a reference to the anticipated target device to avoid the need
/// for tempories during configuration. Normal resolution will
/// still happen after machine configuration is completed to ensure
/// device removal/replacement is handled properly.
/// \param [in] device Reference to anticipated target device.
/// \return The same reference supplied by the caller.
template <typename T>
std::enable_if_t<std::is_convertible<T *, DeviceClass *>::value, T &> operator=(T &device)
{
assert(is_expected_tag(device));
this->m_target = &device;
return device;
}
private:
template <typename T> struct is_device_implementation
{ static constexpr bool value = std::is_base_of<device_t, T>::value; };
template <typename T> struct is_device_interface
{ static constexpr bool value = std::is_base_of<device_interface, T>::value && !is_device_implementation<T>::value; };
/// \brief Check that device implementation has expected tag
/// \param [in] device Reference to device.
/// \return True if supplied device matches the configured target
/// tag, or false otherwise.
template <typename T>
std::enable_if_t<is_device_implementation<T>::value, bool> is_expected_tag(T const &device) const
{
return this->m_base.get().subtag(this->m_tag) == device.tag();
}
/// \brief Check that device mixin has expected tag
/// \param [in] device Reference to interface/mixin.
/// \return True if supplied mixin matches the configured target
/// tag, or false otherwise.
template <typename T>
std::enable_if_t<is_device_interface<T>::value, bool> is_expected_tag(T const &interface) const
{
return this->m_base.get().subtag(this->m_tag) == interface.device().tag();
}
/// \brief Find device
///
/// Find device of desired type with requested tag. If a device

View File

@ -215,8 +215,10 @@ std::string device_t::parameter(const char *tag) const
void device_t::add_machine_configuration(machine_config &config)
{
assert(&config == &m_machine_config);
machine_config::token const token(config.begin_configuration(*this));
machine_config::token const tok(config.begin_configuration(*this));
device_add_mconfig(config);
for (finder_base *autodev = m_auto_finder_list; autodev != nullptr; autodev = autodev->next())
autodev->end_configuration();
}
@ -493,8 +495,8 @@ bool device_t::findit(bool pre_map, bool isvalidation) const
if (isvalidation)
{
// sanity checking
const char *tag = autodev->finder_tag();
if (tag == nullptr)
char const *const tag = autodev->finder_tag();
if (!tag)
{
osd_printf_error("Finder tag is null!\n");
allfound = false;

View File

@ -22,9 +22,9 @@
//-------------------------------------------------
device_sound_interface::device_sound_interface(const machine_config &mconfig, device_t &device)
: device_interface(device, "sound"),
m_outputs(0),
m_auto_allocated_inputs(0)
: device_interface(device, "sound")
, m_outputs(0)
, m_auto_allocated_inputs(0)
{
}
@ -38,6 +38,29 @@ device_sound_interface::~device_sound_interface()
}
//-------------------------------------------------
// add_route - send sound output to a consumer
//-------------------------------------------------
void device_sound_interface::add_route(u32 output, const char *target, double gain, u32 input, u32 mixoutput)
{
assert(!device().started());
m_route_list.emplace_back(sound_route{ output, input, mixoutput, float(gain), device().mconfig().current_device(), target });
}
void device_sound_interface::add_route(u32 output, device_sound_interface &target, double gain, u32 input, u32 mixoutput)
{
assert(!device().started());
m_route_list.emplace_back(sound_route{ output, input, mixoutput, float(gain), target.device(), DEVICE_SELF });
}
void device_sound_interface::add_route(u32 output, speaker_device &target, double gain, u32 input, u32 mixoutput)
{
assert(!device().started());
m_route_list.emplace_back(sound_route{ output, input, mixoutput, float(gain), target, DEVICE_SELF });
}
//-------------------------------------------------
// stream_alloc - allocate a stream implicitly
// associated with this device
@ -202,17 +225,17 @@ int device_sound_interface::inputnum_from_device(device_t &source_device, int ou
void device_sound_interface::interface_validity_check(validity_checker &valid) const
{
// loop over all the routes
for (auto &route : routes())
for (sound_route const &route : routes())
{
// find a device with the requested tag
const device_t *target = device().siblingdevice(route->m_target.c_str());
if (target == nullptr)
osd_printf_error("Attempting to route sound to non-existent device '%s'\n", route->m_target.c_str());
device_t const *const target = route.m_base.get().subdevice(route.m_target.c_str());
if (!target)
osd_printf_error("Attempting to route sound to non-existent device '%s'\n", route.m_base.get().subtag(route.m_target.c_str()).c_str());
// if it's not a speaker or a sound device, error
const device_sound_interface *sound;
if (target != nullptr && target->type() != SPEAKER && !target->interface(sound))
osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.c_str(), target->name());
device_sound_interface const *sound;
if (target && (target->type() != SPEAKER) && !target->interface(sound))
osd_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", target->tag(), target->name());
}
}
@ -226,14 +249,14 @@ void device_sound_interface::interface_pre_start()
{
// scan all the sound devices
sound_interface_iterator iter(m_device.machine().root_device());
for (device_sound_interface &sound : iter)
for (device_sound_interface const &sound : iter)
{
// scan each route on the device
for (auto &route : sound.routes())
for (sound_route const &route : sound.routes())
{
// see if we are the target of this route; if we are, make sure the source device is started
device_t *target_device = sound.device().siblingdevice(route->m_target.c_str());
if (target_device == &m_device && !sound.device().started())
device_t *const target_device = route.m_base.get().subdevice(route.m_target.c_str());
if ((target_device == &m_device) && !sound.device().started())
throw device_missing_dependencies();
}
}
@ -243,14 +266,14 @@ void device_sound_interface::interface_pre_start()
for (device_sound_interface &sound : iter)
{
// scan each route on the device
for (auto &route : sound.routes())
for (sound_route &route : sound.routes())
{
// see if we are the target of this route
device_t *target_device = sound.device().siblingdevice(route->m_target.c_str());
if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT)
device_t *const target_device = route.m_base.get().subdevice(route.m_target.c_str());
if ((target_device == &m_device) && (route.m_input == AUTO_ALLOC_INPUT))
{
route->m_input = m_auto_allocated_inputs;
m_auto_allocated_inputs += (route->m_output == ALL_OUTPUTS) ? sound.outputs() : 1;
route.m_input = m_auto_allocated_inputs;
m_auto_allocated_inputs += (route.m_output == ALL_OUTPUTS) ? sound.outputs() : 1;
}
}
}
@ -268,32 +291,32 @@ void device_sound_interface::interface_post_start()
for (device_sound_interface &sound : sound_interface_iterator(m_device.machine().root_device()))
{
// scan each route on the device
for (auto &route : sound.routes())
for (sound_route const &route : sound.routes())
{
// if we are the target of this route, hook it up
device_t *target_device = sound.device().siblingdevice(route->m_target.c_str());
device_t *const target_device = route.m_base.get().subdevice(route.m_target.c_str());
if (target_device == &m_device)
{
// iterate over all outputs, matching any that apply
int inputnum = route->m_input;
int numoutputs = sound.outputs();
int inputnum = route.m_input;
int const numoutputs = sound.outputs();
for (int outputnum = 0; outputnum < numoutputs; outputnum++)
if (route->m_output == outputnum || route->m_output == ALL_OUTPUTS)
if ((route.m_output == outputnum) || (route.m_output == ALL_OUTPUTS))
{
// find the output stream to connect from
int streamoutputnum;
sound_stream *outputstream = sound.output_to_stream_output(outputnum, streamoutputnum);
if (outputstream == nullptr)
fatalerror("Sound device '%s' specifies route for non-existant output #%d\n", route->m_target.c_str(), outputnum);
sound_stream *const outputstream = sound.output_to_stream_output(outputnum, streamoutputnum);
if (!outputstream)
fatalerror("Sound device '%s' specifies route for non-existent output #%d\n", sound.device().tag(), outputnum);
// find the input stream to connect to
int streaminputnum;
sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum);
if (inputstream == nullptr)
fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d\n", route->m_target.c_str(), outputnum, m_device.tag(), inputnum - 1);
sound_stream *const inputstream = input_to_stream_input(inputnum++, streaminputnum);
if (!inputstream)
fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d\n", sound.device().tag(), outputnum, m_device.tag(), inputnum - 1);
// set the input
inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain);
inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route.m_gain);
}
}
}
@ -316,25 +339,6 @@ void device_sound_interface::interface_pre_reset()
//**************************************************************************
// SOUND ROUTE
//**************************************************************************
//-------------------------------------------------
// sound_route - constructor
//-------------------------------------------------
device_sound_interface::sound_route::sound_route(int output, int input, float gain, const char *target, u32 mixoutput)
: m_output(output),
m_input(input),
m_mixoutput(mixoutput),
m_gain(gain),
m_target(target)
{
}
//**************************************************************************
// SIMPLE DERIVED MIXER INTERFACE
//**************************************************************************
@ -381,18 +385,20 @@ void device_mixer_interface::interface_pre_start()
m_outputmap.resize(m_auto_allocated_inputs);
// iterate through all routes that point to us and note their mixer output
for (device_sound_interface &sound : sound_interface_iterator(m_device.machine().root_device()))
for (auto &route : sound.routes())
for (device_sound_interface const &sound : sound_interface_iterator(m_device.machine().root_device()))
{
for (sound_route const &route : sound.routes())
{
// see if we are the target of this route
device_t *target_device = sound.device().siblingdevice(route->m_target.c_str());
if (target_device == &device() && route->m_input < m_auto_allocated_inputs)
device_t *const target_device = route.m_base.get().subdevice(route.m_target.c_str());
if ((target_device == &device()) && (route.m_input < m_auto_allocated_inputs))
{
int count = (route->m_output == ALL_OUTPUTS) ? sound.outputs() : 1;
int const count = (route.m_output == ALL_OUTPUTS) ? sound.outputs() : 1;
for (int output = 0; output < count; output++)
m_outputmap[route->m_input + output] = route->m_mixoutput;
m_outputmap[route.m_input + output] = route.m_mixoutput;
}
}
}
// allocate the mixer stream
m_mixer_stream = stream_alloc(m_auto_allocated_inputs, m_outputs, device().machine().sample_rate());

View File

@ -17,6 +17,8 @@
#ifndef MAME_EMU_DISOUND_H
#define MAME_EMU_DISOUND_H
#include <functional>
//**************************************************************************
// CONSTANTS
@ -66,13 +68,12 @@ public:
class sound_route
{
public:
sound_route(int output, int input, float gain, const char *target, u32 mixoutput);
u32 m_output; // output index, or ALL_OUTPUTS
u32 m_input; // target input index
u32 m_mixoutput; // target mixer output
float m_gain; // gain
std::string m_target; // target tag
u32 m_output; // output index, or ALL_OUTPUTS
u32 m_input; // target input index
u32 m_mixoutput; // target mixer output
float m_gain; // gain
std::reference_wrapper<device_t> m_base; // target search base
std::string m_target; // target tag
};
// construction/destruction
@ -82,13 +83,12 @@ public:
virtual bool issound() { return true; } /// HACK: allow devices to hide from the ui
// configuration access
const std::vector<std::unique_ptr<sound_route>> &routes() const { return m_route_list; }
std::vector<sound_route> const &routes() const { return m_route_list; }
// inline configuration helpers
void add_route(u32 output, const char *target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0)
{
m_route_list.push_back(std::make_unique<sound_route>(output, input, gain, target, mixoutput));
}
// configuration helpers
void add_route(u32 output, const char *target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0);
void add_route(u32 output, device_sound_interface &target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0);
void add_route(u32 output, speaker_device &target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0);
void reset_routes() { m_route_list.clear(); }
// sound stream update overrides
@ -107,6 +107,9 @@ public:
int inputnum_from_device(device_t &device, int outputnum = 0) const;
protected:
// configuration access
std::vector<sound_route> &routes() { return m_route_list; }
// optional operation overrides
virtual void interface_validity_check(validity_checker &valid) const override;
virtual void interface_pre_start() override;
@ -114,7 +117,7 @@ protected:
virtual void interface_pre_reset() override;
// internal state
std::vector<std::unique_ptr<sound_route>> m_route_list; // list of sound routes
std::vector<sound_route> m_route_list; // list of sound routes
int m_outputs; // number of outputs from this instance
int m_auto_allocated_inputs; // number of auto-allocated inputs targeting us
};

View File

@ -225,6 +225,9 @@ class software_list_loader;
class sound_manager;
class sound_stream;
// declared in speaker.h
class speaker_device;
// declared in tilemap.h
class tilemap_device;
class tilemap_manager;

View File

@ -709,16 +709,16 @@ MACHINE_CONFIG_START(atari_jsa_i_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", JSA_MASTER_CLOCK)
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(atari_jsa_base_device, ym2151_port_w))
MCFG_MIXER_ROUTE(0, DEVICE_SELF_OWNER, 0.60, 0)
MCFG_MIXER_ROUTE(1, DEVICE_SELF_OWNER, 0.60, 1)
MCFG_MIXER_ROUTE(0, *this, 0.60, 0)
MCFG_MIXER_ROUTE(1, *this, 0.60, 1)
MCFG_SOUND_ADD("pokey", POKEY, JSA_MASTER_CLOCK/2)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.40, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.40, 1)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.40, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.40, 1)
MCFG_SOUND_ADD("tms", TMS5220C, JSA_MASTER_CLOCK*2/11) // potentially JSA_MASTER_CLOCK/9 as well
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0, 1)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 1.0, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 1.0, 1)
MACHINE_CONFIG_END
@ -839,10 +839,10 @@ MACHINE_CONFIG_START(atari_jsa_ii_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", JSA_MASTER_CLOCK)
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(atari_jsa_base_device, ym2151_port_w))
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.60, 0)
MCFG_OKIM6295_ADD("oki1", JSA_MASTER_CLOCK/3, PIN7_HIGH)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.75, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.75, 0)
MACHINE_CONFIG_END
@ -921,11 +921,11 @@ MACHINE_CONFIG_START(atari_jsa_iii_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", JSA_MASTER_CLOCK)
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundcomm", atari_sound_comm_device, ym2151_irq_gen))
MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(atari_jsa_base_device, ym2151_port_w))
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.60, 0)
MCFG_OKIM6295_ADD("oki1", JSA_MASTER_CLOCK/3, PIN7_HIGH)
MCFG_DEVICE_ADDRESS_MAP(0, jsa3_oki1_map)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.75, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.75, 0)
MACHINE_CONFIG_END
@ -966,10 +966,10 @@ MACHINE_CONFIG_START(atari_jsa_iiis_device::device_add_mconfig)
MCFG_SOUND_MODIFY("ym2151")
MCFG_SOUND_ROUTES_RESET()
MCFG_MIXER_ROUTE(0, DEVICE_SELF_OWNER, 0.60, 0)
MCFG_MIXER_ROUTE(1, DEVICE_SELF_OWNER, 0.60, 1)
MCFG_MIXER_ROUTE(0, *this, 0.60, 0)
MCFG_MIXER_ROUTE(1, *this, 0.60, 1)
MCFG_OKIM6295_ADD("oki2", JSA_MASTER_CLOCK/3, PIN7_HIGH)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.75, 1)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.75, 1)
MCFG_DEVICE_ADDRESS_MAP(0, jsa3_oki2_map)
MACHINE_CONFIG_END

View File

@ -46,7 +46,7 @@ MACHINE_CONFIG_START(midway_cheap_squeak_deluxe_device::device_add_mconfig)
MCFG_PIA_IRQA_HANDLER(WRITELINE(midway_cheap_squeak_deluxe_device, irq_w))
MCFG_PIA_IRQB_HANDLER(WRITELINE(midway_cheap_squeak_deluxe_device, irq_w))
MCFG_SOUND_ADD("dac", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0)
MCFG_SOUND_ADD("dac", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 1.0)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END

View File

@ -120,7 +120,7 @@ MACHINE_CONFIG_START(gottlieb_sound_r0_device::device_add_mconfig)
MCFG_MOS6530_IN_PB_CB(READ8(gottlieb_sound_r0_device, r6530b_r))
// sound devices
MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@ -320,7 +320,7 @@ MACHINE_CONFIG_START(gottlieb_sound_r1_device::device_add_mconfig)
MCFG_RIOT6532_IRQ_CB(WRITELINE(gottlieb_sound_r1_device, snd_interrupt))
// sound devices
MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25) // unknown DAC
MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@ -372,7 +372,7 @@ MACHINE_CONFIG_START(gottlieb_sound_r1_with_votrax_device::device_add_mconfig)
// add the VOTRAX
MCFG_DEVICE_ADD("votrax", VOTRAX_SC01, 720000)
MCFG_VOTRAX_SC01_REQUEST_CB(DEVWRITELINE(DEVICE_SELF, gottlieb_sound_r1_device, votrax_request))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.5)
MACHINE_CONFIG_END
@ -666,20 +666,20 @@ MACHINE_CONFIG_START(gottlieb_sound_r2_device::device_add_mconfig)
MCFG_CPU_PROGRAM_MAP(gottlieb_speech_r2_map)
// sound hardware
MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.075) // unknown DAC
MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.075) // unknown DAC
MCFG_SOUND_ADD("dacvol", DAC_8BIT_R2R, 0) // unknown DAC
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dacvol", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ADD("ay1", AY8913, SOUND2_CLOCK/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.15)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.15)
MCFG_SOUND_ADD("ay2", AY8913, SOUND2_CLOCK/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.15)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.15)
MCFG_SOUND_ADD("spsnd", SP0250, SOUND2_SPEECH_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 1.0)
MACHINE_CONFIG_END

View File

@ -419,12 +419,12 @@ MACHINE_CONFIG_START(midway_ssio_device::device_add_mconfig)
MCFG_SOUND_ADD("ay0", AY8910, SSIO_CLOCK/2/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(midway_ssio_device, porta0_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(midway_ssio_device, portb0_w))
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.33, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.33, 0)
MCFG_SOUND_ADD("ay1", AY8910, SSIO_CLOCK/2/4)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(midway_ssio_device, porta1_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(midway_ssio_device, portb1_w))
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.33, 1)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.33, 1)
MACHINE_CONFIG_END
@ -599,7 +599,7 @@ MACHINE_CONFIG_START(midway_sounds_good_device::device_add_mconfig)
MCFG_PIA_IRQA_HANDLER(WRITELINE(midway_sounds_good_device, irq_w))
MCFG_PIA_IRQB_HANDLER(WRITELINE(midway_sounds_good_device, irq_w))
MCFG_SOUND_ADD("dac", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0) /// ad7533jn.u10
MCFG_SOUND_ADD("dac", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 1.0) /// ad7533jn.u10
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@ -754,7 +754,7 @@ MACHINE_CONFIG_START(midway_turbo_cheap_squeak_device::device_add_mconfig)
MCFG_PIA_IRQA_HANDLER(WRITELINE(midway_turbo_cheap_squeak_device, irq_w))
MCFG_PIA_IRQB_HANDLER(WRITELINE(midway_turbo_cheap_squeak_device, irq_w))
MCFG_SOUND_ADD("dac", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0)
MCFG_SOUND_ADD("dac", AD7533, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 1.0)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
@ -965,7 +965,7 @@ MACHINE_CONFIG_START(midway_squawk_n_talk_device::device_add_mconfig)
// only used on Discs of Tron, which is stereo
MCFG_SOUND_ADD("tms5200", TMS5200, 640000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.60)
// the board also supports an AY-8912 and/or an 8-bit DAC, neither of
// which are populated on the Discs of Tron board

View File

@ -64,14 +64,14 @@ MACHINE_CONFIG_START(s11c_bg_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", XTAL(3'579'545)) // "3.58 MHz" on schematics and parts list
MCFG_YM2151_IRQ_HANDLER(WRITELINE(s11c_bg_device, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("hc55516_bg", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.5)
MCFG_DEVICE_ADD("pia40", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_byte_interface, write))

View File

@ -187,6 +187,6 @@ MACHINE_CONFIG_START(taito_zoom_device::device_add_mconfig)
MCFG_ZSG2_ADD("zsg2", XTAL(25'000'000))
// we assume the parent machine has created lspeaker/rspeaker
MCFG_SOUND_ROUTE(0, "^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^^rspeaker", 1.0)
MCFG_SOUND_ROUTE(0, "^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^rspeaker", 1.0)
MACHINE_CONFIG_END

View File

@ -187,14 +187,14 @@ MACHINE_CONFIG_START(williams_cvsd_sound_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", CVSD_FM_CLOCK)
MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("pia", pia6821_device, ca1_w)) MCFG_DEVCB_INVERT // IRQ is not true state
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.10)
MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("cvsd", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.60)
MACHINE_CONFIG_END
@ -504,16 +504,16 @@ MACHINE_CONFIG_START(williams_narc_sound_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", NARC_FM_CLOCK)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("cpu0", M6809_FIRQ_LINE))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.10)
MCFG_SOUND_ADD("dac1", AD7224, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
MCFG_SOUND_ADD("dac2", AD7224, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
MCFG_SOUND_ADD("dac1", AD7224, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
MCFG_SOUND_ADD("dac2", AD7224, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac1", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac1", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("cvsd", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.60)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.60)
MACHINE_CONFIG_END
@ -756,15 +756,15 @@ MACHINE_CONFIG_START(williams_adpcm_sound_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", ADPCM_FM_CLOCK)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("cpu", M6809_FIRQ_LINE))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.10)
MCFG_SOUND_ADD("dac", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.10)
MCFG_SOUND_ADD("dac", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.10)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_OKIM6295_ADD("oki", ADPCM_MASTER_CLOCK/8, PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_DEVICE_ADDRESS_MAP(0, williams_adpcm_oki_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.15)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.15)
MACHINE_CONFIG_END

View File

@ -74,14 +74,14 @@ MACHINE_CONFIG_START(wpcsnd_device::device_add_mconfig)
MCFG_YM2151_ADD("ym2151", 3580000)
MCFG_YM2151_IRQ_HANDLER(WRITELINE(wpcsnd_device, ym2151_irq_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
MCFG_SOUND_ADD("dac", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.25)
MCFG_SOUND_ADD("dac", AD7524, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.25)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_SOUND_ADD("hc55516", HC55516, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, *this, 0.5)
MACHINE_CONFIG_END

View File

@ -309,11 +309,11 @@ MACHINE_CONFIG_START(zac1b11107_audio_device::device_add_mconfig)
MCFG_DEVICE_MODIFY("melodypsg1")
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(zac1b11107_audio_device, melodypsg1_porta_w))
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.5, 0)
MCFG_DEVICE_MODIFY("melodypsg2")
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(zac1b11107_audio_device, melodypsg2_porta_w))
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.5, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.5, 0)
MACHINE_CONFIG_END
@ -431,7 +431,7 @@ MACHINE_CONFIG_START(zac1b11142_audio_device::device_add_mconfig)
MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("speech", tms5220_device, data_w))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(zac1b11142_audio_device, pia_1i_portb_w))
MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.40, 0) // mc1408.1f
MCFG_SOUND_ADD("dac", MC1408, 0) MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.40, 0) // mc1408.1f
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
@ -440,11 +440,11 @@ MACHINE_CONFIG_START(zac1b11142_audio_device::device_add_mconfig)
MCFG_SOUND_ADD("speech", TMS5200, 649200) // ROMCLK pin measured at 162.3Khz, OSC is exactly *4 of that)
MCFG_TMS52XX_IRQ_HANDLER(DEVWRITELINE("pia_1i", pia6821_device, cb1_w))
MCFG_TMS52XX_READYQ_HANDLER(DEVWRITELINE("pia_1i", pia6821_device, ca2_w))
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.80, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 0.80, 0)
MCFG_SOUND_ADD("sound_nl", NETLIST_SOUND, 48000)
MCFG_NETLIST_SETUP(zac1b11142)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.0, 0)
MCFG_MIXER_ROUTE(ALL_OUTPUTS, *this, 1.0, 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "ioa0", "I_IOA0.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "ioa1", "I_IOA1.IN", 0)

View File

@ -576,8 +576,8 @@ INPUT_PORTS_END
void dc_cons_state::gdrom_config(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE(0, "^^^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^^^^rspeaker", 1.0)
MCFG_SOUND_ROUTE(0, "^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^^rspeaker", 1.0)
}
MACHINE_CONFIG_START(dc_cons_state::dc)

View File

@ -1163,8 +1163,8 @@ WRITE_LINE_MEMBER( firebeat_state::ata_interrupt )
void firebeat_state::cdrom_config(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE(0, "^^^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^^^^rspeaker", 1.0)
MCFG_SOUND_ROUTE(0, "^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^^rspeaker", 1.0)
}
static SLOT_INTERFACE_START(firebeat_ata_devices)

View File

@ -1888,7 +1888,7 @@ MACHINE_CONFIG_START(gottlieb_state::cobram3)
/* sound hardware */
MCFG_SOUND_MODIFY("r2sound:dac")
MCFG_SOUND_ROUTES_RESET()
MCFG_SOUND_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 1.00)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "r2sound", 1.00)
MACHINE_CONFIG_END

View File

@ -580,7 +580,7 @@ INPUT_PORTS_END
void indigo_state::cdrom_config(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE(0, "^^^^mono", 1.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "^^mono", 1.0)
}
MACHINE_CONFIG_START(indigo_state::indigo3k)

View File

@ -326,8 +326,8 @@ void konamigv_state::driver_start()
void konamigv_state::cdrom_config(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE(0, "^^^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^^^^rspeaker", 1.0)
MCFG_SOUND_ROUTE(0, "^^lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "^^rspeaker", 1.0)
}
MACHINE_CONFIG_START(konamigv_state::konamigv)

View File

@ -2067,8 +2067,8 @@ ADC083X_INPUT_CB(ksys573_state::analogue_inputs_callback)
void ksys573_state::cr589_config(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE( 0, "^^^^lspeaker", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^^^rspeaker", 1.0 )
MCFG_SOUND_ROUTE( 0, "^^lspeaker", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^rspeaker", 1.0 )
}
MACHINE_CONFIG_START(ksys573_state::konami573)

View File

@ -2248,8 +2248,8 @@ MACHINE_CONFIG_END
void pc9801_state::cdrom_headphones(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE(0, "^^^^lheadphone", 1.0)
MCFG_SOUND_ROUTE(1, "^^^^rheadphone", 1.0)
MCFG_SOUND_ROUTE(0, "^^lheadphone", 1.0)
MCFG_SOUND_ROUTE(1, "^^rheadphone", 1.0)
}
MACHINE_CONFIG_START(pc9801_state::pc9801_ide)

View File

@ -2466,8 +2466,8 @@ void segas32_state::system32_cd_map(address_map &map)
void segas32_cd_state::cdrom_config(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE( 0, "^^^^lspeaker", 0.30 )
MCFG_SOUND_ROUTE( 1, "^^^^rspeaker", 0.30 )
MCFG_SOUND_ROUTE( 0, "^^lspeaker", 0.30 )
MCFG_SOUND_ROUTE( 1, "^^rspeaker", 0.30 )
}
MACHINE_CONFIG_START(segas32_cd_state::device_add_mconfig)

View File

@ -139,48 +139,53 @@ static const z80_daisy_config tranz330_daisy_chain[] =
// * - check clocks
// ? - check purported RS232 hookup, inconsistent information found at the relevant webpage vs. user-submitted errata
MACHINE_CONFIG_START(tranz330_state::tranz330)
z80_device &cpu = Z80(config, CPU_TAG, XTAL(7'159'090)/2); //*
cpu.set_addrmap(AS_PROGRAM, address_map_constructor(&tranz330_state::tranz330_mem, tag(), this));
cpu.set_addrmap(AS_IO, address_map_constructor(&tranz330_state::tranz330_io, tag(), this));
cpu.set_daisy_config(tranz330_daisy_chain);
void tranz330_state::tranz330(machine_config &config)
{
m_cpu = Z80(config, CPU_TAG, XTAL(7'159'090)/2); //*
m_cpu->set_addrmap(AS_PROGRAM, address_map_constructor(&tranz330_state::tranz330_mem, tag(), this));
m_cpu->set_addrmap(AS_IO, address_map_constructor(&tranz330_state::tranz330_io, tag(), this));
m_cpu->set_daisy_config(tranz330_daisy_chain);
MCFG_DEVICE_ADD("ctc_clock", CLOCK, XTAL(7'159'090)/4) // ?
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(tranz330_state, clock_w))
CLOCK(config, "ctc_clock", XTAL(7'159'090)/4) // ?
.set_signal_handler(DEVCB_WRITELINE(tranz330_state, clock_w));
MCFG_DEVICE_ADD(RTC_TAG, MSM6242, XTAL(32'768))
MSM6242(config, RTC_TAG, XTAL(32'768));
MCFG_DEVICE_ADD(PIO_TAG, Z80PIO, XTAL(7'159'090)/2) //*
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(CPU_TAG, INPUT_LINE_IRQ0)) //*
MCFG_Z80PIO_OUT_PA_CB(WRITE8(tranz330_state, pio_a_w))
MCFG_Z80PIO_IN_PA_CB(READ8(tranz330_state, card_r))
MCFG_Z80PIO_IN_PB_CB(READ8(tranz330_state, pio_b_r))
m_pio = Z80PIO(config, PIO_TAG, XTAL(7'159'090)/2); //*
m_pio->set_out_int_callback(DEVCB_INPUTLINE(CPU_TAG, INPUT_LINE_IRQ0)); //*
m_pio->set_out_pa_callback(DEVCB_WRITE8(tranz330_state, pio_a_w));
m_pio->set_in_pa_callback(DEVCB_READ8(tranz330_state, card_r));
m_pio->set_in_pb_callback(DEVCB_READ8(tranz330_state, pio_b_r));
MCFG_DEVICE_ADD(DART_TAG, Z80DART, XTAL(7'159'090)/2) //*
MCFG_Z80DART_OUT_SYNCB_CB(WRITELINE(tranz330_state, syncb_w))
MCFG_Z80DART_OUT_TXDB_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) //?
MCFG_Z80DART_OUT_DTRB_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) //?
MCFG_Z80DART_OUT_RTSB_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) //?
MCFG_Z80DART_OUT_INT_CB(INPUTLINE(CPU_TAG, INPUT_LINE_IRQ0))
m_dart = Z80DART(config, DART_TAG, XTAL(7'159'090)/2); //*
m_dart->set_out_syncb_callback(DEVCB_WRITELINE(tranz330_state, syncb_w));
m_dart->set_out_txdb_callback(DEVCB_DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)); //?
m_dart->set_out_dtrb_callback(DEVCB_DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)); //?
m_dart->set_out_rtsb_callback(DEVCB_DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)); //?
m_dart->set_out_int_callback(DEVCB_INPUTLINE(CPU_TAG, INPUT_LINE_IRQ0));
MCFG_DEVICE_ADD(CTC_TAG, Z80CTC, XTAL(7'159'090)/2) //*
MCFG_Z80CTC_ZC2_CB(WRITELINE(tranz330_state, sound_w))
MCFG_Z80CTC_INTR_CB(INPUTLINE(CPU_TAG, INPUT_LINE_IRQ0))
m_ctc = Z80CTC(config, CTC_TAG, XTAL(7'159'090)/2); //*
m_ctc->set_zc_callback<2>(DEVCB_WRITELINE(tranz330_state, sound_w));
m_ctc->set_intr_callback(DEVCB_INPUTLINE(CPU_TAG, INPUT_LINE_IRQ0));
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(DART_TAG, z80dart_device, rxb_w))
MCFG_RS232_DCD_HANDLER(DEVWRITELINE(DART_TAG, z80dart_device, dcdb_w))
MCFG_RS232_CTS_HANDLER(DEVWRITELINE(DART_TAG, z80dart_device, ctsb_w))
m_rs232 = RS232_PORT(config, RS232_TAG, 0);
m_rs232->option_reset();
slot_options_default_rs232_devices(m_rs232);
m_rs232->set_default_option(nullptr);
m_rs232->set_fixed(false);
m_rs232->set_rxd_handler(DEVCB_DEVWRITELINE(DART_TAG, z80dart_device, rxb_w));
m_rs232->set_dcd_handler(DEVCB_DEVWRITELINE(DART_TAG, z80dart_device, dcdb_w));
m_rs232->set_cts_handler(DEVCB_DEVWRITELINE(DART_TAG, z80dart_device, ctsb_w));
// video
MCFG_MIC10937_ADD(VFD_TAG, 0)
MCFG_DEFAULT_LAYOUT( layout_tranz330 )
MIC10937(config, VFD_TAG, 60).set_port_value(0);
config.m_default_layout = &layout_tranz330;
// sound
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
SPEAKER(config, "mono", 0).set_position(0.0, 0.0, 1.0);
SPEAKER_SOUND(config, "speaker", 0)
.add_route(ALL_OUTPUTS, "mono", 0.25);
}
ROM_START( tranz330 )

View File

@ -1069,8 +1069,8 @@ void twinkle_state::scsi_dma_write( uint32_t *p_n_psxram, uint32_t n_address, in
void twinkle_state::cdrom_config(device_t *device)
{
device = device->subdevice("cdda");
MCFG_SOUND_ROUTE( 0, "^^^^speakerleft", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^^^speakerright", 1.0 )
MCFG_SOUND_ROUTE( 0, "^^speakerleft", 1.0 )
MCFG_SOUND_ROUTE( 1, "^^speakerright", 1.0 )
}
MACHINE_CONFIG_START(twinkle_state::twinkle)

View File

@ -61,7 +61,7 @@ protected:
void tranz330_io(address_map &map);
private:
required_device<cpu_device> m_cpu;
required_device<z80_device> m_cpu;
required_device<z80ctc_device> m_ctc;
required_device<z80dart_device> m_dart;
required_device<z80pio_device> m_pio;

View File

@ -250,12 +250,12 @@ void pce_cd_device::nvram_init(nvram_device &nvram, void *data, size_t size)
MCFG_SOUND_ADD( "msm5205", MSM5205, PCE_CD_CLOCK / 6 )
MCFG_MSM5205_VCLK_CB(WRITELINE(pce_cd_device, msm5205_int)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 1/48 prescaler, 4bit data */
MCFG_SOUND_ROUTE( ALL_OUTPUTS, "^:lspeaker", 0.50 )
MCFG_SOUND_ROUTE( ALL_OUTPUTS, "^:rspeaker", 0.50 )
MCFG_SOUND_ROUTE( ALL_OUTPUTS, "^lspeaker", 0.50 )
MCFG_SOUND_ROUTE( ALL_OUTPUTS, "^rspeaker", 0.50 )
MCFG_SOUND_ADD( "cdda", CDDA, 0 )
MCFG_SOUND_ROUTE( 0, "^:lspeaker", 1.00 )
MCFG_SOUND_ROUTE( 1, "^:rspeaker", 1.00 )
MCFG_SOUND_ROUTE( 0, "^lspeaker", 1.00 )
MCFG_SOUND_ROUTE( 1, "^rspeaker", 1.00 )
MACHINE_CONFIG_END