From: Toni Wilen Date: Sat, 23 Apr 2011 13:29:26 +0000 (+0300) Subject: 2320b6 X-Git-Tag: 2320~3 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f2704694969ff1519e49c16f593681677aca6479;p=francis%2Fwinuae.git 2320b6 --- diff --git a/cfgfile.cpp b/cfgfile.cpp index d253a6b1..c73d9acd 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -638,6 +638,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write_bool (f, L"serial_on_demand", p->serial_demand); cfgfile_write_bool (f, L"serial_hardware_ctsrts", p->serial_hwctsrts); cfgfile_write_bool (f, L"serial_direct", p->serial_direct); + cfgfile_dwrite (f, L"serial_stopbits", L"%d", p->serial_stopbits); cfgfile_write_str (f, L"scsi", scsimode[p->scsi]); cfgfile_write_bool (f, L"uaeserial", p->uaeserial); cfgfile_write_bool (f, L"sana2", p->sana2); @@ -2029,6 +2030,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH return 1; if (cfgfile_intval (option, value, L"cachesize", &p->cachesize, 1) + || cfgfile_intval (option, value, L"serial_stopbits", &p->serial_stopbits, 1) || cfgfile_intval (option, value, L"cpu060_revision", &p->cpu060_revision, 1) || cfgfile_intval (option, value, L"fpu_revision", &p->fpu_revision, 1) || cfgfile_intval (option, value, L"cdtvramcard", &p->cs_cdtvcard, 1) @@ -3615,6 +3617,7 @@ void default_prefs (struct uae_prefs *p, int type) p->use_serial = 0; p->serial_demand = 0; p->serial_hwctsrts = 1; + p->serial_stopbits = 0; p->parallel_demand = 0; p->parallel_matrix_emulation = 0; p->parallel_postscript_emulation = 0; diff --git a/cia.cpp b/cia.cpp index df354b08..372ccc4e 100644 --- a/cia.cpp +++ b/cia.cpp @@ -497,7 +497,7 @@ static void do_tod_hack (int dotod) } if (currprefs.cs_ciaatod == 0) - rate = vblank_hz; + rate = (int)(vblank_hz + 0.5); else if (currprefs.cs_ciaatod == 1) rate = 50; else diff --git a/custom.cpp b/custom.cpp index 0d9e7157..958826d5 100644 --- a/custom.cpp +++ b/custom.cpp @@ -182,13 +182,13 @@ int hsyncendpos, hsyncstartpos; static int maxvpos_total = 511; int minfirstline = VBLANK_ENDLINE_PAL; int equ_vblank_endline = EQU_ENDLINE_PAL; -double vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz; +double vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz, vblank_hz_stored; int vblank_skip, doublescan; frame_time_t syncbase; static int fmode; uae_u16 beamcon0, new_beamcon0; uae_u16 vtotal = MAXVPOS_PAL, htotal = MAXHPOS_PAL; -static int maxvpos_stored, maxhpos_stored, vblank_hz_stored; +static int maxvpos_stored, maxhpos_stored; static uae_u16 hsstop, hbstrt, hbstop, vsstop, vbstrt, vbstop, hsstrt, vsstrt, hcenter; static int ciavsyncmode; static int diw_hstrt, diw_hstop; @@ -2850,7 +2850,7 @@ void init_hz (bool fullinit) interlace_seen = (bplcon0 & 4) ? 1 : 0; reset_drawing (); } - if (DBLEQU (vblank_hz, 50) || DBLEQU (vblank_hz, 60) && isvsync () == 2) { + if ((DBLEQU (vblank_hz, 50) || DBLEQU (vblank_hz, 60)) && isvsync () == 2) { if (getvsyncrate (currprefs.gfx_refreshrate) != vblank_hz) vsync_switchmode (vblank_hz, currprefs.gfx_refreshrate); } diff --git a/include/options.h b/include/options.h index e28cd2c4..95a3707c 100644 --- a/include/options.h +++ b/include/options.h @@ -150,6 +150,7 @@ struct uae_prefs { bool serial_demand; bool serial_hwctsrts; bool serial_direct; + int serial_stopbits; bool parallel_demand; int parallel_matrix_emulation; bool parallel_postscript_emulation; diff --git a/include/sysdeps.h b/include/sysdeps.h index a7e3fd2c..c80de382 100644 --- a/include/sysdeps.h +++ b/include/sysdeps.h @@ -576,4 +576,4 @@ extern void xfree (const void*); #endif -#define DBLEQU(f, i) (abs ((f) - (i)) < 0.0001) \ No newline at end of file +#define DBLEQU(f, i) (abs ((f) - (i)) < 0.000001) \ No newline at end of file diff --git a/include/xwin.h b/include/xwin.h index 2bfaaa52..883b8b28 100644 --- a/include/xwin.h +++ b/include/xwin.h @@ -86,6 +86,7 @@ struct vidbuf_description uae_u8 *realbufmem; uae_u8 *linemem; uae_u8 *emergmem; + bool bufmem_allocated; int rowbytes; /* Bytes per row in the memory pointed at by bufmem. */ int pixbytes; /* Bytes per pixel. */ int width; diff --git a/inputdevice.cpp b/inputdevice.cpp index ca7964e4..b88304c4 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -5123,8 +5123,8 @@ int inputdevice_set_mapping (int devnum, int num, const TCHAR *name, TCHAR *cust flag |= (flags & IDEV_MAPPED_TOGGLE) ? ID_FLAG_TOGGLE : 0; flag |= (flags & IDEV_MAPPED_INVERTTOGGLE) ? ID_FLAG_INVERTTOGGLE : 0; } - flag |= (flags & ID_FLAG_GAMEPORTSCUSTOM1) ? ID_FLAG_GAMEPORTSCUSTOM1 : 0; - flag |= (flags & ID_FLAG_GAMEPORTSCUSTOM2) ? ID_FLAG_GAMEPORTSCUSTOM2 : 0; + flag |= (flags & IDEV_MAPPED_GAMEPORTSCUSTOM1) ? ID_FLAG_GAMEPORTSCUSTOM1 : 0; + flag |= (flags & IDEV_MAPPED_GAMEPORTSCUSTOM2) ? ID_FLAG_GAMEPORTSCUSTOM2 : 0; if (port >= 0) portp = port; put_event_data (idf, devindex, num, eid, custom, flag, portp, sub); diff --git a/od-win32/avioutput.cpp b/od-win32/avioutput.cpp index 194a2239..57efd5ce 100644 --- a/od-win32/avioutput.cpp +++ b/od-win32/avioutput.cpp @@ -479,7 +479,7 @@ static int AVIOutput_AllocateVideo (void) { avioutput_width = avioutput_height = avioutput_bits = 0; - avioutput_fps = vblank_hz; + avioutput_fps = (int)(vblank_hz + 0.5); if (!avioutput_fps) avioutput_fps = ispal () ? 50 : 60; if (avioutput_originalsize) diff --git a/od-win32/parser.cpp b/od-win32/parser.cpp index fd73b58a..d5081a72 100644 --- a/od-win32/parser.cpp +++ b/od-win32/parser.cpp @@ -1026,7 +1026,7 @@ int openser (const TCHAR *sername) dcb.ByteSize = 8; dcb.Parity = NOPARITY; dcb.fParity = FALSE; - dcb.StopBits = ONESTOPBIT; + dcb.StopBits = currprefs.serial_stopbits; dcb.fDsrSensitivity = FALSE; dcb.fOutxDsrFlow = FALSE; @@ -1503,10 +1503,10 @@ int enumserialports (void) } } - if (j < MAX_SERPAR_PORTS) { - comports[j].dev = my_strdup (L"TCP://0.0.0.0:1234"); - comports[j].cfgname = my_strdup (comports[j].dev); - comports[j].name = my_strdup (comports[j].dev); + if (cnt < MAX_SERPAR_PORTS) { + comports[cnt].dev = my_strdup (L"TCP://0.0.0.0:1234"); + comports[cnt].cfgname = my_strdup (comports[cnt].dev); + comports[cnt].name = my_strdup (comports[cnt].dev); cnt++; } diff --git a/od-win32/resources/resource b/od-win32/resources/resource index 2dec338f..cb534736 100644 --- a/od-win32/resources/resource +++ b/od-win32/resources/resource @@ -375,7 +375,6 @@ #define IDC_DISPLAYSELECT 1024 #define IDC_AUTOCONFIG 1025 #define IDC_PRINTERLIST 1025 -#define IDC_RESOLUTION3 1025 #define IDC_RESOLUTIONDEPTH 1025 #define IDC_CHIPMEM 1026 #define IDC_CREATELOGFILE 1026 @@ -400,7 +399,6 @@ #define IDC_PORT3_JOYS 1032 #define IDC_PARALLEL 1033 #define IDC_PORT0_AF 1033 -#define IDC_PORT0_AF2 1034 #define IDC_PORT1_AF 1034 #define IDC_JULIAN 1040 #define IDC_FOCUSMINIMIZE 1041 @@ -430,7 +428,6 @@ #define IDC_RICHEDIT2 1092 #define IDC_CONTRIBUTORS 1124 #define IDC_BLACKER_THAN_BLACK 1170 -#define IDC_BLIT32 1173 #define IDC_BLITIMM 1174 #define IDC_LORES 1176 #define IDC_LORES_SMOOTHED 1179 @@ -717,7 +714,6 @@ #define IDC_DF1TYPE 1596 #define IDC_DF2TYPE 1597 #define IDC_SOUNDSPEEDSLIDER 1598 -#define IDC_DF0TYPE4 1598 #define IDC_DF3TYPE 1598 #define IDC_SOUNDSPEEDTEXT 1599 #define IDC_SOUNDSPEEDCAPTION 1600 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index f9fe30d3..8c7865e1 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -124,7 +124,7 @@ BEGIN CONTROL "Blacker than black",IDC_BLACKER_THAN_BLACK,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,17,125,92,10 LTEXT "Refresh:",IDC_REFRESHTEXT,18,173,28,8 CONTROL "Slider1",IDC_FRAMERATE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,168,75,20 - EDITTEXT IDC_RATETEXT,124,172,77,12,ES_CENTER | ES_READONLY + EDITTEXT IDC_RATETEXT,126,172,79,12,ES_CENTER | ES_READONLY GROUPBOX "Centering",IDC_STATIC,221,73,61,49 CONTROL "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,87,49,10 CONTROL "Vertical",IDC_YCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,103,49,10 @@ -135,17 +135,17 @@ BEGIN COMBOBOX IDC_DA_MODE,20,218,58,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_DA_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,84,214,101,20 LTEXT "FPS adj.:",IDC_REFRESH2TEXT,16,193,32,8 - CONTROL "",IDC_FRAMERATE2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,188,127,20 - EDITTEXT IDC_RATE2TEXT,175,192,26,12,ES_CENTER | ES_READONLY + CONTROL "",IDC_FRAMERATE2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,47,188,109,20 + EDITTEXT IDC_RATE2TEXT,159,192,46,12,ES_AUTOHSCROLL COMBOBOX IDC_RESOLUTIONDEPTH,134,27,46,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,125,89,10 - COMBOBOX IDC_SCREENMODE_NATIVE,100,85,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_SCREENMODE_RTG,100,103,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCREENMODE_NATIVE,103,85,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCREENMODE_RTG,103,103,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP RTEXT "Native mode:",IDC_STATIC,19,85,59,15,SS_CENTERIMAGE RTEXT "RTG mode:",IDC_STATIC,19,101,59,15,SS_CENTERIMAGE PUSHBUTTON "Reset to defaults",IDC_DA_RESET,212,218,73,14 RTEXT "Resolution:",IDC_STATIC,27,152,59,15,SS_CENTERIMAGE - COMBOBOX IDC_LORES,100,152,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_LORES,103,152,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Remove interlace artifacts",IDC_FLICKERFIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,139,99,10 RTEXT "Windowed:",IDC_STATIC,17,46,40,15,SS_CENTERIMAGE RTEXT "Fullscreen:",IDC_STATIC,17,19,40,15,SS_CENTERIMAGE diff --git a/od-win32/serial_win32.cpp b/od-win32/serial_win32.cpp index 7588bb19..2376b61e 100644 --- a/od-win32/serial_win32.cpp +++ b/od-win32/serial_win32.cpp @@ -152,7 +152,7 @@ static void checkreceive_enet (int mode) data_in_serdatr = 1; serial_check_irq (); #if SERIALDEBUG > 2 - write_log (L"SERIAL: received %02X (%c)\n", serdatr & 0xff, doTCHAR (serdatr)); + write_log (L"SERIAL: received %02X (%c)\n", serdatr & 0xff, dochar (serdatr)); #endif #endif } @@ -211,7 +211,7 @@ static void checkreceive_serial (int mode) data_in_serdatr = 1; serial_check_irq (); #if SERIALDEBUG > 2 - write_log (L"SERIAL: received %02X (%c)\n", serdatr & 0xff, doTCHAR (serdatr)); + write_log (L"SERIAL: received %02X (%c)\n", serdatr & 0xff, dochar (serdatr)); #endif #endif } @@ -249,7 +249,7 @@ static void checksend (int mode) data_in_serdat = 0; INTREQ (0x8000 | 0x0001); #if SERIALDEBUG > 2 - write_log (L"SERIAL: send %04X (%c)\n", serdatshift, doTCHAR (serdatshift)); + write_log (L"SERIAL: send %04X (%c)\n", serdatshift, dochar (serdatshift)); #endif } } @@ -304,7 +304,7 @@ void SERDAT (uae_u16 w) checksend (1); #if SERIALDEBUG > 2 - write_log (L"SERIAL: wrote 0x%04x (%c) PC=%x\n", w, doTCHAR (w), M68K_GETPC); + write_log (L"SERIAL: wrote 0x%04x (%c) PC=%x\n", w, dochar (w), M68K_GETPC); #endif return; @@ -322,7 +322,7 @@ uae_u16 SERDATR (void) if (ovrun) serdatr |= 0x8000; #if SERIALDEBUG > 2 - write_log ( "SERIAL: read 0x%04x (%c) %x\n", serdatr, doTCHAR (serdatr), M68K_GETPC); + write_log (L"SERIAL: read 0x%04x (%c) %x\n", serdatr, dochar (serdatr), M68K_GETPC); #endif ovrun = 0; data_in_serdatr = 0; diff --git a/od-win32/win32.h b/od-win32/win32.h index 5eae6378..61b0f5c2 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -18,8 +18,8 @@ #define WINUAEPUBLICBETA 1 #define LANG_DLL 1 -#define WINUAEBETA L"5" -#define WINUAEDATE MAKEBD(2011, 4, 16) +#define WINUAEBETA L"6" +#define WINUAEDATE MAKEBD(2011, 4, 23) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 71d72f3e..53ca29b4 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1803,6 +1803,8 @@ static int modeswitchneeded (struct winuae_currentmode *wc) currentmode->current_height != wc->current_height || currentmode->current_depth != wc->current_depth) return -1; + if (!gfxvidinfo.bufmem_allocated) + return -1; } } else if (isfullscreen () == 0) { /* windowed to windowed */ @@ -1957,7 +1959,8 @@ void close_windows (void) S2X_free (); #endif xfree (gfxvidinfo.realbufmem); - gfxvidinfo.realbufmem = 0; + gfxvidinfo.bufmem_allocated = false; + gfxvidinfo.realbufmem = NULL; DirectDraw_Release (); close_hwnds (); } @@ -2512,8 +2515,8 @@ static BOOL doInit (void) currentmode->amiga_height = currentmode->current_height; } gfxvidinfo.pixbytes = currentmode->current_depth >> 3; - gfxvidinfo.bufmem = 0; - gfxvidinfo.linemem = 0; + gfxvidinfo.bufmem = NULL; + gfxvidinfo.linemem = NULL; gfxvidinfo.width = (currentmode->amiga_width + 7) & ~7; gfxvidinfo.height = currentmode->amiga_height; gfxvidinfo.maxblocklines = 0; // flush_screen actually does everything @@ -2539,11 +2542,12 @@ static BOOL doInit (void) xfree (gfxvidinfo.realbufmem); gfxvidinfo.realbufmem = NULL; gfxvidinfo.bufmem = NULL; + gfxvidinfo.bufmem_allocated = false; if (!screen_is_picasso) { if ((currentmode->flags & DM_DDRAW) && !(currentmode->flags & (DM_D3D | DM_SWSCALE))) { - ; + gfxvidinfo.bufmem_allocated = true; } else if (currentmode->flags & DM_SWSCALE) { @@ -2555,6 +2559,7 @@ static BOOL doInit (void) gfxvidinfo.bufmem = gfxvidinfo.realbufmem + (w + (w * 2) * h) * gfxvidinfo.pixbytes; gfxvidinfo.rowbytes = w * 2 * gfxvidinfo.pixbytes; gfxvidinfo.bufmemend = gfxvidinfo.realbufmem + size - gfxvidinfo.rowbytes; + gfxvidinfo.bufmem_allocated = true; } else if (currentmode->flags & DM_D3D) { @@ -2563,6 +2568,7 @@ static BOOL doInit (void) gfxvidinfo.bufmem = gfxvidinfo.realbufmem; gfxvidinfo.rowbytes = currentmode->amiga_width * gfxvidinfo.pixbytes; gfxvidinfo.bufmemend = gfxvidinfo.bufmem + size; + gfxvidinfo.bufmem_allocated = true; } init_row_map (); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index fab3eace..e18ec674 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -5299,6 +5299,7 @@ static void enable_for_displaydlg (HWND hDlg) ew (hDlg, IDC_YCENTER, TRUE); ew (hDlg, IDC_LM_SCANLINES, TRUE); ew (hDlg, IDC_FRAMERATE2, !workprefs.gfx_avsync); + ew (hDlg, IDC_RATE2TEXT, !workprefs.gfx_avsync); ew (hDlg, IDC_FRAMERATE, !workprefs.cpu_cycle_exact); ew (hDlg, IDC_LORES, !workprefs.gfx_autoresolution); ew (hDlg, IDC_LM_NORMAL, !workprefs.gfx_autoresolution); @@ -5634,7 +5635,7 @@ static void values_to_displaydlg (HWND hDlg) if (abs (d) < 1) d = currprefs.ntscmode ? 60.0 : 50.0; SendDlgItemMessage (hDlg, IDC_FRAMERATE2, TBM_SETPOS, TRUE, (LPARAM)d); - _stprintf (buffer, L"%0.2f", d); + _stprintf (buffer, L"%0.6f", d); SetDlgItemText (hDlg, IDC_RATE2TEXT, buffer); v = workprefs.cpu_cycle_exact ? 1 : workprefs.gfx_framerate; @@ -5764,6 +5765,8 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l int gfx_width = workprefs.gfx_size_win.width; int gfx_height = workprefs.gfx_size_win.height; LRESULT posn; + bool updaterate = false; + TCHAR tmp[200]; display_fromselect (SendDlgItemMessage (hDlg, IDC_SCREENMODE_NATIVE, CB_GETCURSEL, 0, 0), &workprefs.gfx_afullscreen, &workprefs.gfx_avsync, 0); @@ -5777,38 +5780,57 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l workprefs.gfx_scanlines = ischecked (hDlg, IDC_LM_SCANLINES); workprefs.gfx_backbuffers = SendDlgItemMessage (hDlg, IDC_DISPLAY_BUFFERCNT, CB_GETCURSEL, 0, 0); workprefs.gfx_framerate = SendDlgItemMessage (hDlg, IDC_FRAMERATE, TBM_GETPOS, 0, 0); - workprefs.chipset_refreshrate = (double)SendDlgItemMessage (hDlg, IDC_FRAMERATE2, TBM_GETPOS, 0, 0); - { - TCHAR buffer[MAX_FRAMERATE_LENGTH]; - TCHAR Nth[MAX_NTH_LENGTH]; - TCHAR *blah[1] = { Nth }; - TCHAR *string = NULL; - - WIN32GUI_LoadUIString(IDS_FRAMERATE, buffer, MAX_FRAMERATE_LENGTH); - LoadNthString(workprefs.gfx_framerate - 1, Nth, MAX_NTH_LENGTH); - if(FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_ALLOCATE_BUFFER, - buffer, 0, 0, (LPTSTR)&string, MAX_FRAMERATE_LENGTH + MAX_NTH_LENGTH, (va_list *)blah ) == 0) - { - DWORD dwLastError = GetLastError(); - _stprintf (buffer, L"Every %s Frame", nth[workprefs.gfx_framerate - 1]); - SetDlgItemText(hDlg, IDC_RATETEXT, buffer); - } - else - { - SetDlgItemText(hDlg, IDC_RATETEXT, string); - LocalFree(string); + if (msg == WM_HSCROLL) { + i = SendDlgItemMessage (hDlg, IDC_FRAMERATE2, TBM_GETPOS, 0, 0); + if (i != (int)workprefs.chipset_refreshrate) + workprefs.chipset_refreshrate = (double)i; + updaterate = true; + } else if (LOWORD (wParam) == IDC_RATE2TEXT && HIWORD (wParam) == EN_KILLFOCUS) { + if (GetDlgItemText(hDlg, IDC_RATE2TEXT, tmp, sizeof tmp / sizeof (TCHAR))) { + workprefs.chipset_refreshrate = _tstof (tmp); + SendDlgItemMessage (hDlg, IDC_FRAMERATE2, TBM_SETPOS, TRUE, (LPARAM)workprefs.chipset_refreshrate); + updaterate = true; } - _stprintf (buffer, L"%.02f", workprefs.chipset_refreshrate); + } + + if (workprefs.chipset_refreshrate > 0 && workprefs.chipset_refreshrate < 1) { + workprefs.chipset_refreshrate = currprefs.ntscmode ? 60.0 : 50.0; + updaterate = true; + } + if (workprefs.chipset_refreshrate > 300) { + workprefs.chipset_refreshrate = currprefs.ntscmode ? 60.0 : 50.0; + updaterate = true; + } + + TCHAR buffer[MAX_FRAMERATE_LENGTH]; + TCHAR Nth[MAX_NTH_LENGTH]; + TCHAR *blah[1] = { Nth }; + TCHAR *string = NULL; + + WIN32GUI_LoadUIString(IDS_FRAMERATE, buffer, MAX_FRAMERATE_LENGTH); + LoadNthString(workprefs.gfx_framerate - 1, Nth, MAX_NTH_LENGTH); + if(FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_ALLOCATE_BUFFER, + buffer, 0, 0, (LPTSTR)&string, MAX_FRAMERATE_LENGTH + MAX_NTH_LENGTH, (va_list *)blah ) == 0) { + DWORD dwLastError = GetLastError(); + _stprintf (buffer, L"Every %s Frame", nth[workprefs.gfx_framerate - 1]); + SetDlgItemText(hDlg, IDC_RATETEXT, buffer); + } else { + SetDlgItemText(hDlg, IDC_RATETEXT, string); + LocalFree(string); + } + if (updaterate) { + _stprintf (buffer, L"%.06f", workprefs.chipset_refreshrate); SetDlgItemText (hDlg, IDC_RATE2TEXT, buffer); - workprefs.gfx_size_win.width = GetDlgItemInt(hDlg, IDC_XSIZE, &success, FALSE); - if(!success) - workprefs.gfx_size_win.width = 800; - workprefs.gfx_size_win.height = GetDlgItemInt(hDlg, IDC_YSIZE, &success, FALSE); - if(!success) - workprefs.gfx_size_win.height = 600; - } - if (abs (workprefs.chipset_refreshrate - (currprefs.ntscmode ? 60.0 : 50.0)) < 0.0001) + } + workprefs.gfx_size_win.width = GetDlgItemInt (hDlg, IDC_XSIZE, &success, FALSE); + if(!success) + workprefs.gfx_size_win.width = 800; + workprefs.gfx_size_win.height = GetDlgItemInt (hDlg, IDC_YSIZE, &success, FALSE); + if(!success) + workprefs.gfx_size_win.height = 600; + + if (DBLEQU (workprefs.chipset_refreshrate, currprefs.ntscmode ? 60.0 : 50.0)) workprefs.chipset_refreshrate = 0.0; workprefs.gfx_xcenter = ischecked (hDlg, IDC_XCENTER) ? 2 : 0; /* Smart centering */ workprefs.gfx_ycenter = ischecked (hDlg, IDC_YCENTER) ? 2 : 0; /* Smart centering */ diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index c3f81c23..4875799a 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,17 @@ +Beta 6: + +- Display panel overwrites chipset_refreshrate decimal part only when slider is adjusted +- Display panel directly accepts non-integer refresh rates +- last serial port device was not listed (b1) +- added serial_stopbits configuration parameter, sets Paula serial port emulation stop bit length. + (0 = 1bit, 1 = 1.5bits, 2 = 2bits) Technically it should always work but at least some USB + adapters don't seem to reliably read Amiga serial data at 19200 without setting it to 1 or 2. + (interestingly for example 115200 works fine, this is quite confusing) +- Gameports panel remapping fixed (b4) +- avioutput refresh rate was not rounded to nearest integer (b5) +- fixed crash when switching from RTG mode to native mode (old bug, only in specific combination of filter and display settings) + Beta 5: - floppy step signal's previous state was not restored properly from statefile (possible one skipped