diff --git a/src/wx/dsound.cpp b/src/wx/dsound.cpp index b7ca3691..911cab37 100644 --- a/src/wx/dsound.cpp +++ b/src/wx/dsound.cpp @@ -239,7 +239,7 @@ void DirectSound::write(u16 * finalWave, int length) LPVOID lpvPtr2; DWORD dwBytes2 = 0; - if( !speedup && synchronize && !gopts.throttle ) { + if (!speedup && synchronize && !gopts.throttle && !gba_joybus_active) { hr = dsbSecondary->GetStatus(&status); if( status & DSBSTATUS_PLAYING ) { if( !soundPaused ) { diff --git a/src/wx/openal.cpp b/src/wx/openal.cpp index ba90225d..0601f634 100644 --- a/src/wx/openal.cpp +++ b/src/wx/openal.cpp @@ -290,7 +290,7 @@ void OpenAL::write(u16 * finalWave, int length) } } - if( !speedup && synchronize && !gopts.throttle ) { + if (!speedup && synchronize && !gopts.throttle && !gba_joybus_active) { // wait until at least one buffer has finished while( nBuffersProcessed == 0 ) { winlog( " waiting...\n" ); diff --git a/src/wx/sys.cpp b/src/wx/sys.cpp index 6a58445a..d54ead82 100644 --- a/src/wx/sys.cpp +++ b/src/wx/sys.cpp @@ -907,7 +907,7 @@ bool systemCanChangeSoundQuality() if(panel) return !panel->IsRecording(); #endif - return true; + return wxGetApp().IsMainLoopRunning(); } bool systemPauseOnFrame() @@ -1135,7 +1135,9 @@ void log(const char *defaultMsg, ...) vsnprintf(buf, 2048, defaultMsg, valist); va_end(valist); wxGetApp().log.append(wxString(buf, wxConvLibc)); - LogDialog *d = wxGetApp().frame->logdlg; - if(d) - d->Update(); + if (wxGetApp().IsMainLoopRunning()) { + LogDialog *d = wxGetApp().frame->logdlg; + if(d) + d->Update(); + } } diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 0f78c126..ccb84782 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -20,6 +20,7 @@ // The built-in vba-over.ini #include "builtin-over.h" +#include "common/ConfigManager.h" IMPLEMENT_APP(wxvbamApp) IMPLEMENT_DYNAMIC_CLASS(MainFrame, wxFrame) @@ -388,6 +389,11 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser &cl) } } } + + home = strdup((const char*)argv[0].mb_str(wxConvUTF8)); + SetHome(home); + LoadConfig(); // Parse command line arguments (overrides ini) + ReadOpts(argc, argv); return true; } diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index 1f05943f..0d5b0443 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -97,6 +97,7 @@ public: } private: wxPathList config_path; + char* home; }; DECLARE_APP(wxvbamApp);