From 39d96469ac107e989d4e34b1d6afbee85ae7c53b Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Thu, 4 Aug 2016 23:57:06 +0300 Subject: [PATCH] Fixed corrupted "none", XP compatibility fixed. --- od-win32/posixemu.cpp | 19 +++++++++++++------ od-win32/win32gui.cpp | 3 ++- od-win32/winuae_msvc15/winuae_msvc.vcxproj | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/od-win32/posixemu.cpp b/od-win32/posixemu.cpp index 3129a03e..a788ea93 100644 --- a/od-win32/posixemu.cpp +++ b/od-win32/posixemu.cpp @@ -175,6 +175,9 @@ void uae_end_thread (uae_thread_id *tid) } } +typedef BOOL(WINAPI* AVSETMMTHREADPRIORITY)(HANDLE, AVRT_PRIORITY); +static AVSETMMTHREADPRIORITY pAvSetMmThreadPriority; + int uae_start_thread (const TCHAR *name, void *(*f)(void *), void *arg, uae_thread_id *tid) { HANDLE hThread; @@ -182,6 +185,10 @@ int uae_start_thread (const TCHAR *name, void *(*f)(void *), void *arg, uae_thre unsigned foo; struct thparms *thp; + if (!pAvSetMmThreadPriority && AVTask) { + pAvSetMmThreadPriority = (AVSETMMTHREADPRIORITY)GetProcAddress(GetModuleHandle(_T("Avrt.dll")), "AvSetMmThreadPriority"); + } + thp = xmalloc (struct thparms, 1); thp->f = f; thp->arg = arg; @@ -191,8 +198,8 @@ int uae_start_thread (const TCHAR *name, void *(*f)(void *), void *arg, uae_thre //write_log (_T("Thread '%s' started (%d)\n"), name, hThread); if (!AVTask) { SetThreadPriority (hThread, THREAD_PRIORITY_HIGHEST); - } else { - AvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); + } else if (pAvSetMmThreadPriority) { + pAvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); } } } else { @@ -212,8 +219,8 @@ int uae_start_thread_fast (void *(*f)(void *), void *arg, uae_thread_id *tid) if (*tid) { if (!AVTask) { SetThreadPriority (*tid, THREAD_PRIORITY_HIGHEST); - } else { - AvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); + } else if (pAvSetMmThreadPriority) { + pAvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); } } return v; @@ -248,8 +255,8 @@ void uae_set_thread_priority (uae_thread_id *tid, int pri) if (!AVTask) { if (!SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_HIGHEST)) SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); - } else { - AvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); + } else if (pAvSetMmThreadPriority) { + pAvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); } } diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 47568593..90ffbeb7 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -1284,7 +1284,7 @@ static int drag_move (HWND hWnd, LPARAM lParam) static HWND cachedlist = NULL; static const TCHAR *memsize_names[] = { - /* 0 */ szNone.c_str(), + /* 0 */ _T("none") /* 1 */ _T("64 KB"), /* 2 */ _T("128 KB"), /* 3 */ _T("256 KB"), @@ -19325,6 +19325,7 @@ static int GetSettings (int all_options, HWND hwnd) default_prefs (&workprefs, false, 0); szNone = WIN32GUI_LoadUIString (IDS_NONE); + memsize_names[0] = szNone.c_str(); prefs_to_gui (&changed_prefs); if (!init_called) { diff --git a/od-win32/winuae_msvc15/winuae_msvc.vcxproj b/od-win32/winuae_msvc15/winuae_msvc.vcxproj index dae68333..40a21610 100644 --- a/od-win32/winuae_msvc15/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc15/winuae_msvc.vcxproj @@ -356,7 +356,7 @@ 0x0409 - ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;libpng16.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;lzmalib.lib;prowizard.lib;libFLAC_static.lib;Avrt.lib;hid.lib;zlibstat.lib;Iphlpapi.lib;luastatic.lib;libmpeg2_ff.lib;softfloat.lib;%(AdditionalDependencies) + ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;libpng16.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;lzmalib.lib;prowizard.lib;libFLAC_static.lib;hid.lib;zlibstat.lib;Iphlpapi.lib;luastatic.lib;libmpeg2_ff.lib;softfloat.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ -- 2.47.3