updated devices/sound devices to use device_add_mconfig insted of device_mconfig_additions (nw)

This commit is contained in:
Ivan Vangelista 2017-05-24 16:44:58 +02:00
parent 5613114773
commit 02e20545e7
10 changed files with 33 additions and 63 deletions

View File

@ -21,7 +21,7 @@ ad1848_device::ad1848_device(const machine_config &mconfig, const char *tag, dev
{
}
static MACHINE_CONFIG_START( ad1848_config )
MACHINE_CONFIG_MEMBER( ad1848_device::device_add_mconfig )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("ldac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.5) // unknown DAC
MCFG_SOUND_ADD("rdac", DAC_16BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.5) // unknown DAC
@ -30,10 +30,6 @@ static MACHINE_CONFIG_START( ad1848_config )
MCFG_SOUND_ROUTE_EX(0, "rdac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "rdac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
machine_config_constructor ad1848_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( ad1848_config );
}
void ad1848_device::device_start()
{

View File

@ -22,16 +22,17 @@ public:
template <class Object> static devcb_base &set_irq_callback(device_t &device, Object &&cb) { return downcast<ad1848_device &>(device).m_irq_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_drq_callback(device_t &device, Object &&cb) { return downcast<ad1848_device &>(device).m_drq_cb.set_callback(std::forward<Object>(cb)); }
virtual machine_config_constructor device_mconfig_additions() const override;
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
DECLARE_READ8_MEMBER(dack_r);
DECLARE_WRITE8_MEMBER(dack_w);
protected:
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual void device_add_mconfig(machine_config &config) override;
private:
union {

View File

@ -42,16 +42,6 @@ static ADDRESS_MAP_START(tms_io_map, AS_IO, 16, bsmt2000_device)
ADDRESS_MAP_END
// machine fragment
static MACHINE_CONFIG_START( bsmt2000 )
MCFG_CPU_ADD("bsmt2000", TMS32015, DERIVED_CLOCK(1,1))
MCFG_CPU_PROGRAM_MAP(tms_program_map)
// data map is internal to the CPU
MCFG_CPU_IO_MAP(tms_io_map)
MCFG_TMS32010_BIO_IN_CB(READLINE(bsmt2000_device, tms_write_pending_r))
MACHINE_CONFIG_END
// ROM definition for the BSMT2000 program ROM
ROM_START( bsmt2000 )
ROM_REGION( 0x2000, "bsmt2000", 0 )
@ -111,14 +101,16 @@ const tiny_rom_entry *bsmt2000_device::device_rom_region() const
//-------------------------------------------------
// machine_config_additions - return a pointer to
// the device's machine fragment
// device_add_mconfig - add device configuration
//-------------------------------------------------
machine_config_constructor bsmt2000_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( bsmt2000 );
}
MACHINE_CONFIG_MEMBER( bsmt2000_device::device_add_mconfig )
MCFG_CPU_ADD("bsmt2000", TMS32015, DERIVED_CLOCK(1,1))
MCFG_CPU_PROGRAM_MAP(tms_program_map)
// data map is internal to the CPU
MCFG_CPU_IO_MAP(tms_io_map)
MCFG_TMS32010_BIO_IN_CB(READLINE(bsmt2000_device, tms_write_pending_r))
MACHINE_CONFIG_END
//-------------------------------------------------

View File

@ -56,7 +56,7 @@ public:
protected:
// device-level overrides
virtual const tiny_rom_entry *device_rom_region() const override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
@ -76,7 +76,6 @@ public:
DECLARE_WRITE16_MEMBER( tms_rom_bank_w );
DECLARE_WRITE16_MEMBER( tms_left_w );
DECLARE_WRITE16_MEMBER( tms_right_w );
DECLARE_READ_LINE_MEMBER( tms_write_pending_r );
private:
// timers
@ -100,6 +99,8 @@ private:
int16_t m_left_data;
int16_t m_right_data;
bool m_write_pending;
DECLARE_READ_LINE_MEMBER( tms_write_pending_r );
};

View File

@ -354,21 +354,16 @@ cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, d
{
}
static MACHINE_CONFIG_START( cdp1869 )
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
MACHINE_CONFIG_MEMBER( cdp1869_device::device_add_mconfig )
MCFG_PALETTE_ADD("palette", 8+64)
MCFG_PALETTE_INIT_OWNER(cdp1869_device, cdp1869)
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - return a pointer to
// the device's machine fragment
//-------------------------------------------------
machine_config_constructor cdp1869_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( cdp1869 );
}
//-------------------------------------------------
// device_start - device-specific startup

View File

@ -195,8 +195,6 @@ public:
static void static_set_pcb_read(device_t &device, pcb_read_delegate &&cb) { downcast<cdp1869_device &>(device).m_in_pcb_func = std::move(cb); }
static void static_set_color_clock(device_t &device, int color_clock) { downcast<cdp1869_device &>(device).m_color_clock = color_clock; }
DECLARE_PALETTE_INIT(cdp1869);
virtual DECLARE_ADDRESS_MAP(io_map, 8);
virtual DECLARE_ADDRESS_MAP(char_map, 8);
virtual DECLARE_ADDRESS_MAP(page_map, 8);
@ -220,7 +218,7 @@ public:
protected:
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const override;
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_post_load() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
@ -286,6 +284,8 @@ private:
uint8_t m_toneamp; // tone output amplitude
uint8_t m_wnfreq; // white noise range select
uint8_t m_wnamp; // white noise output amplitude
DECLARE_PALETTE_INIT(cdp1869);
};

View File

@ -71,15 +71,10 @@
#define ES_PCI_READ 0
#define ES_PCI_WRITE 1
static MACHINE_CONFIG_START( es1373 )
MACHINE_CONFIG_MEMBER( es1373_device::device_add_mconfig )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MACHINE_CONFIG_END
machine_config_constructor es1373_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( es1373 );
}
DEFINE_DEVICE_TYPE(ES1373, es1373_device, "es1373", "Creative Labs Ensoniq AudioPCI97 ES1373")
DEVICE_ADDRESS_MAP_START(map, 32, es1373_device)

View File

@ -30,14 +30,12 @@ public:
DECLARE_READ32_MEMBER (reg_r);
DECLARE_WRITE32_MEMBER(reg_w);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const override;
protected:
virtual void device_start() override;
virtual void device_stop() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual void device_add_mconfig(machine_config &config) override;
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
// Sound stream

View File

@ -56,14 +56,6 @@ static ADDRESS_MAP_START( dsp16_data_map, AS_DATA, 16, qsound_device )
ADDRESS_MAP_END
// machine fragment
static MACHINE_CONFIG_START( qsound )
MCFG_CPU_ADD("qsound", DSP16, QSOUND_CLOCK)
MCFG_CPU_PROGRAM_MAP(dsp16_program_map)
MCFG_CPU_DATA_MAP(dsp16_data_map)
MACHINE_CONFIG_END
// ROM definition for the Qsound program ROM
ROM_START( qsound )
ROM_REGION( 0x6000, "qsound", 0 )
@ -102,14 +94,14 @@ const tiny_rom_entry *qsound_device::device_rom_region() const
//-------------------------------------------------
// machine_config_additions - return a pointer to
// the device's machine fragment
// device_add_mconfig - add device configuration
//-------------------------------------------------
machine_config_constructor qsound_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( qsound );
}
MACHINE_CONFIG_MEMBER( qsound_device::device_add_mconfig )
MCFG_CPU_ADD("qsound", DSP16, QSOUND_CLOCK)
MCFG_CPU_PROGRAM_MAP(dsp16_program_map)
MCFG_CPU_DATA_MAP(dsp16_data_map)
MACHINE_CONFIG_END
//-------------------------------------------------

View File

@ -39,7 +39,7 @@ public:
protected:
// device-level overrides
const tiny_rom_entry *device_rom_region() const override;
machine_config_constructor device_mconfig_additions() const override;
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
// sound stream update overrides