sound/mp3_audio: Implement save states for MP3 decoder (#11232)

This commit is contained in:
987123879113 2023-05-16 01:52:20 +09:00 committed by GitHub
parent fb2b5745d1
commit a411b9fac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -35,9 +35,13 @@ void lc82310_device::device_start()
save_item(NAME(m_ckctl));
save_item(NAME(m_dictl));
save_item(NAME(m_doctl));
save_item(NAME(m_ctl_state));
save_item(NAME(m_ctl_cmd));
save_item(NAME(m_ctl_bits));
save_item(NAME(m_ctl_byte));
save_item(NAME(m_ctl_out_byte));
mp3dec->register_save(*this);
}
void lc82310_device::device_reset()

View File

@ -87,6 +87,8 @@ void mas3507d_device::device_start()
save_item(NAME(playback_status));
save_item(NAME(frame_channels));
mp3dec->register_save(*this);
}
void mas3507d_device::device_reset()

View File

@ -29,6 +29,17 @@ mp3_audio::~mp3_audio()
{
}
void mp3_audio::register_save(device_t &host)
{
host.save_item(NAME(m_found_stream));
host.save_item(NAME(dec->header));
host.save_item(NAME(dec->reserv_buf));
host.save_item(NAME(dec->mdct_overlap));
host.save_item(NAME(dec->qmf_state));
host.save_item(NAME(dec->reserv));
host.save_item(NAME(dec->free_format_bytes));
}
void mp3_audio::clear()
{
mp3dec_init(dec.get());

View File

@ -19,6 +19,8 @@ public:
mp3_audio(const void *base);
~mp3_audio();
void register_save(device_t &host);
bool decode_buffer(int &pos, int limit, short *output, int &output_samples, int &sample_rate, int &channels);
void clear();