From 6a045e6441d3cfce23923d8229f265a40229cc4d Mon Sep 17 00:00:00 2001 From: Daryl Borth Date: Thu, 23 Aug 2018 10:27:26 -0600 Subject: [PATCH] quick and dirty attempt to prevent reading and writing from/to the same audio buffer --- readme.txt | 10 +++++++++- source/audio.cpp | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 58f0b35..51baa5b 100644 --- a/readme.txt +++ b/readme.txt @@ -15,7 +15,7 @@ Wii homebrew is WiiBrew (www.wiibrew.org). | FEATURES | •˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————• -* Based on hybrid Snes9x 1.51 and 1.56 (with faster Blargg S-SMP module) +* Based on Snes9x 1.52 * Wiimote, Nunchuk, Classic, and Gamecube controller support * SNES Superscope, Mouse, Justifier support * Cheat support @@ -33,6 +33,14 @@ Wii homebrew is WiiBrew (www.wiibrew.org). | UPDATE HISTORY | •˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————• +[4.3.9] + +* Revert core completely back to Snes9x 1.52 to fix some games +* Rewritten audio handling +* Fix tinny audio issue when going from the game to the menu and back +* Fixed random in-game crashes +* Fixed sound issues from turbo mode + [4.3.8 - August 16, 2018] * Partially update core to 1.56 (with less accurate but faster Blargg audio core) diff --git a/source/audio.cpp b/source/audio.cpp index f17396b..cc6724d 100644 --- a/source/audio.cpp +++ b/source/audio.cpp @@ -82,6 +82,11 @@ static void S9xAudioCallback (void *data) { updateUnplayed(1); nextab = (nextab + 1) % BUFFERCOUNT; + if(!Settings.TurboMode && ((nextab + 1) % BUFFERCOUNT) == playab) { + // quick and dirty attempt to prevent reading and writing from/to the same buffer + nextab = (nextab + BUFFERCOUNT/2) % BUFFERCOUNT; + } + if(playab == -1) { if(unplayed > 2) { playab = 0;