diff options
author | 2013-06-08 08:09:40 +0000 | |
---|---|---|
committer | 2013-06-08 08:09:40 +0000 | |
commit | 91f32095c5c775746c67189982c5d3cfbd7b2939 (patch) | |
tree | 1cd3a8f90e77db887f323e8d5a88944ee43d214e /src/emu/sound | |
parent | f97247cfd5f0a71dacf3c99d687ab0fa730a70f4 (diff) |
added save state to the remaining devices modernized by me in the past few days. nw.
Diffstat (limited to 'src/emu/sound')
-rw-r--r-- | src/emu/sound/speaker.c | 17 | ||||
-rw-r--r-- | src/emu/sound/speaker.h | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c index 54d4e3ff121..0a6783960c5 100644 --- a/src/emu/sound/speaker.c +++ b/src/emu/sound/speaker.c @@ -173,6 +173,21 @@ void speaker_sound_device::device_start() for (i = 0, i < FILTER_LENGTH; i++) m_ampl[i] = 1; #endif + + save_item(NAME(m_level)); + save_item(NAME(m_composed_volume)); + save_item(NAME(m_composed_sample_index)); + save_item(NAME(m_channel_last_sample_time)); + save_item(NAME(m_interm_sample_index)); + save_item(NAME(m_last_update_time)); + + machine().save().register_postload(save_prepost_delegate(FUNC(speaker_sound_device::speaker_postload), this)); +} + +void speaker_sound_device::speaker_postload() +{ + m_channel_next_sample_time = m_channel_last_sample_time + attotime(0, m_channel_sample_period); + m_next_interm_sample_time = m_channel_last_sample_time + attotime(0, m_interm_sample_period); } //------------------------------------------------- @@ -274,7 +289,7 @@ void speaker_sound_device::level_w(int new_level) /* Finally update speaker state before returning */ m_level = new_level; - + } diff --git a/src/emu/sound/speaker.h b/src/emu/sound/speaker.h index a1e3601b85f..d90f3c50316 100644 --- a/src/emu/sound/speaker.h +++ b/src/emu/sound/speaker.h @@ -78,6 +78,8 @@ private: attotime m_next_interm_sample_time; int m_interm_sample_index; /* counts interm. samples between stream samples */ attotime m_last_update_time; /* internal timestamp */ + + void speaker_postload(); }; extern const device_type SPEAKER_SOUND; |