diff --git a/src/devices/sound/msm5232.cpp b/src/devices/sound/msm5232.cpp index eb887a111f7..7bcaf059d5d 100644 --- a/src/devices/sound/msm5232.cpp +++ b/src/devices/sound/msm5232.cpp @@ -37,7 +37,6 @@ void msm5232_device::device_start() m_stream = machine().sound().stream_alloc(*this, 0, 11, rate); /* register with the save state system */ - machine().save().register_postload(save_prepost_delegate(FUNC(msm5232_device::postload), this)); save_item(NAME(m_EN_out16)); save_item(NAME(m_EN_out8)); save_item(NAME(m_EN_out4)); @@ -709,7 +708,7 @@ void msm5232_device::TG_group_advance(int groupidx) /* MAME Interface */ -void msm5232_device::postload() +void msm5232_device::device_post_load() { init_tables(); } diff --git a/src/devices/sound/msm5232.h b/src/devices/sound/msm5232.h index 11e68c6ec02..7afc5131f0d 100644 --- a/src/devices/sound/msm5232.h +++ b/src/devices/sound/msm5232.h @@ -30,6 +30,7 @@ protected: virtual void device_start() override; virtual void device_stop() override; virtual void device_reset() override; + virtual void device_post_load() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; @@ -101,7 +102,6 @@ private: void init(int clock, int rate); void EG_voices_advance(); void TG_group_advance(int groupidx); - void postload(); }; DECLARE_DEVICE_TYPE(MSM5232, msm5232_device) diff --git a/src/devices/sound/okim6376.cpp b/src/devices/sound/okim6376.cpp index 0446cf50eb4..0e33c83d7a8 100644 --- a/src/devices/sound/okim6376.cpp +++ b/src/devices/sound/okim6376.cpp @@ -355,7 +355,7 @@ void okim6376_device::generate_adpcm(struct ADPCMVoice *voice, int16_t *buffer, ***********************************************************************************************/ -void okim6376_device::postload() +void okim6376_device::device_post_load() { notify_clock_changed(); } @@ -378,21 +378,21 @@ void okim6376_device::okim6376_state_save_register() { adpcm_state_save_register(&m_voice[j], j); } - machine().save().register_postload(save_prepost_delegate(FUNC(okim6376_device::postload), this)); - save_item(NAME(m_command[0])); - save_item(NAME(m_command[1])); - save_item(NAME(m_stage[0])); - save_item(NAME(m_stage[1])); - save_item(NAME(m_latch)); - save_item(NAME(m_divisor)); - save_item(NAME(m_nar)); - save_item(NAME(m_nartimer)); - save_item(NAME(m_busy)); - save_item(NAME(m_st)); - save_item(NAME(m_st_pulses)); - save_item(NAME(m_st_update)); - save_item(NAME(m_ch2)); - save_item(NAME(m_ch2_update)); + + save_item(NAME(m_command[0])); + save_item(NAME(m_command[1])); + save_item(NAME(m_stage[0])); + save_item(NAME(m_stage[1])); + save_item(NAME(m_latch)); + save_item(NAME(m_divisor)); + save_item(NAME(m_nar)); + save_item(NAME(m_nartimer)); + save_item(NAME(m_busy)); + save_item(NAME(m_st)); + save_item(NAME(m_st_pulses)); + save_item(NAME(m_st_update)); + save_item(NAME(m_ch2)); + save_item(NAME(m_ch2_update)); } void okim6376_device::device_clock_changed() diff --git a/src/devices/sound/okim6376.h b/src/devices/sound/okim6376.h index 52760be23ca..7efaa337d49 100644 --- a/src/devices/sound/okim6376.h +++ b/src/devices/sound/okim6376.h @@ -26,6 +26,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; virtual void device_clock_changed() override; + virtual void device_post_load() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; @@ -70,7 +71,6 @@ private: void oki_process(int channel, int command); void generate_adpcm(struct ADPCMVoice *voice, int16_t *buffer, int samples,int channel); - void postload(); void okim6376_state_save_register(); void adpcm_state_save_register(struct ADPCMVoice *voice, int index); }; diff --git a/src/devices/sound/spkrdev.cpp b/src/devices/sound/spkrdev.cpp index fc912fbd367..c44e00f5708 100644 --- a/src/devices/sound/spkrdev.cpp +++ b/src/devices/sound/spkrdev.cpp @@ -168,8 +168,6 @@ void speaker_sound_device::device_start() save_item(NAME(m_last_update_time)); save_item(NAME(m_prevx)); save_item(NAME(m_prevy)); - - machine().save().register_postload(save_prepost_delegate(FUNC(speaker_sound_device::speaker_postload), this)); } void speaker_sound_device::device_reset() @@ -193,7 +191,7 @@ void speaker_sound_device::device_reset() m_prevx = m_prevy = 0.0; } -void speaker_sound_device::speaker_postload() +void speaker_sound_device::device_post_load() { 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); diff --git a/src/devices/sound/spkrdev.h b/src/devices/sound/spkrdev.h index b7d0ac95cec..3d5f70477c2 100644 --- a/src/devices/sound/spkrdev.h +++ b/src/devices/sound/spkrdev.h @@ -32,6 +32,7 @@ protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; + virtual void device_post_load() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; @@ -78,8 +79,6 @@ private: int m_interm_sample_index; /* counts interm. samples between stream samples */ attotime m_last_update_time; /* internal timestamp */ - void speaker_postload(); - // DC blocker state double m_prevx, m_prevy; diff --git a/src/devices/sound/vlm5030.cpp b/src/devices/sound/vlm5030.cpp index b77a5bfc193..9bdbd807876 100644 --- a/src/devices/sound/vlm5030.cpp +++ b/src/devices/sound/vlm5030.cpp @@ -235,7 +235,6 @@ void vlm5030_device::device_start() save_item(NAME(m_target_pitch)); save_item(NAME(m_target_k)); save_item(NAME(m_x)); - machine().save().register_postload(save_prepost_delegate(FUNC(vlm5030_device::restore_state), this)); } //------------------------------------------------- @@ -263,6 +262,11 @@ void vlm5030_device::device_reset() setup_parameter( 0x00); } +void vlm5030_device::device_post_load() +{ + restore_state(); +} + void vlm5030_device::rom_bank_updated() { m_channel->update(); diff --git a/src/devices/sound/vlm5030.h b/src/devices/sound/vlm5030.h index 48e0d712b2f..af5f6dbc75b 100644 --- a/src/devices/sound/vlm5030.h +++ b/src/devices/sound/vlm5030.h @@ -29,6 +29,7 @@ protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; + virtual void device_post_load() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;