diff options
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/sound/disc_cls.h | 14 | ||||
-rw-r--r-- | src/devices/sound/disc_inp.hxx | 7 | ||||
-rw-r--r-- | src/devices/sound/discrete.cpp | 5 | ||||
-rw-r--r-- | src/devices/sound/spkrdev.cpp | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/devices/sound/disc_cls.h b/src/devices/sound/disc_cls.h index 2ea8498d2f1..72a5c39920a 100644 --- a/src/devices/sound/disc_cls.h +++ b/src/devices/sound/disc_cls.h @@ -120,14 +120,14 @@ public: /* Add gain to the output and put into the buffers */ /* Clipping will be handled by the main sound system */ double val = DISCRETE_INPUT(0) * DISCRETE_INPUT(1); - m_stream->put(m_stream_output, m_outview_sample++, val * (1.0 / 32768.0)); + m_stream->put(m_stream_output, m_stream_sample++, val * (1.0 / 32768.0)); } virtual int max_output() override { return 0; } - virtual void set_output_ptr(sound_stream &stream, int output) override { m_stream = &stream; m_stream_output = output; m_outview_sample = 0; } + virtual void set_output_ptr(sound_stream &stream, int output) override { m_stream = &stream; m_stream_output = output; m_stream_sample = 0; } private: sound_stream *m_stream = nullptr; int m_stream_output = 0; - u32 m_outview_sample = 0U; + u32 m_stream_sample = 0U; }; DISCRETE_CLASS(dso_csvlog, 0, @@ -228,13 +228,15 @@ public: virtual void start() override; virtual void input_write(int sub_node, uint8_t data ) override; virtual bool is_buffered() { return false; } + void set_input_ptr(sound_stream &stream, int input) { m_stream = &stream; m_stream_input = input; m_stream_sample = 0; } /* This is called by discrete_sound_device */ void stream_start(); -//protected: - uint32_t m_stream_in_number = 0; - uint32_t m_inview_sample = 0; +protected: + sound_stream *m_stream = nullptr; + uint32_t m_stream_input = 0; + uint32_t m_stream_sample = 0; private: double m_gain = 0.0; /* node gain */ double m_offset = 0.0; /* node offset */ diff --git a/src/devices/sound/disc_inp.hxx b/src/devices/sound/disc_inp.hxx index 432f8c076bf..ef000e6b331 100644 --- a/src/devices/sound/disc_inp.hxx +++ b/src/devices/sound/disc_inp.hxx @@ -246,12 +246,9 @@ DISCRETE_STEP(dss_input_stream) { /* the context pointer is set to point to the current input stream data in discrete_stream_update */ if (m_is_buffered) - { set_output(0, m_data * m_gain + m_offset); - m_inview_sample++; - } else - set_output(0, 0); + set_output(0, m_stream->get(m_stream_input, m_stream_sample ++) * 32768.0 * m_gain + m_offset); } DISCRETE_RESET(dss_input_stream) @@ -282,8 +279,6 @@ DISCRETE_START(dss_input_stream) { discrete_base_node::start(); - /* Stream out number is set during start */ - m_stream_in_number = DSS_INPUT_STREAM__STREAM; m_gain = DSS_INPUT_STREAM__GAIN; m_offset = DSS_INPUT_STREAM__OFFSET; diff --git a/src/devices/sound/discrete.cpp b/src/devices/sound/discrete.cpp index 5e5c1a05ecf..3e97bff89da 100644 --- a/src/devices/sound/discrete.cpp +++ b/src/devices/sound/discrete.cpp @@ -1056,10 +1056,13 @@ void discrete_sound_device::sound_stream_update(sound_stream &stream) outputnum++; } + int inputnum = 0; + /* Setup any input streams */ for (discrete_dss_input_stream_node *node : m_input_stream_list) { - node->m_inview_sample = 0; + node->set_input_ptr(stream, inputnum); + inputnum++; } /* just process it */ diff --git a/src/devices/sound/spkrdev.cpp b/src/devices/sound/spkrdev.cpp index 841656ab4ac..16dc6199c2f 100644 --- a/src/devices/sound/spkrdev.cpp +++ b/src/devices/sound/spkrdev.cpp @@ -268,7 +268,7 @@ void speaker_sound_device::level_w(int new_level) /* This is redundant because time update has to be done within sound_stream_update() anyway, * however this ensures synchronization between the speaker and stream timing: */ - m_channel_last_sample_time = m_channel->sample_time(); + m_channel_last_sample_time = m_channel->end_time(); /* sample_time() may be ahead of us */ if (m_channel_last_sample_time > time) |