]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2710b11
authorToni Wilen <twilen@winuae.net>
Tue, 18 Mar 2014 16:35:08 +0000 (18:35 +0200)
committerToni Wilen <twilen@winuae.net>
Tue, 18 Mar 2014 16:35:08 +0000 (18:35 +0200)
33 files changed:
cfgfile.cpp
consolehook.cpp
custom.cpp
disk.cpp
drawing.cpp
filesys.cpp
gfxutil.cpp
include/drawing.h
include/options.h
inputdevice.cpp
main.cpp
od-win32/avioutput.h
od-win32/dinput.cpp
od-win32/direct3d.cpp
od-win32/hardfile_win32.cpp
od-win32/lib/prowizard.lib
od-win32/lib/prowizard_x64.lib
od-win32/resources/resource.h
od-win32/resources/winuae.rc
od-win32/rp.cpp
od-win32/scaler_more.cpp
od-win32/sysconfig.h
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32_scaler.cpp
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuae_msvc11/winuae_msvc.vcxproj
od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters
od-win32/winuaechangelog.txt
prowizard/misc/misc.c
qemuvga/qemuuaeglue.h
zfile.cpp

index 051bbaedb7bddc45fc0d36cecc3ddaad590f3bc4..e77d13bcb5e146d729042f0efa1a506ea3af2f6e 100644 (file)
@@ -128,7 +128,12 @@ static const TCHAR *guimode1[] = { _T("no"), _T("yes"), _T("nowait"), 0 };
 static const TCHAR *guimode2[] = { _T("false"), _T("true"), _T("nowait"), 0 };
 static const TCHAR *guimode3[] = { _T("0"), _T("1"), _T("nowait"), 0 };
 static const TCHAR *csmode[] = { _T("ocs"), _T("ecs_agnus"), _T("ecs_denise"), _T("ecs"), _T("aga"), 0 };
-static const TCHAR *linemode[] = { _T("none"), _T("none"), _T("double"), _T("scanlines"), _T("double2"), _T("scanlines2"), _T("double3"), _T("scanlines3"), 0 };
+static const TCHAR *linemode[] = {
+       _T("none"),
+       _T("double"), _T("scanlines"), _T("scanlines2p"), _T("scanlines3p"),
+       _T("double2"), _T("scanlines2"), _T("scanlines2p2"), _T("scanlines2p3"),
+       _T("double3"), _T("scanlines3"), _T("scanlines3p2"), _T("scanlines3p3"),
+       0 };
 static const TCHAR *speedmode[] = { _T("max"), _T("real"), 0 };
 static const TCHAR *colormode1[] = { _T("8bit"), _T("15bit"), _T("16bit"), _T("8bit_dither"), _T("4bit_dither"), _T("32bit"), 0 };
 static const TCHAR *colormode2[] = { _T("8"), _T("15"), _T("16"), _T("8d"), _T("4d"), _T("32"), 0 };
@@ -203,6 +208,7 @@ static const TCHAR *waitblits[] = { _T("disabled"), _T("automatic"), _T("noidleo
 static const TCHAR *autoext2[] = { _T("disabled"), _T("copy"), _T("replace"), 0 };
 static const TCHAR *leds[] = { _T("power"), _T("df0"), _T("df1"), _T("df2"), _T("df3"), _T("hd"), _T("cd"), _T("fps"), _T("cpu"), _T("snd"), _T("md"), 0 };
 static int leds_order[] = { 3, 6, 7, 8, 9, 4, 5, 2, 1, 0, 9 };
+static const TCHAR *lacer[] = { _T("off"), _T("i"), _T("p"), 0 };
 
 static const TCHAR *obsolete[] = {
        _T("accuracy"), _T("gfx_opengl"), _T("gfx_32bit_blits"), _T("32bit_blits"),
@@ -522,16 +528,24 @@ static size_t cfg_write (const void *b, struct zfile *z)
 
 #define UTF8NAME _T(".utf8")
 
-static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *value, int d, int target)
+static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *optionext, const TCHAR *value, int d, int target)
 {
        char lf = 10;
-       TCHAR tmp[CONFIG_BLEN];
+       TCHAR tmp[CONFIG_BLEN], tmpext[CONFIG_BLEN];
+       const TCHAR *optionp;
        char tmpa[CONFIG_BLEN];
        char *tmp1, *tmp2;
        int utf8;
 
        if (value == NULL)
                return;
+       if (optionext) {
+               _tcscpy (tmpext, option);
+               _tcscat (tmpext, optionext);
+               optionp = tmpext;
+       } else {
+               optionp = option;
+       }
        utf8 = 0;
        tmp1 = ua (value);
        tmp2 = uutf8 (value);
@@ -539,14 +553,14 @@ static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *valu
                utf8 = 1;
 
        if (target)
-               _stprintf (tmp, _T("%s.%s=%s"), TARGET_NAME, option, value);
+               _stprintf (tmp, _T("%s.%s=%s"), TARGET_NAME, optionp, value);
        else
-               _stprintf (tmp, _T("%s=%s"), option, value);
+               _stprintf (tmp, _T("%s=%s"), optionp, value);
        if (d && isdefault (tmp))
                goto end;
        cfg_write (tmp, f);
        if (utf8 && !unicode_config) {
-               char *opt = ua (option);
+               char *opt = ua (optionp);
                if (target) {
                        char *tna = ua (TARGET_NAME);
                        sprintf (tmpa, "%s.%s.utf8=%s", tna, opt, tmp2);
@@ -562,7 +576,10 @@ end:
        xfree (tmp2);
        xfree (tmp1);
 }
-
+static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *value, int d, int target)
+{
+       cfg_dowrite (f, option, NULL, value, d, target);
+}
 void cfgfile_write_bool (struct zfile *f, const TCHAR *option, bool b)
 {
        cfg_dowrite (f, option, b ? _T("true") : _T("false"), 0, 0);
@@ -571,6 +588,10 @@ void cfgfile_dwrite_bool (struct zfile *f, const TCHAR *option, bool b)
 {
        cfg_dowrite (f, option, b ? _T("true") : _T("false"), 1, 0);
 }
+void cfgfile_dwrite_bool (struct zfile *f, const TCHAR *option, const TCHAR *optionext, bool b)
+{
+       cfg_dowrite (f, option, optionext, b ? _T("true") : _T("false"), 1, 0);
+}
 void cfgfile_dwrite_bool (struct zfile *f, const TCHAR *option, int b)
 {
        cfgfile_dwrite_bool (f, option, b != 0);
@@ -579,10 +600,18 @@ void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value
 {
        cfg_dowrite (f, option, value, 0, 0);
 }
+void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *optionext, const TCHAR *value)
+{
+       cfg_dowrite (f, option, optionext, value, 0, 0);
+}
 void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value)
 {
        cfg_dowrite (f, option, value, 1, 0);
 }
+void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *optionext, const TCHAR *value)
+{
+       cfg_dowrite (f, option, optionext, value, 1, 0);
+}
 
 void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, bool b)
 {
@@ -601,6 +630,20 @@ void cfgfile_target_dwrite_str (struct zfile *f, const TCHAR *option, const TCHA
        cfg_dowrite (f, option, value, 1, 1);
 }
 
+void cfgfile_write (struct zfile *f, const TCHAR *option, const TCHAR *optionext, const TCHAR *format,...)
+{
+       va_list parms;
+       TCHAR tmp[CONFIG_BLEN], tmp2[CONFIG_BLEN];
+
+       if (optionext) {
+               _tcscpy (tmp2, option);
+               _tcscat (tmp2, optionext);
+       }
+       va_start (parms, format);
+       _vsntprintf (tmp, CONFIG_BLEN, format, parms);
+       cfg_dowrite (f, optionext ? tmp2 : option, tmp, 0, 0);
+       va_end (parms);
+}
 void cfgfile_write (struct zfile *f, const TCHAR *option, const TCHAR *format,...)
 {
        va_list parms;
@@ -611,6 +654,20 @@ void cfgfile_write (struct zfile *f, const TCHAR *option, const TCHAR *format,..
        cfg_dowrite (f, option, tmp, 0, 0);
        va_end (parms);
 }
+void cfgfile_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *optionext, const TCHAR *format,...)
+{
+       va_list parms;
+       TCHAR tmp[CONFIG_BLEN], tmp2[CONFIG_BLEN];
+
+       if (optionext) {
+               _tcscpy (tmp2, option);
+               _tcscat (tmp2, optionext);
+       }
+       va_start (parms, format);
+       _vsntprintf (tmp, CONFIG_BLEN, format, parms);
+       cfg_dowrite (f, optionext ? tmp2 : option, tmp, 1, 0);
+       va_end (parms);
+}
 void cfgfile_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *format,...)
 {
        va_list parms;
@@ -1102,6 +1159,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite_bool (f, _T("magic_mouse"), p->input_magic_mouse);
        cfgfile_dwrite_str (f, _T("magic_mousecursor"), magiccursors[p->input_magic_mouse_cursor]);
        cfgfile_dwrite_str (f, _T("absolute_mouse"), abspointers[p->input_tablet]);
+       cfgfile_dwrite_bool (f, _T("tablet_library"), p->tablet_library);
        cfgfile_dwrite_bool (f, _T("clipboard_sharing"), p->clipboard_sharing);
        cfgfile_dwrite_bool (f, _T("native_code"), p->native_code);
 
@@ -1137,7 +1195,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_write_str (f, _T("gfx_resolution"), lorestype1[p->gfx_resolution]);
        cfgfile_write_str (f, _T("gfx_lores_mode"), loresmode[p->gfx_lores_mode]);
        cfgfile_write_bool (f, _T("gfx_flickerfixer"), p->gfx_scandoubler);
-       cfgfile_write_str (f, _T("gfx_linemode"), p->gfx_scanlines >= 2 ? linemode[4 + (p->gfx_scanlines - 2)] : linemode[p->gfx_vresolution * 2 + (p->gfx_scanlines ? 1 : 0)]);
+       cfgfile_write_str (f, _T("gfx_linemode"), p->gfx_vresolution > 0 ? linemode[p->gfx_iscanlines * 4 + p->gfx_pscanlines + 1] : linemode[0]);
        cfgfile_write_str (f, _T("gfx_fullscreen_amiga"), fullmodes[p->gfx_apmode[0].gfx_fullscreen]);
        cfgfile_write_str (f, _T("gfx_fullscreen_picasso"), fullmodes[p->gfx_apmode[1].gfx_fullscreen]);
        cfgfile_write_str (f, _T("gfx_center_horizontal"), centermode1[p->gfx_xcenter]);
@@ -1149,86 +1207,75 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite (f, _T("gfx_horizontal_tweak"), _T("%d"), p->gfx_extrawidth);
 
 #ifdef GFXFILTER
-       for (int i = 0; i <MAX_FILTERSHADERS; i++) {
-               if (p->gfx_filtershader[i][0])
-                       cfgfile_write (f, _T("gfx_filter_pre"), _T("D3D:%s"), p->gfx_filtershader[i]);
-               if (p->gfx_filtermask[i][0])
-                       cfgfile_write_str (f, _T("gfx_filtermask_pre"), p->gfx_filtermask[i]);
-       }
-       for (int i = 0; i <MAX_FILTERSHADERS; i++) {
-               if (p->gfx_filtershader[i + MAX_FILTERSHADERS][0])
-                       cfgfile_write (f, _T("gfx_filter_post"), _T("D3D:%s"), p->gfx_filtershader[i + MAX_FILTERSHADERS]);
-               if (p->gfx_filtermask[i + MAX_FILTERSHADERS][0])
-                       cfgfile_write_str (f, _T("gfx_filtermask_post"), p->gfx_filtermask[i + MAX_FILTERSHADERS]);
-       }
-       cfgfile_dwrite_str (f, _T("gfx_filter_mask"), p->gfx_filtermask[2 * MAX_FILTERSHADERS]);
-       {
-               bool d3dfound = false;
-               if (p->gfx_filtershader[2 * MAX_FILTERSHADERS][0] && p->gfx_api) {
-                       cfgfile_dwrite (f, _T("gfx_filter"), _T("D3D:%s"), p->gfx_filtershader[2 * MAX_FILTERSHADERS]);
-                       d3dfound = true;
+       for (int j = 0; j < 2; j++) {
+               struct gfx_filterdata *gf = &p->gf[j];
+               const TCHAR *ext = j == 0 ? NULL : _T("_rtg");
+               for (int i = 0; i <MAX_FILTERSHADERS; i++) {
+                       if (gf->gfx_filtershader[i][0])
+                               cfgfile_write (f, _T("gfx_filter_pre"), ext, _T("D3D:%s"), gf->gfx_filtershader[i]);
+                       if (gf->gfx_filtermask[i][0])
+                               cfgfile_write_str (f, _T("gfx_filtermask_pre"), ext, gf->gfx_filtermask[i]);
                }
-               if (!d3dfound) {
-                       if (p->gfx_filter > 0) {
-                               int i = 0;
-                               struct uae_filter *uf;
-                               while (uaefilters[i].name) {
-                                       uf = &uaefilters[i];
-                                       if (uf->type == p->gfx_filter) {
-                                               cfgfile_dwrite_str (f, _T("gfx_filter"), uf->cfgname);
+               for (int i = 0; i <MAX_FILTERSHADERS; i++) {
+                       if (gf->gfx_filtershader[i + MAX_FILTERSHADERS][0])
+                               cfgfile_write (f, _T("gfx_filter_post"), ext, _T("D3D:%s"), gf->gfx_filtershader[i + MAX_FILTERSHADERS]);
+                       if (gf->gfx_filtermask[i + MAX_FILTERSHADERS][0])
+                               cfgfile_write_str (f, _T("gfx_filtermask_post"), ext, gf->gfx_filtermask[i + MAX_FILTERSHADERS]);
+               }
+               cfgfile_dwrite_str (f, _T("gfx_filter_mask"), ext, gf->gfx_filtermask[2 * MAX_FILTERSHADERS]);
+               {
+                       bool d3dfound = false;
+                       if (gf->gfx_filtershader[2 * MAX_FILTERSHADERS][0] && p->gfx_api) {
+                               cfgfile_dwrite (f, _T("gfx_filter"), ext, _T("D3D:%s"), gf->gfx_filtershader[2 * MAX_FILTERSHADERS]);
+                               d3dfound = true;
+                       }
+                       if (!d3dfound) {
+                               if (gf->gfx_filter > 0) {
+                                       int i = 0;
+                                       struct uae_filter *uf;
+                                       while (uaefilters[i].name) {
+                                               uf = &uaefilters[i];
+                                               if (uf->type == gf->gfx_filter) {
+                                                       cfgfile_dwrite_str (f, _T("gfx_filter"), ext, uf->cfgname);
+                                               }
+                                               i++;
                                        }
-                                       i++;
+                               } else {
+                                       cfgfile_dwrite (f, _T("gfx_filter"), ext, _T("no"));
                                }
-                       } else {
-                               cfgfile_dwrite (f, _T("gfx_filter"), _T("no"));
                        }
                }
+               cfgfile_dwrite_str (f, _T("gfx_filter_mode"), ext, filtermode2[gf->gfx_filter_filtermode]);
+               cfgfile_dwrite (f, _T("gfx_filter_vert_zoomf"), ext, _T("%f"), gf->gfx_filter_vert_zoom);
+               cfgfile_dwrite (f, _T("gfx_filter_horiz_zoomf"), ext, _T("%f"), gf->gfx_filter_horiz_zoom);
+               cfgfile_dwrite (f, _T("gfx_filter_vert_zoom_multf"), ext, _T("%f"), gf->gfx_filter_vert_zoom_mult);
+               cfgfile_dwrite (f, _T("gfx_filter_horiz_zoom_multf"), ext, _T("%f"), gf->gfx_filter_horiz_zoom_mult);
+               cfgfile_dwrite (f, _T("gfx_filter_vert_offsetf"), ext, _T("%f"), gf->gfx_filter_vert_offset);
+               cfgfile_dwrite (f, _T("gfx_filter_horiz_offsetf"), ext, _T("%f"), gf->gfx_filter_horiz_offset);
+               cfgfile_dwrite (f, _T("gfx_filter_scanlines"), ext, _T("%d"), gf->gfx_filter_scanlines);
+               cfgfile_dwrite (f, _T("gfx_filter_scanlinelevel"), ext, _T("%d"), gf->gfx_filter_scanlinelevel);
+               cfgfile_dwrite (f, _T("gfx_filter_scanlineratio"), ext, _T("%d"), gf->gfx_filter_scanlineratio);
+               cfgfile_dwrite (f, _T("gfx_filter_luminance"), ext, _T("%d"), gf->gfx_filter_luminance);
+               cfgfile_dwrite (f, _T("gfx_filter_contrast"), ext, _T("%d"), gf->gfx_filter_contrast);
+               cfgfile_dwrite (f, _T("gfx_filter_saturation"), ext, _T("%d"), gf->gfx_filter_saturation);
+               cfgfile_dwrite (f, _T("gfx_filter_gamma"), ext, _T("%d"), gf->gfx_filter_gamma);
+               cfgfile_dwrite (f, _T("gfx_filter_blur"), ext, _T("%d"), gf->gfx_filter_blur);
+               cfgfile_dwrite (f, _T("gfx_filter_noise"), ext, _T("%d"), gf->gfx_filter_noise);
+               cfgfile_dwrite_bool (f, _T("gfx_filter_bilinear"), ext, gf->gfx_filter_bilinear != 0);
+               cfgfile_dwrite (f, _T("gfx_filter_keep_autoscale_aspect"), ext, _T("%d"), gf->gfx_filter_keep_autoscale_aspect);
+               cfgfile_dwrite_str (f, _T("gfx_filter_keep_aspect"), ext, aspects[gf->gfx_filter_keep_aspect]);
+               cfgfile_dwrite_str (f, _T("gfx_filter_autoscale"), ext, autoscale[gf->gfx_filter_autoscale]);
+               cfgfile_dwrite (f, _T("gfx_filter_aspect_ratio"), ext, _T("%d:%d"),
+                       gf->gfx_filter_aspect >= 0 ? (gf->gfx_filter_aspect / ASPECTMULT) : -1,
+                       gf->gfx_filter_aspect >= 0 ? (gf->gfx_filter_aspect & (ASPECTMULT - 1)) : -1);
+               if (gf->gfx_filteroverlay[0]) {
+                       cfgfile_dwrite (f, _T("gfx_filter_overlay"), ext, _T("%s%s"),
+                               gf->gfx_filteroverlay, _tcschr (gf->gfx_filteroverlay, ',') ? _T(",") : _T(""));
+               }
        }
-       cfgfile_dwrite_str (f, _T("gfx_filter_mode"), filtermode2[p->gfx_filter_filtermode]);
-       cfgfile_dwrite (f, _T("gfx_filter_vert_zoomf"), _T("%f"), p->gfx_filter_vert_zoom);
-       cfgfile_dwrite (f, _T("gfx_filter_horiz_zoomf"), _T("%f"), p->gfx_filter_horiz_zoom);
-       cfgfile_dwrite (f, _T("gfx_filter_vert_zoom_multf"), _T("%f"), p->gfx_filter_vert_zoom_mult);
-       cfgfile_dwrite (f, _T("gfx_filter_horiz_zoom_multf"), _T("%f"), p->gfx_filter_horiz_zoom_mult);
-       cfgfile_dwrite (f, _T("gfx_filter_vert_offsetf"), _T("%f"), p->gfx_filter_vert_offset);
-       cfgfile_dwrite (f, _T("gfx_filter_horiz_offsetf"), _T("%f"), p->gfx_filter_horiz_offset);
-       cfgfile_dwrite (f, _T("gfx_filter_scanlines"), _T("%d"), p->gfx_filter_scanlines);
-       cfgfile_dwrite (f, _T("gfx_filter_scanlinelevel"), _T("%d"), p->gfx_filter_scanlinelevel);
-       cfgfile_dwrite (f, _T("gfx_filter_scanlineratio"), _T("%d"), p->gfx_filter_scanlineratio);
-       cfgfile_dwrite (f, _T("gfx_filter_luminance"), _T("%d"), p->gfx_filter_luminance);
-       cfgfile_dwrite (f, _T("gfx_filter_contrast"), _T("%d"), p->gfx_filter_contrast);
-       cfgfile_dwrite (f, _T("gfx_filter_saturation"), _T("%d"), p->gfx_filter_saturation);
-       cfgfile_dwrite (f, _T("gfx_filter_gamma"), _T("%d"), p->gfx_filter_gamma);
-       cfgfile_dwrite (f, _T("gfx_filter_blur"), _T("%d"), p->gfx_filter_blur);
-       cfgfile_dwrite (f, _T("gfx_filter_noise"), _T("%d"), p->gfx_filter_noise);
-       cfgfile_dwrite_bool (f, _T("gfx_filter_bilinear"), p->gfx_filter_bilinear != 0);
-       cfgfile_dwrite (f, _T("gfx_filter_keep_autoscale_aspect"), _T("%d"), p->gfx_filter_keep_autoscale_aspect);
-       cfgfile_dwrite_str (f, _T("gfx_filter_keep_aspect"), aspects[p->gfx_filter_keep_aspect]);
-       cfgfile_dwrite_str (f, _T("gfx_filter_autoscale"), autoscale[p->gfx_filter_autoscale]);
-       cfgfile_dwrite (f, _T("gfx_filter_aspect_ratio"), _T("%d:%d"),
-               p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect / ASPECTMULT) : -1,
-               p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect & (ASPECTMULT - 1)) : -1);
        cfgfile_dwrite (f, _T("gfx_luminance"), _T("%d"), p->gfx_luminance);
        cfgfile_dwrite (f, _T("gfx_contrast"), _T("%d"), p->gfx_contrast);
        cfgfile_dwrite (f, _T("gfx_gamma"), _T("%d"), p->gfx_gamma);
-       if (p->gfx_filteroverlay[0]) {
-               cfgfile_dwrite (f, _T("gfx_filter_overlay"), _T("%s%s"),
-                       p->gfx_filteroverlay, _tcschr (p->gfx_filteroverlay, ',') ? _T(",") : _T(""));
-
-#if 0
-               cfgfile_dwrite (f, _T("gfx_filter_overlay"), _T("%s,%d%s:%d%s:%d%s:%d%s:%d%%"),
-                       p->gfx_filteroverlay,
-                       p->gfx_filteroverlay_pos.x >= -24000 ? p->gfx_filteroverlay_pos.x : -p->gfx_filteroverlay_pos.x - 30000,
-                       p->gfx_filteroverlay_pos.x >= -24000 ? _T("") : _T("%"),
-                       p->gfx_filteroverlay_pos.y >= -24000 ? p->gfx_filteroverlay_pos.y : -p->gfx_filteroverlay_pos.y - 30000,
-                       p->gfx_filteroverlay_pos.y >= -24000 ? _T("") : _T("%"),
-                       p->gfx_filteroverlay_pos.width >= -24000 ? p->gfx_filteroverlay_pos.width : -p->gfx_filteroverlay_pos.width - 30000,
-                       p->gfx_filteroverlay_pos.width >= -24000 ? _T("") : _T("%"),
-                       p->gfx_filteroverlay_pos.height >= -24000 ? p->gfx_filteroverlay_pos.height : -p->gfx_filteroverlay_pos.height - 30000,
-                       p->gfx_filteroverlay_pos.height >= -24000 ? _T("") : _T("%"),
-                       p->gfx_filteroverlay_overscan
-                       );
-#endif
-       }
 
        cfgfile_dwrite (f, _T("gfx_center_horizontal_position"), _T("%d"), p->gfx_xcenter_pos);
        cfgfile_dwrite (f, _T("gfx_center_vertical_position"), _T("%d"), p->gfx_ycenter_pos);
@@ -1491,22 +1538,47 @@ int cfgfile_doubleval (const TCHAR *option, const TCHAR *value, const TCHAR *nam
        return 1;
 }
 
-int cfgfile_floatval (const TCHAR *option, const TCHAR *value, const TCHAR *name, float *location)
+int cfgfile_floatval (const TCHAR *option, const TCHAR *value, const TCHAR *name, const TCHAR *nameext, float *location)
 {
        int base = 10;
        TCHAR *endptr;
-       if (name != NULL && _tcscmp (option, name) != 0)
+       if (name == NULL)
                return 0;
+       if (nameext) {
+               TCHAR tmp[MAX_DPATH];
+               _tcscpy (tmp, name);
+               _tcscat (tmp, nameext);
+               if (_tcscmp (tmp, option) != 0)
+                       return 0;
+       } else {
+               if (_tcscmp (option, name) != 0)
+                       return 0;
+       }
        *location = (float)_tcstod (value, &endptr);
        return 1;
 }
+int cfgfile_floatval (const TCHAR *option, const TCHAR *value, const TCHAR *name, float *location)
+{
+       return cfgfile_floatval (option, NULL, value, name, location);
+}
 
-int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, unsigned int *location, int scale)
+int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, const TCHAR *nameext, unsigned int *location, int scale)
 {
        int base = 10;
        TCHAR *endptr;
-       if (name != NULL && _tcscmp (option, name) != 0)
+       TCHAR tmp[MAX_DPATH];
+
+       if (name == NULL)
                return 0;
+       if (nameext) {
+               _tcscpy (tmp, name);
+               _tcscat (tmp, nameext);
+               if (_tcscmp (tmp, option) != 0)
+                       return 0;
+       } else {
+               if (_tcscmp (option, name) != 0)
+                       return 0;
+       }
        /* I guess octal isn't popular enough to worry about here...  */
        if (value[0] == '0' && _totupper (value[1]) == 'X')
                value += 2, base = 16;
@@ -1521,27 +1593,49 @@ int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name,
                        *location = 1;
                        return 1;
                }
-               write_log (_T("Option '%s' requires a numeric argument but got '%s'\n"), option, value);
+               write_log (_T("Option '%s' requires a numeric argument but got '%s'\n"), nameext ? tmp : option, value);
                return -1;
        }
        return 1;
 }
-
+int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, unsigned int *location, int scale)
+{
+       return cfgfile_intval (option, value, name, NULL, location, scale);
+}
 int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale)
 {
        unsigned int v = 0;
-       int r = cfgfile_intval (option, value, name, &v, scale);
+       int r = cfgfile_intval (option, value, name, NULL, &v, scale);
+       if (!r)
+               return 0;
+       *location = (int)v;
+       return r;
+}
+int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, const TCHAR *nameext, int *location, int scale)
+{
+       unsigned int v = 0;
+       int r = cfgfile_intval (option, value, name, nameext, &v, scale);
        if (!r)
                return 0;
        *location = (int)v;
        return r;
 }
 
-int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more)
+int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, const TCHAR *nameext, int *location, const TCHAR *table[], int more)
 {
        int val;
-       if (name != NULL && _tcscmp (option, name) != 0)
+       TCHAR tmp[MAX_DPATH];
+       if (name == NULL)
                return 0;
+       if (nameext) {
+               _tcscpy (tmp, name);
+               _tcscat (tmp, nameext);
+               if (_tcscmp (tmp, option) != 0)
+                       return 0;
+       } else {
+               if (_tcscmp (option, name) != 0)
+                       return 0;
+       }
        val = match_string (table, value);
        if (val == -1) {
                if (more)
@@ -1551,13 +1645,17 @@ int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name,
                } else if  (!strcasecmp (value, _T("no")) || !strcasecmp (value, _T("false"))) {
                        val = 0;
                } else {
-                       write_log (_T("Unknown value ('%s') for option '%s'.\n"), value, option);
+                       write_log (_T("Unknown value ('%s') for option '%s'.\n"), value, nameext ? tmp : option);
                        return -1;
                }
        }
        *location = val;
        return 1;
 }
+int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more)
+{
+       return cfgfile_strval (option, value, name, NULL, location, table, more);
+}
 
 int cfgfile_strboolval (const TCHAR *option, const TCHAR *value, const TCHAR *name, bool *location, const TCHAR *table[], int more)
 {
@@ -1576,6 +1674,23 @@ int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR *name,
        location[maxsz - 1] = '\0';
        return 1;
 }
+int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR *name, const TCHAR *nameext, TCHAR *location, int maxsz)
+{
+       if (nameext) {
+               TCHAR tmp[MAX_DPATH];
+               _tcscpy (tmp, name);
+               _tcscat (tmp, nameext);
+               if (_tcscmp (tmp, option) != 0)
+                       return 0;
+       } else {
+               if (_tcscmp (option, name) != 0)
+                       return 0;
+       }
+       _tcsncpy (location, value, maxsz - 1);
+       location[maxsz - 1] = '\0';
+       return 1;
+}
+
 
 int cfgfile_path (const TCHAR *option, const TCHAR *value, const TCHAR *name, TCHAR *location, int maxsz, struct multipath *mp)
 {
@@ -1895,36 +2010,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, _T("gfx_center_horizontal_size"), &p->gfx_xcenter_size, 1)
                || cfgfile_intval (option, value, _T("gfx_center_vertical_size"), &p->gfx_ycenter_size, 1)
 
-#ifdef GFXFILTER
-               || cfgfile_floatval (option, value, _T("gfx_filter_vert_zoomf"), &p->gfx_filter_vert_zoom)
-               || cfgfile_floatval (option, value, _T("gfx_filter_horiz_zoomf"), &p->gfx_filter_horiz_zoom)
-               || cfgfile_floatval (option, value, _T("gfx_filter_vert_zoom_multf"), &p->gfx_filter_vert_zoom_mult)
-               || cfgfile_floatval (option, value, _T("gfx_filter_horiz_zoom_multf"), &p->gfx_filter_horiz_zoom_mult)
-               || cfgfile_floatval (option, value, _T("gfx_filter_vert_offsetf"), &p->gfx_filter_vert_offset)
-               || cfgfile_floatval (option, value, _T("gfx_filter_horiz_offsetf"), &p->gfx_filter_horiz_offset)
-               || cfgfile_intval (option, value, _T("gfx_filter_scanlines"), &p->gfx_filter_scanlines, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_scanlinelevel"), &p->gfx_filter_scanlinelevel, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_scanlineratio"), &p->gfx_filter_scanlineratio, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_luminance"), &p->gfx_filter_luminance, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_contrast"), &p->gfx_filter_contrast, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_saturation"), &p->gfx_filter_saturation, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_gamma"), &p->gfx_filter_gamma, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_blur"), &p->gfx_filter_blur, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_noise"), &p->gfx_filter_noise, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_bilinear"), &p->gfx_filter_bilinear, 1)
-               || cfgfile_intval (option, value, _T("gfx_luminance"), &p->gfx_luminance, 1)
-               || cfgfile_intval (option, value, _T("gfx_contrast"), &p->gfx_contrast, 1)
-               || cfgfile_intval (option, value, _T("gfx_gamma"), &p->gfx_gamma, 1)
-               || cfgfile_intval (option, value, _T("gfx_filter_keep_autoscale_aspect"), &p->gfx_filter_keep_autoscale_aspect, 1)
-               || cfgfile_intval (option, value, _T("gfx_horizontal_tweak"), &p->gfx_extrawidth, 1)
-               || cfgfile_string (option, value, _T("gfx_filter_mask"), p->gfx_filtermask[2 * MAX_FILTERSHADERS], sizeof p->gfx_filtermask[2 * MAX_FILTERSHADERS] / sizeof (TCHAR))
                || cfgfile_intval (option, value, _T("filesys_max_size"), &p->filesys_limit, 1)
                || cfgfile_intval (option, value, _T("filesys_max_name_length"), &p->filesys_max_name, 1)
                || cfgfile_intval (option, value, _T("filesys_max_file_size"), &p->filesys_max_file_size, 1)
 
+               || cfgfile_intval (option, value, _T("gfx_luminance"), &p->gfx_luminance, 1)
+               || cfgfile_intval (option, value, _T("gfx_contrast"), &p->gfx_contrast, 1)
+               || cfgfile_intval (option, value, _T("gfx_gamma"), &p->gfx_gamma, 1)
                || cfgfile_floatval (option, value, _T("rtg_vert_zoom_multf"), &p->rtg_vert_zoom_mult)
                || cfgfile_floatval (option, value, _T("rtg_horiz_zoom_multf"), &p->rtg_horiz_zoom_mult)
-#endif
+               || cfgfile_intval (option, value, _T("gfx_horizontal_tweak"), &p->gfx_extrawidth, 1)
+
                || cfgfile_intval (option, value, _T("floppy0sound"), &p->floppyslots[0].dfxclick, 1)
                || cfgfile_intval (option, value, _T("floppy1sound"), &p->floppyslots[1].dfxclick, 1)
                || cfgfile_intval (option, value, _T("floppy2sound"), &p->floppyslots[2].dfxclick, 1)
@@ -1962,6 +2058,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_yesno (option, value, _T("headless"), &p->headless)
                || cfgfile_yesno (option, value, _T("clipboard_sharing"), &p->clipboard_sharing)
                || cfgfile_yesno (option, value, _T("native_code"), &p->native_code)
+               || cfgfile_yesno (option, value, _T("tablet_library"), &p->tablet_library)
                || cfgfile_yesno (option, value, _T("bsdsocket_emu"), &p->socket_emu))
                return 1;
 
@@ -1988,13 +2085,40 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_strval (option, value, _T("gfx_color_mode"), &p->color_mode, colormode2, 0)
                || cfgfile_strval (option, value, _T("gfx_max_horizontal"), &p->gfx_max_horizontal, maxhoriz, 0)
                || cfgfile_strval (option, value, _T("gfx_max_vertical"), &p->gfx_max_vertical, maxvert, 0)
-               || cfgfile_strval (option, value, _T("gfx_filter_autoscale"), &p->gfx_filter_autoscale, autoscale, 0)
                || cfgfile_strval (option, value, _T("gfx_api"), &p->gfx_api, filterapi, 0)
                || cfgfile_strval (option, value, _T("magic_mousecursor"), &p->input_magic_mouse_cursor, magiccursors, 0)
-               || cfgfile_strval (option, value, _T("gfx_filter_keep_aspect"), &p->gfx_filter_keep_aspect, aspects, 0)
                || cfgfile_strval (option, value, _T("absolute_mouse"), &p->input_tablet, abspointers, 0))
                return 1;
 
+#ifdef GFXFILTER
+       for (int j = 0; j < 2; j++) {
+               struct gfx_filterdata *gf = &p->gf[j];
+               const TCHAR *ext = j == 0 ? NULL : _T("_rtg");
+               if (cfgfile_strval (option, value, _T("gfx_filter_autoscale"), ext, &gf->gfx_filter_autoscale, autoscale, 0)
+                       || cfgfile_strval (option, value, _T("gfx_filter_keep_aspect"), ext, &gf->gfx_filter_keep_aspect, aspects, 0))
+                       return 1;
+               if (cfgfile_floatval (option, value, _T("gfx_filter_vert_zoomf"), ext, &gf->gfx_filter_vert_zoom)
+                       || cfgfile_floatval (option, value, _T("gfx_filter_horiz_zoomf"), ext, &gf->gfx_filter_horiz_zoom)
+                       || cfgfile_floatval (option, value, _T("gfx_filter_vert_zoom_multf"), ext, &gf->gfx_filter_vert_zoom_mult)
+                       || cfgfile_floatval (option, value, _T("gfx_filter_horiz_zoom_multf"), ext, &gf->gfx_filter_horiz_zoom_mult)
+                       || cfgfile_floatval (option, value, _T("gfx_filter_vert_offsetf"), ext, &gf->gfx_filter_vert_offset)
+                       || cfgfile_floatval (option, value, _T("gfx_filter_horiz_offsetf"), ext, &gf->gfx_filter_horiz_offset)
+                       || cfgfile_intval (option, value, _T("gfx_filter_scanlines"), ext, &gf->gfx_filter_scanlines, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_scanlinelevel"), ext, &gf->gfx_filter_scanlinelevel, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_scanlineratio"), ext, &gf->gfx_filter_scanlineratio, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_luminance"), ext, &gf->gfx_filter_luminance, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_contrast"), ext, &gf->gfx_filter_contrast, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_saturation"), ext, &gf->gfx_filter_saturation, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_gamma"), ext, &gf->gfx_filter_gamma, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_blur"), ext, &gf->gfx_filter_blur, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_noise"), ext, &gf->gfx_filter_noise, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_bilinear"), ext, &gf->gfx_filter_bilinear, 1)
+                       || cfgfile_intval (option, value, _T("gfx_filter_keep_autoscale_aspect"), ext, &gf->gfx_filter_keep_autoscale_aspect, 1)
+                       || cfgfile_string (option, value, _T("gfx_filter_mask"), ext, gf->gfx_filtermask[2 * MAX_FILTERSHADERS], sizeof gf->gfx_filtermask[2 * MAX_FILTERSHADERS] / sizeof (TCHAR)))
+                       return 1;
+       }
+#endif
+
        if (_tcscmp (option, _T("gfx_width_windowed")) == 0) {
                if (!_tcscmp (value, _T("native"))) {
                        p->gfx_size_win.width = 0;
@@ -2075,13 +2199,13 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
        if (_tcscmp (option, _T("gfx_linemode")) == 0) {
                int v;
                p->gfx_vresolution = VRES_DOUBLE;
-               p->gfx_scanlines = 0;
+               p->gfx_pscanlines = 0;
+               p->gfx_iscanlines = 0;
                if (cfgfile_strval (option, value, _T("gfx_linemode"), &v, linemode, 0)) {
-                       if (v >= 4) {
-                               p->gfx_scanlines = (v - 4) + 2;
-                       } else {
-                               p->gfx_scanlines = v & 1;
-                               p->gfx_vresolution = v / 2;
+                       if (v > 0) {
+                               p->gfx_iscanlines = (v - 1) / 4;
+                               p->gfx_pscanlines = (v - 1) % 4;
+                               p->gfx_vresolution = 1;
                        }
                }
                return 1;
@@ -2165,159 +2289,135 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
        }
 
 #ifdef GFXFILTER
-       if (_tcscmp (option, _T("gfx_filter_overlay")) == 0) {
-               TCHAR *s = _tcschr (value, ',');
-               p->gfx_filteroverlay_overscan = 0;
-               p->gfx_filteroverlay_pos.x = 0;
-               p->gfx_filteroverlay_pos.y = 0;
-               p->gfx_filteroverlay_pos.width = 0;
-               p->gfx_filteroverlay_pos.height = 0;
-               if (s)
-                       *s = 0;
-               while (s) {
-                       *s++ = 0;
-                       p->gfx_filteroverlay_overscan = _tstol (s);
-                       s = _tcschr (s, ':');
-                       if (!s)
-                               break;
-#if 0
-                       p->gfx_filteroverlay_pos.x = _tstol (s);
-                       s = _tcschr (s, ',');
-                       if (!s)
-                               break;
-                       if (s[-1] == '%')
-                               p->gfx_filteroverlay_pos.x = -30000 - p->gfx_filteroverlay_pos.x;
-                       *s++ = 0;
-                       p->gfx_filteroverlay_pos.y = _tstol (s);
-                       s = _tcschr (s, ',');
-                       if (!s)
-                               break;
-                       if (s[-1] == '%')
-                               p->gfx_filteroverlay_pos.y = -30000 - p->gfx_filteroverlay_pos.y;
-                       *s++ = 0;
-                       p->gfx_filteroverlay_pos.width = _tstol (s);
-                       s = _tcschr (s, ',');
-                       if (!s)
-                               break;
-                       if (s[-1] == '%')
-                               p->gfx_filteroverlay_pos.width = -30000 - p->gfx_filteroverlay_pos.width;
-                       *s++ = 0;
-                       p->gfx_filteroverlay_pos.height = _tstol (s);
-                       s = _tcschr (s, ',');
-                       if (!s)
+       for (int j = 0; j < 2; j++) {
+               struct gfx_filterdata *gf = &p->gf[j];
+               if ((j == 0 && _tcscmp (option, _T("gfx_filter_overlay")) == 0) || (j == 1 && _tcscmp (option, _T("gfx_filter_overlay_rtg")) == 0)) {
+                       TCHAR *s = _tcschr (value, ',');
+                       gf->gfx_filteroverlay_overscan = 0;
+                       gf->gfx_filteroverlay_pos.x = 0;
+                       gf->gfx_filteroverlay_pos.y = 0;
+                       gf->gfx_filteroverlay_pos.width = 0;
+                       gf->gfx_filteroverlay_pos.height = 0;
+                       if (s)
+                               *s = 0;
+                       while (s) {
+                               *s++ = 0;
+                               gf->gfx_filteroverlay_overscan = _tstol (s);
+                               s = _tcschr (s, ':');
+                               if (!s)
+                                       break;
                                break;
-                       if (s[-1] == '%')
-                               p->gfx_filteroverlay_pos.height = -30000 - p->gfx_filteroverlay_pos.height;
-                       *s++ = 0;
-                       p->gfx_filteroverlay_overscan = _tstol (s);
-                       TCHAR *s2 = _tcschr (s, ',');
-                       if (s2)
-                               *s2 = 0;
-#endif
-                       break;
+                       }
+                       _tcsncpy (gf->gfx_filteroverlay, value, sizeof gf->gfx_filteroverlay / sizeof (TCHAR) - 1);
+                       gf->gfx_filteroverlay[sizeof gf->gfx_filteroverlay / sizeof (TCHAR) - 1] = 0;
+                       return 1;
                }
-               _tcsncpy (p->gfx_filteroverlay, value, sizeof p->gfx_filteroverlay / sizeof (TCHAR) - 1);
-               p->gfx_filteroverlay[sizeof p->gfx_filteroverlay / sizeof (TCHAR) - 1] = 0;
-               return 1;
-       }
 
-       if (_tcscmp (option, _T("gfx_filtermask_pre")) == 0 || _tcscmp (option, _T("gfx_filtermask_post")) == 0) {
-               if (_tcscmp (option, _T("gfx_filtermask_pre")) == 0) {
-                       for (int i = 0; i < MAX_FILTERSHADERS; i++) {
-                               if (p->gfx_filtermask[i][0] == 0) {
-                                       _tcscpy (p->gfx_filtermask[i], value);
-                                       break;
+               if ((j == 0 && (_tcscmp (option, _T("gfx_filtermask_pre")) == 0 || _tcscmp (option, _T("gfx_filtermask_post")) == 0)) ||
+                       (j == 1 && (_tcscmp (option, _T("gfx_filtermask_pre_rtg")) == 0 || _tcscmp (option, _T("gfx_filtermask_post_rtg")) == 0))) {
+                       if (_tcscmp (option, _T("gfx_filtermask_pre")) == 0 || _tcscmp (option, _T("gfx_filtermask_pre_rtg")) == 0) {
+                               for (int i = 0; i < MAX_FILTERSHADERS; i++) {
+                                       if (gf->gfx_filtermask[i][0] == 0) {
+                                               _tcscpy (gf->gfx_filtermask[i], value);
+                                               break;
+                                       }
                                }
-                       }
-               } else {
-                       for (int i = 0; i < MAX_FILTERSHADERS; i++) {
-                               if (p->gfx_filtermask[i + MAX_FILTERSHADERS][0] == 0) {
-                                       _tcscpy (p->gfx_filtermask[i + MAX_FILTERSHADERS], value);
-                                       break;
+                       } else {
+                               for (int i = 0; i < MAX_FILTERSHADERS; i++) {
+                                       if (gf->gfx_filtermask[i + MAX_FILTERSHADERS][0] == 0) {
+                                               _tcscpy (gf->gfx_filtermask[i + MAX_FILTERSHADERS], value);
+                                               break;
+                                       }
                                }
                        }
+                       return 1;
                }
-               return 1;
-       }
 
-       if (_tcscmp (option, _T("gfx_filter_pre")) == 0 || _tcscmp (option, _T("gfx_filter_post")) == 0) {
-               TCHAR *s = _tcschr (value, ':');
-               if (s) {
-                       *s++ = 0;
-                       if (!_tcscmp (value, _T("D3D"))) {
-                               p->gfx_api = 1;
-                               if (_tcscmp (option, _T("gfx_filter_pre")) == 0) {
-                                       for (int i = 0; i < MAX_FILTERSHADERS; i++) {
-                                               if (p->gfx_filtershader[i][0] == 0) {
-                                                       _tcscpy (p->gfx_filtershader[i], s);
-                                                       break;
+               if ((j == 0 && (_tcscmp (option, _T("gfx_filter_pre")) == 0 || _tcscmp (option, _T("gfx_filter_post")) == 0)) ||
+                       (j == 1 && (_tcscmp (option, _T("gfx_filter_pre_rtg")) == 0 || _tcscmp (option, _T("gfx_filter_post_rtg")) == 0))) {
+                       TCHAR *s = _tcschr (value, ':');
+                       if (s) {
+                               *s++ = 0;
+                               if (!_tcscmp (value, _T("D3D"))) {
+                                       p->gfx_api = 1;
+                                       if (_tcscmp (option, _T("gfx_filter_pre")) == 0) {
+                                               for (int i = 0; i < MAX_FILTERSHADERS; i++) {
+                                                       if (gf->gfx_filtershader[i][0] == 0) {
+                                                               _tcscpy (gf->gfx_filtershader[i], s);
+                                                               break;
+                                                       }
                                                }
-                                       }
-                               } else {
-                                       for (int i = 0; i < MAX_FILTERSHADERS; i++) {
-                                               if (p->gfx_filtershader[i + MAX_FILTERSHADERS][0] == 0) {
-                                                       _tcscpy (p->gfx_filtershader[i + MAX_FILTERSHADERS], s);
-                                                       break;
+                                       } else {
+                                               for (int i = 0; i < MAX_FILTERSHADERS; i++) {
+                                                       if (gf->gfx_filtershader[i + MAX_FILTERSHADERS][0] == 0) {
+                                                               _tcscpy (gf->gfx_filtershader[i + MAX_FILTERSHADERS], s);
+                                                               break;
+                                                       }
                                                }
                                        }
                                }
                        }
+                       return 1;
                }
-               return 1;
-       }
 
-       if (_tcscmp (option, _T("gfx_filter")) == 0) {
-               TCHAR *s = _tcschr (value, ':');
-               p->gfx_filter = 0;
-               if (s) {
-                       *s++ = 0;
-                       if (!_tcscmp (value, _T("D3D"))) {
-                               p->gfx_api = 1;
-                               _tcscpy (p->gfx_filtershader[2 * MAX_FILTERSHADERS], s);
-                               for (int i = 0; i < 2 * MAX_FILTERSHADERS; i++) {
-                                       if (!_tcsicmp (p->gfx_filtershader[i], s)) {
-                                               p->gfx_filtershader[i][0] = 0;
-                                               p->gfx_filtermask[i][0] = 0;
+               if ((j == 0 && _tcscmp (option, _T("gfx_filter")) == 0) || (j == 1 && _tcscmp (option, _T("gfx_filter_rtg")) == 0)) {
+                       TCHAR *s = _tcschr (value, ':');
+                       gf->gfx_filter = 0;
+                       if (s) {
+                               *s++ = 0;
+                               if (!_tcscmp (value, _T("D3D"))) {
+                                       p->gfx_api = 1;
+                                       _tcscpy (gf->gfx_filtershader[2 * MAX_FILTERSHADERS], s);
+                                       for (int i = 0; i < 2 * MAX_FILTERSHADERS; i++) {
+                                               if (!_tcsicmp (gf->gfx_filtershader[i], s)) {
+                                                       gf->gfx_filtershader[i][0] = 0;
+                                                       gf->gfx_filtermask[i][0] = 0;
+                                               }
                                        }
                                }
                        }
-               }
-               if (!_tcscmp (value, _T("direct3d"))) {
-                       p->gfx_api = 1; // forwards compatibiity
-               } else {
-                       int i = 0;
-                       while(uaefilters[i].name) {
-                               if (!_tcscmp (uaefilters[i].cfgname, value)) {
-                                       p->gfx_filter = uaefilters[i].type;
-                                       break;
+                       if (!_tcscmp (value, _T("direct3d"))) {
+                               p->gfx_api = 1; // forwards compatibiity
+                       } else {
+                               int i = 0;
+                               while(uaefilters[i].name) {
+                                       if (!_tcscmp (uaefilters[i].cfgname, value)) {
+                                               gf->gfx_filter = uaefilters[i].type;
+                                               break;
+                                       }
+                                       i++;
                                }
-                               i++;
                        }
+                       return 1;
+               }
+               if (j == 0 && _tcscmp (option, _T("gfx_filter_mode")) == 0) {
+                       cfgfile_strval (option, value, _T("gfx_filter_mode"), &gf->gfx_filter_filtermode, filtermode2, 0);
+                       return 1;
+               }
+               if (j == 1 && _tcscmp (option, _T("gfx_filter_mode_rtg")) == 0) {
+                       cfgfile_strval (option, value, _T("gfx_filter_mode_rtg"), &gf->gfx_filter_filtermode, filtermode2, 0);
+                       return 1;
                }
-               return 1;
-       }
-       if (_tcscmp (option, _T("gfx_filter_mode")) == 0) {
-               cfgfile_strval (option, value, _T("gfx_filter_mode"), &p->gfx_filter_filtermode, filtermode2, 0);
-               return 1;
-       }
-
-       if (cfgfile_string (option, value, _T("gfx_filter_aspect_ratio"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) {
-               int v1, v2;
-               TCHAR *s;
 
-               p->gfx_filter_aspect = -1;
-               v1 = _tstol (tmpbuf);
-               s = _tcschr (tmpbuf, ':');
-               if (s) {
-                       v2 = _tstol (s + 1);
-                       if (v1 < 0 || v2 < 0)
-                               p->gfx_filter_aspect = -1;
-                       else if (v1 == 0 || v2 == 0)
-                               p->gfx_filter_aspect = 0;
-                       else
-                               p->gfx_filter_aspect = v1 * ASPECTMULT + v2;
+               if ((j == 0 && cfgfile_string (option, value, _T("gfx_filter_aspect_ratio"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) ||
+                       (j == 1 && cfgfile_string (option, value, _T("gfx_filter_aspect_ratio_rtg"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR)))) {
+                       int v1, v2;
+                       TCHAR *s;
+
+                       gf->gfx_filter_aspect = -1;
+                       v1 = _tstol (tmpbuf);
+                       s = _tcschr (tmpbuf, ':');
+                       if (s) {
+                               v2 = _tstol (s + 1);
+                               if (v1 < 0 || v2 < 0)
+                                       gf->gfx_filter_aspect = -1;
+                               else if (v1 == 0 || v2 == 0)
+                                       gf->gfx_filter_aspect = 0;
+                               else
+                                       gf->gfx_filter_aspect = v1 * ASPECTMULT + v2;
+                       }
+                       return 1;
                }
-               return 1;
        }
 #endif
 
@@ -3400,7 +3500,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_yesno (option, value, _T("comp_midopt"), &p->comp_midopt)
                || cfgfile_yesno (option, value, _T("comp_lowopt"), &p->comp_lowopt)
                || cfgfile_yesno (option, value, _T("rtg_nocustom"), &p->picasso96_nocustom)
-               || cfgfile_yesno (option, value, _T("floppy_write_protected"), &p->floppy_read_only)
+               || cfgfile_yesno (option, value, _T("floppy_write_protect"), &p->floppy_read_only)
                || cfgfile_yesno (option, value, _T("uae_hide_autoconfig"), &p->uae_hide_autoconfig)
                || cfgfile_yesno (option, value, _T("uaeserial"), &p->uaeserial))
                return 1;
@@ -4200,8 +4300,8 @@ static void parse_gfx_specs (struct uae_prefs *p, const TCHAR *spec)
        p->gfx_xcenter = _tcschr (x2, 'x') != 0 ? 1 : _tcschr (x2, 'X') != 0 ? 2 : 0;
        p->gfx_ycenter = _tcschr (x2, 'y') != 0 ? 1 : _tcschr (x2, 'Y') != 0 ? 2 : 0;
        p->gfx_vresolution = _tcschr (x2, 'd') != 0 ? VRES_DOUBLE : VRES_NONDOUBLE;
-       p->gfx_scanlines = _tcschr (x2, 'D') != 0;
-       if (p->gfx_scanlines)
+       p->gfx_pscanlines = _tcschr (x2, 'D') != 0;
+       if (p->gfx_pscanlines)
                p->gfx_vresolution = VRES_DOUBLE;
        p->gfx_apmode[0].gfx_fullscreen = _tcschr (x2, 'a') != 0;
        p->gfx_apmode[1].gfx_fullscreen = _tcschr (x2, 'p') != 0;
@@ -4988,9 +5088,9 @@ void default_prefs (struct uae_prefs *p, int type)
        p->config_hardware_path[0] = 0;
        p->config_host_path[0] = 0;
 
-       p->gfx_scandoubler = 0;
-       p->start_gui = 1;
-       p->start_debugger = 0;
+       p->gfx_scandoubler = false;
+       p->start_gui = true;
+       p->start_debugger = false;
 
        p->all_lines = 0;
        /* Note to porters: please don't change any of these options! UAE is supposed
@@ -5142,20 +5242,23 @@ void default_prefs (struct uae_prefs *p, int type)
        p->cs_resetwarning = 1;
        p->cs_ciatodbug = false;
 
-       p->gfx_filter = 0;
-       for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) {
-               p->gfx_filtershader[i][0] = 0;
-               p->gfx_filtermask[i][0] = 0;
-       }
-       p->gfx_filter_horiz_zoom_mult = 1.0;
-       p->gfx_filter_vert_zoom_mult = 1.0;
-       p->gfx_filter_bilinear = 0;
-       p->gfx_filter_filtermode = 0;
-       p->gfx_filter_scanlineratio = (1 << 4) | 1;
-       p->gfx_filter_keep_aspect = 0;
-       p->gfx_filter_autoscale = AUTOSCALE_STATIC_AUTO;
-       p->gfx_filter_keep_autoscale_aspect = false;
-       p->gfx_filteroverlay_overscan = 0;
+       for (int i = APMODE_NATIVE; i <= APMODE_RTG; i++) {
+               struct gfx_filterdata *f = &p->gf[i];
+               f->gfx_filter = 0;
+               f->gfx_filter_scanlineratio = (1 << 4) | 1;
+               for (int j = 0; j <= 2 * MAX_FILTERSHADERS; j++) {
+                       f->gfx_filtershader[i][0] = 0;
+                       f->gfx_filtermask[i][0] = 0;
+               }
+               f->gfx_filter_horiz_zoom_mult = 1.0;
+               f->gfx_filter_vert_zoom_mult = 1.0;
+               f->gfx_filter_bilinear = 0;
+               f->gfx_filter_filtermode = 0;
+               f->gfx_filter_keep_aspect = 0;
+               f->gfx_filter_autoscale = AUTOSCALE_STATIC_AUTO;
+               f->gfx_filter_keep_autoscale_aspect = false;
+               f->gfx_filteroverlay_overscan = 0;
+       }
 
        p->rtg_horiz_zoom_mult = 1.0;
        p->rtg_vert_zoom_mult = 1.0;
@@ -5245,6 +5348,7 @@ void default_prefs (struct uae_prefs *p, int type)
 #endif
 
        p->input_tablet = TABLET_OFF;
+       p->tablet_library = false;
        p->input_magic_mouse = 0;
        p->input_magic_mouse_cursor = 0;
 
index bac111daaa5011a7ccb38045285d91f906bad4e4..8fd32b5fa3c02e63470290e8c6133ca3e91edb55 100644 (file)
@@ -26,7 +26,8 @@ void consolehook_config (struct uae_prefs *p)
        p->produce_sound = 0;
        p->gfx_resolution = 0;
        p->gfx_vresolution = 0;
-       p->gfx_scanlines = 0;
+       p->gfx_iscanlines = 0;
+       p->gfx_pscanlines = 0;
        p->gfx_framerate = 10;
        p->immediate_blits = 1;
        p->collision_level = 0;
index a55b665f0c20f3bbe92ef8551181f9a08833e400..5a7ff3c42e3cea06d08c922ebc95345c8f5a14f0 100644 (file)
@@ -3364,11 +3364,10 @@ static void finish_decisions (void)
        if (changed) {
                thisline_changed = 1;
                *dp = thisline_decision;
-//             if (vpos >= maxvpos)
-//                     dp[1].plfleft = -2;
-       } else
+       } else {
                /* The only one that may differ: */
                dp->ctable = thisline_decision.ctable;
+       }
 
        /* leave free space for possible extra color changes at the end of line */
        next_color_change += (HBLANK_OFFSET + 1) / 2;
@@ -3760,6 +3759,10 @@ void compute_framesync (void)
                gfxvidinfo.drawbuffer.outheight = gfxvidinfo.drawbuffer.height_allocated;
 
        memset (line_decisions, 0, sizeof line_decisions);
+       memset (line_drawinfo, 0, sizeof line_drawinfo);
+       for (int i = 0; i < sizeof (line_decisions) / sizeof *line_decisions; i++) {
+               line_decisions[i].plfleft = -1;
+       }
 
        compute_vsynctime ();
 
@@ -3880,7 +3883,7 @@ void init_hz (bool fullinit)
                maxvpos_nom = maxvpos;
                maxvpos_display = maxvpos;
                equ_vblank_endline = -1;
-               doublescan = htotal <= 164 ? 1 : 0;
+               doublescan = htotal <= 164 && vtotal >= 350 ? 1 : 0;
                programmedmode = true;
                varsync_changed = true;
                vpos_count = maxvpos_nom;
@@ -7600,20 +7603,28 @@ static void hsync_handler_post (bool onvsync)
                nextline_how = nln_normal;
                if (doflickerfix () && interlace_seen > 0) {
                        lineno *= 2;
-               } else if ((doublescan <= 0 || interlace_seen > 0) && currprefs.gfx_vresolution && currprefs.gfx_scanlines >= 2) {
+               } else if (!interlace_seen && doublescan <= 0 && currprefs.gfx_vresolution && currprefs.gfx_pscanlines > 1) {
+                       lineno *= 2;
+                       if (timeframes & 1) {
+                               lineno++;
+                               nextline_how = currprefs.gfx_pscanlines == 3 ? nln_lower_black_always : nln_lower_black;
+                       } else {
+                               nextline_how = currprefs.gfx_pscanlines == 3 ? nln_upper_black_always : nln_upper_black;
+                       }
+               } else if ((doublescan <= 0 || interlace_seen > 0) && currprefs.gfx_vresolution && currprefs.gfx_iscanlines) {
                        lineno *= 2;
-                       nextline_how = currprefs.gfx_vresolution > VRES_NONDOUBLE && (currprefs.gfx_scanlines & 1) == 0 ? nln_doubled : nln_nblack;
                        if (interlace_seen) {
                                if (!lof_current) {
                                        lineno++;
-                                       nextline_how = nln_lower_black;
+                                       nextline_how = currprefs.gfx_iscanlines == 2 ? nln_lower_black_always : nln_lower_black;
                                } else {
-                                       nextline_how = nln_upper_black;
+                                       nextline_how = currprefs.gfx_iscanlines == 2 ? nln_upper_black_always : nln_upper_black;
                                }
+                       } else {
+                               nextline_how = currprefs.gfx_vresolution > VRES_NONDOUBLE && currprefs.gfx_pscanlines == 1 ? nln_nblack : nln_doubled;
                        }
                } else if (currprefs.gfx_vresolution && (doublescan <= 0 || interlace_seen > 0)) {
                        lineno *= 2;
-                       nextline_how = currprefs.gfx_vresolution > VRES_NONDOUBLE && currprefs.gfx_scanlines == 0 ? nln_doubled : nln_nblack;
                        if (interlace_seen) {
                                if (!lof_current) {
                                        lineno++;
@@ -7621,6 +7632,8 @@ static void hsync_handler_post (bool onvsync)
                                } else {
                                        nextline_how = nln_upper;
                                }
+                       } else {
+                               nextline_how = currprefs.gfx_vresolution > VRES_NONDOUBLE && currprefs.gfx_pscanlines == 1 ? nln_nblack : nln_doubled;
                        }
                }
                prev_lineno = next_lineno;
@@ -9176,11 +9189,11 @@ void check_prefs_changed_custom (void)
                        init_custom ();
        }
 #ifdef GFXFILTER
-       currprefs.gfx_filter_horiz_zoom = changed_prefs.gfx_filter_horiz_zoom;
-       currprefs.gfx_filter_vert_zoom = changed_prefs.gfx_filter_vert_zoom;
-       currprefs.gfx_filter_horiz_offset = changed_prefs.gfx_filter_horiz_offset;
-       currprefs.gfx_filter_vert_offset = changed_prefs.gfx_filter_vert_offset;
-       currprefs.gfx_filter_scanlines = changed_prefs.gfx_filter_scanlines;
+       currprefs.gf[0].gfx_filter_horiz_zoom = changed_prefs.gf[0].gfx_filter_horiz_zoom;
+       currprefs.gf[0].gfx_filter_vert_zoom = changed_prefs.gf[0].gfx_filter_vert_zoom;
+       currprefs.gf[0].gfx_filter_horiz_offset = changed_prefs.gf[0].gfx_filter_horiz_offset;
+       currprefs.gf[0].gfx_filter_vert_offset = changed_prefs.gf[0].gfx_filter_vert_offset;
+       currprefs.gf[0].gfx_filter_scanlines = changed_prefs.gf[0].gfx_filter_scanlines;
 #endif
 }
 
index f3ef066090cc81295cbe0ee761dd4918ffb22d37..12d9b1051b46f0e4d02ffb0e2655044b28b0b912 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -43,6 +43,9 @@ int disk_debug_track = -1;
 #ifdef CAPS
 #include "caps/caps_win32.h"
 #endif
+#ifdef SCP
+#include "scp.h"
+#endif
 #include "crc32.h"
 #include "inputrecord.h"
 #include "amax.h"
@@ -148,7 +151,7 @@ typedef struct {
 #define DRIVE_ID_35HD  0xAAAAAAAA
 #define DRIVE_ID_525SD 0x55555555 /* 40 track 5.25 drive , kickstart does not recognize this */
 
-typedef enum { ADF_NONE = -1, ADF_NORMAL, ADF_EXT1, ADF_EXT2, ADF_FDI, ADF_IPF, ADF_CATWEASEL, ADF_PCDOS, ADF_KICK, ADF_SKICK } drive_filetype;
+typedef enum { ADF_NONE = -1, ADF_NORMAL, ADF_EXT1, ADF_EXT2, ADF_FDI, ADF_IPF, ADF_SCP, ADF_CATWEASEL, ADF_PCDOS, ADF_KICK, ADF_SKICK } drive_filetype;
 typedef struct {
        struct zfile *diskfile;
        struct zfile *writediskfile;
@@ -200,6 +203,8 @@ typedef struct {
 #else
        int catweasel;
        int amax;
+       int lastdataacesstrack;
+       int lastrev;
 #endif
 } drive;
 
@@ -611,6 +616,11 @@ static void drive_image_free (drive *drv)
        case ADF_IPF:
 #ifdef CAPS
                caps_unloadimage (drv - floppy);
+#endif
+               break;
+       case ADF_SCP:
+#ifdef SCP
+               scp_close (drv - floppy);
 #endif
                break;
        case ADF_FDI:
@@ -668,6 +678,7 @@ static void reset_drive (int num)
        drv->idbit = 0;
        drv->drive_id = 0;
        drv->drive_id_scnt = 0;
+       drv->lastdataacesstrack = -1;
        disabled &= ~(1 << num);
        if (currprefs.floppyslots[num].dfxtype < 0)
                disabled |= 1 << num;
@@ -912,6 +923,10 @@ static bool diskfile_iswriteprotect (struct uae_prefs *p, const TCHAR *fname, in
                *needwritefile = 1;
                return wrprot2;
        }
+       if (strncmp ((uae_char*) buffer, "SCP", 3) == 0) {
+               *needwritefile = 1;
+               return wrprot2;
+       }
        if (strncmp ((uae_char*) buffer, "Formatted Disk Image file", 25) == 0) {
                *needwritefile = 1;
                return wrprot2;
@@ -1020,6 +1035,17 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const TCHAR
                drv->num_tracks = num_tracks;
                drv->filetype = ADF_IPF;
 #endif
+#ifdef SCP
+       } else if (strncmp ((char*)buffer, "SCP", 3) == 0) {
+               drv->wrprot = true;
+               if (!scp_open (drv->diskfile, drv - floppy, &num_tracks)) {
+                       zfile_fclose (drv->diskfile);
+                       drv->diskfile = 0;
+                       return 0;
+               }
+               drv->num_tracks = num_tracks;
+               drv->filetype = ADF_SCP;
+#endif
 #ifdef FDI2RAW
        } else if (drv->fdi = fdi2raw_header (drv->diskfile)) {
 
@@ -1704,6 +1730,8 @@ static void drive_fill_bigbuf (drive * drv, int force)
 {
        int tr = drv->cyl * 2 + side;
        trackid *ti = drv->trackdata + tr;
+       bool retrytrack;
+       int rev = -1;
 
        if ((!drv->diskfile && !drv->catweasel) || tr >= drv->num_tracks) {
                track_reset (drv);
@@ -1723,6 +1751,9 @@ static void drive_fill_bigbuf (drive * drv, int force)
        drv->skipoffset = -1;
        drv->revolutions = 1;
 
+       retrytrack = drv->lastdataacesstrack == drv->cyl * 2 + side;
+       //write_log (_T("%d:%d %d\n"), drv->cyl, side, retrytrack);
+
        if (drv->writediskfile && drv->writetrackdata[tr].bitlen > 0) {
                int i;
                trackid *wti = &drv->writetrackdata[tr];
@@ -1751,7 +1782,13 @@ static void drive_fill_bigbuf (drive * drv, int force)
        } else if (drv->filetype == ADF_IPF) {
 
 #ifdef CAPS
-               caps_loadtrack (drv->bigmfmbuf, drv->tracktiming, drv - floppy, tr, &drv->tracklen, &drv->multi_revolution, &drv->skipoffset);
+               caps_loadtrack (drv->bigmfmbuf, drv->tracktiming, drv - floppy, tr, &drv->tracklen, &drv->multi_revolution, &drv->skipoffset, &drv->lastrev, retrytrack);
+#endif
+
+       } else if (drv->filetype == ADF_SCP) {
+
+#ifdef SCP
+               scp_loadtrack (drv->bigmfmbuf, drv->tracktiming, drv - floppy, tr, &drv->tracklen, &drv->multi_revolution, &drv->skipoffset, &drv->lastrev, retrytrack);
 #endif
 
        } else if (drv->filetype == ADF_FDI) {
@@ -2892,13 +2929,23 @@ static void disk_dmafinished (void)
 static void fetchnextrevolution (drive *drv)
 {
        drv->trackspeed = get_floppy_speed2 (drv);
+#if 0
+       if (1 || drv->mfmpos != 0) {
+               write_log (_T("REVOLUTION: %d %d/%d %d %d\n"), drv->trackspeed, drv->mfmpos, drv->tracklen, drv->floppybitcounter);
+       }
+#endif
        if (!drv->multi_revolution)
                return;
        switch (drv->filetype)
        {
        case ADF_IPF:
 #ifdef CAPS
-               caps_loadrevolution (drv->bigmfmbuf, drv - floppy, drv->cyl * 2 + side, &drv->tracklen);
+               caps_loadrevolution (drv->bigmfmbuf, drv->tracktiming, drv - floppy, drv->cyl * 2 + side, &drv->tracklen, &drv->lastrev);
+#endif
+               break;
+       case ADF_SCP:
+#ifdef SCP
+               scp_loadrevolution (drv->bigmfmbuf, drv - floppy, drv->tracktiming, &drv->tracklen);
 #endif
                break;
        case ADF_FDI:
@@ -2917,14 +2964,16 @@ void DISK_handler (uae_u32 data)
 
        event2_remevent (ev2_disk);
        DISK_update (disk_sync_cycle);
-       if (flag & (DISK_REVOLUTION << 0))
-               fetchnextrevolution (&floppy[0]);
-       if (flag & (DISK_REVOLUTION << 1))
-               fetchnextrevolution (&floppy[1]);
-       if (flag & (DISK_REVOLUTION << 2))
-               fetchnextrevolution (&floppy[2]);
-       if (flag & (DISK_REVOLUTION << 3))
-               fetchnextrevolution (&floppy[3]);
+       if (!dskdmaen) {
+               if (flag & (DISK_REVOLUTION << 0))
+                       fetchnextrevolution (&floppy[0]);
+               if (flag & (DISK_REVOLUTION << 1))
+                       fetchnextrevolution (&floppy[1]);
+               if (flag & (DISK_REVOLUTION << 2))
+                       fetchnextrevolution (&floppy[2]);
+               if (flag & (DISK_REVOLUTION << 3))
+                       fetchnextrevolution (&floppy[3]);
+       }
        if (flag & DISK_WORDSYNC)
                INTREQ (0x8000 | 0x1000);
        if (flag & DISK_INDEXSYNC) {
@@ -3015,13 +3064,14 @@ static void updatetrackspeed (drive *drv, int mfmpos)
 {
        if (dskdmaen < DSKDMA_WRITE) {
                int t = drv->tracktiming[mfmpos / 8];
-               drv->trackspeed = get_floppy_speed2 (drv) * t / 1000;
-               if (drv->trackspeed < 700 || drv->trackspeed > 3000) {
+               int ts = get_floppy_speed2 (drv) * t / 1000;
+               if (ts < 700 || ts > 3000) {
                        static int warned;
                        warned++;
                        if (warned < 50)
-                               write_log (_T("corrupted trackspeed value %d\n"), drv->trackspeed);
-                       drv->trackspeed = 1000;
+                               write_log (_T("corrupted trackspeed value %d %d (%d/%d)\n"), t, ts, mfmpos, drv->tracklen);
+               } else {
+                       drv->trackspeed = ts;
                }
        }
 }
@@ -3039,13 +3089,17 @@ static void disk_doupdate_predict (int startcycle)
                        continue;
                if (selected & (1 << dr))
                        continue;
+               int mfmpos = drv->mfmpos;
+               if (drv->tracktiming[0])
+                       updatetrackspeed (drv, mfmpos);
                int diskevent_flag = 0;
                uae_u32 tword = word;
-               int countcycle = startcycle + (drv->floppybitcounter % drv->trackspeed);
-               int mfmpos = drv->mfmpos;
+               //int diff = drv->floppybitcounter % drv->trackspeed;
+               int countcycle = startcycle; // + (diff ? drv->trackspeed - diff : 0);
                while (countcycle < (maxhpos << 8)) {
                        if (drv->tracktiming[0])
                                updatetrackspeed (drv, mfmpos);
+                       countcycle += drv->trackspeed;
                        if (dskdmaen != DSKDMA_WRITE || (dskdmaen == DSKDMA_WRITE && !dma_enable)) {
                                tword <<= 1;
                                if (!drive_empty (drv)) {
@@ -3059,7 +3113,7 @@ static void disk_doupdate_predict (int startcycle)
                        }
                        mfmpos++;
                        mfmpos %= drv->tracklen;
-                       if (mfmpos == 0)
+                       if (mfmpos == 0 && !dskdmaen)
                                diskevent_flag |= DISK_REVOLUTION << (drv - floppy);
                        if (mfmpos == drv->indexoffset)
                                diskevent_flag |= DISK_INDEXSYNC;
@@ -3077,7 +3131,6 @@ static void disk_doupdate_predict (int startcycle)
                        }
                        if (diskevent_flag)
                                break;
-                       countcycle += drv->trackspeed;
                }
                if (drv->tracktiming[0])
                        updatetrackspeed (drv, drv->mfmpos);
@@ -3170,7 +3223,6 @@ static void disk_doupdate_read (drive * drv, int floppybits)
        mfmbuf[7] = 0x4444;
        */
        while (floppybits >= drv->trackspeed) {
-               int oldmfmpos = drv->mfmpos;
                if (drv->tracktiming[0])
                        updatetrackspeed (drv, drv->mfmpos);
                word <<= 1;
@@ -3181,6 +3233,10 @@ static void disk_doupdate_read (drive * drv, int floppybits)
                                word |= getonebit (drv->bigmfmbuf, drv->mfmpos);
                }
                //write_log (_T("%08X bo=%d so=%d mfmpos=%d dma=%d\n"), (word & 0xffffff), bitoffset, syncoffset, drv->mfmpos, dma_enable);
+               if (doreaddma () < 0) {
+                       word >>= 1;
+                       return;
+               }
                drv->mfmpos++;
                drv->mfmpos %= drv->tracklen;
                if (drv->mfmpos == drv->indexoffset) {
@@ -3193,9 +3249,10 @@ static void disk_doupdate_read (drive * drv, int floppybits)
                        drv->mfmpos += disk_jitter;
                        drv->mfmpos %= drv->tracklen;
                }
-               if (doreaddma () < 0) {
-                       drv->mfmpos = oldmfmpos;
-                       return;
+               if (drv->mfmpos == 0) {
+                       fetchnextrevolution (drv);
+                       if (drv->tracktiming[0])
+                               updatetrackspeed (drv, drv->mfmpos);
                }
                if ((bitoffset & 7) == 7) {
                        dskbytr_val = word & 0xff;
@@ -3242,13 +3299,13 @@ uae_u16 DSKBYTR (int hpos)
                v |= 0x2000;
        if (disk_debug_logging > 1)
                write_log (_T("DSKBYTR=%04X hpos=%d\n"), v, hpos);
-       if (disk_debug_mode & DISK_DEBUG_PIO) {
-               int dr;
-               for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
-                       drive *drv = &floppy[dr];
-                       if (drv->motoroff)
-                               continue;
-                       if (!(selected & (1 << dr))) {
+       for (int dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
+               drive *drv = &floppy[dr];
+               if (drv->motoroff)
+                       continue;
+               if (!(selected & (1 << dr))) {
+                       drv->lastdataacesstrack = drv->cyl * 2 + side;
+                       if (disk_debug_mode & DISK_DEBUG_PIO) {
                                if (disk_debug_track < 0 || disk_debug_track == 2 * drv->cyl + side) {
                                        disk_dma_debugmsg ();
                                        write_log (_T("DSKBYTR=%04X\n"), v);
@@ -3274,6 +3331,10 @@ static void DISK_start (void)
                        int tr = drv->cyl * 2 + side;
                        trackid *ti = drv->trackdata + tr;
 
+                       if (dskdmaen == DSKDMA_READ) {
+                               drv->lastdataacesstrack = drv->cyl * 2 + side;
+                       }
+
                        if (dskdmaen == DSKDMA_WRITE) {
                                drv->tracklen = longwritemode ? FLOPPY_WRITE_MAXLEN : FLOPPY_WRITE_LEN * drv->ddhd * 8 * 2;
                                drv->trackspeed = get_floppy_speed ();
@@ -3993,6 +4054,7 @@ uae_u8 *restore_disk2 (int num,uae_u8 *src)
                        if (m & 2)
                                drv->tracktiming[j] = restore_u16 ();
                }
+               drv->revolutions = restore_u16 ();
        }
        return src;
 }
@@ -4052,6 +4114,7 @@ uae_u8 *save_disk2 (int num, int *len, uae_u8 *dstptr)
                if (drv->tracktiming[0])
                        save_u16 (drv->tracktiming[j]);
        }
+       save_u16 (drv->revolutions);
 
        *len = dst - dstbak;
        return dstbak;
index 3a6663eca7ff7d3190dc66f4dde968ffdc409eea..d02a34a7593954c9a0c028344c338acd75f516da 100644 (file)
@@ -85,7 +85,7 @@ static int linedbl, linedbld;
 int interlace_seen = 0;
 #define AUTO_LORES_FRAMES 10
 static int can_use_lores = 0, frame_res, frame_res_lace;
-static int resolution_count[RES_MAX + 1];
+static int resolution_count[RES_MAX + 1], lines_count;
 static bool center_reset;
 
 /* Lookup tables for dual playfields.  The dblpf_*1 versions are for the case
@@ -827,7 +827,7 @@ static void pfield_init_linetoscr (bool border)
        // Sprite hpos don't include DIW_DDF_OFFSET and can appear 1 lores pixel
        // before first bitplane pixel appears.
        // This means "bordersprite" condition is possible under OCS/ECS too. Argh!
-       if (dip_for_drawing->nr_sprites) {
+       if (dip_for_drawing->nr_sprites && !colors_for_drawing.borderblank) {
                /* bordersprite off or not supported: sprites are visible until diw_end */
                if (playfield_end < linetoscr_diw_end && hblank_right_stop > playfield_end) {
                        playfield_end = linetoscr_diw_end;
@@ -841,7 +841,7 @@ static void pfield_init_linetoscr (bool border)
        }
 
 #ifdef AGA
-       if (dp_for_drawing->bordersprite_seen && dip_for_drawing->nr_sprites) {
+       if (dp_for_drawing->bordersprite_seen && !colors_for_drawing.borderblank && dip_for_drawing->nr_sprites) {
                int min = visible_right_border, max = visible_left_border, i;
                for (i = 0; i < dip_for_drawing->nr_sprites; i++) {
                        int x;
@@ -874,7 +874,7 @@ static void pfield_init_linetoscr (bool border)
        int first_x = sprite_first_x;
        int last_x = sprite_last_x;
        if (first_x < last_x) {
-               if (dp_for_drawing->bordersprite_seen) {
+               if (dp_for_drawing->bordersprite_seen && !colors_for_drawing.borderblank) {
                        if (first_x > visible_left_border)
                                first_x = visible_left_border;
                        if (last_x < visible_right_border)
@@ -1579,6 +1579,11 @@ static void pfield_do_linetoscr (int start, int stop, bool blank)
 // left or right AGA border sprite
 static void pfield_do_linetoscr_bordersprite_aga (int start, int stop, bool blank)
 {
+       if (blank) {
+               pfield_do_fill_line (start, stop, blank);
+               return;
+       }
+
        if (res_shift == 0) {
                switch (gfxvidinfo.drawbuffer.pixbytes) {
                case 2: src_pixel = linetoscr_16_aga_spronly (LTPARMS); break;
@@ -2354,7 +2359,10 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
        dp_for_drawing = line_decisions + lineno;
        dip_for_drawing = curr_drawinfo + lineno;
 
-       resolution_count[dp_for_drawing->bplres]++;
+       if (dp_for_drawing->plfleft >= 0) {
+               lines_count++;
+               resolution_count[dp_for_drawing->bplres]++;
+       }
 
        switch (linestate[lineno])
        {
@@ -2398,8 +2406,10 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
                break;
        }
 
+#if 0
        if (border && dp_for_drawing->plfleft < -1)
-               border = -1; // interlace mode missing odd line = blank
+               border = -1; // blank last "missing" line
+#endif
 
        dh = dh_line;
        xlinebuffer = gfxvidinfo.drawbuffer.linemem;
@@ -2440,7 +2450,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
                if (dip_for_drawing->nr_sprites) {
                        int i;
 #ifdef AGA
-                       if (colors_for_drawing.bordersprite && dp_for_drawing->bordersprite_seen)
+                       if (colors_for_drawing.bordersprite && dp_for_drawing->bordersprite_seen && !colors_for_drawing.borderblank)
                                clear_bitplane_border_aga ();
 #endif
 
@@ -2455,7 +2465,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
                }
 
 #ifdef AGA
-               if (dip_for_drawing->nr_sprites && colors_for_drawing.bordersprite && dp_for_drawing->bordersprite_seen)
+               if (dip_for_drawing->nr_sprites && colors_for_drawing.bordersprite && !colors_for_drawing.borderblank && dp_for_drawing->bordersprite_seen)
                        do_color_changes (pfield_do_linetoscr_bordersprite_aga, pfield_do_linetoscr, lineno);
                else
 #endif
@@ -2475,7 +2485,6 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
 
                if (dip_for_drawing->nr_sprites)
                        pfield_erase_hborder_sprites ();
-
        } else if (border > 0) {
                // border > 0: top or bottom border
                bool dosprites = false;
@@ -2483,7 +2492,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
                adjust_drawing_colors (dp_for_drawing->ctable, 0);
 
 #ifdef AGA /* this makes things complex.. */
-               if (dp_for_drawing->bordersprite_seen && dip_for_drawing->nr_sprites) {
+               if (dp_for_drawing->bordersprite_seen && !colors_for_drawing.borderblank && dip_for_drawing->nr_sprites) {
                        dosprites = true;
                        pfield_expand_dp_bplcon ();
                        pfield_init_linetoscr (true);
@@ -2539,8 +2548,9 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
 
        } else {
 
+               // top or bottom blanking region
                int tmp = hposblank;
-               hposblank = colors_for_drawing.borderblank;
+               hposblank = 1;
                fill_line ();
                do_flush_line (vb, gfx_ypos);
                hposblank = tmp;
@@ -2554,7 +2564,7 @@ static void center_image (void)
        int prev_y_adjust = thisframe_y_adjust;
 
        int w = gfxvidinfo.drawbuffer.inwidth;
-       if (currprefs.gfx_xcenter && !currprefs.gfx_filter_autoscale && max_diwstop > 0) {
+       if (currprefs.gfx_xcenter && !currprefs.gf[0].gfx_filter_autoscale && max_diwstop > 0) {
 
                if (max_diwstop - min_diwstart < w && currprefs.gfx_xcenter == 2)
                        /* Try to center. */
@@ -2598,7 +2608,7 @@ static void center_image (void)
                visible_right_border = max_diwlastword;
 
        thisframe_y_adjust = minfirstline;
-       if (currprefs.gfx_ycenter && thisframe_first_drawn_line >= 0 && !currprefs.gfx_filter_autoscale) {
+       if (currprefs.gfx_ycenter && thisframe_first_drawn_line >= 0 && !currprefs.gf[0].gfx_filter_autoscale) {
 
                if (thisframe_last_drawn_line - thisframe_first_drawn_line < max_drawn_amiga_line && currprefs.gfx_ycenter == 2)
                        thisframe_y_adjust = (thisframe_last_drawn_line - thisframe_first_drawn_line - max_drawn_amiga_line) / 2 + thisframe_first_drawn_line;
@@ -2617,7 +2627,7 @@ static void center_image (void)
 
        /* Make sure the value makes sense */
        if (thisframe_y_adjust + max_drawn_amiga_line > maxvpos + maxvpos / 2)
-           thisframe_y_adjust = maxvpos + maxvpos / 2 - max_drawn_amiga_line;
+               thisframe_y_adjust = maxvpos + maxvpos / 2 - max_drawn_amiga_line;
        if (thisframe_y_adjust < 0)
                thisframe_y_adjust = 0;
 
@@ -2632,7 +2642,7 @@ static void center_image (void)
 
        gfxvidinfo.drawbuffer.xoffset = (DISPLAY_LEFT_SHIFT << RES_MAX) + (visible_left_border << (RES_MAX - currprefs.gfx_resolution));
        gfxvidinfo.drawbuffer.yoffset = thisframe_y_adjust << VRES_MAX;
-       
+
        center_reset = false;
        horizontal_changed = false;
        vertical_changed = false;
@@ -2644,7 +2654,7 @@ static void init_drawing_frame (void)
        int i, maxline;
        static int frame_res_old;
 
-       if (currprefs.gfx_autoresolution) {
+       if (currprefs.gfx_autoresolution && lines_count > 0) {
                int frame_res_detected;
                int frame_res_lace_detected = frame_res_lace;
 
@@ -2662,13 +2672,21 @@ static void init_drawing_frame (void)
 
                if (currprefs.gfx_autoresolution == 1)
                        frame_res_detected = largest_res;
-               else if (largest_count * 100 / maxvpos >= currprefs.gfx_autoresolution)
+               else if (largest_count * 100 / lines_count >= currprefs.gfx_autoresolution)
                        frame_res_detected = largest_count_res;
                else
                        frame_res_detected = largest_count_res - 1;
                if (frame_res_detected < 0)
                        frame_res_detected = 0;
-
+#if 0
+               static int delay;
+               delay--;
+               if (delay < 0) {
+                       delay = 50;
+                       write_log (_T("%d %d, %d %d %d, %d %d, %d %d\n"), currprefs.gfx_autoresolution, lines_count, resolution_count[0], resolution_count[1], resolution_count[2],
+                               largest_count, largest_count_res, frame_res_detected, frame_res_lace_detected);
+               }
+#endif
                if (frame_res_detected >= 0 && frame_res_lace_detected >= 0) {
                        if (frame_res_cnt > 0 && frame_res_old == frame_res_detected * 2 + frame_res_lace_detected) {
                                frame_res_cnt--;
@@ -2677,7 +2695,7 @@ static void init_drawing_frame (void)
                                        struct wh *dst = currprefs.gfx_apmode[0].gfx_fullscreen ? &changed_prefs.gfx_size_fs : &changed_prefs.gfx_size_win;
                                        while (m < 3 * 2) {
                                                struct wh *src = currprefs.gfx_apmode[0].gfx_fullscreen ? &currprefs.gfx_size_fs_xtra[m] : &currprefs.gfx_size_win_xtra[m];
-                                               if ((src->width > 0 && src->height > 0) || (currprefs.gfx_api || currprefs.gfx_filter > 0)) {
+                                               if ((src->width > 0 && src->height > 0) || (currprefs.gfx_api || currprefs.gf[0].gfx_filter > 0)) {
                                                        int nr = m >> 1;
                                                        int nl = (m & 1) == 0 ? 0 : 1;
                                                        int nr_o = nr;
@@ -2732,6 +2750,7 @@ static void init_drawing_frame (void)
        }
        for (int i = 0; i <= RES_MAX; i++)
                resolution_count[i] = 0;
+       lines_count = 0;
        frame_res = -1;
        frame_res_lace = 0;
 
@@ -2803,7 +2822,7 @@ void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq)
        case 4:
                {
                        int i;
-                       if (1 || opaq || currprefs.gfx_filter == 0) {
+                       if (1 || opaq || currprefs.gf[0].gfx_filter == 0) {
                                uae_u32 *p = (uae_u32*)buf + x;
                                *p = c8;
                        } else {
@@ -3144,7 +3163,7 @@ bool vsync_handle_check (void)
 void vsync_handle_redraw (int long_field, int lof_changed, uae_u16 bplcon0p, uae_u16 bplcon3p)
 {
        last_redraw_point++;
-       if (lof_changed || interlace_seen <= 0 || (currprefs.gfx_scanlines >= 2 && interlace_seen > 0) || last_redraw_point >= 2 || long_field || doublescan < 0) {
+       if (lof_changed || interlace_seen <= 0 || (currprefs.gfx_iscanlines && interlace_seen > 0) || last_redraw_point >= 2 || long_field || doublescan < 0) {
                last_redraw_point = 0;
 
                if (framecnt == 0)
@@ -3228,25 +3247,23 @@ void hsync_record_line_state (int lineno, enum nln_how how, int changed)
                        || state[1] == LINE_AS_PREVIOUS)
                        state[1] = LINE_DECIDED; //LINE_BLACK;
                break;
+       case nln_lower_black_always:
+               state[1] = LINE_BLACK;
+               *state = LINE_DECIDED;
+               break;
        case nln_lower_black:
-               if (currprefs.gfx_scanlines >= 4) {
-                       state[1] = LINE_BLACK;
-                       *state = LINE_DECIDED;
-               } else {
-                       changed += state[0] != LINE_DONE;
-                       state[1] = LINE_DONE;
-                       *state = changed ? LINE_DECIDED : LINE_DONE;
-               }
+               changed += state[0] != LINE_DONE;
+               state[1] = LINE_DONE;
+               *state = changed ? LINE_DECIDED : LINE_DONE;
+               break;
+       case nln_upper_black_always:
+               *state = LINE_DECIDED;
+               state[-1] = LINE_BLACK;
                break;
        case nln_upper_black:
-               if (currprefs.gfx_scanlines >= 4) {
-                       *state = LINE_DECIDED;
-                       state[-1] = LINE_BLACK;
-               } else {
-                       changed += state[0] != LINE_DONE;
-                       *state = changed ? LINE_DECIDED : LINE_DONE;
-                       state[-1] = LINE_DONE;
-               }
+               changed += state[0] != LINE_DONE;
+               *state = changed ? LINE_DECIDED : LINE_DONE;
+               state[-1] = LINE_DONE;
                break;
        }
 }
index 5d7e0749c2a41e8cba413cd3a8a692073a6021fa..f22298c46e0b8532c07a3dd0a7802af13904bb0d 100644 (file)
@@ -57,6 +57,7 @@
 #include "isofs_api.h"
 #include "scsi.h"
 #include "uaenative.h"
+#include "tabletlibrary.h"
 #ifdef RETROPLATFORM
 #include "rp.h"
 #endif
@@ -6316,6 +6317,9 @@ static uae_u32 REGPARAM2 filesys_diagentry (TrapContext *context)
 #ifdef UAESERIAL
        resaddr = uaeserialdev_startup (resaddr);
 #endif
+#ifdef WITH_TABLETLIBRARY
+       resaddr = tabletlib_startup (resaddr);
+#endif
 
        /* scan for Residents and return pointer to array of them */
        residents = resaddr;
index 204310fd04f73d08f1a88e36f27eb29b724ef7b1..d4ad60b66f89840bcefd813b80434768eda8d511 100644 (file)
@@ -144,7 +144,7 @@ static void video_calc_gammatable (void)
        con = ((float)(currprefs.gfx_contrast + 1000)) / 1000.0f;
        gam = ((float)(1000 - currprefs.gfx_gamma)) / 1000.0f;
 
-       lf = 64 * currprefs.gfx_filter_blur / 1000;
+       lf = 64 * currprefs.gf[picasso_on].gfx_filter_blur / 1000;
        hf = 256 - lf * 2;
 
        for (i = 0; i < (256 * 3); i++) {
@@ -163,7 +163,7 @@ static void video_calc_gammatable (void)
 
 static uae_u32 limit256 (double v)
 {
-       v = v * (double)(currprefs.gfx_filter_contrast + 1000) / 1000.0 + currprefs.gfx_filter_luminance / 10.0;
+       v = v * (double)(currprefs.gf[picasso_on].gfx_filter_contrast + 1000) / 1000.0 + currprefs.gf[picasso_on].gfx_filter_luminance / 10.0;
        if (v < 0)
                v = 0;
        if (v > 255)
@@ -172,7 +172,7 @@ static uae_u32 limit256 (double v)
 }
 static uae_u32 limit256rb (double v)
 {
-       v *= (double)(currprefs.gfx_filter_saturation + 1000) / 1000.0;
+       v *= (double)(currprefs.gf[picasso_on].gfx_filter_saturation + 1000) / 1000.0;
        if (v < -128)
                v = -128;
        if (v > 127)
index 7822fa3eb4f32908a4b4510fd5c2b55765f9e148..0666384a981c97e5b954f6e0ffa8f0950ce78399 100644 (file)
@@ -266,7 +266,9 @@ enum nln_how {
        /* This line normal, next one black.  */
        nln_nblack,
        nln_upper_black,
-       nln_lower_black
+       nln_lower_black,
+       nln_upper_black_always,
+       nln_lower_black_always
 };
 
 extern void hsync_record_line_state (int lineno, enum nln_how, int changed);
index be4ca5077cf8effdcca8ca533ecfc52956fc9e70..711075b33df1ff09da5e3f1774500c2cc476e09e 100644 (file)
@@ -245,6 +245,30 @@ struct apmode
 
 #define MAX_LUA_STATES 16
 
+
+struct gfx_filterdata
+{
+       int gfx_filter;
+       TCHAR gfx_filtershader[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
+       TCHAR gfx_filtermask[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
+       TCHAR gfx_filteroverlay[MAX_DPATH];
+       struct wh gfx_filteroverlay_pos;
+       int gfx_filteroverlay_overscan;
+       int gfx_filter_scanlines;
+       int gfx_filter_scanlineratio;
+       int gfx_filter_scanlinelevel;
+       float gfx_filter_horiz_zoom, gfx_filter_vert_zoom;
+       float gfx_filter_horiz_zoom_mult, gfx_filter_vert_zoom_mult;
+       float gfx_filter_horiz_offset, gfx_filter_vert_offset;
+       int gfx_filter_filtermode;
+       int gfx_filter_bilinear;
+       int gfx_filter_noise, gfx_filter_blur;
+       int gfx_filter_saturation, gfx_filter_luminance, gfx_filter_contrast, gfx_filter_gamma;
+       int gfx_filter_keep_aspect, gfx_filter_aspect;
+       int gfx_filter_autoscale;
+       int gfx_filter_keep_autoscale_aspect;
+};
+
 struct uae_prefs {
 
        struct strlist *all_lines;
@@ -328,7 +352,7 @@ struct uae_prefs {
        int gfx_resolution;
        int gfx_vresolution;
        int gfx_lores_mode;
-       int gfx_scanlines;
+       int gfx_pscanlines, gfx_iscanlines;
        int gfx_xcenter, gfx_ycenter;
        int gfx_xcenter_pos, gfx_ycenter_pos;
        int gfx_xcenter_size, gfx_ycenter_size;
@@ -340,25 +364,7 @@ struct uae_prefs {
        int gfx_extrawidth;
        bool lightboost_strobo;
 
-       int gfx_filter;
-       TCHAR gfx_filtershader[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
-       TCHAR gfx_filtermask[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
-       TCHAR gfx_filteroverlay[MAX_DPATH];
-       struct wh gfx_filteroverlay_pos;
-       int gfx_filteroverlay_overscan;
-       int gfx_filter_scanlines;
-       int gfx_filter_scanlineratio;
-       int gfx_filter_scanlinelevel;
-       float gfx_filter_horiz_zoom, gfx_filter_vert_zoom;
-       float gfx_filter_horiz_zoom_mult, gfx_filter_vert_zoom_mult;
-       float gfx_filter_horiz_offset, gfx_filter_vert_offset;
-       int gfx_filter_filtermode;
-       int gfx_filter_bilinear;
-       int gfx_filter_noise, gfx_filter_blur;
-       int gfx_filter_saturation, gfx_filter_luminance, gfx_filter_contrast, gfx_filter_gamma;
-       int gfx_filter_keep_aspect, gfx_filter_aspect;
-       int gfx_filter_autoscale;
-       int gfx_filter_keep_autoscale_aspect;
+       struct gfx_filterdata gf[2];
 
        float rtg_horiz_zoom_mult;
        float rtg_vert_zoom_mult;
@@ -590,6 +596,7 @@ struct uae_prefs {
        int input_autofire_linecnt;
        int input_mouse_speed;
        int input_tablet;
+       bool tablet_library;
        bool input_magic_mouse;
        int input_magic_mouse_cursor;
        int input_keyboard_type;
index 27c05e5263ccc4a9de7e82552ffa1dfc2d92bbd6..9052666830295ab4554dce82db2e7d92ae070746 100644 (file)
@@ -54,6 +54,7 @@
 #ifdef AVIOUTPUT
 #include "avioutput.h"
 #endif
+#include "tabletlibrary.h"
 
 // 01 = host events
 // 02 = joystick
@@ -1444,6 +1445,12 @@ static void inputdevice_mh_abs (int x, int y, uae_u32 buttonbits)
        p[MH_E] = 0xc0 | 1;
        p[MH_CNT]++;
        tablet_data = 1;
+
+       if (inputdevice_is_tablet () <= 0) {
+               tabletlib_tablet_info (1000, 1000, 0, 0, 0, 0, 1000, 1000);
+               tabletlib_tablet (x, y, 0, 0, buttonbits, -1, 0, 0, 0);
+       }
+
 }
 
 #if 0
index 3c7c70d113a44b389bac47b73a9f2ac4300e93c6..a1ca44a349d4f8088a8a3a1ed5afcc49bcad7290 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -57,6 +57,7 @@
 #include "gfxboard.h"
 #include "luascript.h"
 #include "uaenative.h"
+#include "tabletlibrary.h"
 #ifdef RETROPLATFORM
 #include "rp.h"
 #endif
@@ -201,14 +202,13 @@ void fixup_prefs_dimensions (struct uae_prefs *prefs)
                        if (ap->gfx_backbuffers >= 2)
                                ap->gfx_vflip = -1;
                }
-       }
-
-       if (prefs->gfx_filter == 0 && ((prefs->gfx_filter_autoscale && !prefs->gfx_api) || (prefs->gfx_apmode[0].gfx_vsyncmode))) {
-               prefs->gfx_filter = 1;
-       }
-       if (prefs->gfx_filter == 0 && prefs->monitoremu) {
-               error_log (_T("A2024 and Graffiti require at least null filter enabled."));
-               prefs->gfx_filter = 1;
+               if (prefs->gf[i].gfx_filter == 0 && ((prefs->gf[i].gfx_filter_autoscale && !prefs->gfx_api) || (prefs->gfx_apmode[APMODE_NATIVE].gfx_vsyncmode))) {
+                       prefs->gf[i].gfx_filter = 1;
+               }
+               if (i == 0 && prefs->gf[i].gfx_filter == 0 && prefs->monitoremu) {
+                       error_log (_T("A2024 and Graffiti require at least null filter enabled."));
+                       prefs->gf[i].gfx_filter = 1;
+               }
        }
 }
 
@@ -1009,6 +1009,9 @@ void virtualdevice_init (void)
 #ifdef WITH_UAENATIVE
        uaenative_install ();
 #endif
+#ifdef WITH_TABLETLIBRARY
+       tabletlib_install ();
+#endif
 }
 
 static int real_main2 (int argc, TCHAR **argv)
index b4313ad5e358f6c0f5ebde2503a7a1543bc8a7ff..e5deec37022a88245c31681bb739cb39a127cbfc 100644 (file)
@@ -21,10 +21,10 @@ extern TCHAR avioutput_filename_inuse[MAX_DPATH];
 extern void AVIOutput_Toggle (int mode, bool immediate);
 extern void AVIOutput_WriteAudio (uae_u8 *sndbuffer, int sndbufsize);
 extern void AVIOutput_WriteVideo (void);
-extern int AVIOutput_ChooseAudioCodec (HWND hwnd,TCHAR*,int);
-extern int AVIOutput_GetAudioCodec (TCHAR*,int);
-extern int AVIOutput_ChooseVideoCodec (HWND hwnd,TCHAR*,int);
-extern int AVIOutput_GetVideoCodec (TCHAR*,int);
+extern int AVIOutput_ChooseAudioCodec (HWND hwnd, TCHAR*, int);
+extern int AVIOutput_GetAudioCodec (TCHAR*, int);
+extern int AVIOutput_ChooseVideoCodec (HWND hwnd, TCHAR*, int);
+extern int AVIOutput_GetVideoCodec (TCHAR*, int);
 extern void AVIOutput_Restart (void);
 extern void AVIOutput_End (void);
 extern void AVIOutput_Begin (void);
index ae1a2e1c1a601fe1ad3bc1acb3d461dd28cc5524..0e03caf91acc82b51a5dfcf250a70c402b290982 100644 (file)
@@ -40,6 +40,7 @@ int tablet_log = 0;
 #include "dxwrap.h"
 #include "akiko.h"
 #include "clipboard.h"
+#include "tabletlibrary.h"
 
 #include <winioctl.h>
 #include <ntddkbd.h>
@@ -635,6 +636,8 @@ static void tablet_send (void)
                return;
        inputdevice_tablet (tablet_x, tablet_y, tablet_z, tablet_pressure, tablet_buttons, tablet_proximity,
                tablet_ax, tablet_ay, tablet_az);
+       tabletlib_tablet (tablet_x, tablet_y, tablet_z, tablet_pressure, tablet_buttons, tablet_proximity,
+               tablet_ax, tablet_ay, tablet_az);
 }
 
 void send_tablet_proximity (int inproxi)
@@ -754,6 +757,7 @@ void *open_tablet (HWND hwnd)
        tablet_proximity = -1;
        tablet_x = -1;
        inputdevice_tablet_info (xmax, ymax, zmax, axmax, aymax, azmax, xres, yres);
+       tabletlib_tablet_info (xmax, ymax, zmax, axmax, aymax, azmax, xres, yres);
        initialized = 1;
        return WTOpen (hwnd, &lc, TRUE);
 #else
index bed125e7dc826d97e59890e5413da6a3ba98d6f0..a6969ed9fdd0414eb2340437cf25898f7eec7949 100644 (file)
@@ -43,6 +43,8 @@ int forcedframelatency = -1;
 
 static TCHAR *D3DHEAD = _T("-");
 static int psEnabled, psActive, shaderon;
+static struct gfx_filterdata *filterd3d;
+static int filterd3didx;
 
 static bool showoverlay = true;
 
@@ -1313,20 +1315,20 @@ static void createscanlines (int force)
        uae_u8 *sld, *p;
        int bpp;
 
-       if (osl1 == currprefs.gfx_filter_scanlines && osl3 == currprefs.gfx_filter_scanlinelevel && osl2 == currprefs.gfx_filter_scanlineratio && !force)
+       if (osl1 == filterd3d->gfx_filter_scanlines && osl3 == filterd3d->gfx_filter_scanlinelevel && osl2 == filterd3d->gfx_filter_scanlineratio && !force)
                return;
        bpp = t_depth < 32 ? 2 : 4;
-       osl1 = currprefs.gfx_filter_scanlines;
-       osl3 = currprefs.gfx_filter_scanlinelevel;
-       osl2 = currprefs.gfx_filter_scanlineratio;
-       sl4 = currprefs.gfx_filter_scanlines * 16 / 100;
-       sl42 = currprefs.gfx_filter_scanlinelevel * 16 / 100;
+       osl1 = filterd3d->gfx_filter_scanlines;
+       osl3 = filterd3d->gfx_filter_scanlinelevel;
+       osl2 = filterd3d->gfx_filter_scanlineratio;
+       sl4 = filterd3d->gfx_filter_scanlines * 16 / 100;
+       sl42 = filterd3d->gfx_filter_scanlinelevel * 16 / 100;
        if (sl4 > 15)
                sl4 = 15;
        if (sl42 > 15)
                sl42 = 15;
-       l1 = (currprefs.gfx_filter_scanlineratio >> 0) & 15;
-       l2 = (currprefs.gfx_filter_scanlineratio >> 4) & 15;
+       l1 = (filterd3d->gfx_filter_scanlineratio >> 0) & 15;
+       l2 = (filterd3d->gfx_filter_scanlineratio >> 4) & 15;
 
        if (l1 + l2 <= 0)
                return;
@@ -2047,42 +2049,42 @@ static int restoredeviceobjects (void)
                        break;
                }
                for (int i = 0; i < MAX_FILTERSHADERS; i++) {
-                       if (currprefs.gfx_filtershader[i][0]) {
+                       if (filterd3d->gfx_filtershader[i][0]) {
                                struct shaderdata *s = allocshaderslot (SHADERTYPE_BEFORE);
-                               if (!psEffect_LoadEffect (currprefs.gfx_filtershader[i], true, s, i)) {
-                                       currprefs.gfx_filtershader[i][0] = changed_prefs.gfx_filtershader[i][0] = 0;
+                               if (!psEffect_LoadEffect (filterd3d->gfx_filtershader[i], true, s, i)) {
+                                       filterd3d->gfx_filtershader[i][0] = changed_prefs.gf[filterd3didx].gfx_filtershader[i][0] = 0;
                                        break;
                                }
                        }
-                       if (currprefs.gfx_filtermask[i][0]) {
+                       if (filterd3d->gfx_filtermask[i][0]) {
                                struct shaderdata *s = allocshaderslot (SHADERTYPE_MASK_BEFORE);
-                               createmasktexture (currprefs.gfx_filtermask[i], s);
+                               createmasktexture (filterd3d->gfx_filtermask[i], s);
                        }
                }
-               if (currprefs.gfx_filtershader[2 * MAX_FILTERSHADERS][0]) {
+               if (filterd3d->gfx_filtershader[2 * MAX_FILTERSHADERS][0]) {
                        struct shaderdata *s = allocshaderslot (SHADERTYPE_MIDDLE);
-                       if (!psEffect_LoadEffect (currprefs.gfx_filtershader[2 * MAX_FILTERSHADERS], true, s, 2 * MAX_FILTERSHADERS)) {
-                               currprefs.gfx_filtershader[2 * MAX_FILTERSHADERS][0] = changed_prefs.gfx_filtershader[2 * MAX_FILTERSHADERS][0] = 0;
+                       if (!psEffect_LoadEffect (filterd3d->gfx_filtershader[2 * MAX_FILTERSHADERS], true, s, 2 * MAX_FILTERSHADERS)) {
+                               filterd3d->gfx_filtershader[2 * MAX_FILTERSHADERS][0] = changed_prefs.gf[filterd3didx].gfx_filtershader[2 * MAX_FILTERSHADERS][0] = 0;
                        }
                }
-               if (currprefs.gfx_filtermask[2 * MAX_FILTERSHADERS][0]) {
+               if (filterd3d->gfx_filtermask[2 * MAX_FILTERSHADERS][0]) {
                        struct shaderdata *s = allocshaderslot (SHADERTYPE_MASK_AFTER);
-                       createmasktexture (currprefs.gfx_filtermask[2 * MAX_FILTERSHADERS], s);
+                       createmasktexture (filterd3d->gfx_filtermask[2 * MAX_FILTERSHADERS], s);
                }
                for (int i = 0; i < MAX_FILTERSHADERS; i++) {
-                       if (currprefs.gfx_filtershader[i + MAX_FILTERSHADERS][0]) {
+                       if (filterd3d->gfx_filtershader[i + MAX_FILTERSHADERS][0]) {
                                struct shaderdata *s = allocshaderslot (SHADERTYPE_AFTER);
-                               if (!psEffect_LoadEffect (currprefs.gfx_filtershader[i + MAX_FILTERSHADERS], true, s, i + MAX_FILTERSHADERS)) {
-                                       currprefs.gfx_filtershader[i + MAX_FILTERSHADERS][0] = changed_prefs.gfx_filtershader[i + MAX_FILTERSHADERS][0] = 0;
+                               if (!psEffect_LoadEffect (filterd3d->gfx_filtershader[i + MAX_FILTERSHADERS], true, s, i + MAX_FILTERSHADERS)) {
+                                       filterd3d->gfx_filtershader[i + MAX_FILTERSHADERS][0] = changed_prefs.gf[filterd3didx].gfx_filtershader[i + MAX_FILTERSHADERS][0] = 0;
                                        break;
                                }
                        }
-                       if (currprefs.gfx_filtermask[i + MAX_FILTERSHADERS][0]) {
+                       if (filterd3d->gfx_filtermask[i + MAX_FILTERSHADERS][0]) {
                                struct shaderdata *s = allocshaderslot (SHADERTYPE_MASK_AFTER);
-                               createmasktexture (currprefs.gfx_filtermask[i + MAX_FILTERSHADERS], s);
+                               createmasktexture (filterd3d->gfx_filtermask[i + MAX_FILTERSHADERS], s);
                        }
                }
-               if (currprefs.gfx_filter_scanlines > 0) {
+               if (filterd3d->gfx_filter_scanlines > 0) {
                        createsltexture ();
                        createscanlines (1);
                }
@@ -2091,7 +2093,7 @@ static int restoredeviceobjects (void)
        if (wasshader && !shaderon)
                write_log (_T("Falling back to non-shader mode\n"));
 
-       createmask2texture (currprefs.gfx_filteroverlay);
+       createmask2texture (filterd3d->gfx_filteroverlay);
 
        createledtexture ();
 
@@ -2229,6 +2231,9 @@ static const TCHAR *D3D_init2 (HWND ahwnd, int w_w, int w_h, int depth, int *fre
        struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[APMODE_RTG] : &currprefs.gfx_apmode[APMODE_NATIVE];
        D3DADAPTER_IDENTIFIER9 did;
 
+       filterd3didx = picasso_on;
+       filterd3d = &currprefs.gf[filterd3didx];
+
        D3D_free2 ();
        if (!currprefs.gfx_api) {
                _tcscpy (errmsg, _T("D3D: not enabled"));
@@ -2483,11 +2488,11 @@ static const TCHAR *D3D_init2 (HWND ahwnd, int w_w, int w_h, int depth, int *fre
 
        required_sl_texture_w = w_w;
        required_sl_texture_h = w_h;
-       if (currprefs.gfx_filter_scanlines > 0 && (max_texture_w < w_w || max_texture_h < w_h)) {
+       if (filterd3d->gfx_filter_scanlines > 0 && (max_texture_w < w_w || max_texture_h < w_h)) {
                gui_message (_T("%s: %d * %d or bigger texture support required for scanlines (max is only %d * %d)\n"),
                        D3DHEAD, _T("Scanlines disabled."),
                        required_sl_texture_w, required_sl_texture_h, max_texture_w, max_texture_h);
-               changed_prefs.gfx_filter_scanlines = currprefs.gfx_filter_scanlines = 0;
+               changed_prefs.gf[filterd3didx].gfx_filter_scanlines = filterd3d->gfx_filter_scanlines = 0;
        }
 
        switch (depth)
@@ -2933,7 +2938,7 @@ static void D3D_render2 (void)
                        if (FAILED (hr = postEffect->SetTechnique (postTechniquePlain)))
                                write_log (_T("%s: SetTechnique(postTechniquePlain) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));
                }
-               hr = postEffect->SetInt (postFilterMode, currprefs.gfx_filter_bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT);
+               hr = postEffect->SetInt (postFilterMode, filterd3d->gfx_filter_bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT);
 
                if (FAILED (hr = postEffect->SetTexture (postSourceTextureHandle, srctex)))
                        write_log (_T("%s: SetTexture(srctex) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));
@@ -2986,7 +2991,7 @@ static void D3D_render2 (void)
                hr = d3ddev->SetTransform (D3DTS_WORLD, &m_matWorld);
                hr = d3ddev->SetTexture (0, srctex);
                hr = d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0, 2);
-               int bl = currprefs.gfx_filter_bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT;
+               int bl = filterd3d->gfx_filter_bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT;
                hr = d3ddev->SetSamplerState (0, D3DSAMP_MINFILTER, bl);
                hr = d3ddev->SetSamplerState (0, D3DSAMP_MAGFILTER, bl);
 
@@ -3047,20 +3052,20 @@ static void D3D_render2 (void)
                        MatrixScaling (&t, w, h, 0);
 
                        v.x = 0;
-                       if (currprefs.gfx_filteroverlay_pos.x == -1)
+                       if (filterd3d->gfx_filteroverlay_pos.x == -1)
                                v.x = (window_w - (mask2texture_w * w)) / 2;
-                       else if (currprefs.gfx_filteroverlay_pos.x > -24000)
-                               v.x = currprefs.gfx_filteroverlay_pos.x;
+                       else if (filterd3d->gfx_filteroverlay_pos.x > -24000)
+                               v.x = filterd3d->gfx_filteroverlay_pos.x;
                        else
-                               v.x = (window_w - (mask2texture_w * w)) / 2 + (-currprefs.gfx_filteroverlay_pos.x - 30100) * window_w / 100.0;
+                               v.x = (window_w - (mask2texture_w * w)) / 2 + (-filterd3d->gfx_filteroverlay_pos.x - 30100) * window_w / 100.0;
 
                        v.y = 0;
-                       if (currprefs.gfx_filteroverlay_pos.y == -1)
+                       if (filterd3d->gfx_filteroverlay_pos.y == -1)
                                v.y = (window_h - (mask2texture_h * h)) / 2;
-                       else if (currprefs.gfx_filteroverlay_pos.y > -24000)
-                               v.y = currprefs.gfx_filteroverlay_pos.y;
+                       else if (filterd3d->gfx_filteroverlay_pos.y > -24000)
+                               v.y = filterd3d->gfx_filteroverlay_pos.y;
                        else
-                               v.y = (window_h - (mask2texture_h * h)) / 2 + (-currprefs.gfx_filteroverlay_pos.y - 30100) * window_h / 100.0;
+                               v.y = (window_h - (mask2texture_h * h)) / 2 + (-filterd3d->gfx_filteroverlay_pos.y - 30100) * window_h / 100.0;
 
                        v.x /= w;
                        v.y /= h;
index 0f3ac7bad89b3f1d4a09bd5db6e3d2255ddd30e5..07e4b4e9a0d6df7a1be4daa0563e24c64aa53de5 100644 (file)
@@ -583,7 +583,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                                        NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
                                DWORD err = GetLastError ();
                                if (h == INVALID_HANDLE_VALUE && err == ERROR_FILE_NOT_FOUND)
-                                       goto end;
+                                       goto emptyreal;
                        }
                }
                if (h != INVALID_HANDLE_VALUE) {
@@ -693,6 +693,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                        //fixdrive (hfd);
 
                } else {
+emptyreal:
                        hfd->flags = HFD_FLAGS_REALDRIVE;
                        hfd->drive_empty = -1;
                        hfd->emptyname = my_strdup (name);
index d2c44a93955daff30bf07b17c0f45136b287a26a..75ee3faef9bcd6586d08bb6038cafcd2fdc2e50c 100644 (file)
Binary files a/od-win32/lib/prowizard.lib and b/od-win32/lib/prowizard.lib differ
index 0eff7af081d07f93118f79ae004934c60dbfc53f..e299ad3568ad872cc826d297be6fc58986684ebb 100644 (file)
Binary files a/od-win32/lib/prowizard_x64.lib and b/od-win32/lib/prowizard_x64.lib differ
index 9765903b772a13c6d69274fee7559fe1bb1896c8..5e619358ad9ec4fc943a374edcb2c4823bc3b897 100644 (file)
 #define IDC_GFXCARDTEXT                 1191
 #define IDC_LM_SCANLINES                1191
 #define IDC_INPUTSPEEDM                 1191
-#define IDC_P96RAM                      1192
-#define IDC_P96MEM                      1193
-#define IDC_DA_SLIDER                   1193
+#define IDC_LM_PDOUBLED2                1192
+#define IDC_LM_PDOUBLED3                1193
 #define IDC_FRAMERATE2                  1194
 #define IDC_RATE2TEXT                   1195
 #define IDC_DA_TEXT                     1196
 #define IDC_RTG_SCALE_ALLOW             1791
 #define IDC_CPU_FREQUENCY               1791
 #define IDC_LOGENABLE2                  1791
+#define IDC_PORT_TABLET_LIBRARY         1791
 #define IDC_RTG_SCALE_ASPECTRATIO       1792
 #define IDC_ASSOCIATE_ON                1792
 #define IDC_DD_SURFACETYPE2             1792
 #define IDC_ERRORLOGCLEAR               1836
 #define IDC_DISKINFOBOX                 1837
 #define IDC_SAVEBOOTBLOCK               1838
+#define IDC_P96RAM                      1839
+#define IDC_FILTER_NATIVERTG            1839
+#define IDC_P96MEM                      1840
+#define IDC_DA_SLIDER                   1841
 #define ID__FLOPPYDRIVES                40004
 #define ID_FLOPPYDRIVES_DF0             40005
 #define ID_ST_CONFIGURATION             40010
 #define ID_ST_CDEJECTALL                40047
 #define ID_CDDRIVES_CD                  40048
 #define ID_ST_CD0                       40049
-#define IDC_STATIC                      -1
 
 // Next default values for new objects
 // 
 #define _APS_3D_CONTROLS                     1
 #define _APS_NEXT_RESOURCE_VALUE        391
 #define _APS_NEXT_COMMAND_VALUE         40050
-#define _APS_NEXT_CONTROL_VALUE         1839
+#define _APS_NEXT_CONTROL_VALUE         1840
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif
index 94437ab7bcce7580611cb0b58a42a94c00a061c5..714f6462e1e26960ec5ed77286ecb01c61813f40 100644 (file)
@@ -1,7 +1,7 @@
 // Microsoft Visual C++ generated resource script.
 //
-#include "resource.h"
 #include "winres.h"
+#include "resource.h"
 /////////////////////////////////////////////////////////////////////////////
 // English resources
 
@@ -136,6 +136,8 @@ BEGIN
     CONTROL         "Remove interlace artifacts",IDC_FLICKERFIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,154,142,10
     RTEXT           "Resolution:",IDC_STATIC,24,170,110,8,SS_CENTERIMAGE
     COMBOBOX        IDC_LORES,142,169,127,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Resolution autoswitch:",IDC_STATIC,92,190,110,8,SS_CENTERIMAGE
+    COMBOBOX        IDC_AUTORESOLUTIONSELECT,210,189,59,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
     RTEXT           "Refresh:",IDC_REFRESHTEXT,11,209,57,8
     CONTROL         "Slider1",IDC_FRAMERATE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,71,204,99,20
     COMBOBOX        IDC_RATE2BOX,210,209,60,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
@@ -143,24 +145,24 @@ BEGIN
     CONTROL         "",IDC_FRAMERATE2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,71,225,99,20
     EDITTEXT        IDC_RATE2TEXT,210,229,46,12,ES_AUTOHSCROLL
     CONTROL         "",IDC_RATE2ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,261,230,8,10
-    GROUPBOX        "Centering",IDC_STATIC,289,86,105,46
-    CONTROL         "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,100,90,10
-    CONTROL         "Vertical",IDC_YCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,116,90,10
-    GROUPBOX        "Line mode",IDC_STATIC,290,134,104,63
-    CONTROL         "Single",IDC_LM_NORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,299,150,90,10
-    CONTROL         "Double",IDC_LM_DOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,166,90,10
-    CONTROL         "Scanlines",IDC_LM_SCANLINES,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,182,90,10
-    GROUPBOX        "Interlaced line mode",IDC_STATIC,290,199,104,70
-    CONTROL         "Single",IDC_LM_INORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,299,214,90,10
-    CONTROL         "Double, frames",IDC_LM_IDOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,228,90,10
-    CONTROL         "Double, fields",IDC_LM_IDOUBLED2,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,241,90,10
-    CONTROL         "Double, fields+",IDC_LM_IDOUBLED3,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,254,90,10
     COMBOBOX        IDC_DA_MODE,15,260,71,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
     CONTROL         "",IDC_DA_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,96,256,96,20
     EDITTEXT        IDC_DA_TEXT,205,260,56,12,ES_AUTOHSCROLL | ES_READONLY
     PUSHBUTTON      "Reset to defaults",IDC_DA_RESET,156,278,106,14
-    COMBOBOX        IDC_AUTORESOLUTIONSELECT,210,189,59,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    RTEXT           "Resolution autoswitch:",IDC_STATIC,92,190,110,8,SS_CENTERIMAGE
+    GROUPBOX        "Centering",IDC_STATIC,289,86,105,46
+    CONTROL         "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,100,90,10
+    CONTROL         "Vertical",IDC_YCENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,116,90,10
+    GROUPBOX        "Line mode",IDC_STATIC,290,134,104,81
+    CONTROL         "Single",IDC_LM_NORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,299,148,90,10
+    CONTROL         "Double",IDC_LM_DOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,161,90,10
+    CONTROL         "Scanlines",IDC_LM_SCANLINES,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,174,90,10
+    CONTROL         "Double, fields",IDC_LM_PDOUBLED2,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,187,90,10
+    CONTROL         "Double, fields+",IDC_LM_PDOUBLED3,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,200,90,10
+    GROUPBOX        "Interlaced line mode",IDC_STATIC,290,222,104,70
+    CONTROL         "Single",IDC_LM_INORMAL,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,299,238,90,10
+    CONTROL         "Double, frames",IDC_LM_IDOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,251,90,10
+    CONTROL         "Double, fields",IDC_LM_IDOUBLED2,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,264,90,10
+    CONTROL         "Double, fields+",IDC_LM_IDOUBLED3,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,299,277,90,10
 END
 
 IDD_MEMORY DIALOGEX 0, 0, 396, 206
@@ -213,6 +215,8 @@ BEGIN
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,128,120,11
     CONTROL         "MMU [] 68030, 68040 and 68060 MMU emulation. Not compatible with JIT.",IDC_MMUENABLE,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,142,120,11
+    CONTROL         "Unimplemented CPU emu [] Emulate 68060 unimplemented integer instructions",IDC_CPU_UNIMPLEMENTED,
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,8,156,118,10
     GROUPBOX        "CPU Emulation Speed",IDC_STATIC,136,3,258,111
     CONTROL         "Fastest possible",IDC_CS_HOST,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,143,24,195,10
     CONTROL         "Approximate A500/A1200 or cycle-exact",IDC_CS_68000,
@@ -233,6 +237,8 @@ BEGIN
     CONTROL         "CPU internal",IDC_FPU3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,8,236,93,10
     CONTROL         "More compatible [] More compatible but slower FPU emulation.",IDC_COMPATIBLE_FPU,
                     "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,8,252,117,10
+    CONTROL         "Unimplemented FPU emu [] Emulate FPU unimplemented instructions",IDC_FPU_UNIMPLEMENTED,
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,8,265,116,10
     GROUPBOX        "Advanced JIT Settings",IDC_STATIC,136,181,258,99
     RTEXT           "Cache size:",IDC_STATIC,143,200,66,10,SS_CENTERIMAGE
     CONTROL         "Slider1",IDC_CACHE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,212,194,115,20
@@ -243,10 +249,6 @@ BEGIN
     CONTROL         "No flags",IDC_NOFLAGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,243,227,68,11
     CONTROL         "Direct",IDC_TRUST0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,315,227,72,10
     CONTROL         "Indirect",IDC_TRUST1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,315,241,72,10
-    CONTROL         "Unimplemented FPU emu [] Emulate FPU unimplemented instructions",IDC_FPU_UNIMPLEMENTED,
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,8,265,116,10
-    CONTROL         "Unimplemented CPU emu [] Emulate 68060 unimplemented integer instructions",IDC_CPU_UNIMPLEMENTED,
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,8,156,118,10
 END
 
 IDD_FLOPPY DIALOGEX 0, 0, 396, 261
@@ -259,6 +261,7 @@ BEGIN
     COMBOBOX        IDC_DF0TYPE,152,14,65,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     RTEXT           "Write-protected",IDC_STATIC,221,17,74,10,SS_CENTERIMAGE
     CONTROL         "",IDC_DF0WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,300,13,10,15
+    PUSHBUTTON      "?",IDC_INFO0,323,12,17,15
     PUSHBUTTON      "Eject",IDC_EJECT0,345,12,30,15
     PUSHBUTTON      "...",IDC_DF0,379,12,10,15
     COMBOBOX        IDC_DF0TEXT,6,31,384,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
@@ -267,6 +270,7 @@ BEGIN
     COMBOBOX        IDC_DF1TYPE,152,51,65,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     RTEXT           "Write-protected",IDC_STATIC,221,53,74,10,SS_CENTERIMAGE
     CONTROL         "",IDC_DF1WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,300,50,10,15
+    PUSHBUTTON      "?",IDC_INFO1,323,49,17,15
     PUSHBUTTON      "Eject",IDC_EJECT1,345,49,30,15
     PUSHBUTTON      "...",IDC_DF1,379,49,10,15
     COMBOBOX        IDC_DF1TEXT,6,68,383,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
@@ -275,6 +279,7 @@ BEGIN
     COMBOBOX        IDC_DF2TYPE,152,87,65,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     RTEXT           "Write-protected",IDC_STATIC,222,88,73,10,SS_CENTERIMAGE
     CONTROL         "",IDC_DF2WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,300,86,9,15
+    PUSHBUTTON      "?",IDC_INFO2,323,85,17,15
     PUSHBUTTON      "Eject",IDC_EJECT2,345,85,30,15
     PUSHBUTTON      "...",IDC_DF2,379,85,10,15
     COMBOBOX        IDC_DF2TEXT,6,104,384,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
@@ -283,6 +288,7 @@ BEGIN
     COMBOBOX        IDC_DF3TYPE,152,123,65,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     RTEXT           "Write-protected",IDC_STATIC,222,125,73,10,SS_CENTERIMAGE
     CONTROL         "",IDC_DF3WP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,300,123,9,15
+    PUSHBUTTON      "?",IDC_INFO3,323,122,17,15
     PUSHBUTTON      "Eject",IDC_EJECT3,345,121,30,15
     PUSHBUTTON      "...",IDC_DF3,379,121,10,15
     COMBOBOX        IDC_DF3TEXT,6,140,383,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
@@ -297,10 +303,6 @@ BEGIN
     EDITTEXT        IDC_CREATE_NAME,130,243,97,13,ES_AUTOHSCROLL
     CONTROL         "Bootblock",IDC_FLOPPY_BOOTABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,235,242,59,15
     CONTROL         "FFS",IDC_FLOPPY_FFS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,300,242,34,15
-    PUSHBUTTON      "?",IDC_INFO0,323,12,17,15
-    PUSHBUTTON      "?",IDC_INFO1,323,49,17,15
-    PUSHBUTTON      "?",IDC_INFO2,323,85,17,15
-    PUSHBUTTON      "?",IDC_INFO3,323,122,17,15
 END
 
 IDD_HARDDISK DIALOGEX 0, 0, 396, 315
@@ -312,6 +314,8 @@ BEGIN
     PUSHBUTTON      "Add &Directory or Archive...",IDC_NEW_FS,1,157,128,15
     PUSHBUTTON      "Add &Hardfile...",IDC_NEW_HF,135,157,126,15
     PUSHBUTTON      "Add Ha&rd Drive...",IDC_NEW_HD,267,157,127,15
+    PUSHBUTTON      "Add SCSI/IDE CD Drive",IDC_NEW_CD,1,176,128,15
+    PUSHBUTTON      "Add SCSI Tape Drive",IDC_NEW_TAPE,135,176,126,15
     PUSHBUTTON      "&Properties",IDC_EDIT,267,176,60,15
     PUSHBUTTON      "Remove",IDC_REMOVE,334,176,60,15
     GROUPBOX        "Options",IDC_STATIC,1,191,393,72
@@ -332,8 +336,6 @@ BEGIN
     COMBOBOX        IDC_CD_TYPE,282,279,71,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     PUSHBUTTON      "Eject",IDC_CD_EJECT,360,278,30,15
     COMBOBOX        IDC_CD_TEXT,5,297,386,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "Add SCSI/IDE CD Drive",IDC_NEW_CD,1,176,128,15
-    PUSHBUTTON      "Add SCSI Tape Drive",IDC_NEW_TAPE,135,176,126,15
 END
 
 IDD_SOUND DIALOGEX 0, 0, 396, 288
@@ -347,8 +349,12 @@ BEGIN
     CONTROL         "Enabled",IDC_SOUND2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,71,108,10
     CONTROL         "Automatic switching",IDC_SOUND_AUTO,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,13,89,108,10
     GROUPBOX        "Volume",IDC_STATIC,139,19,255,69
+    RTEXT           "Paula Audio",IDC_STATIC,152,38,51,10,SS_CENTERIMAGE
     CONTROL         "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,207,32,105,20
     EDITTEXT        IDC_SOUNDVOLUME2,329,35,48,12,ES_CENTER | ES_READONLY
+    RTEXT           "CD Audio",IDC_STATIC,152,67,51,10,SS_CENTERIMAGE
+    CONTROL         "",IDC_SOUNDVOLUMECD,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,207,61,105,20
+    EDITTEXT        IDC_SOUNDVOLUMECD2,329,64,48,12,ES_CENTER | ES_READONLY
     GROUPBOX        "Sound Buffer Size",IDC_STATIC,140,90,254,42
     CONTROL         "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,207,106,105,20
     EDITTEXT        IDC_SOUNDBUFFERMEM,329,109,48,12,ES_CENTER | ES_READONLY
@@ -377,10 +383,6 @@ BEGIN
     CONTROL         "WASAPI",IDC_SOUND_WASAPI,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,292,240,98,10
     CONTROL         "OpenAL",IDC_SOUND_OPENAL,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,292,253,98,10
     CONTROL         "PortAudio",IDC_SOUND_PORTAUDIO,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,292,266,98,10
-    CONTROL         "",IDC_SOUNDVOLUMECD,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,207,61,105,20
-    EDITTEXT        IDC_SOUNDVOLUMECD2,329,64,48,12,ES_CENTER | ES_READONLY
-    RTEXT           "CD Audio",IDC_STATIC,152,67,51,10,SS_CENTERIMAGE
-    RTEXT           "Paula Audio",IDC_STATIC,152,38,51,10,SS_CENTERIMAGE
 END
 
 IDD_LOADSAVE DIALOGEX 0, 0, 396, 318
@@ -431,14 +433,14 @@ BEGIN
     CONTROL         "Direct []Use when emulating serial-link games on two PCs running WinUAE",IDC_SER_DIRECT,
                     "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,181,171,83,12
     CONTROL         "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,275,171,108,12
+    GROUPBOX        "MIDI",IDC_STATIC,1,191,393,54,BS_LEFT
     RTEXT           "Out:",IDC_MIDI,22,202,32,15,SS_CENTERIMAGE
     COMBOBOX        IDC_MIDIOUTLIST,58,204,145,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     RTEXT           "In:",IDC_MIDI2,204,201,31,15,SS_CENTERIMAGE
     COMBOBOX        IDC_MIDIINLIST,239,203,145,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+    CONTROL         "Route MIDI In to MIDI Out",IDC_MIDIROUTER,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,41,227,170,12
     GROUPBOX        "Protection Dongle",IDC_STATIC,1,252,393,41,BS_LEFT
-    GROUPBOX        "MIDI",IDC_STATIC,1,191,393,54,BS_LEFT
     COMBOBOX        IDC_DONGLELIST,58,270,232,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Route MIDI In to MIDI Out",IDC_MIDIROUTER,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,41,227,170,12
 END
 
 IDD_GAMEPORTS DIALOGEX 0, 0, 396, 288
@@ -469,9 +471,11 @@ BEGIN
     CONTROL         "Magic Mouse",IDC_PORT_MOUSETRICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,195,235,160,11
     RTEXT           "Magic Mouse cursor mode:",IDC_STATIC,45,254,138,10,SS_CENTERIMAGE
     COMBOBOX        IDC_PORT_TABLET_CURSOR,195,251,119,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Install virtual mouse driver",IDC_PORT_TABLET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,270,136,11
+    CONTROL         "Install virtual mouse driver",IDC_PORT_TABLET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,270,116,11
     CONTROL         "Full tablet input emulation",IDC_PORT_TABLET_FULL,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,195,270,160,11
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,270,106,11
+    CONTROL         "Tablet.library emulation",IDC_PORT_TABLET_LIBRARY,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,267,271,117,11
 END
 
 IDD_CONTRIBUTORS DIALOGEX 0, 0, 530, 345
@@ -489,8 +493,8 @@ CAPTION "Configuration error log"
 FONT 8, "MS Sans Serif", 0, 0, 0x0
 BEGIN
     DEFPUSHBUTTON   "OK",IDOK,176,322,65,15
-    CONTROL         "",IDC_ERRORLOGMESSAGE,"RICHEDIT",TCS_HOTTRACK | TCS_VERTICAL | TCS_RAGGEDRIGHT | TCS_OWNERDRAWFIXED | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,4,5,521,309
     PUSHBUTTON      "Clear log",IDC_ERRORLOGCLEAR,288,322,65,15
+    CONTROL         "",IDC_ERRORLOGMESSAGE,"RICHEDIT",TCS_HOTTRACK | TCS_VERTICAL | TCS_RAGGEDRIGHT | TCS_OWNERDRAWFIXED | TCS_MULTISELECT | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,4,5,521,309
 END
 
 IDD_ABOUT DIALOGEX 0, 0, 345, 258
@@ -566,6 +570,7 @@ BEGIN
     CONTROL         "Read/write",IDC_HDF_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,53,74,67,10
     CONTROL         "Bootable",IDC_HDF_AUTOBOOT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,74,67,10
     CONTROL         "Do not mount",IDC_HDF_DONOTMOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,217,74,67,10
+    CONTROL         "Global filesystem",IDC_HDF_ADDFSRES,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,298,74,82,10
     RTEXT           "Boot priority:",IDC_HARDFILE_BOOTPRI_TEXT,26,94,78,10
     EDITTEXT        IDC_HARDFILE_BOOTPRI,109,90,44,15
     RTEXT           "Surfaces:",IDC_SURFACES_TEXT,160,94,48,10
@@ -579,6 +584,7 @@ BEGIN
     RTEXT           "Block size:",IDC_BLOCKSIZE_TEXT,261,113,50,10
     EDITTEXT        IDC_BLOCKSIZE,317,111,40,15,ES_NUMBER
     EDITTEXT        IDC_HDFINFO,5,131,385,12,ES_CENTER | ES_READONLY
+    EDITTEXT        IDC_HDFINFO2,5,147,385,12,ES_CENTER | ES_READONLY
     GROUPBOX        "New hard disk image file",IDC_STATIC,2,171,392,62
     PUSHBUTTON      "Create",IDC_HF_CREATE,58,187,80,14
     COMBOBOX        IDC_HF_TYPE,58,211,80,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
@@ -590,8 +596,6 @@ BEGIN
     CONTROL         "Dynamic HDF",IDC_HF_DYNAMIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,208,87,10
     PUSHBUTTON      "OK",IDOK,147,242,50,14
     PUSHBUTTON      "Cancel",IDCANCEL,203,242,50,14
-    EDITTEXT        IDC_HDFINFO2,5,147,385,12,ES_CENTER | ES_READONLY
-    CONTROL         "Global filesystem",IDC_HDF_ADDFSRES,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,298,74,82,10
 END
 
 IDD_FILESYS DIALOGEX 15, 25, 396, 111
@@ -691,20 +695,22 @@ BEGIN
     CONTROL         "A600/A1200 IDE",IDC_CS_IDE1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,143,104,11
     CONTROL         "ROM Mirror (E0)",IDC_CS_KSMIRROR_E0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,157,104,11
     CONTROL         "KB Reset Warning",IDC_CS_RESETWARNING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,171,104,11
+    CONTROL         "CIA TOD bug",IDC_CS_CIATODBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,184,104,11
     CONTROL         "A1000 Boot RAM/ROM",IDC_CS_A1000RAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,102,121,11
     CONTROL         "CD32 C2P",IDC_CS_CD32C2P,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,116,121,11
     CONTROL         "CDTV SRAM",IDC_CS_CDTVRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,129,121,11
     CONTROL         "A4000/A4000T IDE",IDC_CS_IDE2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,143,121,11
     CONTROL         "ROM Mirror (A8)",IDC_CS_KSMIRROR_A8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,157,121,11
     CONTROL         "No-EHB Denise",IDC_CS_NOEHB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,171,121,11
-    CONTROL         "A3000 WD33C93 SCSI",IDC_CS_DMAC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,216,121,11
-    CONTROL         "CDTV WD33C93 SCSI",IDC_CS_CDTVSCSI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,229,121,11
     CONTROL         "DF0: ID Hardware",IDC_CS_DF0IDHW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,102,125,11
     CONTROL         "CD32 NVRAM",IDC_CS_CD32NVRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,116,125,11
     CONTROL         "CDTV SRAM Expansion",IDC_CS_CDTVRAMEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,129,125,11
     CONTROL         "PCMCIA",IDC_CS_PCMCIA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,143,125,11
     CONTROL         "C00000 is Fast RAM",IDC_CS_SLOWISFAST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,157,125,11
     CONTROL         "A1000 Agnus (8361/8367)",IDC_CS_DIPAGNUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,171,125,11
+    GROUPBOX        "Internal SCSI Hardware",IDC_STATIC,0,201,393,45
+    CONTROL         "A3000 WD33C93 SCSI",IDC_CS_DMAC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,216,121,11
+    CONTROL         "CDTV WD33C93 SCSI",IDC_CS_CDTVSCSI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,229,121,11
     CONTROL         "A4000T NCR53C710 SCSI",IDC_CS_DMAC2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,171,216,125,11
     GROUPBOX        "Chipset Revision",IDC_STATIC,1,249,393,46
     CONTROL         "Ramsey revision:",IDC_CS_RAMSEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,261,97,11
@@ -715,8 +721,6 @@ BEGIN
     CONTROL         "Denise/Lisa revision:",IDC_CS_DENISE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,200,275,107,11
     EDITTEXT        IDC_CS_AGNUSREV,311,260,45,13,ES_AUTOHSCROLL
     EDITTEXT        IDC_CS_DENISEREV,311,275,45,13,ES_AUTOHSCROLL
-    CONTROL         "CIA TOD bug",IDC_CS_CIATODBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,184,104,11
-    GROUPBOX        "Internal SCSI Hardware",IDC_STATIC,0,201,393,45
 END
 
 IDD_AVIOUTPUT DIALOGEX 0, 0, 396, 260
@@ -781,48 +785,49 @@ BEGIN
     PUSHBUTTON      "Swap 1<>2",IDC_INPUTSWAP,324,303,70,14
 END
 
-IDD_FILTER DIALOGEX 0, 0, 396, 288
+IDD_FILTER DIALOGEX 0, 0, 396, 295
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD
 FONT 8, "MS Sans Serif", 0, 0, 0x1
 BEGIN
-    GROUPBOX        "Filter Settings",-1,1,1,393,146
-    COMBOBOX        IDC_FILTERMODE,9,15,167,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_FILTERFILTER,215,15,63,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "Reset to defaults",IDC_FILTERDEFAULT,283,15,106,14
-    COMBOBOX        IDC_FILTEROVERLAYTYPE,9,36,118,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_FILTEROVERLAY,134,36,145,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_FILTERAUTOSCALE,284,36,104,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    RTEXT           "Horiz. size:",-1,7,63,81,10,SS_CENTERIMAGE
-    COMBOBOX        IDC_FILTERHZMULT,92,62,35,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,56,152,19
-    EDITTEXT        IDC_FILTERHZV,316,58,42,12,ES_CENTER | ES_READONLY
-    RTEXT           "Vert. size:",-1,7,84,81,10,SS_CENTERIMAGE
-    COMBOBOX        IDC_FILTERVZMULT,92,83,35,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Slider1",IDC_FILTERVZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,77,152,19
-    EDITTEXT        IDC_FILTERVZV,316,79,42,12,ES_CENTER | ES_READONLY
-    RTEXT           "Horiz. position:",-1,5,105,81,10,SS_CENTERIMAGE
-    CONTROL         "Slider1",IDC_FILTERHO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,98,151,19
-    EDITTEXT        IDC_FILTERHOV,316,100,42,12,ES_CENTER | ES_READONLY
-    RTEXT           "Vert. position:",-1,5,125,81,10,SS_CENTERIMAGE
-    CONTROL         "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,119,151,19
-    EDITTEXT        IDC_FILTERVOV,316,121,42,12,ES_CENTER | ES_READONLY
-    GROUPBOX        "Aspect Ratio Correction",-1,1,152,144,89
-    COMBOBOX        IDC_FILTERASPECT,14,169,99,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    GROUPBOX        "Filter Settings",-1,1,1,393,160
+    COMBOBOX        IDC_FILTERMODE,9,31,167,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_FILTERSTACK,182,31,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_FILTERFILTER,215,31,63,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Reset to defaults",IDC_FILTERDEFAULT,283,31,106,14
+    COMBOBOX        IDC_FILTEROVERLAYTYPE,9,52,118,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_FILTEROVERLAY,134,52,145,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_FILTERAUTOSCALE,284,52,104,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Horiz. size:",-1,7,79,81,10,SS_CENTERIMAGE
+    COMBOBOX        IDC_FILTERHZMULT,92,78,35,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Vert. size:",-1,7,100,81,10,SS_CENTERIMAGE
+    COMBOBOX        IDC_FILTERVZMULT,92,99,35,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Horiz. position:",-1,5,121,81,10,SS_CENTERIMAGE
+    RTEXT           "Vert. position:",-1,5,141,81,10,SS_CENTERIMAGE
+    CONTROL         "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,72,152,19
+    EDITTEXT        IDC_FILTERHZV,316,74,42,12,ES_CENTER | ES_READONLY
+    CONTROL         "Slider1",IDC_FILTERVZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,93,152,19
+    EDITTEXT        IDC_FILTERVZV,316,95,42,12,ES_CENTER | ES_READONLY
+    CONTROL         "Slider1",IDC_FILTERHO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,114,151,19
+    EDITTEXT        IDC_FILTERHOV,316,116,42,12,ES_CENTER | ES_READONLY
+    CONTROL         "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,147,135,151,19
+    EDITTEXT        IDC_FILTERVOV,316,137,42,12,ES_CENTER | ES_READONLY
+    GROUPBOX        "Aspect Ratio Correction",-1,1,165,144,89
+    COMBOBOX        IDC_FILTERASPECT,14,182,99,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
     CONTROL         "Keep autoscale aspect",IDC_FILTERKEEPAUTOSCALEASPECT,
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,189,126,11
-    CONTROL         "Keep aspect ratio",IDC_FILTERKEEPASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,204,126,11
-    COMBOBOX        IDC_FILTERASPECT2,14,220,99,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    GROUPBOX        "Extra Settings",-1,154,152,240,89
-    COMBOBOX        IDC_FILTERXTRA,177,172,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_FILTERSLR,327,172,41,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Slider1",IDC_FILTERXL,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,195,141,19
-    EDITTEXT        IDC_FILTERXLV,327,197,41,12,ES_CENTER | ES_READONLY
-    GROUPBOX        "Presets",-1,1,245,393,36
-    COMBOBOX        IDC_FILTERPRESETS,13,260,183,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "Load",IDC_FILTERPRESETLOAD,205,259,55,14
-    PUSHBUTTON      "Save",IDC_FILTERPRESETSAVE,265,259,55,14
-    PUSHBUTTON      "Delete",IDC_FILTERPRESETDELETE,325,259,55,14
-    COMBOBOX        IDC_FILTERSTACK,182,15,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,202,126,11
+    CONTROL         "Keep aspect ratio",IDC_FILTERKEEPASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,217,126,11
+    COMBOBOX        IDC_FILTERASPECT2,14,233,99,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    GROUPBOX        "Extra Settings",-1,154,165,240,89
+    COMBOBOX        IDC_FILTERXTRA,177,185,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_FILTERSLR,327,185,41,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    CONTROL         "Slider1",IDC_FILTERXL,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,208,141,19
+    EDITTEXT        IDC_FILTERXLV,327,210,41,12,ES_CENTER | ES_READONLY
+    GROUPBOX        "Presets",-1,1,258,393,36
+    COMBOBOX        IDC_FILTERPRESETS,13,273,183,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Load",IDC_FILTERPRESETLOAD,205,272,55,14
+    PUSHBUTTON      "Save",IDC_FILTERPRESETSAVE,265,272,55,14
+    PUSHBUTTON      "Delete",IDC_FILTERPRESETDELETE,325,272,55,14
+    COMBOBOX        IDC_FILTER_NATIVERTG,284,12,104,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
 END
 
 IDD_HARDDRIVE DIALOGEX 0, 0, 396, 109
@@ -832,6 +837,8 @@ FONT 8, "MS Sans Serif", 0, 0, 0x0
 BEGIN
     LTEXT           "Hard drive:",IDC_STATIC,7,11,80,10
     COMBOBOX        IDC_HARDDRIVE,49,9,339,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    EDITTEXT        IDC_HDFINFO,5,29,385,12,ES_CENTER | ES_READONLY
+    EDITTEXT        IDC_HDFINFO2,5,46,385,12,ES_CENTER | ES_READONLY
     DEFPUSHBUTTON   "Create hard disk image file",IDC_HARDDRIVE_IMAGE,49,67,115,14
     EDITTEXT        IDC_PATH_NAME,183,67,97,15,ES_AUTOHSCROLL | NOT WS_VISIBLE
     RTEXT           "HD Controller:",IDC_STATIC,12,90,65,10,SS_CENTERIMAGE
@@ -839,8 +846,6 @@ BEGIN
     CONTROL         "Read/write",IDC_HDF_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,90,60,10
     DEFPUSHBUTTON   "Add hard drive",IDOK,236,87,73,14
     PUSHBUTTON      "Cancel",IDCANCEL,316,87,73,14
-    EDITTEXT        IDC_HDFINFO,5,29,385,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_HDFINFO2,5,46,385,12,ES_CENTER | ES_READONLY
 END
 
 IDD_MISC2 DIALOGEX 0, 0, 396, 263
@@ -891,10 +896,10 @@ BEGIN
     PUSHBUTTON      "Reset",IDC_RESETAMIGA,3,328,47,14
     PUSHBUTTON      "Quit",IDC_QUITEMU,55,328,47,14
     PUSHBUTTON      "Restart",IDC_RESTARTEMU,107,328,47,14,NOT WS_VISIBLE
+    PUSHBUTTON      "Error log",IDC_ERRORLOG,322,328,47,14,NOT WS_VISIBLE
     DEFPUSHBUTTON   "OK",IDOK,375,328,47,14
     PUSHBUTTON      "Cancel",IDCANCEL,427,328,47,14
     PUSHBUTTON      "Help",IDHELP,479,328,47,14,WS_DISABLED
-    PUSHBUTTON      "Error log",IDC_ERRORLOG,322,328,47,14,NOT WS_VISIBLE
 END
 
 IDD_PATHS DIALOGEX 0, 0, 396, 303
@@ -961,20 +966,20 @@ BEGIN
     PUSHBUTTON      "Select image file",IDC_DF0QQ,93,148,98,15
     RTEXT           "Write-protected",IDC_DF0WPTEXTQ,196,151,69,10,SS_CENTERIMAGE
     CONTROL         "",IDC_DF0WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,270,149,10,15
+    PUSHBUTTON      "?",IDC_INFO0Q,334,148,19,15
     PUSHBUTTON      "Eject",IDC_EJECT0Q,358,148,30,15
     COMBOBOX        IDC_DF0TEXTQ,9,167,379,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
     CONTROL         "Floppy drive DF1:",IDC_DF1QENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,186,77,15
     PUSHBUTTON      "Select image file",IDC_DF1QQ,93,186,98,15
     RTEXT           "Write-protected",IDC_DF1WPTEXTQ,195,189,69,10,SS_CENTERIMAGE
+    COMBOBOX        IDC_CD0Q_TYPE,199,187,74,50,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
     CONTROL         "",IDC_DF1WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,270,185,10,15
+    PUSHBUTTON      "?",IDC_INFO1Q,334,186,19,15
     PUSHBUTTON      "Eject",IDC_EJECT1Q,358,186,30,15
     COMBOBOX        IDC_DF1TEXTQ,9,204,379,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
     PUSHBUTTON      "Set configuration",IDC_QUICKSTART_SETCONFIG,9,239,88,15,NOT WS_VISIBLE
     GROUPBOX        "Mode",IDC_STATIC,250,231,144,28,BS_LEFT
     CONTROL         "Start in Quickstart mode",IDC_QUICKSTARTMODE,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,259,242,131,12
-    COMBOBOX        IDC_CD0Q_TYPE,199,187,74,50,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "?",IDC_INFO0Q,334,148,19,15
-    PUSHBUTTON      "?",IDC_INFO1Q,334,186,19,15
 END
 
 IDD_FRONTEND DIALOGEX 0, 0, 420, 242
@@ -1067,6 +1072,7 @@ BEGIN
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,67,212,10
     CONTROL         "Always scale in windowed mode",IDC_RTG_SCALE_ALLOW,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,80,212,10
+    CONTROL         "Always center",IDC_RTG_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,93,212,10
     CONTROL         "Hardware vertical blank interrupt",IDC_RTG_VBINTERRUPT,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,106,157,10
     CONTROL         "Hardware sprite emulation",IDC_RTG_HWSPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,106,148,10
@@ -1086,6 +1092,9 @@ BEGIN
     CONTROL         "Catweasel Z2 emulation [] Catweasel MK2 Zorro II card emulation. Physical Windows compatible Catweasel card and drivers required.",IDC_CATWEASEL,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,216,147,11
     CONTROL         "uaescsi.device",IDC_SCSIDEVICE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,229,147,11
+    CONTROL         "A590/A2091 WD33C93 SCSI",IDC_CS_A2091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,242,147,11
+    CONTROL         "A4091 NCR53C710 SCSI",IDC_CS_A4091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,255,151,11
+    CONTROL         "Include host SCSI devices",IDC_CS_SCSIMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,268,147,11
     GROUPBOX        "Network",IDC_STATIC,181,197,213,86
     CONTROL         "bsdsocket.library [] bsdsocket network library emulation.",IDC_SOCKETS,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,216,187,11
@@ -1094,10 +1103,6 @@ BEGIN
     CONTROL         "A2065 Z2 [] A2065 Ethernet Zorro II card emulation.",IDC_A2065,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,242,187,11
     COMBOBOX        IDC_NETDEVICE,202,257,178,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Always center",IDC_RTG_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,93,212,10
-    CONTROL         "A590/A2091 WD33C93 SCSI",IDC_CS_A2091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,242,147,11
-    CONTROL         "A4091 NCR53C710 SCSI",IDC_CS_A4091,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,255,151,11
-    CONTROL         "Include host SCSI devices",IDC_CS_SCSIMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,268,147,11
 END
 
 IDD_INPUTMAP DIALOGEX 0, 0, 421, 341
@@ -1109,13 +1114,13 @@ BEGIN
     CONTROL         "",IDC_INPUTMAPLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,1,1,418,257
     EDITTEXT        IDC_INPUTMAPOUT,1,261,418,14,ES_AUTOHSCROLL | ES_READONLY | WS_DISABLED
     EDITTEXT        IDC_INPUTMAPOUTM,1,277,418,29,ES_MULTILINE | ES_READONLY | WS_DISABLED
-    PUSHBUTTON      "Remap",IDC_INPUTMAP_CAPTURE,86,324,80,14
+    COMBOBOX        IDC_INPUTMAPADD,2,309,345,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
     PUSHBUTTON      "Add",IDC_INPUTMAP_CUSTOM,351,308,66,14
+    PUSHBUTTON      "Test",IDC_INPUTMAP_TEST,2,324,80,14
+    PUSHBUTTON      "Remap",IDC_INPUTMAP_CAPTURE,86,324,80,14
     PUSHBUTTON      "Delete",IDC_INPUTMAP_DELETE,170,324,80,14
     PUSHBUTTON      "Delete all",IDC_INPUTMAP_DELETEALL,254,324,80,14
-    PUSHBUTTON      "Test",IDC_INPUTMAP_TEST,2,324,80,14
     PUSHBUTTON      "Exit",IDC_INPUTMAP_EXIT,338,324,80,14
-    COMBOBOX        IDC_INPUTMAPADD,2,309,345,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
 END
 
 IDD_INFOBOX DIALOGEX 0, 0, 420, 68
@@ -1158,15 +1163,15 @@ STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK |
 CAPTION "Tape Drive Settings"
 FONT 8, "MS Sans Serif", 0, 0, 0x0
 BEGIN
-    DEFPUSHBUTTON   "Add Tape Drive",IDOK,201,58,88,14
-    PUSHBUTTON      "Cancel",IDCANCEL,300,58,87,14
-    RTEXT           "HD Controller:",IDC_STATIC,35,61,65,10,SS_CENTERIMAGE
-    COMBOBOX        IDC_HDF_CONTROLLER,115,59,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    EDITTEXT        IDC_PATH_NAME,52,15,334,15,ES_AUTOHSCROLL
     RTEXT           "Path:",IDC_STATIC,4,18,43,10,SS_CENTERIMAGE
+    EDITTEXT        IDC_PATH_NAME,52,15,334,15,ES_AUTOHSCROLL
     PUSHBUTTON      "Select Directory",IDC_TAPE_SELECT_DIR,19,36,123,15
     PUSHBUTTON      "Select Archive or Plain File",IDC_TAPE_SELECT_FILE,160,36,123,15
     CONTROL         "Read/write",IDC_TAPE_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,313,39,67,10
+    RTEXT           "HD Controller:",IDC_STATIC,35,61,65,10,SS_CENTERIMAGE
+    COMBOBOX        IDC_HDF_CONTROLLER,115,59,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    DEFPUSHBUTTON   "Add Tape Drive",IDOK,201,58,88,14
+    PUSHBUTTON      "Cancel",IDCANCEL,300,58,87,14
 END
 
 IDD_DISKINFO DIALOGEX 0, 0, 491, 323
@@ -1175,8 +1180,8 @@ CAPTION "Disk image information"
 FONT 8, "MS Sans Serif", 0, 0, 0x0
 BEGIN
     DEFPUSHBUTTON   "OK",IDOK,220,303,50,14
-    EDITTEXT        IDC_DISKINFOBOX,5,4,481,292,ES_MULTILINE | ES_READONLY | WS_VSCROLL
     PUSHBUTTON      "Save bootblock",IDC_SAVEBOOTBLOCK,397,303,89,14,NOT WS_VISIBLE
+    EDITTEXT        IDC_DISKINFOBOX,5,4,481,292,ES_MULTILINE | ES_READONLY | WS_VSCROLL
 END
 
 
@@ -1420,6 +1425,7 @@ BEGIN
 
     IDD_FILTER, DIALOG
     BEGIN
+        BOTTOMMARGIN, 288
     END
 
     IDD_HARDDRIVE, DIALOG
index 38a9a9582fd4329814b0a425865b29451f37b552..53e3acd45caa47d6f3062d7ab08c9e668a71395f 100644 (file)
@@ -496,27 +496,27 @@ static void fixup_size (struct uae_prefs *prefs)
        write_log(_T("fixup_size(%d,%d)\n"), prefs->gfx_xcenter_size, prefs->gfx_ycenter_size);
        if (prefs->gfx_xcenter_size > 0) {
                int hres = prefs->gfx_resolution;
-               if (prefs->gfx_filter) {
-                       if (prefs->gfx_filter_horiz_zoom_mult)
-                               hres += prefs->gfx_filter_horiz_zoom_mult - 1;
-                       hres += uaefilters[prefs->gfx_filter].intmul - 1;
+               if (prefs->gf[0].gfx_filter) {
+                       if (prefs->gf[0].gfx_filter_horiz_zoom_mult)
+                               hres += prefs->gf[0].gfx_filter_horiz_zoom_mult - 1;
+                       hres += uaefilters[prefs->gf[0].gfx_filter].intmul - 1;
                }
                if (hres > max_horiz_dbl)
                        hres = max_horiz_dbl;
                prefs->gfx_size_win.width = prefs->gfx_xcenter_size >> (RES_MAX - hres);
-               prefs->gfx_filter_autoscale = 0;
+               prefs->gf[0].gfx_filter_autoscale = 0;
        }
        if (prefs->gfx_ycenter_size > 0) {
                int vres = prefs->gfx_vresolution;
-               if (prefs->gfx_filter) {
-                       if (prefs->gfx_filter_vert_zoom_mult)
-                               vres += prefs->gfx_filter_vert_zoom_mult - 1;
-                       vres += uaefilters[prefs->gfx_filter].intmul - 1;
+               if (prefs->gf[0].gfx_filter) {
+                       if (prefs->gf[0].gfx_filter_vert_zoom_mult)
+                               vres += prefs->gf[0].gfx_filter_vert_zoom_mult - 1;
+                       vres += uaefilters[prefs->gf[0].gfx_filter].intmul - 1;
                }
                if (vres > max_vert_dbl)
                        vres = max_vert_dbl;
                prefs->gfx_size_win.height = (prefs->gfx_ycenter_size * 2) >> (VRES_QUAD - vres);
-               prefs->gfx_filter_autoscale = 0;
+               prefs->gf[0].gfx_filter_autoscale = 0;
        }
        write_log(_T("-> %dx%d\n"), prefs->gfx_size_win.width, prefs->gfx_size_win.height);
 }
@@ -604,8 +604,8 @@ static void get_screenmode (struct RPScreenMode *sm, struct uae_prefs *p, bool g
                }
                write_log (_T("GET_RPSM: %d %d %d %d\n"), rx, ry, rw, rh);
 
-               hmult = p->gfx_filter_horiz_zoom_mult;
-               vmult = p->gfx_filter_vert_zoom_mult;
+               hmult = p->gf[0].gfx_filter_horiz_zoom_mult;
+               vmult = p->gf[0].gfx_filter_vert_zoom_mult;
 
                full = p->gfx_apmode[0].gfx_fullscreen;
 
@@ -639,12 +639,12 @@ static void get_screenmode (struct RPScreenMode *sm, struct uae_prefs *p, bool g
                        sm->lClipHeight = p->gfx_ycenter_size <= 0 ? -1 : p->gfx_ycenter_size;
                }
 
-               if (p->gfx_filter_scanlines || p->gfx_scanlines)
+               if (p->gf[0].gfx_filter_scanlines || p->gfx_pscanlines)
                        m |= RP_SCREENMODE_SCANLINES;
 
                if (p->gfx_xcenter_pos == 0 && p->gfx_ycenter_pos == 0)
                        cf |= RP_CLIPFLAGS_NOCLIP;
-               else if (p->gfx_filter_autoscale == AUTOSCALE_RESIZE || p->gfx_filter_autoscale == AUTOSCALE_NORMAL)
+               else if (p->gf[0].gfx_filter_autoscale == AUTOSCALE_RESIZE || p->gf[0].gfx_filter_autoscale == AUTOSCALE_NORMAL)
                        cf |= RP_CLIPFLAGS_AUTOCLIP;
        }
        if (full) {
@@ -707,7 +707,7 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
                else
                        fs = 1;
        }
-       p->gfx_filter_autoscale = AUTOSCALE_CENTER;
+       p->gf[0].gfx_filter_autoscale = AUTOSCALE_CENTER;
        disp = getdisplay (p);
 
        if (log_rp & 2) {
@@ -842,7 +842,7 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
                        hmult = vmult = 0;
                } else if (integerscale) {
                        hmult = vmult = 1;
-                       p->gfx_filter_autoscale = AUTOSCALE_INTEGER;
+                       p->gf[0].gfx_filter_autoscale = AUTOSCALE_INTEGER;
                        if (sm->dwClipFlags & RP_CLIPFLAGS_AUTOCLIP) {
                                p->gfx_xcenter_pos = -1;
                                p->gfx_ycenter_pos = -1;
@@ -857,25 +857,25 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
                }
 
                if (keepaspect) {
-                       p->gfx_filter_aspect = -1;
-                       p->gfx_filter_keep_aspect = 1;
+                       p->gf[0].gfx_filter_aspect = -1;
+                       p->gf[0].gfx_filter_keep_aspect = 1;
                } else {
-                       p->gfx_filter_aspect = 0;
-                       p->gfx_filter_keep_aspect = 0;
+                       p->gf[0].gfx_filter_aspect = 0;
+                       p->gf[0].gfx_filter_keep_aspect = 0;
                }
 
                if (!integerscale) {
                        if (sm->dwClipFlags & RP_CLIPFLAGS_AUTOCLIP) {
                                if (!forcesize)
-                                       p->gfx_filter_autoscale = AUTOSCALE_RESIZE;
+                                       p->gf[0].gfx_filter_autoscale = AUTOSCALE_RESIZE;
                                else
-                                       p->gfx_filter_autoscale = AUTOSCALE_NORMAL;
+                                       p->gf[0].gfx_filter_autoscale = AUTOSCALE_NORMAL;
                                p->gfx_xcenter_pos = -1;
                                p->gfx_ycenter_pos = -1;
                                p->gfx_xcenter_size = -1;
                                p->gfx_ycenter_size = -1;
                        } else if (sm->dwClipFlags & RP_CLIPFLAGS_NOCLIP) {
-                               p->gfx_filter_autoscale = AUTOSCALE_STATIC_MAX;
+                               p->gf[0].gfx_filter_autoscale = AUTOSCALE_STATIC_MAX;
                                p->gfx_xcenter_pos = -1;
                                p->gfx_ycenter_pos = -1;
                                p->gfx_xcenter_size = -1;
@@ -892,20 +892,21 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
                                p->gfx_ycenter_size = sm->lClipHeight;
 
                        if ((p->gfx_xcenter_pos >= 0 && p->gfx_ycenter_pos >= 0) || (p->gfx_xcenter_size > 0 && p->gfx_ycenter_size > 0)) {
-                               p->gfx_filter_autoscale = AUTOSCALE_MANUAL;
+                               p->gf[0].gfx_filter_autoscale = AUTOSCALE_MANUAL;
                        }
                }
 
-               p->gfx_filter_horiz_zoom_mult = hmult;
-               p->gfx_filter_vert_zoom_mult = vmult;
+               p->gf[0].gfx_filter_horiz_zoom_mult = hmult;
+               p->gf[0].gfx_filter_vert_zoom_mult = vmult;
 
-               p->gfx_filter_scanlines = 0;
-               p->gfx_scanlines = 0;
+               p->gf[0].gfx_filter_scanlines = 0;
+               p->gfx_iscanlines = 0;
+               p->gfx_pscanlines = 0;
                if (sm->dwScreenMode & RP_SCREENMODE_SCANLINES) {
-                       p->gfx_scanlines = 1;
-                       p->gfx_filter_scanlines = 8;
-                       p->gfx_filter_scanlinelevel = 8;
-                       p->gfx_filter_scanlineratio = (1 << 4) | 1;
+                       p->gfx_pscanlines = 1;
+                       p->gf[0].gfx_filter_scanlines = 8;
+                       p->gf[0].gfx_filter_scanlinelevel = 8;
+                       p->gf[0].gfx_filter_scanlineratio = (1 << 4) | 1;
                }
        }
 
@@ -921,10 +922,10 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
                        write_log (_T("WW=%d WH=%d FW=%d FH=%d HM=%.1f VM=%.1f XP=%d YP=%d XS=%d YS=%d AS=%d AR=%d,%d\n"),
                                p->gfx_size_win.width, p->gfx_size_win.height,
                                p->gfx_size_fs.width, p->gfx_size_fs.height,
-                               p->gfx_filter_horiz_zoom_mult, p->gfx_filter_vert_zoom_mult,
+                               p->gf[0].gfx_filter_horiz_zoom_mult, p->gf[0].gfx_filter_vert_zoom_mult,
                                p->gfx_xcenter_pos, p->gfx_ycenter_pos,
                                p->gfx_xcenter_size, p->gfx_ycenter_size,
-                               p->gfx_filter_autoscale, p->gfx_filter_aspect, p->gfx_filter_keep_aspect);
+                               p->gf[0].gfx_filter_autoscale, p->gf[0].gfx_filter_aspect, p->gf[0].gfx_filter_keep_aspect);
                }
        }
 
@@ -1347,11 +1348,11 @@ void rp_fixup_options (struct uae_prefs *p)
        sendenum ();
 
        changed_prefs.win32_borderless = currprefs.win32_borderless = 1;
-       rp_filter_default = rp_filter = currprefs.gfx_filter;
+       rp_filter_default = rp_filter = currprefs.gf[0].gfx_filter;
        if (rp_filter == 0) {
                rp_filter = UAE_FILTER_NULL;
                if (currprefs.gfx_api)
-                       changed_prefs.gfx_filter = currprefs.gfx_filter = rp_filter;
+                       changed_prefs.gf[0].gfx_filter = currprefs.gf[0].gfx_filter = rp_filter;
        }
 
        fixup_size (p);
index 09b7fafefabafd0c8c7e2d7feff4eb2429b6eb99..28a707211cc9f469ac05e621f821551b1a943a70 100644 (file)
@@ -39,8 +39,8 @@ void PAL_init(void)
                xx2 = 5;
                xx3 = 7;
        }
-       pal_noise_mask = (1 << (currprefs.gfx_filter_noise * 7 / 100)) - 1;
-       scanlinelevel = 128 - currprefs.gfx_filter_scanlines * 128 / 100;
+       pal_noise_mask = (1 << (currprefs.gf[picasso_on].gfx_filter_noise * 7 / 100)) - 1;
+       scanlinelevel = 128 - currprefs.gf[picasso_on].gfx_filter_scanlines * 128 / 100;
 }
 
 #if 0
index 8a955ac0f4034c7bfd8e4b4a919aae34330fb61a..9396ab1ae125f8e255e99c2a4b2c824788e3bc89 100644 (file)
@@ -47,6 +47,7 @@
 #define UAESERIAL /* uaeserial.device emulation */
 #define FPUEMU /* FPU emulation */
 #define FPU_UAE
+#define USE_LONG_DOUBLE 0
 #define MMUEMU /* Aranym 68040 MMU */
 #define FULLMMU /* Aranym 68040 MMU */
 #define CPUEMU_0 /* generic 680x0 emulation */
@@ -63,6 +64,7 @@
 #define UAEGFX_INTERNAL /* built-in libs:picasso96/uaegfx.card */
 #define BSDSOCKET /* bsdsocket.library emulation */
 #define CAPS /* CAPS-image support */
+#define SCP /* SuperCardPro */
 #define FDI2RAW /* FDI 1.0 and 2.x image support */
 #define AVIOUTPUT /* Avioutput support */
 #define PROWIZARD /* Pro-Wizard module ripper */
@@ -81,6 +83,7 @@
 #define WITH_LUA /* lua scripting */
 #define WITH_UAENATIVE
 #define WITH_SLIRP
+#define WITH_TABLETLIBRARY
 
 #else
 
index 9cb7e5a6497f3467380012b304d27130f46b08c5..2e1bfd651d996695bb4962b653ccf69cdfef28aa 100644 (file)
@@ -1606,7 +1606,7 @@ static int canstretch (void)
        if (isfullscreen () != 0)
                return 0;
        if (!WIN32GFX_IsPicassoScreen ()) {
-               if (currprefs.gfx_filter_autoscale == AUTOSCALE_RESIZE)
+               if (currprefs.gf[APMODE_NATIVE].gfx_filter_autoscale == AUTOSCALE_RESIZE)
                        return 0;
                return 1;
        } else {
@@ -3102,8 +3102,10 @@ void target_default_options (struct uae_prefs *p, int type)
                p->win32_commandpathend[0] = 0;
                p->win32_statusbar = 1;
                p->gfx_api = os_vista ? 1 : 0;
-               if (p->gfx_filter == 0 && p->gfx_api)
-                       p->gfx_filter = 1;
+               if (p->gf[APMODE_NATIVE].gfx_filter == 0 && p->gfx_api)
+                       p->gf[APMODE_NATIVE].gfx_filter = 1;
+               if (p->gf[APMODE_RTG].gfx_filter == 0 && p->gfx_api)
+                       p->gf[APMODE_RTG].gfx_filter = 1;
                WIN32GUI_LoadUIString (IDS_INPUT_CUSTOM, buf, sizeof buf / sizeof (TCHAR));
                for (int i = 0; i < GAMEPORT_INPUT_SETTINGS; i++)
                        _stprintf (p->input_config_name[i], buf, i + 1);
index 9b19acaf509b12ce85e5cc966d0d4371f686c83b..25c463c4a07543f552082b14afb68e33b7cf7edf 100644 (file)
 #define LANG_DLL 1
 
 #if WINUAEPUBLICBETA
-#define WINUAEBETA _T("10")
+#define WINUAEBETA _T("11")
 #else
 #define WINUAEBETA _T("")
 #endif
-#define WINUAEDATE MAKEBD(2014, 3, 4)
+#define WINUAEDATE MAKEBD(2014, 3, 18)
 #define WINUAEEXTRA _T("")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 //#define WINUAEEXTRA _T("Amiga Forever Edition")
index 7820b6fc44535153ceb80e32a6ac472b8f053f6b..f54073d0668368fea9d42ba3737690cb08f65226 100644 (file)
@@ -149,12 +149,12 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
        bool doautoaspect = false;
        float autoaspectratio;
 
-       float filter_horiz_zoom = currprefs.gfx_filter_horiz_zoom / 1000.0f;
-       float filter_vert_zoom = currprefs.gfx_filter_vert_zoom / 1000.0f;
-       float filter_horiz_zoom_mult = currprefs.gfx_filter_horiz_zoom_mult;
-       float filter_vert_zoom_mult = currprefs.gfx_filter_vert_zoom_mult;
-       float filter_horiz_offset = currprefs.gfx_filter_horiz_offset / 10000.0f;
-       float filter_vert_offset = currprefs.gfx_filter_vert_offset / 10000.0f;
+       float filter_horiz_zoom = currprefs.gf[picasso_on].gfx_filter_horiz_zoom / 1000.0f;
+       float filter_vert_zoom = currprefs.gf[picasso_on].gfx_filter_vert_zoom / 1000.0f;
+       float filter_horiz_zoom_mult = currprefs.gf[picasso_on].gfx_filter_horiz_zoom_mult;
+       float filter_vert_zoom_mult = currprefs.gf[picasso_on].gfx_filter_vert_zoom_mult;
+       float filter_horiz_offset = currprefs.gf[picasso_on].gfx_filter_horiz_offset / 10000.0f;
+       float filter_vert_offset = currprefs.gf[picasso_on].gfx_filter_vert_offset / 10000.0f;
 
        store_custom_limits (-1, -1, -1, -1);
 
@@ -175,8 +175,8 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
        aws = aw * scale;
        ahs = ah * scale;
        //write_log (_T("%d %d %d\n"), dst_width, temp_width, aws);
-       extraw = -aws * (filter_horiz_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2.0f;
-       extrah = -ahs * (filter_vert_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2.0f;
+       extraw = -aws * (filter_horiz_zoom - currprefs.gf[picasso_on].gfx_filteroverlay_overscan * 10) / 2.0f;
+       extrah = -ahs * (filter_vert_zoom - currprefs.gf[picasso_on].gfx_filteroverlay_overscan * 10) / 2.0f;
 
        extraw2 = 0;
        if (getscalerect (&mrmx, &mrmy, &mrsx, &mrsy)) {
@@ -201,9 +201,9 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
        float ymult = filter_vert_zoom_mult;
 
        srcratio = 4.0f / 3.0f;
-       if (currprefs.gfx_filter_aspect > 0) {
-               dstratio = (currprefs.gfx_filter_aspect / ASPECTMULT) * 1.0f / (currprefs.gfx_filter_aspect & (ASPECTMULT - 1));
-       } else if (currprefs.gfx_filter_aspect < 0) {
+       if (currprefs.gf[picasso_on].gfx_filter_aspect > 0) {
+               dstratio = (currprefs.gf[picasso_on].gfx_filter_aspect / ASPECTMULT) * 1.0f / (currprefs.gf[picasso_on].gfx_filter_aspect & (ASPECTMULT - 1));
+       } else if (currprefs.gf[picasso_on].gfx_filter_aspect < 0) {
                if (isfullscreen () && deskw > 0 && deskh > 0)
                        dstratio = 1.0f * deskw / deskh;
                else
@@ -212,7 +212,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
                dstratio = srcratio;
        }
 
-       int scalemode = currprefs.gfx_filter_autoscale;
+       int scalemode = currprefs.gf[picasso_on].gfx_filter_autoscale;
 
        if (!specialmode && scalemode == AUTOSCALE_STATIC_AUTO) {
                if (currprefs.gfx_apmode[0].gfx_fullscreen) {
@@ -271,8 +271,8 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
                                bool ok = true;
 
                                if (currprefs.gfx_xcenter_pos >= 0 || currprefs.gfx_ycenter_pos >= 0) {
-                                       changed_prefs.gfx_filter_horiz_offset = currprefs.gfx_filter_horiz_offset = 0.0;
-                                       changed_prefs.gfx_filter_vert_offset = currprefs.gfx_filter_vert_offset = 0.0;
+                                       changed_prefs.gf[picasso_on].gfx_filter_horiz_offset = currprefs.gf[picasso_on].gfx_filter_horiz_offset = 0.0;
+                                       changed_prefs.gf[picasso_on].gfx_filter_vert_offset = currprefs.gf[picasso_on].gfx_filter_vert_offset = 0.0;
                                        filter_horiz_offset = 0.0;
                                        filter_vert_offset = 0.0;
                                        get_custom_topedge (&cx, &cy, false);
@@ -320,8 +320,8 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
 
                } else if (scalemode == AUTOSCALE_MANUAL) {
 
-                       changed_prefs.gfx_filter_horiz_offset = currprefs.gfx_filter_horiz_offset = 0.0;
-                       changed_prefs.gfx_filter_vert_offset = currprefs.gfx_filter_vert_offset = 0.0;
+                       changed_prefs.gf[picasso_on].gfx_filter_horiz_offset = currprefs.gf[picasso_on].gfx_filter_horiz_offset = 0.0;
+                       changed_prefs.gf[picasso_on].gfx_filter_vert_offset = currprefs.gf[picasso_on].gfx_filter_vert_offset = 0.0;
                        filter_horiz_offset = 0.0;
                        filter_vert_offset = 0.0;
 
@@ -359,7 +359,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
                }
        
                autoaspectratio = 0;
-               if (currprefs.gfx_filter_keep_autoscale_aspect && cw > 0 && ch > 0 && crealh > 0 && (scalemode == AUTOSCALE_NORMAL || scalemode == AUTOSCALE_INTEGER_AUTOSCALE || scalemode == AUTOSCALE_MANUAL)) {
+               if (currprefs.gf[picasso_on].gfx_filter_keep_autoscale_aspect && cw > 0 && ch > 0 && crealh > 0 && (scalemode == AUTOSCALE_NORMAL || scalemode == AUTOSCALE_INTEGER_AUTOSCALE || scalemode == AUTOSCALE_MANUAL)) {
                        float cw2 = cw;
                        float ch2 = ch;
                        int res = currprefs.gfx_resolution - currprefs.gfx_vresolution;
@@ -398,7 +398,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
                                OffsetRect (zr, cx * scale - (dst_width - ww) / 2, cy * scale - (dst_height - hh) / 2);
                                goto cont;
 
-                       } else if (scalemode == AUTOSCALE_RESIZE && isfullscreen () == 0 && !currprefs.gfx_filteroverlay[0]) {
+                       } else if (scalemode == AUTOSCALE_RESIZE && isfullscreen () == 0 && !currprefs.gf[picasso_on].gfx_filteroverlay[0]) {
 
                                static int lastresize = 0;
                                static int lastdelay = 1;
@@ -439,8 +439,8 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
                                        lastresize = AUTORESIZE_FRAME_DELAY;
                                        lastdelay = 0;
                                }
-                               float scalex = currprefs.gfx_filter_horiz_zoom_mult > 0 ? currprefs.gfx_filter_horiz_zoom_mult : 1.0f;
-                               float scaley = currprefs.gfx_filter_vert_zoom_mult > 0 ? currprefs.gfx_filter_horiz_zoom_mult : 1.0f;
+                               float scalex = currprefs.gf[picasso_on].gfx_filter_horiz_zoom_mult > 0 ? currprefs.gf[picasso_on].gfx_filter_horiz_zoom_mult : 1.0f;
+                               float scaley = currprefs.gf[picasso_on].gfx_filter_vert_zoom_mult > 0 ? currprefs.gf[picasso_on].gfx_filter_horiz_zoom_mult : 1.0f;
                                SetRect (sr, 0, 0, cw * scale * scalex, ch * scale * scaley);
                                dr->left = (temp_width - aws) /2;
                                dr->top = (temp_height - ahs) / 2;
@@ -488,19 +488,19 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
                        xmult = 1.0;
                        ymult = 1.0;
 
-                       if (currprefs.gfx_filter_keep_aspect || currprefs.gfx_filter_aspect != 0) {
+                       if (currprefs.gf[picasso_on].gfx_filter_keep_aspect || currprefs.gf[picasso_on].gfx_filter_aspect != 0) {
 
-                               if (currprefs.gfx_filter_keep_aspect) {
+                               if (currprefs.gf[picasso_on].gfx_filter_keep_aspect) {
                                        if (currprefs.ntscmode) {
                                                dstratio = dstratio * 1.21f;
-                                               if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
+                                               if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
                                                        dstratio = dstratio * 0.93f;
-                                               else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
+                                               else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
                                                        dstratio = dstratio * 0.98f;
                                        } else {
-                                               if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
+                                               if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
                                                        dstratio = dstratio * 0.95f;
-                                               else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
+                                               else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
                                                        dstratio = dstratio * 0.95f;
                                        }
                                }
@@ -550,7 +550,7 @@ cont:
 
                sizeoffset (dr, zr, extraw, extrah);
 
-               if (currprefs.gfx_filter_keep_aspect) {
+               if (currprefs.gf[picasso_on].gfx_filter_keep_aspect) {
                        float xm, ym, m;
 
                        xm = aws / dst_width;
@@ -568,14 +568,14 @@ cont:
        }
 
        if (currprefs.ntscmode) {
-               if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
+               if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
                        dstratio = dstratio * 0.93f;
-               else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
+               else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
                        dstratio = dstratio * 0.98f;
        } else {
-               if (currprefs.gfx_filter_keep_aspect == 2 && ispal ())
+               if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
                        dstratio = dstratio * 0.95f;
-               else if (currprefs.gfx_filter_keep_aspect == 1 && !ispal ())
+               else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
                        dstratio = dstratio * 0.95f;
        }
 
@@ -760,7 +760,7 @@ bool S2X_init (int dw, int dh, int dd)
        if (WIN32GFX_IsPicassoScreen ())
                return true;
 
-       if (!currprefs.gfx_filter || !usedfilter) {
+       if (!currprefs.gf[picasso_on].gfx_filter || !usedfilter) {
                usedfilter = &uaefilters[0];
                scale = 1;
        } else {
@@ -769,7 +769,7 @@ bool S2X_init (int dw, int dh, int dd)
                if ((amiga_depth2 == 16 && !(flags & UAE_FILTER_MODE_16)) || (amiga_depth2 == 32 && !(flags & UAE_FILTER_MODE_32))) {
                        usedfilter = &uaefilters[0];
                        scale = 1;
-                       changed_prefs.gfx_filter = usedfilter->type;
+                       changed_prefs.gf[picasso_on].gfx_filter = usedfilter->type;
                }
        }
 #if 0
@@ -789,7 +789,7 @@ bool S2X_init (int dw, int dh, int dd)
        amiga_depth = vb->pixbytes * 8;
 
        if (d3d) {
-               int m = currprefs.gfx_filter_filtermode + 1;
+               int m = currprefs.gf[picasso_on].gfx_filter_filtermode + 1;
                if (m < scale)
                        m = scale;
                temp_width = dst_width * m;
@@ -991,9 +991,9 @@ void S2X_render (void)
 
        }
 
-       if (ok == 0 && currprefs.gfx_filter) {
+       if (ok == 0 && currprefs.gf[picasso_on].gfx_filter) {
                usedfilter = &uaefilters[0];
-               changed_prefs.gfx_filter = usedfilter->type;
+               changed_prefs.gf[picasso_on].gfx_filter = usedfilter->type;
        }
 
 end:
index 819c83e8712aecad1f477e33136e9a5f6583faa2..80aecdd195dd21436240a8746a1d8b39b4e0540d 100644 (file)
@@ -1743,28 +1743,32 @@ int check_prefs_changed_gfx (void)
        c |= currprefs.gfx_api != changed_prefs.gfx_api ? (1|8|32) : 0;
        c |= currprefs.lightboost_strobo != changed_prefs.lightboost_strobo ? (2|16) : 0;
 
-       for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) {
-               c |= _tcscmp (currprefs.gfx_filtershader[i], changed_prefs.gfx_filtershader[i]) ? (2|8) : 0;
-               c |= _tcscmp (currprefs.gfx_filtermask[i], changed_prefs.gfx_filtermask[i]) ? (2|8) : 0;
-       }
-
-       c |= currprefs.gfx_filter != changed_prefs.gfx_filter ? (2|8) : 0;
-       c |= _tcscmp (currprefs.gfx_filteroverlay, changed_prefs.gfx_filteroverlay) ? (2|8) : 0;
-       c |= currprefs.gfx_filter_filtermode != changed_prefs.gfx_filter_filtermode ? (2|8) : 0;
-       c |= currprefs.gfx_filter_bilinear != changed_prefs.gfx_filter_bilinear ? (2|8) : 0;
-       c |= currprefs.gfx_filter_horiz_zoom_mult != changed_prefs.gfx_filter_horiz_zoom_mult ? (1) : 0;
-       c |= currprefs.gfx_filter_vert_zoom_mult != changed_prefs.gfx_filter_vert_zoom_mult ? (1) : 0;
-       c |= currprefs.gfx_filter_noise != changed_prefs.gfx_filter_noise ? (1) : 0;
-       c |= currprefs.gfx_filter_blur != changed_prefs.gfx_filter_blur ? (1) : 0;
-       c |= currprefs.gfx_filter_scanlines != changed_prefs.gfx_filter_scanlines ? (1|8) : 0;
-       c |= currprefs.gfx_filter_scanlinelevel != changed_prefs.gfx_filter_scanlinelevel ? (1|8) : 0;
-       c |= currprefs.gfx_filter_scanlineratio != changed_prefs.gfx_filter_scanlineratio ? (1|8) : 0;
-       c |= currprefs.gfx_filter_aspect != changed_prefs.gfx_filter_aspect ? (1) : 0;
-       c |= currprefs.gfx_filter_luminance != changed_prefs.gfx_filter_luminance ? (1) : 0;
-       c |= currprefs.gfx_filter_contrast != changed_prefs.gfx_filter_contrast ? (1) : 0;
-       c |= currprefs.gfx_filter_saturation != changed_prefs.gfx_filter_saturation ? (1) : 0;
-       c |= currprefs.gfx_filter_gamma != changed_prefs.gfx_filter_gamma ? (1) : 0;
-       //c |= currprefs.gfx_filter_ != changed_prefs.gfx_filter_ ? (1|8) : 0;
+       for (int j = 0; j < 2; j++) {
+               struct gfx_filterdata *gf = &currprefs.gf[j];
+               struct gfx_filterdata *gfc = &changed_prefs.gf[j];
+               for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) {
+                       c |= _tcscmp (gf->gfx_filtershader[i], gfc->gfx_filtershader[i]) ? (2|8) : 0;
+                       c |= _tcscmp (gf->gfx_filtermask[i], gfc->gfx_filtermask[i]) ? (2|8) : 0;
+               }
+
+               c |= gf->gfx_filter != gfc->gfx_filter ? (2|8) : 0;
+               c |= _tcscmp (gf->gfx_filteroverlay, gfc->gfx_filteroverlay) ? (2|8) : 0;
+               c |= gf->gfx_filter_filtermode != gfc->gfx_filter_filtermode ? (2|8) : 0;
+               c |= gf->gfx_filter_bilinear != gfc->gfx_filter_bilinear ? (2|8) : 0;
+               c |= gf->gfx_filter_horiz_zoom_mult != gfc->gfx_filter_horiz_zoom_mult ? (1) : 0;
+               c |= gf->gfx_filter_vert_zoom_mult != gfc->gfx_filter_vert_zoom_mult ? (1) : 0;
+               c |= gf->gfx_filter_noise != gfc->gfx_filter_noise ? (1) : 0;
+               c |= gf->gfx_filter_blur != gfc->gfx_filter_blur ? (1) : 0;
+               c |= gf->gfx_filter_scanlines != gfc->gfx_filter_scanlines ? (1|8) : 0;
+               c |= gf->gfx_filter_scanlinelevel != gfc->gfx_filter_scanlinelevel ? (1|8) : 0;
+               c |= gf->gfx_filter_scanlineratio != gfc->gfx_filter_scanlineratio ? (1|8) : 0;
+               c |= gf->gfx_filter_aspect != gfc->gfx_filter_aspect ? (1) : 0;
+               c |= gf->gfx_filter_luminance != gfc->gfx_filter_luminance ? (1) : 0;
+               c |= gf->gfx_filter_contrast != gfc->gfx_filter_contrast ? (1) : 0;
+               c |= gf->gfx_filter_saturation != gfc->gfx_filter_saturation ? (1) : 0;
+               c |= gf->gfx_filter_gamma != gfc->gfx_filter_gamma ? (1) : 0;
+               //c |= gf->gfx_filter_ != gfc->gfx_filter_ ? (1|8) : 0;
+       }
 
        c |= currprefs.rtg_horiz_zoom_mult != changed_prefs.rtg_horiz_zoom_mult ? (1) : 0;
        c |= currprefs.rtg_vert_zoom_mult != changed_prefs.rtg_vert_zoom_mult ? (1) : 0;
@@ -1777,7 +1781,8 @@ int check_prefs_changed_gfx (void)
        c |= currprefs.gfx_vresolution != changed_prefs.gfx_vresolution ? (128) : 0;
        c |= currprefs.gfx_autoresolution_minh != changed_prefs.gfx_autoresolution_minh ? (128) : 0;
        c |= currprefs.gfx_autoresolution_minv != changed_prefs.gfx_autoresolution_minv ? (128) : 0;
-       c |= currprefs.gfx_scanlines != changed_prefs.gfx_scanlines ? (2 | 8) : 0;
+       c |= currprefs.gfx_iscanlines != changed_prefs.gfx_iscanlines ? (2 | 8) : 0;
+       c |= currprefs.gfx_pscanlines != changed_prefs.gfx_pscanlines ? (2 | 8) : 0;
        c |= currprefs.monitoremu != changed_prefs.monitoremu ? (2 | 8) : 0;
 
        c |= currprefs.gfx_lores_mode != changed_prefs.gfx_lores_mode ? (2 | 8) : 0;
@@ -1837,28 +1842,32 @@ int check_prefs_changed_gfx (void)
                        display_change_requested = 0;
                }
 
-               for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) {
-                       _tcscpy (currprefs.gfx_filtershader[i], changed_prefs.gfx_filtershader[i]);
-                       _tcscpy (currprefs.gfx_filtermask[i], changed_prefs.gfx_filtermask[i]);
+               for (int j = 0; j < 2; j++) {
+                       struct gfx_filterdata *gf = &currprefs.gf[j];
+                       struct gfx_filterdata *gfc = &changed_prefs.gf[j];
+                       for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) {
+                               _tcscpy (gf->gfx_filtershader[i], gfc->gfx_filtershader[i]);
+                               _tcscpy (gf->gfx_filtermask[i], gfc->gfx_filtermask[i]);
+                       }
+                       gf->gfx_filter = gfc->gfx_filter;
+                       gf->gfx_filter_scanlines = gfc->gfx_filter_scanlines;
+                       gf->gfx_filter_scanlinelevel = gfc->gfx_filter_scanlinelevel;
+                       gf->gfx_filter_scanlineratio = gfc->gfx_filter_scanlineratio;
+                       _tcscpy (gf->gfx_filteroverlay, gfc->gfx_filteroverlay);
+                       gf->gfx_filter_filtermode = gfc->gfx_filter_filtermode;
+                       gf->gfx_filter_bilinear = gfc->gfx_filter_bilinear;
+                       gf->gfx_filter_horiz_zoom_mult = gfc->gfx_filter_horiz_zoom_mult;
+                       gf->gfx_filter_vert_zoom_mult = gfc->gfx_filter_vert_zoom_mult;
+                       gf->gfx_filter_noise = gfc->gfx_filter_noise;
+                       gf->gfx_filter_blur = gfc->gfx_filter_blur;
+                       gf->gfx_filter_aspect = gfc->gfx_filter_aspect;
+                       gf->gfx_filter_luminance = gfc->gfx_filter_luminance;
+                       gf->gfx_filter_contrast = gfc->gfx_filter_contrast;
+                       gf->gfx_filter_saturation = gfc->gfx_filter_saturation;
+                       gf->gfx_filter_gamma = gfc->gfx_filter_gamma;
+                       gf->gfx_filter_autoscale = gfc->gfx_filter_autoscale;
+                       //gf->gfx_filter_ = gfc->gfx_filter_;
                }
-               currprefs.gfx_filter = changed_prefs.gfx_filter;
-               _tcscpy (currprefs.gfx_filteroverlay, changed_prefs.gfx_filteroverlay);
-               currprefs.gfx_filter_filtermode = changed_prefs.gfx_filter_filtermode;
-               currprefs.gfx_filter_bilinear = changed_prefs.gfx_filter_bilinear;
-               currprefs.gfx_filter_horiz_zoom_mult = changed_prefs.gfx_filter_horiz_zoom_mult;
-               currprefs.gfx_filter_vert_zoom_mult = changed_prefs.gfx_filter_vert_zoom_mult;
-               currprefs.gfx_filter_noise = changed_prefs.gfx_filter_noise;
-               currprefs.gfx_filter_blur = changed_prefs.gfx_filter_blur;
-               currprefs.gfx_filter_scanlines = changed_prefs.gfx_filter_scanlines;
-               currprefs.gfx_filter_scanlinelevel = changed_prefs.gfx_filter_scanlinelevel;
-               currprefs.gfx_filter_scanlineratio = changed_prefs.gfx_filter_scanlineratio;
-               currprefs.gfx_filter_aspect = changed_prefs.gfx_filter_aspect;
-               currprefs.gfx_filter_luminance = changed_prefs.gfx_filter_luminance;
-               currprefs.gfx_filter_contrast = changed_prefs.gfx_filter_contrast;
-               currprefs.gfx_filter_saturation = changed_prefs.gfx_filter_saturation;
-               currprefs.gfx_filter_gamma = changed_prefs.gfx_filter_gamma;
-               currprefs.gfx_filter_autoscale = changed_prefs.gfx_filter_autoscale;
-               //currprefs.gfx_filter_ = changed_prefs.gfx_filter_;
 
                currprefs.rtg_horiz_zoom_mult = changed_prefs.rtg_horiz_zoom_mult;
                currprefs.rtg_vert_zoom_mult = changed_prefs.rtg_vert_zoom_mult;
@@ -1871,7 +1880,8 @@ int check_prefs_changed_gfx (void)
                currprefs.gfx_vresolution = changed_prefs.gfx_vresolution;
                currprefs.gfx_autoresolution_minh = changed_prefs.gfx_autoresolution_minh;
                currprefs.gfx_autoresolution_minv = changed_prefs.gfx_autoresolution_minv;
-               currprefs.gfx_scanlines = changed_prefs.gfx_scanlines;
+               currprefs.gfx_iscanlines = changed_prefs.gfx_iscanlines;
+               currprefs.gfx_pscanlines = changed_prefs.gfx_pscanlines;
                currprefs.monitoremu = changed_prefs.monitoremu;
 
                currprefs.gfx_lores_mode = changed_prefs.gfx_lores_mode;
@@ -1977,7 +1987,7 @@ int check_prefs_changed_gfx (void)
                return 1;
        }
 
-       if (currprefs.gfx_filter_autoscale != changed_prefs.gfx_filter_autoscale ||
+       if (currprefs.gf[0].gfx_filter_autoscale != changed_prefs.gf[0].gfx_filter_autoscale ||
                currprefs.gfx_xcenter_pos != changed_prefs.gfx_xcenter_pos ||
                currprefs.gfx_ycenter_pos != changed_prefs.gfx_ycenter_pos ||
                currprefs.gfx_xcenter_size != changed_prefs.gfx_xcenter_size ||
@@ -1991,7 +2001,7 @@ int check_prefs_changed_gfx (void)
                currprefs.gfx_ycenter_size = changed_prefs.gfx_ycenter_size;
                currprefs.gfx_xcenter = changed_prefs.gfx_xcenter;
                currprefs.gfx_ycenter = changed_prefs.gfx_ycenter;
-               currprefs.gfx_filter_autoscale = changed_prefs.gfx_filter_autoscale;
+               currprefs.gf[0].gfx_filter_autoscale = changed_prefs.gf[0].gfx_filter_autoscale;
 
                get_custom_limits (NULL, NULL, NULL, NULL, NULL);
                fixup_prefs_dimensions (&changed_prefs);
@@ -2500,10 +2510,10 @@ static void gfxmode_reset (void)
 {
 #ifdef GFXFILTER
        usedfilter = 0;
-       if (currprefs.gfx_filter > 0) {
+       if (currprefs.gf[picasso_on].gfx_filter > 0) {
                int i = 0;
                while (uaefilters[i].name) {
-                       if (uaefilters[i].type == currprefs.gfx_filter) {
+                       if (uaefilters[i].type == currprefs.gf[picasso_on].gfx_filter) {
                                usedfilter = &uaefilters[i];
                                break;
                        }
@@ -4176,7 +4186,7 @@ static BOOL doInit (void)
 
        if (!screen_is_picasso) {
 
-               if (currprefs.gfx_api == 0 && currprefs.gfx_filter == 0) {
+               if (currprefs.gfx_api == 0 && currprefs.gf[0].gfx_filter == 0) {
                        allocsoftbuffer (_T("draw"), &gfxvidinfo.drawbuffer, currentmode->flags,
                                currentmode->native_width, currentmode->native_height, currentmode->current_depth);
                } else {
@@ -4197,12 +4207,12 @@ static BOOL doInit (void)
        S2X_free ();
        oldtex_w = oldtex_h = -1;
        if (currentmode->flags & DM_D3D) {
-               const TCHAR *err = D3D_init (hAmigaWnd, currentmode->native_width, currentmode->native_height, currentmode->current_depth, &currentmode->freq, screen_is_picasso ? 1 : currprefs.gfx_filter_filtermode + 1);
+               const TCHAR *err = D3D_init (hAmigaWnd, currentmode->native_width, currentmode->native_height, currentmode->current_depth, &currentmode->freq, screen_is_picasso ? 1 : currprefs.gf[picasso_on].gfx_filter_filtermode + 1);
                if (err) {
                        D3D_free (true);
                        gui_message (err);
                        changed_prefs.gfx_api = currprefs.gfx_api = 0;
-                       changed_prefs.gfx_filter = currprefs.gfx_filter = 0;
+                       changed_prefs.gf[picasso_on].gfx_filter = currprefs.gf[picasso_on].gfx_filter = 0;
                        currentmode->current_depth = currentmode->native_depth;
                        gfxmode_reset ();
                        DirectDraw_Start ();
index a0aefa2aa98e9edc2cbb06097bda7fea43771d23..10a16b982261787adb6e944eb547d50ebfa4ca9b 100644 (file)
@@ -99,7 +99,7 @@
 
 #define ARCHIVE_STRING _T("*.zip;*.7z;*.rar;*.lha;*.lzh;*.lzx")
 
-#define DISK_FORMAT_STRING _T("(*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.exe)\0*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.exe;*.ima;*.wrp;*.dsq;*.st;") ARCHIVE_STRING _T("\0")
+#define DISK_FORMAT_STRING _T("(*.adf;*.adz;*.gz;*.dms;*.ipf;*.scp;*.fdi;*.exe)\0*.adf;*.adz;*.gz;*.dms;*.ipf;*.scp;*.fdi;*.exe;*.ima;*.wrp;*.dsq;*.st;*.raw;") ARCHIVE_STRING _T("\0")
 #define ROM_FORMAT_STRING _T("(*.rom;*.roz)\0*.rom;*.roz;") ARCHIVE_STRING _T("\0")
 #define USS_FORMAT_STRING_RESTORE _T("(*.uss)\0*.uss;*.gz;") ARCHIVE_STRING _T("\0")
 #define USS_FORMAT_STRING_SAVE _T("(*.uss)\0*.uss\0")
@@ -5955,6 +5955,8 @@ static void enable_for_displaydlg (HWND hDlg)
        ew (hDlg, IDC_LM_NORMAL, !workprefs.gfx_autoresolution);
        ew (hDlg, IDC_LM_DOUBLED, !workprefs.gfx_autoresolution);
        ew (hDlg, IDC_LM_SCANLINES, !workprefs.gfx_autoresolution);
+       ew (hDlg, IDC_LM_PDOUBLED2, !workprefs.gfx_autoresolution);
+       ew (hDlg, IDC_LM_PDOUBLED3, !workprefs.gfx_autoresolution);
 
        ew (hDlg, IDC_LM_INORMAL, !workprefs.gfx_autoresolution && !isdouble);
        ew (hDlg, IDC_LM_IDOUBLED, !workprefs.gfx_autoresolution && isdouble);
@@ -6355,8 +6357,8 @@ static void values_to_displaydlg (HWND hDlg)
        v = workprefs.cpu_cycle_exact ? 1 : workprefs.gfx_framerate;
        SendDlgItemMessage (hDlg, IDC_FRAMERATE, TBM_SETPOS, TRUE, (int)v);
 
-       CheckRadioButton (hDlg, IDC_LM_NORMAL, IDC_LM_SCANLINES, IDC_LM_NORMAL + (workprefs.gfx_vresolution ? 1 : 0) + ((workprefs.gfx_scanlines & 1) ? 1 : 0));
-       CheckRadioButton (hDlg, IDC_LM_INORMAL, IDC_LM_IDOUBLED3, IDC_LM_INORMAL + (workprefs.gfx_scanlines >= 2 ? workprefs.gfx_scanlines / 2 + 1: (workprefs.gfx_vresolution ? 1 : 0)));
+       CheckRadioButton (hDlg, IDC_LM_NORMAL, IDC_LM_PDOUBLED3, IDC_LM_NORMAL + (workprefs.gfx_vresolution ? 1 : 0) + workprefs.gfx_pscanlines);
+       CheckRadioButton (hDlg, IDC_LM_INORMAL, IDC_LM_IDOUBLED3, IDC_LM_INORMAL + (workprefs.gfx_iscanlines ? workprefs.gfx_iscanlines + 1 : (workprefs.gfx_vresolution ? 1 : 0)));
 
        SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_RESETCONTENT, 0, 0);
        SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE2, CB_RESETCONTENT, 0, 0);
@@ -6563,21 +6565,27 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
        workprefs.gfx_blackerthanblack = ischecked (hDlg, IDC_BLACKER_THAN_BLACK);
        
        int vres = workprefs.gfx_vresolution;
-       int vscan = workprefs.gfx_scanlines;
+       int viscan = workprefs.gfx_iscanlines;
+       int vpscan = workprefs.gfx_pscanlines;
        
-       workprefs.gfx_vresolution = (ischecked (hDlg, IDC_LM_DOUBLED) || ischecked (hDlg, IDC_LM_SCANLINES)) ? VRES_DOUBLE : VRES_NONDOUBLE;
-       workprefs.gfx_scanlines = 0;
+       workprefs.gfx_vresolution = (ischecked (hDlg, IDC_LM_DOUBLED) || ischecked (hDlg, IDC_LM_SCANLINES) || ischecked (hDlg, IDC_LM_PDOUBLED2) || ischecked (hDlg, IDC_LM_PDOUBLED3)) ? VRES_DOUBLE : VRES_NONDOUBLE;
+       workprefs.gfx_iscanlines = 0;
+       workprefs.gfx_pscanlines = 0;
        if (workprefs.gfx_vresolution >= VRES_DOUBLE) {
                if (ischecked (hDlg, IDC_LM_IDOUBLED2))
-                       workprefs.gfx_scanlines = 2;
+                       workprefs.gfx_iscanlines = 1;
                if (ischecked (hDlg, IDC_LM_IDOUBLED3))
-                       workprefs.gfx_scanlines = 4;
+                       workprefs.gfx_iscanlines = 2;
+               if (ischecked (hDlg, IDC_LM_SCANLINES))
+                       workprefs.gfx_pscanlines = 1;
+               if (ischecked (hDlg, IDC_LM_PDOUBLED2))
+                       workprefs.gfx_pscanlines = 2;
+               if (ischecked (hDlg, IDC_LM_PDOUBLED3))
+                       workprefs.gfx_pscanlines = 3;
        }
-       workprefs.gfx_scanlines |= ischecked (hDlg, IDC_LM_SCANLINES) ? 1 : 0;
-
-       if (vres != workprefs.gfx_vresolution || vscan != workprefs.gfx_scanlines) {
-               CheckRadioButton (hDlg, IDC_LM_NORMAL, IDC_LM_SCANLINES, IDC_LM_NORMAL + (workprefs.gfx_vresolution ? 1 : 0) + ((workprefs.gfx_scanlines & 1) ? 1 : 0));
-               CheckRadioButton (hDlg, IDC_LM_INORMAL, IDC_LM_IDOUBLED3, IDC_LM_INORMAL + (workprefs.gfx_scanlines >= 2 ? workprefs.gfx_scanlines / 2 + 1: (workprefs.gfx_vresolution ? 1 : 0)));
+       if (vres != workprefs.gfx_vresolution || viscan != workprefs.gfx_iscanlines || vpscan != workprefs.gfx_pscanlines) {
+               CheckRadioButton (hDlg, IDC_LM_NORMAL, IDC_LM_PDOUBLED3, IDC_LM_NORMAL + (workprefs.gfx_vresolution ? 1 : 0) + workprefs.gfx_pscanlines);
+               CheckRadioButton (hDlg, IDC_LM_INORMAL, IDC_LM_IDOUBLED3, IDC_LM_INORMAL + (workprefs.gfx_iscanlines ? workprefs.gfx_iscanlines + 1: (workprefs.gfx_vresolution ? 1 : 0)));
        }
 
        workprefs.gfx_apmode[0].gfx_backbuffers = SendDlgItemMessage (hDlg, IDC_DISPLAY_BUFFERCNT, CB_GETCURSEL, 0, 0);
@@ -11892,6 +11900,7 @@ static void enable_for_gameportsdlg (HWND hDlg)
 {
        int v = full_property_sheet;
        ew (hDlg, IDC_PORT_TABLET_FULL, v && is_tablet () && workprefs.input_tablet > 0);
+       //ew (hDlg, IDC_PORT_TABLET_LIBRARY, v && is_tablet () && workprefs.input_tablet > 0);
        ew (hDlg, IDC_PORT_TABLET_CURSOR, v && workprefs.input_tablet > 0);
        ew (hDlg, IDC_PORT_TABLET, v);
 }
@@ -11954,6 +11963,7 @@ static void updatejoyport (HWND hDlg, int changedport)
        SendDlgItemMessage (hDlg, IDC_PORT_TABLET_CURSOR, CB_SETCURSEL, workprefs.input_magic_mouse_cursor, 0);
        CheckDlgButton (hDlg, IDC_PORT_TABLET, workprefs.input_tablet > 0);
        CheckDlgButton (hDlg, IDC_PORT_TABLET_FULL, workprefs.input_tablet == TABLET_REAL);
+       CheckDlgButton (hDlg, IDC_PORT_TABLET_LIBRARY, workprefs.tablet_library);
 
        if (joyxprevious[0] < 0)
                joyxprevious[0] = inputdevice_get_device_total (IDTYPE_JOYSTICK) + 1;
@@ -12032,6 +12042,7 @@ static void values_from_gameportsdlg (HWND hDlg, int d, int changedport)
                        if (ischecked (hDlg, IDC_PORT_TABLET_FULL))
                                workprefs.input_tablet = TABLET_REAL;
                }
+               workprefs.tablet_library = ischecked (hDlg, IDC_PORT_TABLET_LIBRARY);
                return;
        }
 
@@ -14118,10 +14129,11 @@ static INT_PTR CALLBACK InputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
 static int scanlineratios[] = { 1,1,1,2,1,3, 2,1,2,2,2,3, 3,1,3,2,3,3, 0,0 };
 static int scanlineindexes[100];
 static int filterpreset_selected = -1, filterpreset_builtin = -1;
+static int filter_nativertg;
 
 static void enable_for_hw3ddlg (HWND hDlg)
 {
-       int v = workprefs.gfx_filter ? TRUE : FALSE;
+       int v = workprefs.gf[filter_nativertg].gfx_filter ? TRUE : FALSE;
        int vv = FALSE, vv2 = FALSE, vv3 = FALSE;
        int as = FALSE;
        struct uae_filter *uf;
@@ -14131,7 +14143,7 @@ static void enable_for_hw3ddlg (HWND hDlg)
        uf = &uaefilters[0];
        i = 0;
        while (uaefilters[i].name) {
-               if (workprefs.gfx_filter == uaefilters[i].type) {
+               if (workprefs.gf[filter_nativertg].gfx_filter == uaefilters[i].type) {
                        uf = &uaefilters[i];
                        isfilter = 1;
                        break;
@@ -14145,6 +14157,9 @@ static void enable_for_hw3ddlg (HWND hDlg)
        if (workprefs.gfx_api)
                v = vv = vv2 = vv3 = TRUE;
 
+       if (filter_nativertg)
+               v = FALSE;
+
        ew (hDlg, IDC_FILTERHZ, v);
        ew (hDlg, IDC_FILTERVZ, v);
        ew (hDlg, IDC_FILTERHZMULT, v && !as);
@@ -14155,13 +14170,12 @@ static void enable_for_hw3ddlg (HWND hDlg)
        ew (hDlg, IDC_FILTERXL, vv2);
        ew (hDlg, IDC_FILTERXLV, vv2);
        ew (hDlg, IDC_FILTERXTRA, vv2);
-       ew (hDlg, IDC_FILTERDEFAULT, v);
        ew (hDlg, IDC_FILTERFILTER, workprefs.gfx_api);
        ew (hDlg, IDC_FILTERSTACK, workprefs.gfx_api);
        ew (hDlg, IDC_FILTERKEEPASPECT, v);
        ew (hDlg, IDC_FILTERASPECT, v);
-       ew (hDlg, IDC_FILTERASPECT2, v && workprefs.gfx_filter_keep_aspect);
-       ew (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT, (workprefs.gfx_filter_autoscale == AUTOSCALE_NORMAL || workprefs.gfx_filter_autoscale == AUTOSCALE_INTEGER_AUTOSCALE));
+       ew (hDlg, IDC_FILTERASPECT2, v && workprefs.gf[filter_nativertg].gfx_filter_keep_aspect);
+       ew (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT, (workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_NORMAL || workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_INTEGER_AUTOSCALE));
        ew (hDlg, IDC_FILTEROVERLAY, workprefs.gfx_api);
        ew (hDlg, IDC_FILTEROVERLAYTYPE, workprefs.gfx_api);
 
@@ -14175,8 +14189,8 @@ static TCHAR *filtermultnames[] = {
 };
 static float filtermults[] = { 0, 0.25f, 0.5f, 1.0f, 1.5f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 6.0f, 8.0f };
 struct filterxtra {
-       TCHAR *label;
-       int *varw, *varc;
+       const TCHAR *label;
+       int *varw[2], *varc[2];
        int min, max, step;
 };
 static struct filterxtra *filter_extra[4], *filter_selected;
@@ -14184,20 +14198,20 @@ static int filter_selected_num;
 
 static struct filterxtra filter_pal_extra[] =
 {
-       _T("Brightness"), &workprefs.gfx_filter_luminance, &currprefs.gfx_filter_luminance, -1000, 1000, 10,
-       _T("Contrast"), &workprefs.gfx_filter_contrast, &currprefs.gfx_filter_contrast, -1000, 1000, 10,
-       _T("Saturation"), &workprefs.gfx_filter_saturation, &currprefs.gfx_filter_saturation, -1000, 1000, 10,
-       _T("Gamma"), &workprefs.gfx_gamma, &currprefs.gfx_gamma, -1000, 1000, 10,
-       _T("Scanlines"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 1,
-       _T("Blurriness"), &workprefs.gfx_filter_blur, &currprefs.gfx_filter_blur,0, 2000, 10,
-       _T("Noise"), &workprefs.gfx_filter_noise, &currprefs.gfx_filter_noise,0, 100, 10,
+       _T("Brightness"), &workprefs.gf[0].gfx_filter_luminance, NULL, &currprefs.gf[0].gfx_filter_luminance, NULL, -1000, 1000, 10,
+       _T("Contrast"), &workprefs.gf[0].gfx_filter_contrast, NULL, &currprefs.gf[0].gfx_filter_contrast, NULL, -1000, 1000, 10,
+       _T("Saturation"), &workprefs.gf[0].gfx_filter_saturation, NULL, &currprefs.gf[0].gfx_filter_saturation, NULL, -1000, 1000, 10,
+       _T("Gamma"), &workprefs.gfx_gamma, NULL, &currprefs.gfx_gamma, NULL, -1000, 1000, 10,
+       _T("Scanlines"), &workprefs.gf[0].gfx_filter_scanlines, NULL, &currprefs.gf[0].gfx_filter_scanlines, NULL, 0, 100, 1,
+       _T("Blurriness"), &workprefs.gf[0].gfx_filter_blur, NULL, &currprefs.gf[0].gfx_filter_blur, NULL, 0, 2000, 10,
+       _T("Noise"), &workprefs.gf[0].gfx_filter_noise, NULL, &currprefs.gf[0].gfx_filter_noise, NULL, 0, 100, 10,
        NULL
 };
 static struct filterxtra filter_3d_extra[] =
 {
-       _T("Point/Bilinear"), &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1,
-       _T("Scanline opacity"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
-       _T("Scanline level"), &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10,
+       _T("Point/Bilinear"), &workprefs.gf[0].gfx_filter_bilinear, &workprefs.gf[1].gfx_filter_bilinear, &currprefs.gf[0].gfx_filter_bilinear, &currprefs.gf[1].gfx_filter_bilinear, 0, 1, 1,
+       _T("Scanline opacity"), &workprefs.gf[0].gfx_filter_scanlines, &workprefs.gf[1].gfx_filter_scanlines, &currprefs.gf[0].gfx_filter_scanlines, &currprefs.gf[1].gfx_filter_scanlines, 0, 100, 10,
+       _T("Scanline level"), &workprefs.gf[0].gfx_filter_scanlinelevel, &workprefs.gf[1].gfx_filter_scanlinelevel, &currprefs.gf[0].gfx_filter_scanlinelevel, &currprefs.gf[1].gfx_filter_scanlinelevel, 0, 100, 10,
        NULL
 };
 static int dummy_in, dummy_out;
@@ -14216,31 +14230,31 @@ static int filtertypes[] = {
        -1
 };     
 static void *filtervars[] = {
-       &workprefs.gfx_filter, &workprefs.gfx_filter_filtermode,
-       &workprefs.gfx_filter_vert_zoom, &workprefs.gfx_filter_horiz_zoom,
-       &workprefs.gfx_filter_vert_zoom_mult, &workprefs.gfx_filter_horiz_zoom_mult,
-       &workprefs.gfx_filter_vert_offset, &workprefs.gfx_filter_horiz_offset,
-       &workprefs.gfx_filter_scanlines, &workprefs.gfx_filter_scanlinelevel, &workprefs.gfx_filter_scanlineratio,
-       &workprefs.gfx_resolution, &workprefs.gfx_vresolution, &workprefs.gfx_scanlines,
+       &workprefs.gf[0].gfx_filter, &workprefs.gf[0].gfx_filter_filtermode,
+       &workprefs.gf[0].gfx_filter_vert_zoom, &workprefs.gf[0].gfx_filter_horiz_zoom,
+       &workprefs.gf[0].gfx_filter_vert_zoom_mult, &workprefs.gf[0].gfx_filter_horiz_zoom_mult,
+       &workprefs.gf[0].gfx_filter_vert_offset, &workprefs.gf[0].gfx_filter_horiz_offset,
+       &workprefs.gf[0].gfx_filter_scanlines, &workprefs.gf[0].gfx_filter_scanlinelevel, &workprefs.gf[0].gfx_filter_scanlineratio,
+       &workprefs.gfx_resolution, &workprefs.gfx_vresolution, &workprefs.gfx_iscanlines,
        &workprefs.gfx_xcenter, &workprefs.gfx_ycenter,
-       &workprefs.gfx_filter_luminance, &workprefs.gfx_filter_contrast, &workprefs.gfx_filter_saturation,
-       &workprefs.gfx_filter_gamma, &workprefs.gfx_filter_blur, &workprefs.gfx_filter_noise,
-       &workprefs.gfx_filter_keep_aspect, &workprefs.gfx_filter_aspect,
-       &workprefs.gfx_filter_autoscale, &workprefs.gfx_filter_bilinear,
+       &workprefs.gf[0].gfx_filter_luminance, &workprefs.gf[0].gfx_filter_contrast, &workprefs.gf[0].gfx_filter_saturation,
+       &workprefs.gf[0].gfx_filter_gamma, &workprefs.gf[0].gfx_filter_blur, &workprefs.gf[0].gfx_filter_noise,
+       &workprefs.gf[0].gfx_filter_keep_aspect, &workprefs.gf[0].gfx_filter_aspect,
+       &workprefs.gf[0].gfx_filter_autoscale, &workprefs.gf[0].gfx_filter_bilinear,
        NULL
 };
 static void *filtervars2[] = {
-       NULL, &currprefs.gfx_filter_filtermode,
-       &currprefs.gfx_filter_vert_zoom, &currprefs.gfx_filter_horiz_zoom,
-       &currprefs.gfx_filter_vert_zoom_mult, &currprefs.gfx_filter_horiz_zoom_mult,
-       &currprefs.gfx_filter_vert_offset, &currprefs.gfx_filter_horiz_offset,
-       &currprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlineratio,
-       &currprefs.gfx_resolution, &currprefs.gfx_vresolution, &currprefs.gfx_scanlines,
+       NULL, &currprefs.gf[0].gfx_filter_filtermode,
+       &currprefs.gf[0].gfx_filter_vert_zoom, &currprefs.gf[0].gfx_filter_horiz_zoom,
+       &currprefs.gf[0].gfx_filter_vert_zoom_mult, &currprefs.gf[0].gfx_filter_horiz_zoom_mult,
+       &currprefs.gf[0].gfx_filter_vert_offset, &currprefs.gf[0].gfx_filter_horiz_offset,
+       &currprefs.gf[0].gfx_filter_scanlines, &currprefs.gf[0].gfx_filter_scanlinelevel, &currprefs.gf[0].gfx_filter_scanlineratio,
+       &currprefs.gfx_resolution, &currprefs.gfx_vresolution, &currprefs.gfx_iscanlines,
        &currprefs.gfx_xcenter, &currprefs.gfx_ycenter,
-       &currprefs.gfx_filter_luminance, &currprefs.gfx_filter_contrast, &currprefs.gfx_filter_saturation,
-       &currprefs.gfx_filter_gamma, &currprefs.gfx_filter_blur, &currprefs.gfx_filter_noise,
-       &currprefs.gfx_filter_keep_aspect, &currprefs.gfx_filter_aspect,
-       &currprefs.gfx_filter_autoscale, &currprefs.gfx_filter_bilinear,
+       &currprefs.gf[0].gfx_filter_luminance, &currprefs.gf[0].gfx_filter_contrast, &currprefs.gf[0].gfx_filter_saturation,
+       &currprefs.gf[0].gfx_filter_gamma, &currprefs.gf[0].gfx_filter_blur, &currprefs.gf[0].gfx_filter_noise,
+       &currprefs.gf[0].gfx_filter_keep_aspect, &currprefs.gf[0].gfx_filter_aspect,
+       &currprefs.gf[0].gfx_filter_autoscale, &currprefs.gf[0].gfx_filter_bilinear,
        NULL
 };
 
@@ -14298,8 +14312,8 @@ static void setfiltermult2 (HWND hDlg, int id, float val)
 
 static void setfiltermult (HWND hDlg)
 {
-       setfiltermult2 (hDlg, IDC_FILTERHZMULT, workprefs.gfx_filter_horiz_zoom_mult);
-       setfiltermult2 (hDlg, IDC_FILTERVZMULT, workprefs.gfx_filter_vert_zoom_mult);
+       setfiltermult2 (hDlg, IDC_FILTERHZMULT, workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom_mult);
+       setfiltermult2 (hDlg, IDC_FILTERVZMULT, workprefs.gf[filter_nativertg].gfx_filter_vert_zoom_mult);
 }
 
 static void values_to_hw3ddlg (HWND hDlg)
@@ -14311,15 +14325,15 @@ static void values_to_hw3ddlg (HWND hDlg)
        UAEREG *fkey;
 
        SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_SETCURSEL,
-               (workprefs.gfx_filter_aspect == 0) ? 0 :
-               (workprefs.gfx_filter_aspect < 0) ? 1 :
-               getaspectratioindex (workprefs.gfx_filter_aspect) + 2, 0);
+               (workprefs.gf[filter_nativertg].gfx_filter_aspect == 0) ? 0 :
+               (workprefs.gf[filter_nativertg].gfx_filter_aspect < 0) ? 1 :
+               getaspectratioindex (workprefs.gf[filter_nativertg].gfx_filter_aspect) + 2, 0);
 
-       CheckDlgButton (hDlg, IDC_FILTERKEEPASPECT, workprefs.gfx_filter_keep_aspect);
-       CheckDlgButton (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT, workprefs.gfx_filter_keep_autoscale_aspect != 0);
+       CheckDlgButton (hDlg, IDC_FILTERKEEPASPECT, workprefs.gf[filter_nativertg].gfx_filter_keep_aspect);
+       CheckDlgButton (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT, workprefs.gf[filter_nativertg].gfx_filter_keep_autoscale_aspect != 0);
 
        SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_SETCURSEL,
-               workprefs.gfx_filter_keep_aspect, 0);
+               workprefs.gf[filter_nativertg].gfx_filter_keep_aspect, 0);
 
        SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_RESETCONTENT, 0, 0L);
        WIN32GUI_LoadUIString (IDS_AUTOSCALE_DISABLED, txt, sizeof (txt) / sizeof (TCHAR));
@@ -14342,16 +14356,16 @@ static void values_to_hw3ddlg (HWND hDlg)
        SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt);
        WIN32GUI_LoadUIString (IDS_AUTOSCALE_INTEGER_AUTOSCALE, txt, sizeof (txt) / sizeof (TCHAR));
        SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt);
-       SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_SETCURSEL, workprefs.gfx_filter_autoscale, 0);
+       SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_SETCURSEL, workprefs.gf[filter_nativertg].gfx_filter_autoscale, 0);
 
        SendDlgItemMessage (hDlg, IDC_FILTERSTACK, CB_RESETCONTENT, 0, 0);
        for (i = -MAX_FILTERSHADERS; i < MAX_FILTERSHADERS; i++) {
                j = i < 0 ? i : i + 1;
                if (i == 0) {
-                       _stprintf (tmp, _T("%d%s"), 0, workprefs.gfx_filtershader[2 * MAX_FILTERSHADERS][0] ? _T(" *") : _T(""));
+                       _stprintf (tmp, _T("%d%s"), 0, workprefs.gf[filter_nativertg].gfx_filtershader[2 * MAX_FILTERSHADERS][0] ? _T(" *") : _T(""));
                        SendDlgItemMessage (hDlg, IDC_FILTERSTACK, CB_ADDSTRING, 0, (LPARAM)tmp);
                }
-               _stprintf (tmp, _T("%d%s"), j, workprefs.gfx_filtershader[i + 4][0] ? _T(" *") : _T(""));
+               _stprintf (tmp, _T("%d%s"), j, workprefs.gf[filter_nativertg].gfx_filtershader[i + 4][0] ? _T(" *") : _T(""));
                SendDlgItemMessage (hDlg, IDC_FILTERSTACK, CB_ADDSTRING, 0, (LPARAM)tmp);
        }
 
@@ -14362,8 +14376,8 @@ static void values_to_hw3ddlg (HWND hDlg)
                i++;
        SendDlgItemMessage (hDlg, IDC_FILTERSTACK, CB_SETCURSEL, i, 0);
 
-       int range1 = workprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL ? -1 : -9999;
-       int range2 = workprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL ? 1800 : 9999;
+       int range1 = workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_MANUAL ? -1 : -9999;
+       int range2 = workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_MANUAL ? 1800 : 9999;
 
        SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETRANGE, TRUE, MAKELONG (range1, range2));
        SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPAGESIZE, 0, 1);
@@ -14375,6 +14389,9 @@ static void values_to_hw3ddlg (HWND hDlg)
        SendDlgItemMessage (hDlg, IDC_FILTERVO, TBM_SETPAGESIZE, 0, 1);
 
        SendDlgItemMessage (hDlg, IDC_FILTEROVERLAY, CB_RESETCONTENT, 0, 0L);
+
+       SendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_SETCURSEL, filter_nativertg, 0);
+
        SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_RESETCONTENT, 0, 0L);
        WIN32GUI_LoadUIString (IDS_NONE, tmp, MAX_DPATH);
        SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
@@ -14382,8 +14399,12 @@ static void values_to_hw3ddlg (HWND hDlg)
        fltnum = 0;
        i = 0; j = 1;
        while (uaefilters[i].name) {
+               if (filter_nativertg && uaefilters[i].type > 1) {
+                       i++;
+                       continue;
+               }
                SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)uaefilters[i].name);
-               if (uaefilters[i].type == workprefs.gfx_filter) {
+               if (uaefilters[i].type == workprefs.gf[filter_nativertg].gfx_filter) {
                        uf = &uaefilters[i];
                        fltnum = j;
                }
@@ -14404,7 +14425,7 @@ static void values_to_hw3ddlg (HWND hDlg)
                                _stprintf (tmp2, _T("D3D: %s"), wfd.cFileName);
                                tmp2[_tcslen (tmp2) - 3] = 0;
                                SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp2);
-                               if (workprefs.gfx_api && !_tcscmp (workprefs.gfx_filtershader[filterstackpos], wfd.cFileName)) {
+                               if (workprefs.gfx_api && !_tcscmp (workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos], wfd.cFileName)) {
                                        fltnum = j;
                                        gotit = true;
                                }
@@ -14416,7 +14437,7 @@ static void values_to_hw3ddlg (HWND hDlg)
                        }
                }
                for (int i = 1; i < 2 * MAX_FILTERSHADERS; i++) {
-                       if (workprefs.gfx_filtershader[i][0] && !gotit)
+                       if (workprefs.gf[filter_nativertg].gfx_filtershader[i][0] && !gotit)
                                fltnum = UAE_FILTER_NULL;
                }
        }
@@ -14439,7 +14460,7 @@ static void values_to_hw3ddlg (HWND hDlg)
                                !_tcsicmp (ext, _T(".bmp"))))
                        {
                                SendDlgItemMessage (hDlg, IDC_FILTEROVERLAY, CB_ADDSTRING, 0, (LPARAM)wfd.cFileName);
-                               if (!_tcsicmp (wfd.cFileName, overlaytype == 0 ? workprefs.gfx_filteroverlay : workprefs.gfx_filtermask[filterstackpos]))
+                               if (!_tcsicmp (wfd.cFileName, overlaytype == 0 ? workprefs.gf[filter_nativertg].gfx_filteroverlay : workprefs.gf[filter_nativertg].gfx_filtermask[filterstackpos]))
                                        SendDlgItemMessage (hDlg, IDC_FILTEROVERLAY, CB_SETCURSEL, j, 0);
                                j++;
 
@@ -14508,12 +14529,14 @@ static void values_to_hw3ddlg (HWND hDlg)
                SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_SETCURSEL, filter_selected_num, 0);
                SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETRANGE, TRUE, MAKELONG (filter_selected->min, filter_selected->max));
                SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPAGESIZE, 0, filter_selected->step);
-               SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPOS, TRUE, *(filter_selected->varw));
-               SetDlgItemInt (hDlg, IDC_FILTERXLV, *(filter_selected->varw), TRUE);
+               if (filter_selected->varw[filter_nativertg]) {
+                       SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPOS, TRUE, *(filter_selected->varw[filter_nativertg]));
+                       SetDlgItemInt (hDlg, IDC_FILTERXLV, *(filter_selected->varw[filter_nativertg]), TRUE);
+               }
        }
-       if (workprefs.gfx_filter_filtermode >= filtermodenum)
-               workprefs.gfx_filter_filtermode = 0;
-       SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_SETCURSEL, workprefs.gfx_filter_filtermode, 0);
+       if (workprefs.gf[filter_nativertg].gfx_filter_filtermode >= filtermodenum)
+               workprefs.gf[filter_nativertg].gfx_filter_filtermode = 0;
+       SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_SETCURSEL, workprefs.gf[filter_nativertg].gfx_filter_filtermode, 0);
        setfiltermult (hDlg);
 
        SendDlgItemMessage (hDlg, IDC_FILTERSLR, CB_RESETCONTENT, 0, 0L);
@@ -14521,7 +14544,7 @@ static void values_to_hw3ddlg (HWND hDlg)
        while (scanlineratios[i * 2]) {
                int sl = scanlineratios[i * 2] * 16 + scanlineratios[i * 2 + 1];
                _stprintf (txt, _T("%d:%d"), scanlineratios[i * 2], scanlineratios[i * 2 + 1]);
-               if (workprefs.gfx_filter_scanlineratio == sl)
+               if (workprefs.gf[filter_nativertg].gfx_filter_scanlineratio == sl)
                        j = i;
                SendDlgItemMessage (hDlg, IDC_FILTERSLR, CB_ADDSTRING, 0, (LPARAM)txt);
                scanlineindexes[i] = sl;
@@ -14556,16 +14579,16 @@ static void values_to_hw3ddlg (HWND hDlg)
        SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_SETCURSEL, filterpreset_selected, 0);
 
        float ho, vo, hz, vz;
-       if (workprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL) {
+       if (workprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_MANUAL) {
                hz = workprefs.gfx_xcenter_size;
                vz = workprefs.gfx_ycenter_size;
                ho = workprefs.gfx_xcenter_pos;
                vo = workprefs.gfx_ycenter_pos;
        } else {
-               hz = workprefs.gfx_filter_horiz_zoom;
-               vz = workprefs.gfx_filter_vert_zoom;
-               ho = workprefs.gfx_filter_horiz_offset;
-               vo = workprefs.gfx_filter_vert_offset;
+               hz = workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom;
+               vz = workprefs.gf[filter_nativertg].gfx_filter_vert_zoom;
+               ho = workprefs.gf[filter_nativertg].gfx_filter_horiz_offset;
+               vo = workprefs.gf[filter_nativertg].gfx_filter_vert_offset;
        }
 
        SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, (int)hz);
@@ -14697,41 +14720,41 @@ static void filter_handle (HWND hDlg)
        LRESULT item = SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_GETCURSEL, 0, 0L);
        if (item != CB_ERR) {
                TCHAR tmp[MAX_DPATH], oldsh[MAX_DPATH];
-               int of = workprefs.gfx_filter;
-               int off = workprefs.gfx_filter_filtermode;
+               int of = workprefs.gf[filter_nativertg].gfx_filter;
+               int off = workprefs.gf[filter_nativertg].gfx_filter_filtermode;
                tmp[0] = 0;
-               _tcscpy (oldsh, workprefs.gfx_filtershader[filterstackpos]);
+               _tcscpy (oldsh, workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos]);
                SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_GETLBTEXT, (WPARAM)item, (LPARAM)tmp);
-               workprefs.gfx_filtershader[filterstackpos][0] = 0;
-               workprefs.gfx_filter = 0;
-               workprefs.gfx_filter_filtermode = 0;
+               workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos][0] = 0;
+               workprefs.gf[filter_nativertg].gfx_filter = 0;
+               workprefs.gf[filter_nativertg].gfx_filter_filtermode = 0;
                if (workprefs.gfx_api) {
                        LRESULT item2 = SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_GETCURSEL, 0, 0L);
                        if (item2 != CB_ERR)
-                               workprefs.gfx_filter_filtermode = (int)item2;
+                               workprefs.gf[filter_nativertg].gfx_filter_filtermode = (int)item2;
                }
                if (item > 0) {
                        if (item > UAE_FILTER_LAST) {
-                               _stprintf (workprefs.gfx_filtershader[filterstackpos], _T("%s.fx"), tmp + 5);
+                               _stprintf (workprefs.gf[filter_nativertg].gfx_filtershader[filterstackpos], _T("%s.fx"), tmp + 5);
                        } else {
                                item--;
-                               workprefs.gfx_filter = uaefilters[item].type;
+                               workprefs.gf[filter_nativertg].gfx_filter = uaefilters[item].type;
                        }
-                       if (of != workprefs.gfx_filter || off != workprefs.gfx_filter_filtermode) {
+                       if (of != workprefs.gf[filter_nativertg].gfx_filter || off != workprefs.gf[filter_nativertg].gfx_filter_filtermode) {
                                values_to_hw3ddlg (hDlg);
                                hw3d_changed = 1;
                        }
                }
                for (int i = 1; i < MAX_FILTERSHADERS; i++) {
-                       if (workprefs.gfx_filtershader[i][0])
-                               workprefs.gfx_filter = UAE_FILTER_NULL;
+                       if (workprefs.gf[filter_nativertg].gfx_filtershader[i][0])
+                               workprefs.gf[filter_nativertg].gfx_filter = UAE_FILTER_NULL;
                }
-               if (workprefs.gfx_filter == 0 && !workprefs.gfx_api)
-                       workprefs.gfx_filter_autoscale = 0;
+               if (workprefs.gf[filter_nativertg].gfx_filter == 0 && !workprefs.gfx_api)
+                       workprefs.gf[filter_nativertg].gfx_filter_autoscale = 0;
        }
 
        int overlaytype = SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_GETCURSEL, 0, 0L);
-       TCHAR *filterptr = overlaytype == 0 ? workprefs.gfx_filteroverlay : workprefs.gfx_filtermask[filterstackpos];
+       TCHAR *filterptr = overlaytype == 0 ? workprefs.gf[filter_nativertg].gfx_filteroverlay : workprefs.gf[filter_nativertg].gfx_filtermask[filterstackpos];
        item = SendDlgItemMessage (hDlg, IDC_FILTEROVERLAY, CB_GETCURSEL, 0, 0L);
        if (item != CB_ERR) {
                TCHAR tmp[MAX_DPATH];
@@ -14775,6 +14798,10 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)_T("VGA"));
                SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)_T("TV"));
 
+               SendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_RESETCONTENT, 0, 0L);
+               SendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_ADDSTRING, 0, (LPARAM)_T("Native"));
+               SendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_ADDSTRING, 0, (LPARAM)_T("RTG"));
+
                SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_RESETCONTENT, 0, 0L);
                SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_RESETCONTENT, 0, 0L);
                for (i = 0; filtermultnames[i]; i++) {
@@ -14788,7 +14815,7 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                WIN32GUI_LoadUIString (IDS_FILTEROVERLAYTYPE_MASKS, tmp, sizeof tmp / sizeof (TCHAR));
                SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)tmp);
                if (filteroverlaypos < 0) {
-                       if (!workprefs.gfx_filteroverlay[0])
+                       if (!workprefs.gf[filter_nativertg].gfx_filteroverlay[0])
                                filteroverlaypos = 1;
                        else
                                filteroverlaypos = 0;
@@ -14812,12 +14839,12 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                switch (wParam)
                {
                case IDC_FILTERDEFAULT:
-                       currprefs.gfx_filter_horiz_zoom = workprefs.gfx_filter_horiz_zoom = 0;
-                       currprefs.gfx_filter_vert_zoom = workprefs.gfx_filter_vert_zoom = 0;
-                       currprefs.gfx_filter_horiz_offset = workprefs.gfx_filter_horiz_offset = 0;
-                       currprefs.gfx_filter_vert_offset = workprefs.gfx_filter_vert_offset = 0;
-                       currprefs.gfx_filter_horiz_zoom_mult = workprefs.gfx_filter_horiz_zoom_mult = 1.0;
-                       currprefs.gfx_filter_vert_zoom_mult = workprefs.gfx_filter_vert_zoom_mult = 1.0;
+                       currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom = workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom = 0;
+                       currprefs.gf[filter_nativertg].gfx_filter_vert_zoom = workprefs.gf[filter_nativertg].gfx_filter_vert_zoom = 0;
+                       currprefs.gf[filter_nativertg].gfx_filter_horiz_offset = workprefs.gf[filter_nativertg].gfx_filter_horiz_offset = 0;
+                       currprefs.gf[filter_nativertg].gfx_filter_vert_offset = workprefs.gf[filter_nativertg].gfx_filter_vert_offset = 0;
+                       currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom_mult = workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom_mult = 1.0;
+                       currprefs.gf[filter_nativertg].gfx_filter_vert_zoom_mult = workprefs.gf[filter_nativertg].gfx_filter_vert_zoom_mult = 1.0;
                        values_to_hw3ddlg (hDlg);
                        updatedisplayarea ();
                        break;
@@ -14831,16 +14858,16 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                case IDC_FILTERKEEPASPECT:
                        {
                                if (ischecked (hDlg, IDC_FILTERKEEPASPECT))
-                                       currprefs.gfx_filter_keep_aspect = workprefs.gfx_filter_keep_aspect = 1;
+                                       currprefs.gf[filter_nativertg].gfx_filter_keep_aspect = workprefs.gf[filter_nativertg].gfx_filter_keep_aspect = 1;
                                else
-                                       currprefs.gfx_filter_keep_aspect = workprefs.gfx_filter_keep_aspect = 0;
+                                       currprefs.gf[filter_nativertg].gfx_filter_keep_aspect = workprefs.gf[filter_nativertg].gfx_filter_keep_aspect = 0;
                                enable_for_hw3ddlg (hDlg);
                                values_to_hw3ddlg (hDlg);
                                updatedisplayarea ();
                        }
                case IDC_FILTERKEEPAUTOSCALEASPECT:
                        {
-                               workprefs.gfx_filter_keep_autoscale_aspect = currprefs.gfx_filter_keep_autoscale_aspect = ischecked (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT) ? 1 : 0;
+                               workprefs.gf[filter_nativertg].gfx_filter_keep_autoscale_aspect = currprefs.gf[filter_nativertg].gfx_filter_keep_autoscale_aspect = ischecked (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT) ? 1 : 0;
                                enable_for_hw3ddlg (hDlg);
                                values_to_hw3ddlg (hDlg);
                                updatedisplayarea ();
@@ -14850,6 +14877,14 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                        if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS)  {
                                switch (LOWORD (wParam))
                                {
+                               case IDC_FILTER_NATIVERTG:
+                                       item = SendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_GETCURSEL, 0, 0L);
+                                       if (item != CB_ERR) {
+                                               filter_nativertg = item;
+                                               values_to_hw3ddlg (hDlg);
+                                               enable_for_hw3ddlg (hDlg);
+                                       }
+                                       break;
                                case IDC_FILTERSTACK:
                                        item = SendDlgItemMessage (hDlg, IDC_FILTERSTACK, CB_GETCURSEL, 0, 0L);
                                        if (item != CB_ERR) {
@@ -14866,9 +14901,9 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                case IDC_FILTERAUTOSCALE:
                                        item = SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_GETCURSEL, 0, 0L);
                                        if (item != CB_ERR) {
-                                               workprefs.gfx_filter_autoscale = item;
-                                               if (workprefs.gfx_filter_autoscale && workprefs.gfx_filter == 0 && !workprefs.gfx_api)
-                                                       workprefs.gfx_filter = 1; // NULL
+                                               workprefs.gf[filter_nativertg].gfx_filter_autoscale = item;
+                                               if (workprefs.gf[filter_nativertg].gfx_filter_autoscale && workprefs.gf[filter_nativertg].gfx_filter == 0 && !workprefs.gfx_api)
+                                                       workprefs.gf[filter_nativertg].gfx_filter = 1; // NULL
                                                values_to_hw3ddlg (hDlg);
                                                enable_for_hw3ddlg (hDlg);
                                        }
@@ -14882,7 +14917,7 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                case IDC_FILTERSLR:
                                        item = SendDlgItemMessage (hDlg, IDC_FILTERSLR, CB_GETCURSEL, 0, 0L);
                                        if (item != CB_ERR) {
-                                               currprefs.gfx_filter_scanlineratio = workprefs.gfx_filter_scanlineratio = scanlineindexes[item];
+                                               currprefs.gf[filter_nativertg].gfx_filter_scanlineratio = workprefs.gf[filter_nativertg].gfx_filter_scanlineratio = scanlineindexes[item];
                                                updatedisplayarea ();
                                        }
                                        break;
@@ -14900,11 +14935,11 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                        values_to_hw3ddlg (hDlg);
                                        break;
                                case IDC_FILTERHZMULT:
-                                       currprefs.gfx_filter_horiz_zoom_mult = workprefs.gfx_filter_horiz_zoom_mult = getfiltermult (hDlg, IDC_FILTERHZMULT);
+                                       currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom_mult = workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom_mult = getfiltermult (hDlg, IDC_FILTERHZMULT);
                                        updatedisplayarea ();
                                        break;
                                case IDC_FILTERVZMULT:
-                                       currprefs.gfx_filter_vert_zoom_mult = workprefs.gfx_filter_vert_zoom_mult = getfiltermult (hDlg, IDC_FILTERVZMULT);
+                                       currprefs.gf[filter_nativertg].gfx_filter_vert_zoom_mult = workprefs.gf[filter_nativertg].gfx_filter_vert_zoom_mult = getfiltermult (hDlg, IDC_FILTERVZMULT);
                                        updatedisplayarea ();
                                        break;
                                case IDC_FILTERASPECT:
@@ -14919,7 +14954,7 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                                        else if (v >= 2)
                                                                v2 = getaspectratio (v - 2);
                                                }
-                                               currprefs.gfx_filter_aspect = workprefs.gfx_filter_aspect = v2;
+                                               currprefs.gf[filter_nativertg].gfx_filter_aspect = workprefs.gf[filter_nativertg].gfx_filter_aspect = v2;
                                                updatedisplayarea ();
                                        }
                                        break;
@@ -14927,7 +14962,7 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                        {
                                                int v = SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_GETCURSEL, 0, 0L);
                                                if (v != CB_ERR)
-                                                       currprefs.gfx_filter_keep_aspect = workprefs.gfx_filter_keep_aspect = v;
+                                                       currprefs.gf[filter_nativertg].gfx_filter_keep_aspect = workprefs.gf[filter_nativertg].gfx_filter_keep_aspect = v;
                                                updatedisplayarea ();
                                        }
                                        break;
@@ -14947,7 +14982,7 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                        if (recursive)
                                break;
                        recursive++;
-                       if (currprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL) {
+                       if (currprefs.gf[filter_nativertg].gfx_filter_autoscale == AUTOSCALE_MANUAL) {
                                currprefs.gfx_xcenter_size = workprefs.gfx_xcenter_size = (int)SendMessage (hz, TBM_GETPOS, 0, 0);
                                currprefs.gfx_ycenter_size = workprefs.gfx_ycenter_size = (int)SendMessage (vz, TBM_GETPOS, 0, 0);
                                currprefs.gfx_xcenter_pos = workprefs.gfx_xcenter_pos = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0);
@@ -14958,28 +14993,28 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                SetDlgItemInt (hDlg, IDC_FILTERVZV, workprefs.gfx_ycenter_size, TRUE);
                        } else {
                                if (h == hz) {
-                                       currprefs.gfx_filter_horiz_zoom = workprefs.gfx_filter_horiz_zoom = (int)SendMessage (hz, TBM_GETPOS, 0, 0);
-                                       if (workprefs.gfx_filter_keep_aspect) {
-                                               currprefs.gfx_filter_vert_zoom = workprefs.gfx_filter_vert_zoom = currprefs.gfx_filter_horiz_zoom;
-                                               SendDlgItemMessage (hDlg, IDC_FILTERVZ, TBM_SETPOS, TRUE, workprefs.gfx_filter_vert_zoom);
+                                       currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom = workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom = (int)SendMessage (hz, TBM_GETPOS, 0, 0);
+                                       if (workprefs.gf[filter_nativertg].gfx_filter_keep_aspect) {
+                                               currprefs.gf[filter_nativertg].gfx_filter_vert_zoom = workprefs.gf[filter_nativertg].gfx_filter_vert_zoom = currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom;
+                                               SendDlgItemMessage (hDlg, IDC_FILTERVZ, TBM_SETPOS, TRUE, workprefs.gf[filter_nativertg].gfx_filter_vert_zoom);
                                        }
                                } else if (h == vz) {
-                                       currprefs.gfx_filter_vert_zoom = workprefs.gfx_filter_vert_zoom = (int)SendMessage (vz, TBM_GETPOS, 0, 0);
-                                       if (workprefs.gfx_filter_keep_aspect) {
-                                               currprefs.gfx_filter_horiz_zoom = workprefs.gfx_filter_horiz_zoom = currprefs.gfx_filter_vert_zoom;
-                                               SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, workprefs.gfx_filter_horiz_zoom);
+                                       currprefs.gf[filter_nativertg].gfx_filter_vert_zoom = workprefs.gf[filter_nativertg].gfx_filter_vert_zoom = (int)SendMessage (vz, TBM_GETPOS, 0, 0);
+                                       if (workprefs.gf[filter_nativertg].gfx_filter_keep_aspect) {
+                                               currprefs.gf[filter_nativertg].gfx_filter_horiz_zoom = workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom = currprefs.gf[filter_nativertg].gfx_filter_vert_zoom;
+                                               SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom);
                                        }
                                }
-                               currprefs.gfx_filter_horiz_offset = workprefs.gfx_filter_horiz_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0);
-                               currprefs.gfx_filter_vert_offset = workprefs.gfx_filter_vert_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0);
-                               SetDlgItemInt (hDlg, IDC_FILTERHOV, (int)workprefs.gfx_filter_horiz_offset, TRUE);
-                               SetDlgItemInt (hDlg, IDC_FILTERVOV, (int)workprefs.gfx_filter_vert_offset, TRUE);
-                               SetDlgItemInt (hDlg, IDC_FILTERHZV, (int)workprefs.gfx_filter_horiz_zoom, TRUE);
-                               SetDlgItemInt (hDlg, IDC_FILTERVZV, (int)workprefs.gfx_filter_vert_zoom, TRUE);
+                               currprefs.gf[filter_nativertg].gfx_filter_horiz_offset = workprefs.gf[filter_nativertg].gfx_filter_horiz_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0);
+                               currprefs.gf[filter_nativertg].gfx_filter_vert_offset = workprefs.gf[filter_nativertg].gfx_filter_vert_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0);
+                               SetDlgItemInt (hDlg, IDC_FILTERHOV, (int)workprefs.gf[filter_nativertg].gfx_filter_horiz_offset, TRUE);
+                               SetDlgItemInt (hDlg, IDC_FILTERVOV, (int)workprefs.gf[filter_nativertg].gfx_filter_vert_offset, TRUE);
+                               SetDlgItemInt (hDlg, IDC_FILTERHZV, (int)workprefs.gf[filter_nativertg].gfx_filter_horiz_zoom, TRUE);
+                               SetDlgItemInt (hDlg, IDC_FILTERVZV, (int)workprefs.gf[filter_nativertg].gfx_filter_vert_zoom, TRUE);
                        }
-                       if (filter_selected) {
-                               int *pw = filter_selected->varw;
-                               int *pc = filter_selected->varc;
+                       if (filter_selected && filter_selected->varw[filter_nativertg]) {
+                               int *pw = filter_selected->varw[filter_nativertg];
+                               int *pc = filter_selected->varc[filter_nativertg];
                                int v = (int)SendMessage (GetDlgItem(hDlg, IDC_FILTERXL), TBM_GETPOS, 0, 0);
                                if (v < filter_selected->min)
                                        v = filter_selected->min;
index fc63af25011f7ad83b51bbe862ce4844b0a4e144..f79baaaba22459ef734b68c39c7926e7e4044890 100644 (file)
     <ClCompile Include="..\..\qemuvga\lsi53c895a.cpp" />
     <ClCompile Include="..\..\qemuvga\qemuuaeglue.cpp" />
     <ClCompile Include="..\..\qemuvga\vga.cpp" />
+    <ClCompile Include="..\..\scp.cpp" />
     <ClCompile Include="..\..\scsitape.cpp" />
     <ClCompile Include="..\..\slirp\bootp.cpp" />
     <ClCompile Include="..\..\slirp\cksum.cpp" />
     <ClCompile Include="..\..\slirp\udp.cpp" />
     <ClCompile Include="..\..\specialmonitors.cpp" />
     <ClCompile Include="..\..\statusline.cpp" />
+    <ClCompile Include="..\..\tabletlibrary.cpp" />
     <ClCompile Include="..\..\uaenative.cpp" />
     <ClCompile Include="..\ahidsound_dsonly.cpp" />
     <ClCompile Include="..\ahidsound_new.cpp" />
index facaac5bd2d179bc7e8dc9494a1769adf3796c67..c9881f2239f5ee130f5c40dd824b130bd3d1dab8 100644 (file)
     <ClCompile Include="..\..\newcpu_common.cpp">
       <Filter>common</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\scp.cpp">
+      <Filter>common</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\tabletlibrary.cpp">
+      <Filter>common</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\resources\35floppy.ico">
index 1cd3737a178cf98cc0e10de09f7350457290a719..01fc342cf1f4ff4e610d4c222f12e5a963fb64fe 100644 (file)
@@ -1,16 +1,45 @@
 
 1 -> 0 (-)   : 0,1FE,1FE,1FE,..
 1 -> 1 (D)   : 0,1FE,0,1FE,0,..
-1 -> 2 (C)   : 0,1FE,70,1FE,70,.. (C-)
-1 -> 9 (AD)  : 0,1FE,0,74,0,74,.. (DA)
-1 -> B (ACD) : 0,1FE,70,0,74,70,0,74,70,0,74,.. (ACD)
-1 -> C (AB)  : 0,1FE,72,74,70,72,74,70,72,.. (CBA)
-1 -> D (ABD) : 0,1FE,72,74,70,72,74,70,72,.. (CBA)
-1 -> E (ABC) : 0,1FE,70,70,70,70,.. (C)
-1 -> F (ABCD): 0,1FE,70,70,74,70,70,70,74,70,70,70,74,.. (CCCA)
+1 -> 2 (C)   : 0,1FE,70,1FE,70,..                                                      (C-)
+1 -> 9 (AD)  : 0,1FE,0,74,0,74,..                                                      (DA)
+1 -> B (ACD) : 0,1FE,70,0,74,70,0,74,70,0,74,..                                (CDA)
+1 -> C (AB)  : 0,1FE,72,74,70,72,74,70,72,..                           (CBA)
+1 -> D (ABD) : 0,1FE,72,74,70,72,74,70,72,..                           (CBA)
+1 -> E (ABC) : 0,1FE,70,70,70,70,..                                                    (C)
+1 -> F (ABCD): 0,1FE,70,70,74,70,70,70,74,70,70,70,74,..       (CCCA)
 
 - restore only single input target to default.
 
+Beta 10:
+
+- Programmed display mode positioning bug fixed, should fix remaining problems with clipped left or right edges.
+- Switching between interlace PAL and interlace NTSC modes calculated wrong vertical line count.
+- Some CPU emulation optimization, only modify linear memory address in getpc/setpc/incpc functions if mode
+  is not prefetch/ce/mmu.
+- Added slirp inbound port configuration, config file slirp_redir=<proto>:<port>:<internal port>:<internal ip>,
+  multiple entries supported, internal ip part is optional.
+- Added simple slirp inbound port configuration, config file slirp_ports=port1,port2,.. (TCP ports only,
+  internal address is default 10.0.2.15, host port equals internal port)
+- Added quick slirp inbound port selection to GUI, opens TCP ports 21, 22, 23 and 80. (Same as slirp_ports=21,22,23,80)
+- Added missing slirp cleanup code from QEMU.
+- 6888x Packed-Decimal Real negative k-factor values fully emulated (Previous confirmed, required by NeXTSTEP OS),
+  positive non-zero values not emulated yet which needs Fortran "E" scientific notation format string that C does
+  not directly support.
+- First and last drawn scanlines were always detected incorrectly since few major versions ago, breaking vertical centering.
+- Input device autoswitch by using analog directions now only work with X or Y axis, other directions may work
+  differently and can cause accidental switches.
+- Force recalculation of horiz and vert centering (if enabled) when screen mode is detected (guessed) as changed.
+- Toggle input events (warp mode, mute etc..) now also support setting to on or off state without toggling.
+  Input panel only, click on input event name to change mode
+- Added audio/video recording input event, supports also new toggle/on/off modes. If recording is started using
+  input event (not from GUI), number is appended to filename and it is increased each time recording is started.
+
+SLiRP inbound ports note: all ports will be opened when network hardware is initialized, there is no way to know
+when something actually starts listening for some port. This also means you won't get exactly same behavior as
+"real" low level network emulation, mainly you won't ever get connection refused if port is open but not actually
+listening on the Amiga side, connection opens and then closes immediately.
+
 Beta 9:
 
 - NCR emulation didn't work with SCSI IDs 4-6.
index e0bba0d48dd55a04ee60be520902c8797062b890..f93e52783bbf14f3b22173c26f8d79c2f2162faa 100644 (file)
@@ -511,6 +511,6 @@ void fillPTKtable (Uchar poss[37][2])
 #ifndef _WIN64
 int htonl(int v)
 {
-       return v;
+       return ((v >> 24) & 0x000000ff) | ((v >> 8) & 0x0000ff00) | ((v << 8) & 0x00ff0000) | ((v << 24) & 0xff000000);
 }
 #endif
index 9e8b9eaa85b5b0f5b5e9eca34f97707da9956671..52757a59d3dcef3b3c3328a45c88cf5b95076156 100644 (file)
@@ -173,9 +173,14 @@ void portio_list_add(PortioList *piolist,
 void portio_list_del(PortioList *piolist);
 
 
-typedef struct IORange IORange;
 typedef struct IORangeOps IORangeOps;
 
+typedef struct IORange {
+    const IORangeOps *ops;
+    uint64_t base;
+    uint64_t len;
+} IORange;
+
 struct IORangeOps {
     void (*read)(IORange *iorange, uint64_t offset, unsigned width,
                  uint64_t *data);
@@ -184,11 +189,6 @@ struct IORangeOps {
     void (*destructor)(IORange *iorange);
 };
 
-typedef struct IORange {
-    const IORangeOps *ops;
-    uint64_t base;
-    uint64_t len;
-} IORange;
 
 typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
 typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
@@ -220,14 +220,16 @@ void qemu_register_reset(QEMUResetHandler *func, void *opaque);
 #define CIRRUS_ID_CLGD5436  (0x2B<<2)
 #define CIRRUS_ID_CLGD5446  (0x2E<<2)
 
-typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
-                                     uint8_t * dst, const uint8_t * src,
+typedef struct CirrusVGAState CirrusVGAState;
+
+typedef void (*cirrus_bitblt_rop_t) (CirrusVGAState *s,
+                                        uint8_t * dst, const uint8_t * src,
                                     int dstpitch, int srcpitch,
                                     int bltwidth, int bltheight);
-typedef void (*cirrus_fill_t)(struct CirrusVGAState *s,
+typedef void (*cirrus_fill_t)(CirrusVGAState *s,
                               uint8_t *dst, int dst_pitch, int width, int height);
 
-typedef struct CirrusVGAState {
+struct CirrusVGAState {
     VGACommonState vga;
 
     MemoryRegion cirrus_vga_io;
@@ -278,7 +280,7 @@ typedef struct CirrusVGAState {
     int device_id;
     int bustype;
        int valid_memory_config;
-} CirrusVGAState;
+};
 
 void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci,
                                MemoryRegion *system_memory,
index 52a50738baa57900a8bbe593cd1cd3dca290af70..8514957a47c06693b4ac1cf4a7c12014824a4a3f 100644 (file)
--- a/zfile.cpp
+++ b/zfile.cpp
@@ -259,7 +259,7 @@ static bool checkwrite (struct zfile *zf, int *retcode)
 
 
 static uae_u8 exeheader[]={ 0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00 };
-static TCHAR *diskimages[] = { _T("adf"), _T("adz"), _T("ipf"), _T("fdi"), _T("dms"), _T("wrp"), _T("dsq"), 0 };
+static TCHAR *diskimages[] = { _T("adf"), _T("adz"), _T("ipf"), _T("scp"), _T("fdi"), _T("dms"), _T("wrp"), _T("dsq"), 0 };
 
 int zfile_gettype (struct zfile *z)
 {
@@ -296,6 +296,16 @@ int zfile_gettype (struct zfile *z)
        zfile_fseek (z, -8, SEEK_CUR);
        if (!memcmp (buf, exeheader, sizeof (buf)))
                return ZFILE_DISKIMAGE;
+       if (!memcmp (buf, "CAPS", 4))
+               return ZFILE_DISKIMAGE;
+       if (!memcmp (buf, "SCP", 3))
+               return ZFILE_DISKIMAGE;
+       if (!memcmp (buf, "UAE--ADF", 8))
+               return ZFILE_DISKIMAGE;
+       if (!memcmp (buf, "UAE-1ADF", 8))
+               return ZFILE_DISKIMAGE;
+       if (!memcmp (buf, "Formatte", 89))
+               return ZFILE_DISKIMAGE;
        if (!memcmp (buf, "RDSK", 4))
                return ZFILE_HDFRDB;
        if (!memcmp (buf, "DOS", 3)) {
@@ -900,7 +910,7 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode)
                for (i = 0; i < tracks; i++) {
                        uae_u8 *buf, *p;
                        int mrev, gapo;
-                       caps_loadtrack (mfm, NULL, 0, i, &len, &mrev, &gapo);
+                       caps_loadtrack (mfm, NULL, 0, i, &len, &mrev, &gapo, NULL, true);
                        //write_log (_T("%d: %d %d %d\n"), i, mrev, gapo, len);
                        len /= 8;
                        buf = p = xmalloc (uae_u8, len);
@@ -1267,7 +1277,7 @@ end:
 const TCHAR *uae_ignoreextensions[] =
 { _T(".gif"), _T(".jpg"), _T(".png"), _T(".xml"), _T(".pdf"), _T(".txt"), 0 };
 const TCHAR *uae_diskimageextensions[] =
-{ _T(".adf"), _T(".adz"), _T(".ipf"), _T(".fdi"), _T(".exe"), _T(".dms"), _T(".wrp"), _T(".dsq"), 0 };
+{ _T(".adf"), _T(".adz"), _T(".ipf"), _T(".scp"), _T(".fdi"), _T(".exe"), _T(".dms"), _T(".wrp"), _T(".dsq"), 0 };
 
 int zfile_is_ignore_ext (const TCHAR *name)
 {