diff options
Diffstat (limited to 'src/emu/sound.h')
-rw-r--r-- | src/emu/sound.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/emu/sound.h b/src/emu/sound.h index c1e66808ae6..15f6a5743a2 100644 --- a/src/emu/sound.h +++ b/src/emu/sound.h @@ -373,6 +373,7 @@ public: // safely write a sample to the buffer void put(s32 start, sample_t sample) { + sound_assert(u32(start) < samples()); m_buffer->put(index_to_buffer_index(start), sample); } @@ -399,6 +400,7 @@ public: // safely add a sample to the buffer void add(s32 start, sample_t sample) { + sound_assert(u32(start) < samples()); u32 index = index_to_buffer_index(start); m_buffer->put(index, m_buffer->get(index) + sample); } @@ -458,7 +460,6 @@ private: // given a stream starting offset, return the buffer index u32 index_to_buffer_index(s32 start) const { - sound_assert(u32(start) < samples()); u32 index = start + m_start; if (index >= m_buffer->size()) index -= m_buffer->size(); @@ -669,11 +670,14 @@ private: // handle updates after a save state load void postload(); + // handle updates before a save state load + void presave(); + // re-print the synchronization timer void reprime_sync_timer(); // timer callback for synchronous streams - void sync_update(void *, s32); + void sync_update(s32); // return a view of 0 data covering the given time period read_stream_view empty_view(attotime start, attotime end); @@ -692,6 +696,8 @@ private: bool m_resampling_disabled; // is resampling of input streams disabled? emu_timer *m_sync_timer; // update timer for synchronous streams + attotime m_last_update_end_time; // last end_time() in update + // input information std::vector<sound_stream_input> m_input; // list of streams we directly depend upon std::vector<read_stream_view> m_input_view; // array of output views for passing to the callback @@ -816,7 +822,7 @@ private: stream_buffer::sample_t adjust_toward_compressor_scale(stream_buffer::sample_t curscale, stream_buffer::sample_t prevsample, stream_buffer::sample_t rawsample); // periodic sound update, called STREAMS_UPDATE_FREQUENCY per second - void update(void *ptr = nullptr, s32 param = 0); + void update(s32 param = 0); // internal state running_machine &m_machine; // reference to the running machine |