diff options
Diffstat (limited to 'src/devices/sound/rf5c68.h')
-rw-r--r-- | src/devices/sound/rf5c68.h | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/src/devices/sound/rf5c68.h b/src/devices/sound/rf5c68.h index 262efb54286..f95dc124650 100644 --- a/src/devices/sound/rf5c68.h +++ b/src/devices/sound/rf5c68.h @@ -26,17 +26,9 @@ class rf5c68_device : public device_t, public: typedef device_delegate<void (int channel)> sample_end_cb_delegate; - rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - void set_end_callback(sample_end_cb_delegate callback) { m_sample_end_cb = callback; } - template <class FunctionClass> void set_end_callback(const char *devname, void (FunctionClass::*callback)(int), const char *name) - { - set_end_callback(sample_end_cb_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr))); - } - template <class FunctionClass> void set_end_callback(void (FunctionClass::*callback)(int), const char *name) - { - set_end_callback(sample_end_cb_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr))); - } + template <typename... T> void set_end_callback(T &&... args) { m_sample_end_cb.set(std::forward<T>(args)...); } u8 rf5c68_r(offs_t offset); void rf5c68_w(offs_t offset, u8 data); @@ -44,20 +36,22 @@ public: u8 rf5c68_mem_r(offs_t offset); void rf5c68_mem_w(offs_t offset, u8 data); + void map(address_map &map) ATTR_COLD; protected: - rf5c68_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + rf5c68_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int output_bits); // device-level overrides - virtual void device_start() override; + virtual void device_start() override ATTR_COLD; virtual void device_clock_changed() override; // sound stream update overrides - virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + virtual void sound_stream_update(sound_stream &stream) override; // device_memory_interface configuration virtual space_config_vector memory_space_config() const override; address_space_config m_data_config; + private: static constexpr unsigned NUM_CHANNELS = 8; @@ -65,22 +59,24 @@ private: { pcm_channel() { } - uint8_t enable = 0; - uint8_t env = 0; - uint8_t pan = 0; - uint8_t start = 0; - uint32_t addr = 0; - uint16_t step = 0; - uint16_t loopst = 0; + u8 enable = 0; + u8 env = 0; + u8 pan = 0; + u8 start = 0; + u32 addr = 0; + u16 step = 0; + u16 loopst = 0; }; - address_space *m_data; - memory_access_cache<0, 0, ENDIANNESS_LITTLE> *m_cache; - sound_stream* m_stream; - pcm_channel m_chan[NUM_CHANNELS]; - uint8_t m_cbank; - uint16_t m_wbank; - uint8_t m_enable; + memory_access<16, 0, 0, ENDIANNESS_LITTLE>::cache m_cache; + sound_stream* m_stream; + pcm_channel m_chan[NUM_CHANNELS]; + u8 m_cbank; + u16 m_wbank; + u8 m_enable; + int m_output_bits; + std::vector<s32> m_mixleft; + std::vector<s32> m_mixright; sample_end_cb_delegate m_sample_end_cb; }; @@ -88,7 +84,9 @@ private: class rf5c164_device : public rf5c68_device { public: - rf5c164_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rf5c164_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + void rf5c164_map(address_map &map) ATTR_COLD; }; DECLARE_DEVICE_TYPE(RF5C68, rf5c68_device) |