From e1717d1cbdc3c5a8572b287075ffa7355ca47445 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 10 Mar 2025 20:07:25 +0200 Subject: [PATCH] 6000b14 --- gfxutil.cpp | 45 -------------------------------- midiemu.cpp | 6 ++++- od-win32/direct3d11.cpp | 40 +++++++++++++++++++---------- od-win32/win32.h | 34 ++++++++++++------------ od-win32/win32gui.cpp | 50 ++++++++++++++++++++++-------------- od-win32/winuaechangelog.txt | 19 ++++++++++++++ pcem/vid_mga.cpp | 2 +- 7 files changed, 99 insertions(+), 97 deletions(-) diff --git a/gfxutil.cpp b/gfxutil.cpp index ff6e9a80..e80d3ac3 100644 --- a/gfxutil.cpp +++ b/gfxutil.cpp @@ -191,51 +191,6 @@ static void video_calc_gammatable(int monid) } } -static uae_u32 limit256(int monid, float v) -{ - struct amigadisplay *ad = &adisplays[monid]; - if (!gfx_hdr) { - v = v * (float)(currprefs.gf[ad->gf_index].gfx_filter_contrast + 1000) / 1000.0f + currprefs.gf[ad->gf_index].gfx_filter_luminance / 10.0f; - } - if (v < 0) - v = 0; - if (v > 255) - v = 255; - return (uae_u32)v; -} -static uae_s32 limit256rb(int monid, float v) -{ - struct amigadisplay *ad = &adisplays[monid]; - if (!gfx_hdr) { - v *= (float)(currprefs.gf[ad->gf_index].gfx_filter_saturation + 1000) / 1000.0f; - } - if (v < -128) - v = -128; - if (v > 127) - v = 127; - return (uae_s32)v; -} -static float get_y(int r, int g, int b) -{ - return 0.2989f * r + 0.5866f * g + 0.1145f * b; -} -static uae_u32 get_yh(int monid, int r, int g, int b) -{ - return limit256(monid, get_y (r, g, b) * hf / 256); -} -static uae_u32 get_yl(int monid, int r, int g, int b) -{ - return limit256(monid, get_y (r, g, b) * lf / 256); -} -static uae_s32 get_cb(int monid, int r, int g, int b) -{ - return limit256rb(monid, -0.168736f * r - 0.331264f * g + 0.5f * b); -} -static uae_s32 get_cr(int monid, int r, int g, int b) -{ - return limit256rb(monid, 0.5f * r - 0.418688f * g - 0.081312f * b); -} - static uae_u32 lowbits (int v, int shift, int lsize) { v >>= shift; diff --git a/midiemu.cpp b/midiemu.cpp index 8001a3a8..a947b300 100644 --- a/midiemu.cpp +++ b/midiemu.cpp @@ -3,6 +3,8 @@ #include "sysdeps.h" #include "options.h" +#ifdef WITH_MIDIEMU + #include "fsdb.h" #include "uae.h" #include "audio.h" @@ -262,4 +264,6 @@ void midi_emu_reopen(void) } } } -} \ No newline at end of file +} + +#endif diff --git a/od-win32/direct3d11.cpp b/od-win32/direct3d11.cpp index 6c3bacc7..592812c1 100644 --- a/od-win32/direct3d11.cpp +++ b/od-win32/direct3d11.cpp @@ -1023,6 +1023,7 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile int layout = 0; char *fx; int size; + bool hlsl = false; if (!pD3DCompileFromFile || !ppD3DCompile) { write_log(_T("D3D11 No shader compiler available (D3DCompiler_46.dll or D3DCompiler_47.dll).\n")); @@ -1049,6 +1050,9 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile _tcscat(tmp, shaderfile); write_log(_T("Direct3D11: Attempting to load '%s'\n"), tmp); _tcscpy(s->loadedshader, shaderfile); + if (_tcslen(tmp) > 5 && !_tcsicmp(tmp + _tcslen(tmp) - 5, _T(".hlsl"))) { + hlsl = true; + } ID3DX11Effect *g_pEffect = NULL; ID3DBlob *errors = NULL; @@ -1070,7 +1074,7 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile z = NULL; fx = fx1; - if (fxneedconvert(fx1)) { + if (!hlsl && fxneedconvert(fx1)) { static const char *converts1[] = { "technique", "vs_3_0", "vs_2_0", "vs_1_1", "ps_3_0", "ps_2_0", NULL }; static const char *converts2[] = { "technique10", "vs_4_0_level_9_3", "vs_4_0_level_9_3", "vs_4_0_level_9_3", "ps_4_0_level_9_3", "ps_4_0_level_9_3", NULL }; fxconvert(fx1, fx2, converts1, converts2); @@ -1084,19 +1088,27 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile } SetCurrentDirectory(tmp2); - hr = D3DX11CompileEffectFromMemory(fx, strlen(fx), name, NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, dwShaderFlags, 0, d3d->m_device, &g_pEffect, &errors); - -#if 0 - hr = D3DX11CompileEffectFromFile(tmp, nullptr, D3D_COMPILE_STANDARD_FILE_INCLUDE, dwShaderFlags, 0, d3d->m_device, &g_pEffect, &errors); -#endif - - if (FAILED(hr)) { - write_log(_T("Direct3D11: D3DX11CompileEffectFromMemory('%s') failed: %08x\n"), tmp, hr); - void *p = errors->GetBufferPointer(); - TCHAR *s = au((char*)p); - write_log(_T("Effect compiler errors:\n%s\n"), s); - xfree(s); - goto end; + if (hlsl) { + ID3DBlob *ppCode = NULL; + hr = D3DCompileFromFile(tmp, NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_5_0", 0, 0, &ppCode, &errors); + if (FAILED(hr)) { + write_log(_T("Direct3D11HLSL: D3DCompileFromFile('%s') failed: %08x\n"), tmp, hr); + void *p = errors->GetBufferPointer(); + TCHAR *s = au((char *)p); + write_log(_T("Effect compiler errors:\n%s\n"), s); + xfree(s); + goto end; + } + } else { + hr = D3DX11CompileEffectFromMemory(fx, strlen(fx), name, NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, dwShaderFlags, 0, d3d->m_device, &g_pEffect, &errors); + if (FAILED(hr)) { + write_log(_T("Direct3D11FX: D3DX11CompileEffectFromMemory('%s') failed: %08x\n"), tmp, hr); + void *p = errors->GetBufferPointer(); + TCHAR *s = au((char *)p); + write_log(_T("Effect compiler errors:\n%s\n"), s); + xfree(s); + goto end; + } } if (errors) { diff --git a/od-win32/win32.h b/od-win32/win32.h index e798aff3..99f52a44 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -20,12 +20,12 @@ #define LANG_DLL_FULL_VERSION_MATCH 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("13") +#define WINUAEBETA _T("14") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2025, 3, 7) +#define WINUAEDATE MAKEBD(2025, 3, 10) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") @@ -51,22 +51,22 @@ extern TCHAR start_path_exe[MAX_DPATH]; extern TCHAR start_path_data[MAX_DPATH]; extern TCHAR start_path_plugins[MAX_DPATH]; -extern bool my_kbd_handler (int, int, int, bool); -extern void clearallkeys (void); -extern int getcapslock (void); - -void releasecapture (struct AmigaMonitor*); -int WIN32_RegisterClasses (void); -int WIN32_InitLibraries (void); -void WIN32_HandleRegistryStuff (void); -extern void setup_brkhandler (void); -extern void remove_brkhandler (void); -extern void disablecapture (void); +extern bool my_kbd_handler(int, int, int, bool); +extern void clearallkeys(void); +extern int getcapslock(void); + +void releasecapture(struct AmigaMonitor*); +int WIN32_RegisterClasses(void); +int WIN32_InitLibraries(void); +void WIN32_HandleRegistryStuff(void); +extern void setup_brkhandler(void); +extern void remove_brkhandler(void); +extern void disablecapture(void); extern int isfocus(void); -extern void gui_restart (void); +extern void gui_restart(void); extern bool quit_ok(void); -int timebegin (void); -int timeend (void); +int timebegin(void); +int timeend(void); extern void setmouseactive(int monid, int active); extern void minimizewindow(int monid); @@ -82,7 +82,7 @@ extern void unsetminimized (int monid); extern void setminimized(int monid); extern int getfocusedmonitor(void); -void finishjob (void); +void finishjob(void); void init_colors(int monid); extern int pause_emulation; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 8e866c31..d12ff512 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -20797,26 +20797,38 @@ static void values_to_hw3ddlg (HWND hDlg, bool initdialog) if (workprefs.gfx_api && D3D_canshaders ()) { bool gotit = false; HANDLE h; - WIN32_FIND_DATA wfd; TCHAR tmp[MAX_DPATH]; - get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("filtershaders\\direct3d")); - _tcscat (tmp, _T("*.fx")); - h = FindFirstFile (tmp, &wfd); - while (h != INVALID_HANDLE_VALUE) { - if (wfd.cFileName[0] != '_') { - TCHAR tmp2[MAX_DPATH]; - _stprintf (tmp2, _T("D3D: %s"), wfd.cFileName); - tmp2[_tcslen (tmp2) - 3] = 0; - xSendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp2); - if (workprefs.gfx_api && !_tcscmp (workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos], wfd.cFileName)) { - fltnum = j; - gotit = true; - } - j++; + for (int fx = 0; fx < 2; fx++) { + get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("filtershaders\\direct3d")); + if (fx) { + _tcscat (tmp, _T("*.fx")); + } else { + _tcscat(tmp, _T("*.hlsl")); } - if (!FindNextFile (h, &wfd)) { - FindClose (h); - h = INVALID_HANDLE_VALUE; + WIN32_FIND_DATA wfd; + h = FindFirstFile (tmp, &wfd); + while (h != INVALID_HANDLE_VALUE) { + if (wfd.cFileName[0] != '_') { + TCHAR tmp2[MAX_DPATH]; + _stprintf (tmp2, _T("D3D: %s"), wfd.cFileName); +#if 0 + if (!fx) { + tmp2[_tcslen(tmp2) - 5] = 0; + } else { + tmp2[_tcslen(tmp2) - 3] = 0; + } +#endif + xSendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp2); + if (workprefs.gfx_api && !_tcscmp (workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos], wfd.cFileName)) { + fltnum = j; + gotit = true; + } + j++; + } + if (!FindNextFile (h, &wfd)) { + FindClose (h); + h = INVALID_HANDLE_VALUE; + } } } } @@ -21143,7 +21155,7 @@ static void filter_handle (HWND hDlg) if (item2 != CB_ERR) workprefs.gf[filter_nativertg].gfx_filter_filtermodev = (int)item2; if (item > 0) { - _stprintf (workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos], _T("%s.fx"), tmp + 5); + _stprintf (workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos], _T("%s"), tmp + 5); cfgfile_get_shader_config(&workprefs, full_property_sheet ? 0 : filter_nativertg); if (of != workprefs.gf[filter_nativertg].gfx_filter || offh != workprefs.gf[filter_nativertg].gfx_filter_filtermodeh || diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 35e264e2..0de9d8f2 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,23 @@ + +Beta 14: + +- Left side of display had corruption if horizontal resolution was small enough. +- Make sure drawing thread has finished before exit or config change. +- Fixed bad D3D surface lock/unlock functions. +- Keyboard reset without keyboard low level emulation didn't force CPU to reset state while reset keys are being kept pressed. CPU kept executing, possibly random instructions because ROM overlay is already active and autoconfig boards are deactivated, possibly causing random illegal memory accesses being logged. +- Matrox emulation blitter background thread support re-enabled. +- Remaining software filter support removed. +- Fixed slirp bug (has been since it was added) that didn't seem to affect WinUAE but affected other UAE ports. +- GDI mode didn't free all resources when native<>RTG mode switched. +- Closing last open configuration tree node didn't update registry/ini. +- Debugger command H DMA debugger listing support is back. Now only listed if D is appended (HD). +- CPU KS ROM accesses are listed in DMA debugger. 68000/010 only because 68020+ can have faster ROM access time than chipset. Uses CIA DMA debugger line but because there is not enough space, only R/W state, size and address is shown. +- -nomt skipped RGA buffering start/end overlap handling, for example copper color writes near the start of scanline were skipped. +- Genlock display had vertical wobble effect in threaded mode. Genlock, grayscale and CD32FMV are working. Other display port adapters should not be used yet. +- Non-CE fast mode subpixel scroll fix. (May not be perfect yet) +- TV overscan modes didn't affect fast draw mode horizontal blanking. + Beta 13: Major performance improvement! Finally faster than older versions! diff --git a/pcem/vid_mga.cpp b/pcem/vid_mga.cpp index f895c138..bf0a978f 100644 --- a/pcem/vid_mga.cpp +++ b/pcem/vid_mga.cpp @@ -35,7 +35,7 @@ #if 1 -#define THREADED_QUEUE 0 +#define THREADED_QUEUE 1 extern void activate_debugger(void); -- 2.47.3