From 4571763225162f1d0a720920476ba5630a03a59a Mon Sep 17 00:00:00 2001 From: mudlord Date: Tue, 16 Jun 2009 12:01:18 +0000 Subject: [PATCH] Fixed DirectSound initialization issues. --- src/win32/VBA.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index ae45cb68..776b6b29 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -494,19 +494,21 @@ BOOL VBA::InitInstance() loadSettings(); + if(!initDisplay()) { + if(videoOption >= VIDEO_320x240) { + regSetDwordValue("video", VIDEO_2X); + } + return FALSE; + } + + + if(!openLinkLog()) return FALSE; if(!initInput()) return FALSE; - if(!initDisplay()) { - if(videoOption >= VIDEO_320x240) { - regSetDwordValue("video", VIDEO_1X); - } - return FALSE; - } - hAccel = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR)); winAccelMgr.Connect((MainWnd *)m_pMainWnd); @@ -1182,6 +1184,7 @@ SoundDriver * systemSoundInit() } if( drv ) { + if (theApp.throttle) drv->setThrottle( theApp.throttle ); } @@ -2444,7 +2447,7 @@ void VBA::saveSettings() regSetDwordValue("soundEnable", soundGetEnable() & 0x30f); - regSetDwordValue("soundQuality", soundGetSampleRate() / 44100); + regSetDwordValue("soundQuality", 44100 / soundGetSampleRate() ); regSetDwordValue("soundVolume", (DWORD)(soundGetVolume() * 100.0f));