From fdd3cc5d7dd39a1f7ba6ca90d4beb62561bcc559 Mon Sep 17 00:00:00 2001 From: Mystro256 Date: Feb 21 2017 05:31:52 +0000 Subject: Update to gitsnapshot, better soundsync patch --- diff --git a/.gitignore b/.gitignore index 9bf4e44..b4d8543 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /visualboyadvance-m-2.0.0-Beta3.tar.gz +/visualboyadvance-m-2.0.0-6a7d494.tar.gz +/visualboyadvance-m-2.0.0-git6a7d494.tar.gz diff --git a/sources b/sources index d6fdb04..30942fc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (visualboyadvance-m-2.0.0-Beta3.tar.gz) = 61525a8b418087a00b2932f03f8cd1e8bb12c050126b813be46ce8347b53034365261563616a3f24a50d989cea953a28c930e8764dc38199ab45c4378125159e +SHA512 (visualboyadvance-m-2.0.0-git6a7d494.tar.gz) = d622d01ae1d8ba402c48178a720f2273f1ad24390043105b607421b7b1254aa69ef8c2f0fbb65d7a930461cb77679c6edcba7f072275904ae21083e204546446 diff --git a/visualboyadvance-m-2.0.0-soundsync.patch b/visualboyadvance-m-2.0.0-soundsync.patch index 79c80d8..901e4d0 100644 --- a/visualboyadvance-m-2.0.0-soundsync.patch +++ b/visualboyadvance-m-2.0.0-soundsync.patch @@ -1,198 +1,13 @@ -diff --git a/src/common/ConfigManager.cpp b/src/common/ConfigManager.cpp -index dafdb72..06752e4 100644 ---- a/src/common/ConfigManager.cpp -+++ b/src/common/ConfigManager.cpp -@@ -220,6 +220,7 @@ int speedupToggle; - int sunBars; - int surfaceSizeX; - int surfaceSizeY; -+int synchronize = false; - int threadPriority; - int tripleBuffering; - int useBios = 0; -@@ -522,6 +523,7 @@ void LoadConfig() - soundFiltering = (float)ReadPref("gbaSoundFiltering", 50) / 100.0f; - soundInterpolation = ReadPref("gbaSoundInterpolation", 1); - soundRecordDir = ReadPrefString("soundRecordDir"); -+ synchronize = ReadPref("synchronize", 1); - threadPriority = ReadPref("priority", 2); - throttle = ReadPref("throttle", 100); - tripleBuffering = ReadPref("tripleBuffering", 0); -@@ -1038,6 +1040,13 @@ int ReadOpts(int argc, char ** argv) - } - break; - -+ case OPT_SYNCHRONIZE: -+ // --synchronize -+ if (optarg) { -+ synchronize = atoi(optarg); -+ } -+ break; -+ - case OPT_VIDEO_OPTION: - // --video-option - if (optarg) { -diff --git a/src/common/ConfigManager.h b/src/common/ConfigManager.h -index e6a1008..034ceed 100644 ---- a/src/common/ConfigManager.h -+++ b/src/common/ConfigManager.h -@@ -119,6 +119,7 @@ extern int speedupToggle; - extern int sunBars; - extern int surfaceSizeX; - extern int surfaceSizeY; -+extern int synchronize; - extern int threadPriority; - extern int tripleBuffering; - extern int useBios; -diff --git a/src/common/SoundSDL.cpp b/src/common/SoundSDL.cpp -index 9713d44..09c46a7 100644 ---- a/src/common/SoundSDL.cpp -+++ b/src/common/SoundSDL.cpp -@@ -18,17 +18,15 @@ - #include "SoundSDL.h" - #include "ConfigManager.h" - #include "../gba/Globals.h" --#include "../gba/Sound.h" - - extern int emulating; - --// Hold up to 32 ms of data in the ring buffer --const float SoundSDL::_delay = 0.032f; -+// Hold up to 100 ms of data in the ring buffer -+const float SoundSDL::_delay = 0.1f; - - SoundSDL::SoundSDL(): - _rbuf(0), - _dev(-1), -- current_rate(0), - _initialized(false) - { - -@@ -48,7 +46,7 @@ void SoundSDL::read(uint16_t * stream, int length) - /* since this is running in a different thread, speedup and - * throttle can change at any time; save the value so locks - * stay in sync */ -- bool lock = (emulating && !speedup && throttle && !gba_joybus_active) ? true : false; -+ bool lock = (emulating && !speedup && synchronize && !gba_joybus_active) ? true : false; - - if (lock) - SDL_SemWait (_semBufferFull); -@@ -77,7 +75,7 @@ void SoundSDL::write(uint16_t * finalWave, int length) - std::size_t avail; - while ((avail = _rbuf.avail() / 2) < samples) - { -- bool lock = (emulating && !speedup && throttle && !gba_joybus_active) ? true : false; -+ bool lock = (emulating && !speedup && synchronize && !gba_joybus_active) ? true : false; - - _rbuf.write(finalWave, avail * 2); - -@@ -89,12 +87,6 @@ void SoundSDL::write(uint16_t * finalWave, int length) - if (lock) - { - SDL_SemWait(_semBufferEmpty); -- if (throttle > 0 && throttle != current_rate) -- { -- SDL_CloseAudio(); -- init(soundGetSampleRate() * throttle / 100); -- current_rate = throttle; -- } - } - else - { -@@ -131,13 +123,10 @@ bool SoundSDL::init(long sampleRate) - - _rbuf.reset(_delay * sampleRate * 2); - -- if (!_initialized) -- { -- _mutex = SDL_CreateMutex(); -- _semBufferFull = SDL_CreateSemaphore (0); -- _semBufferEmpty = SDL_CreateSemaphore (1); -- _initialized = true; -- } -+ _mutex = SDL_CreateMutex(); -+ _semBufferFull = SDL_CreateSemaphore (0); -+ _semBufferEmpty = SDL_CreateSemaphore (1); -+ _initialized = true; - - return true; - } -@@ -165,8 +154,6 @@ SoundSDL::~SoundSDL() - SDL_CloseAudioDevice(_dev); - - emulating = iSave; -- -- _initialized = false; - } - - void SoundSDL::pause() -diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp -index c083678..5e31c1d 100644 ---- a/src/wx/cmdevents.cpp -+++ b/src/wx/cmdevents.cpp -@@ -2625,6 +2625,12 @@ EVT_HANDLER(SkipIntro, "Skip BIOS initialization") - update_opts(); - } - -+EVT_HANDLER(SyncGameAudio, "Synchronize game to audio") -+{ -+ GetMenuOptionInt("SyncGameAudio", synchronize, 1); -+ update_opts(); -+} +--- a/src/wx/wxvbam.cpp ++++ b/src/wx/wxvbam.cpp +@@ -259,6 +259,10 @@ bool wxvbamApp::OnInit() + gopts.render_method = RND_SIMPLE; + } + ++ if (throttle == 0) { ++ throttle = 100; ++ } + - EVT_HANDLER(BootRomEn, "Use the specified BIOS file for GBA") - { - GetMenuOptionInt("BootRomEn", useBiosFileGBA, 1); -diff --git a/src/wx/dsound.cpp b/src/wx/dsound.cpp -index 2ed26e2..062b1b2 100644 ---- a/src/wx/dsound.cpp -+++ b/src/wx/dsound.cpp -@@ -233,7 +233,7 @@ void DirectSound::write(uint16_t* finalWave, int length) - LPVOID lpvPtr2; - DWORD dwBytes2 = 0; - -- if (!speedup && throttle && !gba_joybus_active) { -+ if (!speedup && synchronize && !throttle && !gba_joybus_active) { - hr = dsbSecondary->GetStatus(&status); - - if (status & DSBSTATUS_PLAYING) { -diff --git a/src/wx/openal.cpp b/src/wx/openal.cpp -index a3a08da..82e2f72 100644 ---- a/src/wx/openal.cpp -+++ b/src/wx/openal.cpp -@@ -286,7 +286,7 @@ void OpenAL::write(uint16_t* finalWave, int length) - } - } - -- if (!speedup && throttle && !gba_joybus_active) { -+ if (!speedup && synchronize && !throttle && !gba_joybus_active) { - // wait until at least one buffer has finished - while (nBuffersProcessed == 0) { - winlog(" waiting...\n"); -diff --git a/src/wx/opts.cpp b/src/wx/opts.cpp -index 68198c4..f96cffe 100644 ---- a/src/wx/opts.cpp -+++ b/src/wx/opts.cpp -@@ -246,6 +246,7 @@ opt_desc opts[] = { - INTOPT("preferences/skipBios", "SkipIntro", wxTRANSLATE("Skip BIOS initialization"), skipBios, 0, 1), - INTOPT("preferences/skipSaveGameCheats", "", wxTRANSLATE("Do not overwrite cheat list when loading state"), skipSaveGameCheats, 0, 1), - INTOPT("preferences/skipSaveGameBattery", "", wxTRANSLATE("Do not overwrite native (battery) save when loading state"), skipSaveGameBattery, 0, 1), -+ INTOPT ("preferences/synchronize", "SyncGameAudio", wxTRANSLATE("Synchronize game to audio"), synchronize, 0, 1), - INTOPT("preferences/throttle", "", wxTRANSLATE("Throttle game speed, even when accelerated (0-1000%, 0 = disabled)"), throttle, 0, 1000), - INTOPT("preferences/useBiosGB", "BootRomGB", wxTRANSLATE("Use the specified BIOS file for GB"), useBiosFileGB, 0, 1), - INTOPT("preferences/useBiosGBA", "BootRomEn", wxTRANSLATE("Use the specified BIOS file"), useBiosFileGBA, 0, 1), -diff --git a/src/wx/xrc/MainMenu.xrc b/src/wx/xrc/MainMenu.xrc -index 5313057..b778ab2 100644 ---- a/src/wx/xrc/MainMenu.xrc -+++ b/src/wx/xrc/MainMenu.xrc -@@ -242,6 +242,10 @@ - - 1 - -+ -+ -+ 1 -+ - - - 1 + // process command-line options + for (int i = 0; i < pending_optset.size(); i++) { + wxString p = pending_optset[i]; diff --git a/visualboyadvance-m.spec b/visualboyadvance-m.spec index 4560205..d9bbd8e 100644 --- a/visualboyadvance-m.spec +++ b/visualboyadvance-m.spec @@ -1,22 +1,24 @@ %undefine _hardened_build %global shortname vbam -%global rctag Beta3 +#Upstream git tag/commit: +%global upstreamtag 6a7d49419cdcb51383403b3640cb92a3b3b36e1d +#Sanitized RC name (for fedora) +%global rctagfedora git6a7d494 +#RC Version that appears in app +%global rcversion Beta-3 Name: visualboyadvance-m Version: 2.0.0 -Release: 0.12%{?rctag:.%{rctag}}%{?dist} +Release: 0.13%{?rctagfedora:.%{rctagfedora}}%{?dist} Summary: High compatibility Gameboy Advance Emulator combining VBA builds License: GPLv2 Url: http://www.vba-m.com -Source0: https://github.com/visualboyadvance-m/visualboyadvance-m/archive/Beta-3.tar.gz#/%{name}-%{version}%{?rctag:-%{rctag}}.tar.gz +Source0: https://github.com/%{name}/%{name}/archive/%{upstreamtag}.tar.gz#/%{name}-%{version}%{?rctagfedora:-%{rctagfedora}}.tar.gz #Workaround for sound synchronization issues: #https://github.com/visualboyadvance-m/visualboyadvance-m/issues/51 Patch0: %{name}-%{version}-soundsync.patch -#Queue Window Refresh, needed for wayland support: -#https://github.com/visualboyadvance-m/visualboyadvance-m/pull/68 -Patch1: %{name}-%{version}-refresh-on-wayland.patch BuildRequires: cairo-devel BuildRequires: cmake BuildRequires: libjpeg-turbo-devel @@ -74,17 +76,16 @@ variants. VBA-M is a continued development of the now inactive VisualBoy Advance project, with many improvements from various developments of VBA. %prep -%autosetup -p1 -n %{name}-Beta-3 +%autosetup -p1 -n %{name}-%{upstreamtag} sed -i '/CMAKE_C.*_FLAGS/d' CMakeLists.txt sed -i 's/ -mtune=generic//g' CMakeLists.txt -#Hack to get openal to load correctly: -#https://github.com/visualboyadvance-m/visualboyadvance-m/issues/69 -sed -i 's/wxT("openal"))/wxT("openal"))+wxT(".1")/g' src/wx/openal.cpp +#Some odd permission issues: +chmod -x src/wx/rpi.h %build %cmake . \ -DCMAKE_SKIP_RPATH=ON \ - -DVERSION="%{version}%{?rctag: %{rctag}}" \ + -DVERSION="%{version}%{?rcversion: %{rcversion}}" \ -DENABLE_SDL=ON \ -DENABLE_WX=ON \ -DENABLE_FFMPEG=OFF \ @@ -138,6 +139,11 @@ fi /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Mon Feb 20 2017 Jeremy Newton - 2.0.0-0.13.git6a7d494 +- Update to git snapshot, fixes many issues +- Drop wayland and openal fixes (better fixes have been upstreamed) +- Better workaround patch for sound syncing issue + * Wed Feb 15 2017 Jeremy Newton - 2.0.0-0.12.Beta3 - Rebuilt for SFML 2.4