From 6d0d09ec8a4bd218d40e3d364e6a64aa9e639a3a Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 17 May 2015 14:59:42 +0300 Subject: [PATCH] 3100b19 --- audio.cpp | 3 +- gayle.cpp | 2 +- main.cpp | 5 ++ .../genlinetoscr_msvc.vcxproj | 4 +- od-win32/win32.cpp | 46 +++++++++++---- od-win32/win32.h | 2 +- od-win32/win32gfx.cpp | 11 ++-- od-win32/win32gui.cpp | 58 +++++++++++++++---- od-win32/winuae_msvc11/winuae_msvc.vcxproj | 8 +-- od-win32/winuaechangelog.txt | 16 +++++ scsi.cpp | 2 +- sndboard.cpp | 4 +- 12 files changed, 122 insertions(+), 39 deletions(-) diff --git a/audio.cpp b/audio.cpp index 562a6226..3da7ca69 100644 --- a/audio.cpp +++ b/audio.cpp @@ -1902,8 +1902,9 @@ void update_audio (void) /* Test if new sample needs to be outputted */ if (rounded == best_evtime) { /* Before the following addition, next_sample_evtime is in range [-0.5, 0.5) */ - next_sample_evtime += scaled_sample_evtime - extrasamples * 15; + next_sample_evtime += scaled_sample_evtime; #if SOUNDSTUFF > 1 + next_sample_evtime -= extrasamples * 15; doublesample = 0; if (--samplecounter <= 0) { samplecounter = currprefs.sound_freq / 1000; diff --git a/gayle.cpp b/gayle.cpp index a9fb69a5..6c818ea8 100644 --- a/gayle.cpp +++ b/gayle.cpp @@ -3,7 +3,7 @@ * * Gayle (and motherboard resources) memory bank * -* (c) 2006 - 2013 Toni Wilen +* (c) 2006 - 2015 Toni Wilen */ #define GAYLE_LOG 0 diff --git a/main.cpp b/main.cpp index 9a3c9530..3ea9c0da 100644 --- a/main.cpp +++ b/main.cpp @@ -295,6 +295,11 @@ void fixup_cpu (struct uae_prefs *p) if (p->cpu_cycle_exact) p->cpu_compatible = true; + if (p->cpu_cycle_exact && p->produce_sound == 0) { + p->produce_sound = 1; + error_log(_T("Cycle-exact mode requires at least Disabled but emulated sound setting.")); + } + if (p->cpuboard_type && cpuboard_jitdirectompatible(p) && !p->comptrustbyte) { error_log(_T("JIT direct is not compatible with emulated Blizzard accelerator boards.")); p->comptrustbyte = 1; diff --git a/od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcxproj b/od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcxproj index e7739ba4..c66f9c80 100644 --- a/od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcxproj +++ b/od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcxproj @@ -35,13 +35,13 @@ Application Unicode true - v140_xp + v120_xp Application Unicode true - v140 + v120 Application diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index c759f469..4b775910 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -1161,6 +1161,7 @@ static void add_media_insert_queue(HWND hwnd, const TCHAR *drvname, int retrycnt } #if TOUCH_SUPPORT +#define TOUCH_DEBUG 0 static int touch_touched; static DWORD touch_time; @@ -1174,21 +1175,46 @@ static void processtouch(HWND hwnd, WPARAM wParam, LPARAM lParam) if (pGetTouchInputInfo((HTOUCHINPUT)lParam, cInputs, pInputs, sizeof(TOUCHINPUT))) { for (int i = 0; i < cInputs; i++) { PTOUCHINPUT ti = &pInputs[i]; - //write_log(_T("ID=%08x FLAGS=%08x MASK=%08x X=%d Y=%d \n"), ti->dwID, ti->dwFlags, ti->dwMask, ti->x / 100, ti->y / 100); + int x = ti->x / 100; + int y = ti->y / 100; +#if TOUCH_DEBUG + write_log(_T("ID=%08x FLAGS=%08x MASK=%08x X=%d Y=%d \n"), ti->dwID, ti->dwFlags, ti->dwMask, x, y); +#endif if (ti->dwFlags & TOUCHEVENTF_PRIMARY) { - int x = ti->x / 100; - int y = ti->y / 100; - if (x > 20 || y > 20) { + RECT r; + if (isfullscreen()) { + r.left = amigawin_rect.left; + r.top = amigawin_rect.top; + r.right = amigawin_rect.right; + r.bottom = amigawin_rect.top + 30; + } else { + r.left = mainwin_rect.left; + r.top = mainwin_rect.top; + r.right = mainwin_rect.right; + r.bottom = amigawin_rect.top + GetSystemMetrics(SM_CYMENU) + 2; + } + if (x < r.left || x >= r.right || y < r.top || y >= r.bottom) { touch_touched = 0; } else { - if (ti->dwFlags & TOUCHEVENTF_DOWN) { - touch_touched = 1; - touch_time = ti->dwTime; - } - if (ti->dwFlags & TOUCHEVENTF_UP) { - if (touch_touched && ti->dwTime >= touch_time + 3 * 1000) { + if (ti->dwFlags & (TOUCHEVENTF_DOWN | TOUCHEVENTF_MOVE)) { + if (!touch_touched && (ti->dwFlags & TOUCHEVENTF_DOWN)) { + touch_touched = 1; + touch_time = ti->dwTime; +#if TOUCH_DEBUG + write_log(_T("TOUCHED %d\n"), touch_time); +#endif + } + if (touch_touched && ti->dwTime >= touch_time + 2 * 1000) { +#if TOUCH_DEBUG + write_log(_T("TOUCHED GUI\n"), touch_time); +#endif inputdevice_add_inputcode(AKS_ENTERGUI, 1); + touch_touched = 0; } + } else if (ti->dwFlags & TOUCHEVENTF_UP) { +#if TOUCH_DEBUG + write_log(_T("RELEASED\n")); +#endif touch_touched = 0; } } diff --git a/od-win32/win32.h b/od-win32/win32.h index 942045d1..33457c44 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -25,7 +25,7 @@ #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2015, 5, 12) +#define WINUAEDATE MAKEBD(2015, 5, 17) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 0226c6e6..537407b0 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -2072,11 +2072,11 @@ int check_prefs_changed_gfx (void) } } if (changed) { - init_hz_full (); + init_hz_normal(); } if (currprefs.chipset_refreshrate != changed_prefs.chipset_refreshrate) { currprefs.chipset_refreshrate = changed_prefs.chipset_refreshrate; - init_hz_full (); + init_hz_normal(); return 1; } @@ -4064,11 +4064,12 @@ static int create_windows_2 (void) } if (hMainWnd == NULL) { hMainWnd = hAmigaWnd; + registertouch(hAmigaWnd); + } else { + registertouch(hMainWnd); + registertouch(hAmigaWnd); } - registertouch(hAmigaWnd); - registertouch(hMainWnd); - updatewinrect (true); GetWindowRect (hMainWnd, &mainwin_rect); if (dxfs || d3dfs) diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 59a1690b..ed750dad 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -7351,7 +7351,8 @@ static INT_PTR CALLBACK ChipsetDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("Black Belt Systems HAM-E Plus")); SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("Newtronic Video DAC 18")); SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("Archos AVideo 12")); - SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("Archos AVideo 24")); + SendDlgItemMessage(hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("Archos AVideo 24")); + SendDlgItemMessage(hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("Impulse FireCracker 24")); //SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("DCTV")); #ifndef AGA @@ -16485,9 +16486,9 @@ static void enable_for_avioutputdlg (HWND hDlg) if (!avioutput_framelimiter) avioutput_nosoundoutput = 1; - CheckDlgButton (hDlg, IDC_AVIOUTPUT_FRAMELIMITER, avioutput_framelimiter ? FALSE : TRUE); - CheckDlgButton (hDlg, IDC_AVIOUTPUT_NOSOUNDOUTPUT, avioutput_nosoundoutput ? TRUE : FALSE); - CheckDlgButton (hDlg, IDC_AVIOUTPUT_NOSOUNDSYNC, avioutput_nosoundsync ? TRUE : FALSE); + CheckDlgButton(hDlg, IDC_AVIOUTPUT_FRAMELIMITER, avioutput_framelimiter ? FALSE : TRUE); + CheckDlgButton(hDlg, IDC_AVIOUTPUT_NOSOUNDOUTPUT, avioutput_nosoundoutput ? TRUE : FALSE); + CheckDlgButton(hDlg, IDC_AVIOUTPUT_NOSOUNDSYNC, avioutput_nosoundsync ? TRUE : FALSE); ew (hDlg, IDC_AVIOUTPUT_ACTIVATED, (!avioutput_audio && !avioutput_video) ? FALSE : TRUE); @@ -16680,7 +16681,7 @@ static INT_PTR CALLBACK AVIOutputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP ofn.Flags = OFN_EXTENSIONDIFFERENT | OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR; ofn.lpstrCustomFilter = NULL; ofn.nMaxCustFilter = 0; - ofn.nFilterIndex = 0; + ofn.nFilterIndex = avioutput_audio == AVIAUDIO_WAV ? 2 : 0; ofn.lpstrFile = avioutput_filename_gui; ofn.nMaxFile = MAX_DPATH; ofn.lpstrFileTitle = NULL; @@ -16699,7 +16700,14 @@ static INT_PTR CALLBACK AVIOutputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP if (_tcslen (avioutput_filename_gui) > 4 && !_tcsicmp (avioutput_filename_gui + _tcslen (avioutput_filename_gui) - 4, _T(".avi"))) _tcscpy (avioutput_filename_gui + _tcslen (avioutput_filename_gui) - 4, _T(".wav")); _tcscpy (avioutput_filename_auto, avioutput_filename_gui); + } else if (avioutput_audio == AVIAUDIO_WAV) { + avioutput_audio = 0; + avioutput_video = 0; + if (_tcslen(avioutput_filename_gui) > 4 && !_tcsicmp(avioutput_filename_gui + _tcslen(avioutput_filename_gui) - 4, _T(".wav"))) + _tcscpy(avioutput_filename_gui + _tcslen(avioutput_filename_gui) - 4, _T(".avi")); + _tcscpy(avioutput_filename_auto, avioutput_filename_gui); } + AVIOutput_SetSettings(); break; } } @@ -17936,11 +17944,14 @@ static void blah(void) static int GetSettings (int all_options, HWND hwnd) { static int init_called = 0; + static int start_gui_width = -1; + static int start_gui_height = -1; int psresult; HWND dhwnd; int first = 0; static struct newresource *panelresource; struct newresource *tres; + bool closed = false; gui_active++; timeend(); @@ -18035,19 +18046,29 @@ static int GetSettings (int all_options, HWND hwnd) dialogreturn = -1; hAccelTable = NULL; - if (hwnd != NULL) - DragAcceptFiles (hwnd, TRUE); if (first) write_log (_T("Entering GUI idle loop\n")); if (gui_fullscreen) { + gui_width = GetSystemMetrics(SM_CXSCREEN); + gui_height = GetSystemMetrics(SM_CYSCREEN); if (isfullscreen() > 0) { struct MultiDisplay *md = getdisplay (&currprefs); - gui_width = md->rect.right - md->rect.left; - gui_height = md->rect.bottom - md->rect.top; - } else { - gui_width = GetSystemMetrics (SM_CXSCREEN); - gui_height = GetSystemMetrics (SM_CYSCREEN); + int w = md->rect.right - md->rect.left; + int h = md->rect.bottom - md->rect.top; + write_log(_T("GUI Fullscreen, screen size %dx%d (%dx%d)\n"), w, h, start_gui_width, start_gui_height); + if (w < (start_gui_width / 10 * 9) || h < (start_gui_height / 10 * 9)) { + gui_width = start_gui_width; + gui_height = start_gui_height; + write_log(_T("GUI Fullscreen %dx%d, closing fullscreen.\n"), gui_width, gui_height); + hwnd = currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL; + closed = true; + close_windows(); + } else { + gui_width = w; + gui_height = h; + write_log(_T("GUI Fullscreen %dx%d\n"), gui_width, gui_height); + } } scaleresource_setmult (hwnd, gui_width, gui_height, 1); int gw = gui_width; @@ -18062,6 +18083,10 @@ static int GetSettings (int all_options, HWND hwnd) else scaleresource_setmult (hwnd, gui_width, gui_height, 0); } + + if (hwnd != NULL) + DragAcceptFiles(hwnd, TRUE); + fmultx = 0; write_log (_T("Requested GUI size = %dx%d (%dx%d)\n"), gui_width, gui_height, workprefs.gfx_size.width, workprefs.gfx_size.height); if (dodialogmousemove () && isfullscreen() > 0) { @@ -18095,6 +18120,11 @@ static int GetSettings (int all_options, HWND hwnd) goto gui_exit; } + if (start_gui_width < 0) { + start_gui_width = w; + start_gui_height = h; + } + setguititle (dhwnd); ShowWindow (dhwnd, SW_SHOW); MapDialogRect (dhwnd, &dialog_rect); @@ -18195,6 +18225,10 @@ gui_exit: else if (qs_request_reset && quickstart) uae_reset (qs_request_reset == 2 ? 1 : 0, 1); + if (closed) { + graphics_init(false); + } + qs_request_reset = 0; full_property_sheet = 0; gui_active--; diff --git a/od-win32/winuae_msvc11/winuae_msvc.vcxproj b/od-win32/winuae_msvc11/winuae_msvc.vcxproj index 6d8cbd7e..892c9b27 100644 --- a/od-win32/winuae_msvc11/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc11/winuae_msvc.vcxproj @@ -482,7 +482,7 @@ true Sync Default - MultiThreaded + MultiThreadedDLL false true NotSet @@ -512,7 +512,7 @@ $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ - MSVCRT.lib;%(IgnoreSpecificDefaultLibraries) + %(IgnoreSpecificDefaultLibraries) wpcap.dll;packet.dll;d3dx9_43.dll;openal32.dll;portaudio_x64.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll;Dwmapi.dll;Iphlpapi.dll;%(DelayLoadDLLs) true $(Platform)\$(Configuration)\winuae.pdb @@ -554,7 +554,7 @@ true Sync Default - MultiThreaded + MultiThreadedDLL false false NotSet @@ -700,7 +700,7 @@ true Sync Default - MultiThreaded + MultiThreadedDLL false true NotSet diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 3136cdb5..e4a195c5 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,20 @@ +Beta 19: + +- Switching from non-lace to/from lace didn't always select correct long/short/interlace frame timing. +- SCSI CD READ TOC and READ SUB-CHANNEL returned failure instead of truncating result if command's + allocation length was smaller than returned data structure. +- If cycle-exact and sound is Disabled: Force Disabled, but emulated. +- Added Preferred Technologices Nexus MEM TEST -jumper, clears autoconfig add to memlist bit. +- Removed Nexus 2M/4M/8M config options, dynamic RAM board autoconfig data modifications are now supported. +- Added Impulse FireCracker 24 display adapter emulation, single display mode only. + (Display scaling and positioning incomplete and not all control register bits are known) +- Pixel perfect genlock transparency data is now available if configured display adapter needs it. + (HAM-E and FireCracker 24) HAM-E end of display is now correctly detected. +- AVIOutput wave/avi mode and file name is stored in registry/ini. +- AVI recording A/V sync getting larger and larger fixed. Should be perfect now in all configurations. +- Tablet touch GUI open function really works now. + Beta 18: (Official in 2-3 weeks) - Archos AVideo 24 emulation. Animation/doublebuffering feature not yet emulated. diff --git a/scsi.cpp b/scsi.cpp index 79437b7d..5b7d6dce 100644 --- a/scsi.cpp +++ b/scsi.cpp @@ -3,7 +3,7 @@ * * SCSI emulation (not uaescsi.device) * -* Copyright 2007 Toni Wilen +* Copyright 2007-2015 Toni Wilen * */ diff --git a/sndboard.cpp b/sndboard.cpp index 7ed68251..387742cc 100644 --- a/sndboard.cpp +++ b/sndboard.cpp @@ -530,8 +530,8 @@ static void REGPARAM2 toccata_wput(uaecptr addr, uae_u32 b) #ifdef JIT special_mem |= S_WRITE; #endif - toccata_bput(addr, b >> 8); - toccata_bput(addr, b >> 0); + toccata_bput(addr + 0, b >> 8); + toccata_bput(addr + 1, b >> 0); } static void REGPARAM2 toccata_lput(uaecptr addr, uae_u32 b) -- 2.47.3