diff options
author | Ivan Vangelista <mesgnet@yahoo.it> | 2017-05-24 16:44:58 +0200 |
---|---|---|
committer | Ivan Vangelista <mesgnet@yahoo.it> | 2017-05-24 16:44:58 +0200 |
commit | 02e20545e7950e7a75a1750dadba76b8161d0827 (patch) | |
tree | b79cfaab5483ca21bda7e5b70bf90a92f0bbbdcb | |
parent | 561311477307cd5807566e5cf966d2be276a6b19 (diff) |
updated devices/sound devices to use device_add_mconfig insted of device_mconfig_additions (nw)
-rw-r--r-- | src/devices/sound/ad1848.cpp | 6 | ||||
-rw-r--r-- | src/devices/sound/ad1848.h | 5 | ||||
-rw-r--r-- | src/devices/sound/bsmt2000.cpp | 24 | ||||
-rw-r--r-- | src/devices/sound/bsmt2000.h | 5 | ||||
-rw-r--r-- | src/devices/sound/cdp1869.cpp | 15 | ||||
-rw-r--r-- | src/devices/sound/cdp1869.h | 6 | ||||
-rw-r--r-- | src/devices/sound/es1373.cpp | 7 | ||||
-rw-r--r-- | src/devices/sound/es1373.h | 4 | ||||
-rw-r--r-- | src/devices/sound/qsound.cpp | 20 | ||||
-rw-r--r-- | src/devices/sound/qsound.h | 2 |
10 files changed, 32 insertions, 62 deletions
diff --git a/src/devices/sound/ad1848.cpp b/src/devices/sound/ad1848.cpp index 1cc3b7f9647..8f30b7def32 100644 --- a/src/devices/sound/ad1848.cpp +++ b/src/devices/sound/ad1848.cpp @@ -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() { diff --git a/src/devices/sound/ad1848.h b/src/devices/sound/ad1848.h index 4b410adcdf2..0822a9979ba 100644 --- a/src/devices/sound/ad1848.h +++ b/src/devices/sound/ad1848.h @@ -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 { diff --git a/src/devices/sound/bsmt2000.cpp b/src/devices/sound/bsmt2000.cpp index 334ec36e855..612d1cd0dec 100644 --- a/src/devices/sound/bsmt2000.cpp +++ b/src/devices/sound/bsmt2000.cpp @@ -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 //------------------------------------------------- diff --git a/src/devices/sound/bsmt2000.h b/src/devices/sound/bsmt2000.h index 9a7494777c5..48380ad253f 100644 --- a/src/devices/sound/bsmt2000.h +++ b/src/devices/sound/bsmt2000.h @@ -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 ); }; diff --git a/src/devices/sound/cdp1869.cpp b/src/devices/sound/cdp1869.cpp index 4546f8c22bc..de927b2795c 100644 --- a/src/devices/sound/cdp1869.cpp +++ b/src/devices/sound/cdp1869.cpp @@ -354,20 +354,15 @@ cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, d { } -static MACHINE_CONFIG_START( cdp1869 ) - 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 +// device_add_mconfig - add device configuration //------------------------------------------------- -machine_config_constructor cdp1869_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( cdp1869 ); -} +MACHINE_CONFIG_MEMBER( cdp1869_device::device_add_mconfig ) + MCFG_PALETTE_ADD("palette", 8+64) + MCFG_PALETTE_INIT_OWNER(cdp1869_device, cdp1869) +MACHINE_CONFIG_END //------------------------------------------------- diff --git a/src/devices/sound/cdp1869.h b/src/devices/sound/cdp1869.h index f80da696867..8023da30d61 100644 --- a/src/devices/sound/cdp1869.h +++ b/src/devices/sound/cdp1869.h @@ -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); }; diff --git a/src/devices/sound/es1373.cpp b/src/devices/sound/es1373.cpp index 4dd5079b58e..b4dfbf18359 100644 --- a/src/devices/sound/es1373.cpp +++ b/src/devices/sound/es1373.cpp @@ -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) diff --git a/src/devices/sound/es1373.h b/src/devices/sound/es1373.h index 848e175fa58..49c728f6a10 100644 --- a/src/devices/sound/es1373.h +++ b/src/devices/sound/es1373.h @@ -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 diff --git a/src/devices/sound/qsound.cpp b/src/devices/sound/qsound.cpp index 2eb71f53965..78840603199 100644 --- a/src/devices/sound/qsound.cpp +++ b/src/devices/sound/qsound.cpp @@ -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 //------------------------------------------------- diff --git a/src/devices/sound/qsound.h b/src/devices/sound/qsound.h index fa5732dab1f..836f9a64eb5 100644 --- a/src/devices/sound/qsound.h +++ b/src/devices/sound/qsound.h @@ -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 |