From cfda443d7816915f1ad76dd1fa370e17052b3e49 Mon Sep 17 00:00:00 2001 From: bladeoner Date: Wed, 17 Apr 2019 21:31:26 +0200 Subject: [PATCH] Snes9x - Restore MSU1_AUDIO_POS. (#844) Snes9x: - Restore MSU1_AUDIO_POS. - Restore MSU1 playback position correctly. --- source/snes9x/msu1.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/snes9x/msu1.cpp b/source/snes9x/msu1.cpp index 9829a63..65c0032 100644 --- a/source/snes9x/msu1.cpp +++ b/source/snes9x/msu1.cpp @@ -416,6 +416,8 @@ void S9xMSU1PostLoadState(void) if (MSU1.MSU1_STATUS & AudioPlaying) { + uint32 savedPosition = MSU1.MSU1_AUDIO_POS; + if (AudioOpen()) { REVERT_STREAM(audioStream, 4, 0); @@ -424,6 +426,7 @@ void S9xMSU1PostLoadState(void) audioLoopPos <<= 2; audioLoopPos += 8; + MSU1.MSU1_AUDIO_POS = savedPosition; REVERT_STREAM(audioStream, MSU1.MSU1_AUDIO_POS, 0); } else