From 838ebaf96f07f9d67df9be2a4a8352064beee87d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 12 Dec 2012 18:49:11 +0200 Subject: [PATCH] 2510b2 --- epsonprinter.cpp | 2 +- include/xwin.h | 2 +- isofs.cpp | 4 +- main.cpp | 2 +- newcpu.cpp | 13 +++++-- od-win32/rp.cpp | 25 +++++++----- od-win32/win32.cpp | 13 ++++--- od-win32/win32.h | 4 +- od-win32/win32gfx.cpp | 44 ++++++++++++++++++---- od-win32/win32gfx.h | 2 +- od-win32/win32gui.cpp | 6 ++- od-win32/winuae_msvc11/winuae_msvc.vcxproj | 3 +- od-win32/winuaechangelog.txt | 13 +++++++ 13 files changed, 94 insertions(+), 39 deletions(-) diff --git a/epsonprinter.cpp b/epsonprinter.cpp index d36e92be..4d01f501 100644 --- a/epsonprinter.cpp +++ b/epsonprinter.cpp @@ -766,7 +766,7 @@ static void *prt_thread (void *p) Bit8u r, g, b; getcolor (Tpage, Tcpage, x, y, Tpage_pitch, &r, &g, &b); if (r != 255 || g != 255 || b != 255) - SetPixel (TmemHDC, x, y, (r << 16) | (g << 8) | b); + SetPixel (TmemHDC, x, y, RGB(r, g, b)); } } diff --git a/include/xwin.h b/include/xwin.h index eeb4ab4d..b49758c0 100644 --- a/include/xwin.h +++ b/include/xwin.h @@ -18,7 +18,7 @@ extern xcolnr xcolors_32[4096]; extern uae_u32 p96_rgbx16[65536]; extern int graphics_setup (void); -extern int graphics_init (void); +extern int graphics_init (bool); extern void graphics_leave (void); extern void handle_events (void); extern int handle_msgpump (void); diff --git a/isofs.cpp b/isofs.cpp index 2ea40cda..93306d1b 100644 --- a/isofs.cpp +++ b/isofs.cpp @@ -1751,8 +1751,8 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent, uae_u } goto root_found; } else { - /* Unknown supplementary volume descriptor */ - sec = NULL; + /* Unknown supplementary volume descriptor */ + sec = NULL; } } } else { diff --git a/main.cpp b/main.cpp index 91d5992d..c9795c90 100644 --- a/main.cpp +++ b/main.cpp @@ -1026,7 +1026,7 @@ static int real_main2 (int argc, TCHAR **argv) gui_update (); - if (graphics_init ()) { + if (graphics_init (true)) { setup_brkhandler (); if (currprefs.start_debugger && debuggable ()) activate_debugger (); diff --git a/newcpu.cpp b/newcpu.cpp index 301c69b6..85a2ef50 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -3750,11 +3750,13 @@ static void m68k_run_1 (void) cpu_cycles = (*cpufunctbl[opcode])(opcode); cpu_cycles = adjust_cycles (cpu_cycles); if (r->spcflags) { - if (do_specialties (cpu_cycles)) + if (do_specialties (cpu_cycles)) { + regs.ipl = regs.ipl_pin; return; + } } regs.ipl = regs.ipl_pin; - if (!currprefs.cpu_compatible || (currprefs.cpu_cycle_exact && currprefs.cpu_model == 68000)) + if (!currprefs.cpu_compatible || (currprefs.cpu_cycle_exact && currprefs.cpu_model <= 68000)) return; } } @@ -4287,7 +4289,7 @@ uae_u32 get_word_020_prefetch (int o) } } -// full prefetch +// full prefetch 020+ static void m68k_run_2p (void) { struct regstruct *r = ®s; @@ -4310,9 +4312,12 @@ static void m68k_run_2p (void) cpu_cycles = (*cpufunctbl[opcode])(opcode); cpu_cycles = adjust_cycles (cpu_cycles); if (r->spcflags) { - if (do_specialties (cpu_cycles)) + if (do_specialties (cpu_cycles)) { + ipl_fetch (); return; + } } + ipl_fetch (); } } diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index 6a5347d3..cda36dd0 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -599,15 +599,19 @@ static void get_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) vres = max_vert_dbl; vres += getmult (vmult, &half); +#if 0 if (hres > RES_SUPERHIRES) hres = RES_SUPERHIRES; if (vres > VRES_QUAD) vres = VRES_QUAD; +#endif - if (hres == RES_HIRES) { + if (hres == RES_SUPERHIRES) { m = half ? RP_SCREENMODE_SCALE_3X : RP_SCREENMODE_SCALE_2X; - } else if (hres >= RES_SUPERHIRES) { + } else if (hres >= RES_SUPERHIRES + 1) { m = half ? RP_SCREENMODE_SCALE_3X : RP_SCREENMODE_SCALE_4X; + } else { + m = RP_SCREENMODE_SCALE_1X; } sm->lClipLeft = p->gfx_xcenter_pos < 0 ? -1 : p->gfx_xcenter_pos; @@ -698,8 +702,8 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) if (smm == RP_SCREENMODE_SCALE_3X) { - hdbl = RES_HIRES; - vdbl = VRES_DOUBLE; + hdbl = RES_SUPERHIRES; + vdbl = VRES_QUAD; hmult = 1.5; vmult = 1.5; half = true; @@ -719,14 +723,17 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) half = false; if (smm == RP_SCREENMODE_SCALE_2X) { - hdbl = RES_HIRES; - vdbl = VRES_DOUBLE; - } else if (smm == RP_SCREENMODE_SCALE_4X) { + // 2X hdbl = RES_SUPERHIRES; vdbl = VRES_QUAD; + } else if (smm == RP_SCREENMODE_SCALE_4X) { + // 4X + hdbl = RES_SUPERHIRES + 1; + vdbl = VRES_QUAD + 1; } else { - hdbl = RES_LORES; - vdbl = VRES_NONDOUBLE; + // 1X + hdbl = RES_HIRES; + vdbl = VRES_DOUBLE; } if (smm > RP_SCREENMODE_SCALE_4X || smm == RP_SCREENMODE_SCALE_MAX) { diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 52ca3446..69adad44 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -1080,7 +1080,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, return 0; case WM_RBUTTONDOWN: case WM_RBUTTONDBLCLK: - if (dinput_winmouse () >= 0 && isfocus ()) + if (dinput_winmouse () >= 0 && isfocus () > 0) setmousebuttonstate (dinput_winmouse (), 1, 1); return 0; case WM_MBUTTONUP: @@ -1101,7 +1101,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, if (mouseactive) setmouseactive (0); } else { - if (dinput_winmouse () >= 0 && isfocus ()) + if (dinput_winmouse () >= 0 && isfocus () > 0) setmousebuttonstate (dinput_winmouse (), 2, 1); } return 0; @@ -1113,13 +1113,13 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, return 0; case WM_XBUTTONDOWN: case WM_XBUTTONDBLCLK: - if (dinput_winmouse () >= 0 && isfocus ()) { + if (dinput_winmouse () >= 0 && isfocus () > 0) { handleXbutton (wParam, 1); return TRUE; } return 0; case WM_MOUSEWHEEL: - if (dinput_winmouse () >= 0 && isfocus ()) { + if (dinput_winmouse () >= 0 && isfocus () > 0) { int val = ((short)HIWORD (wParam)); setmousestate (dinput_winmouse (), 2, val, 0); if (val < 0) @@ -1130,7 +1130,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, } return 0; case WM_MOUSEHWHEEL: - if (dinput_winmouse () >= 0 && isfocus ()) { + if (dinput_winmouse () >= 0 && isfocus () > 0) { int val = ((short)HIWORD (wParam)); setmousestate (dinput_winmouse (), 3, val, 0); if (val < 0) @@ -1634,7 +1634,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, #endif case WM_DWMCOMPOSITIONCHANGED: case WM_THEMECHANGED: - WIN32GFX_DisplayChangeRequested (); + WIN32GFX_DisplayChangeRequested (-1); return 0; case WM_GETMINMAXINFO: @@ -1971,6 +1971,7 @@ void handle_events (void) while (checkIPC (globalipc, &currprefs)); #endif if (was_paused) { + pause_emulation = was_paused; resumepaused (was_paused); sound_closed = 0; manual_painting_needed--; diff --git a/od-win32/win32.h b/od-win32/win32.h index 8ab6b6b2..7d36bd02 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,8 +19,8 @@ #define LANG_DLL 1 //#define WINUAEBETA _T("") -#define WINUAEBETA _T("1") -#define WINUAEDATE MAKEBD(2012, 12, 10) +#define WINUAEBETA _T("2") +#define WINUAEDATE MAKEBD(2012, 12, 12) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") #define WINUAEREV _T("") diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 4640cd17..cf4035d6 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1513,7 +1513,7 @@ static void update_gfxparams (void) } -static int open_windows (int full) +static int open_windows (bool full) { static bool started = false; int ret, i; @@ -1610,9 +1610,9 @@ static int getstatuswindowheight (void) return wi.rcWindow.bottom - wi.rcWindow.top; } -void WIN32GFX_DisplayChangeRequested (void) +void WIN32GFX_DisplayChangeRequested (int mode) { - display_change_requested = 1; + display_change_requested = mode; } int check_prefs_changed_gfx (void) @@ -1711,6 +1711,8 @@ int check_prefs_changed_gfx (void) if (display_change_requested || c) { + bool setpause = false; + bool dontcapture = false; int keepfsmode = currprefs.gfx_apmode[0].gfx_fullscreen == changed_prefs.gfx_apmode[0].gfx_fullscreen && currprefs.gfx_apmode[1].gfx_fullscreen == changed_prefs.gfx_apmode[1].gfx_fullscreen; @@ -1728,6 +1730,13 @@ int check_prefs_changed_gfx (void) if (display_change_requested) { c = 2; keepfsmode = 0; + if (display_change_requested <= -1) { + dontcapture = true; + if (display_change_requested == -2) + setpause = true; + if (pause_emulation) + setpause = true; + } display_change_requested = 0; } @@ -1827,7 +1836,7 @@ int check_prefs_changed_gfx (void) unacquired = true; } close_windows (); - graphics_init (); + graphics_init (false); graphics_mode_changed = 1; } init_custom (); @@ -1836,8 +1845,19 @@ int check_prefs_changed_gfx (void) reset_sound (); resume_sound (); } + + if (setpause || dontcapture) { + if (!unacquired) + inputdevice_unacquire (); + unacquired = false; + } + if (unacquired) inputdevice_acquire (TRUE); + + if (setpause) + setpaused (1); + return 1; } @@ -2403,13 +2423,13 @@ void machdep_free (void) #endif } -int graphics_init (void) +int graphics_init (bool first) { systray (hHiddenWnd, TRUE); systray (hHiddenWnd, FALSE); gfxmode_reset (); graphics_mode_changed = 1; - return open_windows (1); + return open_windows (first); } int graphics_setup (void) @@ -2467,6 +2487,15 @@ static void createstatuswindow (void) } if (currprefs.win32_statusbar == 0) return; + if (currentmode->flags & DM_W_FULLSCREEN) + return; +#ifdef RETROPLATFORMR + if (rp_isactive ()) + return; +#endif + if (currprefs.win32_borderless) + return; + hStatusWnd = CreateWindowEx ( 0, STATUSCLASSNAME, (LPCTSTR) NULL, SBARS_TOOLTIPS | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hMainWnd, (HMENU) 1, hInst, NULL); @@ -3677,8 +3706,7 @@ static int create_windows_2 (void) GetWindowRect (hMainWnd, &rc2); window_extra_width = rc2.right - rc2.left - currentmode->current_width; window_extra_height = rc2.bottom - rc2.top - currentmode->current_height; - if (!(currentmode->flags & DM_W_FULLSCREEN)) - createstatuswindow (); + createstatuswindow (); } else { x = rc.left; y = rc.top; diff --git a/od-win32/win32gfx.h b/od-win32/win32gfx.h index 3e0f3aad..c818d50d 100644 --- a/od-win32/win32gfx.h +++ b/od-win32/win32gfx.h @@ -10,7 +10,7 @@ int WIN32GFX_IsPicassoScreen (void); int WIN32GFX_GetWidth (void); int WIN32GFX_GetHeight(void); int WIN32GFX_GetDepth (int real); -void WIN32GFX_DisplayChangeRequested (void); +void WIN32GFX_DisplayChangeRequested (int); void WIN32GFX_DisablePicasso (void); void WIN32GFX_EnablePicasso (void); void WIN32GFX_WindowMove (void); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 981a2053..2c1e3ac8 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -8340,8 +8340,8 @@ static void enable_for_cpudlg (HWND hDlg) ew (hDlg, IDC_CPU_FREQUENCY, workprefs.cpu_cycle_exact); ew (hDlg, IDC_CPU_FREQUENCY2, workprefs.cpu_cycle_exact && !workprefs.cpu_clock_multiplier); - ew (hDlg, IDC_FPU1, workprefs.cpu_model < 68040); - ew (hDlg, IDC_FPU2, workprefs.cpu_model < 68040); + ew (hDlg, IDC_FPU1, workprefs.cpu_model < 68040 && (workprefs.cpu_model >= 68020 || !workprefs.cpu_compatible)); + ew (hDlg, IDC_FPU2, workprefs.cpu_model < 68040 && (workprefs.cpu_model >= 68020 || !workprefs.cpu_compatible)); ew (hDlg, IDC_FPU3, workprefs.cpu_model >= 68040); ew (hDlg, IDC_MMUENABLE, workprefs.cpu_model == 68040 && workprefs.cachesize == 0); @@ -8479,6 +8479,8 @@ static void values_from_cpudlg (HWND hDlg) oldcache = workprefs.cachesize; jitena = ischecked (hDlg, IDC_JITENABLE) ? 1 : 0; workprefs.cachesize = SendMessage (GetDlgItem (hDlg, IDC_CACHE), TBM_GETPOS, 0, 0) * 1024; + if (!workprefs.cachesize) + setchecked (hDlg, IDC_JITENABLE, false); if (!jitena) { cachesize_prev = workprefs.cachesize; trust_prev = workprefs.comptrustbyte; diff --git a/od-win32/winuae_msvc11/winuae_msvc.vcxproj b/od-win32/winuae_msvc11/winuae_msvc.vcxproj index 90ba4dea..4ddda324 100644 --- a/od-win32/winuae_msvc11/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc11/winuae_msvc.vcxproj @@ -480,8 +480,7 @@ false true MachineX86 - - + 5.01 false diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index a189a0bc..4fe1da8d 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -4,6 +4,19 @@ This is usual quick 2.5.0 bug fix version. Estimated release date: before Christmas. I try not to do any GUI changes this time, 2.5.0 translation DLLs should still work with 2.5.1. +Beta 2: + +- Resuming pause with input event didn't restore sound. (b1) +- Do not capture mouse when theme changes, keep pause state (Window may not get refreshed until unpaused, this won't be fixed until later) (b1) +- Windows mouse mode and mouse not captured: right, middle and other possible extra mouse buttons leaked to Amiga side. +- Fixed GUI JIT slider weird behavior when cache size slider was moved to zero. +- Windowed mode status bar appeared in full window modes after mode change (b1) +- Epson matrix color printing swapped red and blue fixed. (Printing only, png output worked) +- Fixed 68010 + cycle-exact broken interrupt handling. (This is not recommended option, it is far from cycle-exact) +- Optimized build (official b1) had wrong settings, didn't load on Windows XP. + +Beta 1: + - Internal mouse counter under/overflow fixed, while moving mouse far enough, mouse jumped in opposite direction. (old bug) - Directory filesystem file modification date resolution support is now 1 microsecond (was 1 second). AmigaDOS file time 1/50s "tick" resolution is now fully supported (if NTFS, FAT only has 2 second resolution) -- 2.47.3