Skip to content

Commit

Permalink
Add AY8910 buffer to save state
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jan 12, 2024
1 parent ab661f0 commit 5d1fc76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ void Audio::SaveState(std::ostream& stream)
{
stream.write(reinterpret_cast<const char*> (&m_ElapsedCycles), sizeof(m_ElapsedCycles));
stream.write(reinterpret_cast<const char*> (m_pSampleBuffer), sizeof(blip_sample_t) * GC_AUDIO_BUFFER_SIZE);
stream.write(reinterpret_cast<const char*> (m_pSGMBuffer), sizeof(s16) * GC_AUDIO_BUFFER_SIZE);
m_pAY8910->SaveState(stream);
}

void Audio::LoadState(std::istream& stream)
{
stream.read(reinterpret_cast<char*> (&m_ElapsedCycles), sizeof(m_ElapsedCycles));
stream.read(reinterpret_cast<char*> (m_pSampleBuffer), sizeof(blip_sample_t) * GC_AUDIO_BUFFER_SIZE);
stream.read(reinterpret_cast<char*> (m_pSGMBuffer), sizeof(s16) * GC_AUDIO_BUFFER_SIZE);
m_pAY8910->LoadState(stream);

m_pApu->reset();
Expand Down

0 comments on commit 5d1fc76

Please sign in to comment.