]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2410b7
authorToni Wilen <twilen@winuae.net>
Wed, 18 Apr 2012 17:17:17 +0000 (20:17 +0300)
committerToni Wilen <twilen@winuae.net>
Wed, 18 Apr 2012 17:17:17 +0000 (20:17 +0300)
19 files changed:
cfgfile.cpp
custom.cpp
disk.cpp
drawing.cpp
gayle.cpp
include/custom.h
include/drawing.h
include/inputdevice.h
include/options.h
inputdevice.cpp
od-win32/dinput.cpp
od-win32/direct3d.cpp
od-win32/dxwrap.cpp
od-win32/hardfile_win32.cpp
od-win32/rp.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt

index 7643f05aa6d9edb5eb9f28f5e65009e29ec60c96..def720973d1e8e7de9bb64889c84666b31664d8d 100644 (file)
@@ -357,6 +357,8 @@ static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *valu
        char *tmp1, *tmp2;
        int utf8;
 
+       if (value == NULL)
+               return;
        utf8 = 0;
        tmp1 = ua (value);
        tmp2 = uutf8 (value);
@@ -799,10 +801,10 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite_bool (f, _T("native_code"), p->native_code);
 
        cfgfile_write (f, _T("gfx_display"), _T("%d"), p->gfx_apmode[APMODE_NATIVE].gfx_display);
-       cfgfile_dwrite_str (f, _T("gfx_display_name"), p->gfx_apmode[APMODE_NATIVE].gfx_display_name);
-       if (p->gfx_apmode[APMODE_NATIVE].gfx_display != p->gfx_apmode[APMODE_RTG].gfx_display || p->gfx_apmode[APMODE_RTG].gfx_display_name[0]) {
+       cfgfile_write_str (f, _T("gfx_display_name"), target_get_display_name (p->gfx_apmode[APMODE_NATIVE].gfx_display));
+       if (p->gfx_apmode[APMODE_NATIVE].gfx_display != p->gfx_apmode[APMODE_RTG].gfx_display) {
                cfgfile_write (f, _T("gfx_display_rtg"), _T("%d"), p->gfx_apmode[APMODE_RTG].gfx_display);
-               cfgfile_dwrite_str (f, _T("gfx_display_name_rtg"), p->gfx_apmode[APMODE_RTG].gfx_display_name);
+               cfgfile_write_str (f, _T("gfx_display_name_rtg"), target_get_display_name (p->gfx_apmode[APMODE_RTG].gfx_display));
        }
        cfgfile_write (f, _T("gfx_framerate"), _T("%d"), p->gfx_framerate);
        cfgfile_write (f, _T("gfx_width"), _T("%d"), p->gfx_size_win.width); /* compatibility with old versions */
@@ -1592,11 +1594,22 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
        if (cfgfile_intval (option, value, _T("gfx_display_rtg"), &p->gfx_apmode[APMODE_RTG].gfx_display, 1)) {
                return 1;
        }
-       if (cfgfile_string (option, value, _T("gfx_display_name"), p->gfx_apmode[APMODE_NATIVE].gfx_display_name, sizeof p->gfx_apmode[APMODE_NATIVE].gfx_display_name / sizeof (TCHAR))) {
-               _tcscpy (p->gfx_apmode[APMODE_RTG].gfx_display_name, p->gfx_apmode[APMODE_NATIVE].gfx_display_name);
+       if (_tcscmp (option, _T("gfx_display_name")) == 0) {
+               TCHAR tmp[MAX_DPATH];
+               if (cfgfile_string (option, value, _T("gfx_display_name"), tmp, sizeof tmp / sizeof (TCHAR))) {
+                       int num = target_get_display (tmp);
+                       if (num >= 0)
+                               p->gfx_apmode[APMODE_RTG].gfx_display = p->gfx_apmode[APMODE_NATIVE].gfx_display = num;
+               }
                return 1;
        }
-       if (cfgfile_string (option, value, _T("gfx_display_name_rtg"), p->gfx_apmode[APMODE_RTG].gfx_display_name, sizeof p->gfx_apmode[APMODE_RTG].gfx_display_name / sizeof (TCHAR))) {
+       if (_tcscmp (option, _T("gfx_display_name_rtg")) == 0) {
+               TCHAR tmp[MAX_DPATH];
+               if (cfgfile_string (option, value, _T("gfx_display_name_rtg"), tmp, sizeof tmp / sizeof (TCHAR))) {
+                       int num = target_get_display (tmp);
+                       if (num >= 0)
+                               p->gfx_apmode[APMODE_RTG].gfx_display = num;
+               }
                return 1;
        }
 
@@ -2218,6 +2231,200 @@ static void parse_addmem (struct uae_prefs *p, TCHAR *buf, int num)
        p->custom_memory_sizes[num] = size;
 }
 
+static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, bool hdf, TCHAR *value)
+{
+       int secs, heads, reserved, bs, bp, hdcv;
+       bool ro;
+       TCHAR *dname = NULL, *aname = _T(""), *root = NULL, *fs = NULL, *hdc;
+       TCHAR *tmpp = _tcschr (value, ',');
+       TCHAR *str = NULL;
+
+       config_newfilesystem = 1;
+       if (tmpp == 0)
+               goto invalid_fs;
+
+       *tmpp++ = '\0';
+       if (strcasecmp (value, _T("ro")) == 0)
+               ro = true;
+       else if (strcasecmp (value, _T("rw")) == 0)
+               ro = false;
+       else
+               goto invalid_fs;
+       secs = 0; heads = 0; reserved = 0; bs = 0; bp = 0;
+       fs = 0; hdc = 0; hdcv = 0;
+
+       value = tmpp;
+       if (!hdf) {
+               tmpp = _tcschr (value, ':');
+               if (tmpp == 0)
+                       goto empty_fs;
+               *tmpp++ = 0;
+               dname = value;
+               aname = tmpp;
+               tmpp = _tcschr (tmpp, ':');
+               if (tmpp == 0)
+                       goto empty_fs;
+               *tmpp++ = 0;
+               root = tmpp;
+               tmpp = _tcschr (tmpp, ',');
+               if (tmpp == 0)
+                       goto empty_fs;
+               *tmpp++ = 0;
+               if (! getintval (&tmpp, &bp, 0))
+                       goto empty_fs;
+       } else {
+               tmpp = _tcschr (value, ':');
+               if (tmpp == 0)
+                       goto invalid_fs;
+               *tmpp++ = '\0';
+               dname = value;
+               root = tmpp;
+               tmpp = _tcschr (tmpp, ',');
+               if (tmpp == 0)
+                       goto invalid_fs;
+               *tmpp++ = 0;
+               aname = 0;
+               if (! getintval (&tmpp, &secs, ',')
+                       || ! getintval (&tmpp, &heads, ',')
+                       || ! getintval (&tmpp, &reserved, ',')
+                       || ! getintval (&tmpp, &bs, ','))
+                       goto invalid_fs;
+               if (getintval2 (&tmpp, &bp, ',')) {
+                       fs = tmpp;
+                       tmpp = _tcschr (tmpp, ',');
+                       if (tmpp != 0) {
+                               *tmpp++ = 0;
+                               hdc = tmpp;
+                               if(_tcslen (hdc) >= 4 && !_tcsncmp (hdc, _T("ide"), 3)) {
+                                       hdcv = hdc[3] - '0' + HD_CONTROLLER_IDE0;
+                                       if (hdcv < HD_CONTROLLER_IDE0 || hdcv > HD_CONTROLLER_IDE3)
+                                               hdcv = 0;
+                               }
+                               if(_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scsi"), 4)) {
+                                       hdcv = hdc[4] - '0' + HD_CONTROLLER_SCSI0;
+                                       if (hdcv < HD_CONTROLLER_SCSI0 || hdcv > HD_CONTROLLER_SCSI6)
+                                               hdcv = 0;
+                               }
+                               if (_tcslen (hdc) >= 6 && !_tcsncmp (hdc, _T("scsram"), 6))
+                                       hdcv = HD_CONTROLLER_PCMCIA_SRAM;
+                               if (_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scide"), 6))
+                                       hdcv = HD_CONTROLLER_PCMCIA_IDE;
+                       }
+               }
+       }
+empty_fs:
+       if (root) {
+               if (_tcslen (root) > 3 && root[0] == 'H' && root[1] == 'D' && root[2] == '_') {
+                       root += 2;
+                       *root = ':';
+               }
+               str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, false);
+       }
+#ifdef FILESYS
+       add_filesys_config (p, nr, dname, aname, str, ro, secs, heads, reserved, bs, bp, fs, hdcv, 0);
+#endif
+       xfree (str);
+       return 1;
+
+invalid_fs:
+       write_log (_T("Invalid filesystem/hardfile specification.\n"));
+       return 1;
+}
+
+static int cfgfile_parse_filesys (struct uae_prefs *p, const TCHAR *option, TCHAR *value)
+{
+       int i;
+
+       for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
+               TCHAR tmp[100];
+               _stprintf (tmp, _T("uaehf%d"), i);
+               if (_tcscmp (option, tmp) == 0) {
+                       for (;;) {
+                               bool hdf = false;
+                               TCHAR *tmpp = _tcschr (value, ',');
+                               if (tmpp == NULL)
+                                       return 1;
+                               *tmpp++ = 0;
+                               if (strcasecmp (value, _T("hdf")) == 0) {
+                                       hdf = true;
+                               } else if (strcasecmp (value, _T("dir")) != 0) {
+                                       return 1;
+                               }
+#if 0                  // not yet
+                               return cfgfile_parse_newfilesys (p, i, hdf, tmpp);
+#else
+                               return 1;
+#endif
+                       }
+                       return 1;
+               }
+       }
+
+       if (_tcscmp (option, _T("filesystem")) == 0
+               || _tcscmp (option, _T("hardfile")) == 0)
+       {
+               int secs, heads, reserved, bs;
+               bool ro;
+               TCHAR *aname, *root;
+               TCHAR *tmpp = _tcschr (value, ',');
+               TCHAR *str;
+
+               if (config_newfilesystem)
+                       return 1;
+
+               if (tmpp == 0)
+                       goto invalid_fs;
+
+               *tmpp++ = '\0';
+               if (_tcscmp (value, _T("1")) == 0 || strcasecmp (value, _T("ro")) == 0
+                       || strcasecmp (value, _T("readonly")) == 0
+                       || strcasecmp (value, _T("read-only")) == 0)
+                       ro = true;
+               else if (_tcscmp (value, _T("0")) == 0 || strcasecmp (value, _T("rw")) == 0
+                       || strcasecmp (value, _T("readwrite")) == 0
+                       || strcasecmp (value, _T("read-write")) == 0)
+                       ro = false;
+               else
+                       goto invalid_fs;
+               secs = 0; heads = 0; reserved = 0; bs = 0;
+
+               value = tmpp;
+               if (_tcscmp (option, _T("filesystem")) == 0) {
+                       tmpp = _tcschr (value, ':');
+                       if (tmpp == 0)
+                               goto invalid_fs;
+                       *tmpp++ = '\0';
+                       aname = value;
+                       root = tmpp;
+               } else {
+                       if (! getintval (&value, &secs, ',')
+                               || ! getintval (&value, &heads, ',')
+                               || ! getintval (&value, &reserved, ',')
+                               || ! getintval (&value, &bs, ','))
+                               goto invalid_fs;
+                       root = value;
+                       aname = 0;
+               }
+               str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, true);
+#ifdef FILESYS
+               add_filesys_config (p, -1, NULL, aname, str, ro, secs, heads, reserved, bs, 0, NULL, 0, 0);
+#endif
+               free (str);
+               return 1;
+invalid_fs:
+               write_log (_T("Invalid filesystem/hardfile specification.\n"));
+               return 1;
+
+       }
+
+       if (_tcscmp (option, _T("filesystem2")) == 0)
+               return cfgfile_parse_newfilesys (p, -1, false, value);
+       if (_tcscmp (option, _T("hardfile2")) == 0)
+               return cfgfile_parse_newfilesys (p, -1, true, value);
+
+       return 0;
+}
+
 static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCHAR *value)
 {
        int tmpval, dummyint, i;
@@ -2518,167 +2725,8 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                return 1;
        }
 
-       for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
-               TCHAR tmp[100];
-               _stprintf (tmp, _T("uaehf%d"), i);
-               if (_tcscmp (option, tmp) == 0)
-                       return 1;
-       }
-
-       if (_tcscmp (option, _T("filesystem")) == 0
-               || _tcscmp (option, _T("hardfile")) == 0)
-       {
-               int secs, heads, reserved, bs;
-               bool ro;
-               TCHAR *aname, *root;
-               TCHAR *tmpp = _tcschr (value, ',');
-               TCHAR *str;
-
-               if (config_newfilesystem)
-                       return 1;
-
-               if (tmpp == 0)
-                       goto invalid_fs;
-
-               *tmpp++ = '\0';
-               if (_tcscmp (value, _T("1")) == 0 || strcasecmp (value, _T("ro")) == 0
-                       || strcasecmp (value, _T("readonly")) == 0
-                       || strcasecmp (value, _T("read-only")) == 0)
-                       ro = true;
-               else if (_tcscmp (value, _T("0")) == 0 || strcasecmp (value, _T("rw")) == 0
-                       || strcasecmp (value, _T("readwrite")) == 0
-                       || strcasecmp (value, _T("read-write")) == 0)
-                       ro = false;
-               else
-                       goto invalid_fs;
-               secs = 0; heads = 0; reserved = 0; bs = 0;
-
-               value = tmpp;
-               if (_tcscmp (option, _T("filesystem")) == 0) {
-                       tmpp = _tcschr (value, ':');
-                       if (tmpp == 0)
-                               goto invalid_fs;
-                       *tmpp++ = '\0';
-                       aname = value;
-                       root = tmpp;
-               } else {
-                       if (! getintval (&value, &secs, ',')
-                               || ! getintval (&value, &heads, ',')
-                               || ! getintval (&value, &reserved, ',')
-                               || ! getintval (&value, &bs, ','))
-                               goto invalid_fs;
-                       root = value;
-                       aname = 0;
-               }
-               str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, true);
-#ifdef FILESYS
-               add_filesys_config (p, -1, NULL, aname, str, ro, secs, heads, reserved, bs, 0, NULL, 0, 0);
-#endif
-               free (str);
-               return 1;
-
-       }
-
-       if (_tcscmp (option, _T("filesystem2")) == 0
-               || _tcscmp (option, _T("hardfile2")) == 0)
-       {
-               int secs, heads, reserved, bs, bp, hdcv;
-               bool ro;
-               TCHAR *dname = NULL, *aname = _T(""), *root = NULL, *fs = NULL, *hdc;
-               TCHAR *tmpp = _tcschr (value, ',');
-               TCHAR *str = NULL;
-
-               config_newfilesystem = 1;
-               if (tmpp == 0)
-                       goto invalid_fs;
-
-               *tmpp++ = '\0';
-               if (strcasecmp (value, _T("ro")) == 0)
-                       ro = true;
-               else if (strcasecmp (value, _T("rw")) == 0)
-                       ro = false;
-               else
-                       goto invalid_fs;
-               secs = 0; heads = 0; reserved = 0; bs = 0; bp = 0;
-               fs = 0; hdc = 0; hdcv = 0;
-
-               value = tmpp;
-               if (_tcscmp (option, _T("filesystem2")) == 0) {
-                       tmpp = _tcschr (value, ':');
-                       if (tmpp == 0)
-                               goto empty_fs;
-                       *tmpp++ = 0;
-                       dname = value;
-                       aname = tmpp;
-                       tmpp = _tcschr (tmpp, ':');
-                       if (tmpp == 0)
-                               goto empty_fs;
-                       *tmpp++ = 0;
-                       root = tmpp;
-                       tmpp = _tcschr (tmpp, ',');
-                       if (tmpp == 0)
-                               goto empty_fs;
-                       *tmpp++ = 0;
-                       if (! getintval (&tmpp, &bp, 0))
-                               goto empty_fs;
-               } else {
-                       tmpp = _tcschr (value, ':');
-                       if (tmpp == 0)
-                               goto invalid_fs;
-                       *tmpp++ = '\0';
-                       dname = value;
-                       root = tmpp;
-                       tmpp = _tcschr (tmpp, ',');
-                       if (tmpp == 0)
-                               goto invalid_fs;
-                       *tmpp++ = 0;
-                       aname = 0;
-                       if (! getintval (&tmpp, &secs, ',')
-                               || ! getintval (&tmpp, &heads, ',')
-                               || ! getintval (&tmpp, &reserved, ',')
-                               || ! getintval (&tmpp, &bs, ','))
-                               goto invalid_fs;
-                       if (getintval2 (&tmpp, &bp, ',')) {
-                               fs = tmpp;
-                               tmpp = _tcschr (tmpp, ',');
-                               if (tmpp != 0) {
-                                       *tmpp++ = 0;
-                                       hdc = tmpp;
-                                       if(_tcslen (hdc) >= 4 && !_tcsncmp (hdc, _T("ide"), 3)) {
-                                               hdcv = hdc[3] - '0' + HD_CONTROLLER_IDE0;
-                                               if (hdcv < HD_CONTROLLER_IDE0 || hdcv > HD_CONTROLLER_IDE3)
-                                                       hdcv = 0;
-                                       }
-                                       if(_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scsi"), 4)) {
-                                               hdcv = hdc[4] - '0' + HD_CONTROLLER_SCSI0;
-                                               if (hdcv < HD_CONTROLLER_SCSI0 || hdcv > HD_CONTROLLER_SCSI6)
-                                                       hdcv = 0;
-                                       }
-                                       if (_tcslen (hdc) >= 6 && !_tcsncmp (hdc, _T("scsram"), 6))
-                                               hdcv = HD_CONTROLLER_PCMCIA_SRAM;
-                                       if (_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scide"), 6))
-                                               hdcv = HD_CONTROLLER_PCMCIA_IDE;
-                               }
-                       }
-               }
-empty_fs:
-               if (root) {
-                       if (_tcslen (root) > 3 && root[0] == 'H' && root[1] == 'D' && root[2] == '_') {
-                               root += 2;
-                               *root = ':';
-                       }
-                       str = cfgfile_subst_path_load (UNEXPANDED, &p->path_hardfile, root, false);
-               }
-#ifdef FILESYS
-               add_filesys_config (p, -1, dname, aname, str, ro, secs, heads, reserved, bs, bp, fs, hdcv, 0);
-#endif
-               xfree (str);
-               return 1;
-
-invalid_fs:
-               write_log (_T("Invalid filesystem/hardfile specification.\n"));
+       if (cfgfile_parse_filesys (p, option, value))
                return 1;
-       }
 
        return 0;
 }
@@ -2766,7 +2814,7 @@ int cfgfile_parse_option (struct uae_prefs *p, TCHAR *option, TCHAR *value, int
                if (cfgfile_parse_host (p, option, value))
                        return 1;
        }
-       if (type > 0)
+       if (type > 0 && (type & (CONFIG_TYPE_HARDWARE | CONFIG_TYPE_HOST)) != (CONFIG_TYPE_HARDWARE | CONFIG_TYPE_HOST))
                return 1;
        return 0;
 }
index 31ad34e79df418ec3b0525a7b5822898bccbb4e1..d61bf8d98686656d92901c3817b830517a9b5833 100644 (file)
@@ -186,7 +186,8 @@ int maxvpos_nom = MAXVPOS_PAL; // nominal value (same as maxvpos but "faked" max
 int hsyncendpos, hsyncstartpos;
 static int maxvpos_total = 511;
 int minfirstline = VBLANK_ENDLINE_PAL;
-int equ_vblank_endline = EQU_ENDLINE_PAL;
+static int equ_vblank_endline = EQU_ENDLINE_PAL;
+static bool equ_vblank_toggle = true;
 double vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz, vblank_hz_stored;
 static int vblank_hz_mult, vblank_hz_state;
 static struct chipset_refresh *stored_chipset_refresh;
@@ -571,6 +572,11 @@ static void remember_ctable_for_border (void)
        remember_ctable ();
 }
 
+STATIC_INLINE int get_equ_vblank_endline (void)
+{
+       return equ_vblank_endline + (equ_vblank_toggle ? (lof_current ? 1 : 0) : 0);
+}
+
 /* Called to determine the state of the horizontal display window state
 * machine at the current position. It might have changed since we last
 * checked.  */
@@ -583,7 +589,7 @@ static void decide_diw (int hpos)
        */
 
        int hdiw = hpos >= maxhpos ? maxhpos * 2 + 1 : hpos * 2 + 2;
-       if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE) && vpos <= equ_vblank_endline) {
+       if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE) && vpos <= get_equ_vblank_endline ()) {
                hdiw = diw_hcounter;
                hdiw &= 511;
        }
@@ -952,7 +958,7 @@ static void setup_fmodes (int hpos)
        ddf_change = vpos;
 }
 
-static void BPLCON0_Denise (int hpos, uae_u16 v);
+static void BPLCON0_Denise (int hpos, uae_u16 v, bool);
 
 // writing to BPLCON0 adds 4 cycle delay before Agnus bitplane DMA sequence changes
 // (Note that Denise sees the change after 1 cycle)
@@ -966,7 +972,7 @@ static void maybe_setup_fmodes (int hpos)
        switch (bpldmasetupphase)
        {
        case 0:
-               BPLCON0_Denise (hpos, bplcon0);
+               BPLCON0_Denise (hpos, bplcon0, false);
                bpldmasetupphase++;
                bpldmasetuphpos += BPLCON_AGNUS_DELAY - BPLCON_DENISE_DELAY;
                break;
@@ -989,7 +995,7 @@ static void bpldmainitdelay (int hpos)
        hposa = hpos + BPLCON_AGNUS_DELAY;
        ddf_change = vpos;
        if (hposa < 0x14) {
-               BPLCON0_Denise (hpos, bplcon0);
+               BPLCON0_Denise (hpos, bplcon0, false);
                setup_fmodes (hpos);
                return;
        }
@@ -2610,9 +2616,9 @@ static void finish_decisions (void)
        next_color_change += (HBLANK_OFFSET + 1) / 2;
 
        diw_hcounter += maxhpos * 2;
-       if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE) && vpos == equ_vblank_endline - 1)
+       if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE) && vpos == get_equ_vblank_endline () - 1)
                diw_hcounter++;
-       if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) || vpos > equ_vblank_endline || (currprefs.cs_dipagnus && vpos == 0)) {
+       if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) || vpos > get_equ_vblank_endline () || (currprefs.cs_dipagnus && vpos == 0)) {
                diw_hcounter = maxhpos * 2;
                last_hdiw = 2 - 1;
        }
@@ -2665,7 +2671,7 @@ static void reset_decisions (void)
        bplcon1_hpos = -1;
        if (bpldmasetuphpos >= 0) {
                // this can happen in "too fast" modes
-               BPLCON0_Denise (0, bplcon0);
+               BPLCON0_Denise (0, bplcon0, true);
                setup_fmodes (0);
        }
        bpldmasetuphpos = -1;
@@ -2954,7 +2960,7 @@ void compute_framesync (void)
                vblank_hz, vblank_hz * maxvpos_nom,
                maxhpos, maxvpos, lof_store ? 1 : 0,
                cr ? cr->index : -1,
-               cr != NULL && cr->label != NULL ? cr->label : _T("<unknown>")
+               cr != NULL && cr->label != NULL ? cr->label : _T("<?>")
        );
 
        config_changed = 1;
@@ -2993,6 +2999,7 @@ void init_hz (bool fullinit)
                vblank_hz = VBLANK_HZ_PAL;
                sprite_vblank_endline = VBLANK_SPRITE_PAL;
                equ_vblank_endline = EQU_ENDLINE_PAL;
+               equ_vblank_toggle = true;
        } else {
                maxvpos = MAXVPOS_NTSC;
                maxhpos = MAXHPOS_NTSC;
@@ -3000,6 +3007,7 @@ void init_hz (bool fullinit)
                vblank_hz = VBLANK_HZ_NTSC;
                sprite_vblank_endline = VBLANK_SPRITE_NTSC;
                equ_vblank_endline = EQU_ENDLINE_NTSC;
+               equ_vblank_toggle = false;
        }
        maxvpos_nom = maxvpos;
        if (vpos_count > 0) {
@@ -3482,7 +3490,10 @@ static void DMACON (int hpos, uae_u16 v)
        dmacon &= 0x1FFF;
 
        changed = dmacon ^ oldcon;
-
+#if 0
+       if (changed)
+               write_log (L"%04x -> %04x %08x\n", oldcon, dmacon, m68k_getpc ());
+#endif
        oldcop = (oldcon & DMA_COPPER) && (oldcon & DMA_MASTER);
        newcop = (dmacon & DMA_COPPER) && (dmacon & DMA_MASTER);
 
@@ -3752,7 +3763,7 @@ static void BPLxPTL (int hpos, uae_u16 v, int num)
        //write_log (_T("%d:%d:BPL%dPTL %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip);
 }
 
-static void BPLCON0_Denise (int hpos, uae_u16 v)
+static void BPLCON0_Denise (int hpos, uae_u16 v, bool immediate)
 {
        if (! (currprefs.chipset_mask & CSMASK_ECS_DENISE))
                v &= ~0x00F1;
@@ -3771,7 +3782,11 @@ static void BPLCON0_Denise (int hpos, uae_u16 v)
        if (isehb (bplcon0d, bplcon2))
                v |= 0x80;
 
-       record_register_change (hpos, 0x100, (bplcon0d & ~(0x800 | 0x400 | 0x80)) | (v & (0x0800 | 0x400 | 0x80)));
+       if (immediate) {
+               record_register_change (hpos, 0x100, v);
+       } else {
+               record_register_change (hpos, 0x100, (bplcon0d & ~(0x800 | 0x400 | 0x80)) | (v & (0x0800 | 0x400 | 0x80)));
+       }
 
        bplcon0d = v & ~0x80;
 
@@ -3812,7 +3827,7 @@ static void BPLCON0 (int hpos, uae_u16 v)
        bpldmainitdelay (hpos);
 
        if (thisline_decision.plfleft < 0)
-               BPLCON0_Denise (hpos, v);
+               BPLCON0_Denise (hpos, v, true);
 }
 
 STATIC_INLINE void BPLCON1 (int hpos, uae_u16 v)
@@ -5196,11 +5211,13 @@ static void framewait (void)
        frame_time_t start;
        int vs = isvsync_chipset ();
 
+       is_syncline = 0;
+
        if (vs > 0) {
 
                curr_time = read_processor_time ();
                vsyncwaittime = vsyncmaxtime = curr_time + vsynctimebase;
-               vsynctimeperline = vsynctimebase / maxvpos_nom;
+               vsynctimeperline = vsynctimebase / (maxvpos_nom + 1);
                render_screen ();
                show_screen ();
                frame_shown = true;
@@ -5217,24 +5234,27 @@ static void framewait (void)
                if (vs == -2 || vs == -3) {
 
                        // fastest possible
-                       int max;
+                       int max, adjust;
+
+                       adjust = 0;
                        curr_time = read_processor_time ();
-                       vsync_busywait_end ();
+                       start = vsync_busywait_end ();
+                       if ((int)curr_time - (int)vsyncwaittime < 0)
+                               curr_time = start;
+
                        vsync_busywait_do (NULL, (bplcon0 & 4) != 0 && !lof_changed && !lof_changing, lof_store != 0);
                        vsync_busywait_start ();
 
+                       max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
+                       if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vsynctimebase / 2)
+                               adjust = curr_time - vsyncwaittime;
+                       max -= adjust;
+
                        vsyncmintime = curr_time;
                        vsyncwaittime = curr_time + vsynctimebase;
-                       max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
-                       max -= frameskiptime + maxvpos_nom / 10;
-                       frameskiptime = 0;
-                       if (max < 0) {
-                               max = 0;
-                               vsynctimeperline = 1;
-                       } else {
-                               vsynctimeperline = max / maxvpos_nom;
-                       }
-                       vsyncmaxtime = max + curr_time;
+
+                       vsynctimeperline = max / (maxvpos_nom + 1);
+                       vsyncmaxtime = curr_time + max;
 
                } else {
 
@@ -5245,7 +5265,7 @@ static void framewait (void)
                        vsyncmintime = curr_time;
                        vsyncwaittime = curr_time + vsynctimebase;
                        vsyncmaxtime = curr_time + vsynctimebase;
-                       vsynctimeperline = vsynctimebase / maxvpos_nom;
+                       vsynctimeperline = vsynctimebase / (maxvpos_nom + 1);
                        if (!show) {    
                                show_screen ();
                                if (extraframewait)
@@ -5273,26 +5293,24 @@ static void framewait (void)
                }
 
                int max;
-               if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vsynctimebase / 2) {
-                       int adjust = curr_time - vsyncwaittime;
-                       max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
-                       vsyncwaittime = curr_time + vsynctimebase - adjust;
-               } else {
-                       max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
-                       vsyncwaittime = curr_time + vsynctimebase;
-               }
+               int adjust = 0;
+               if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vsynctimebase / 2)
+                       adjust = curr_time - vsyncwaittime;
+               max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
+               vsyncwaittime = curr_time + vsynctimebase - adjust;
                vsyncmintime = curr_time;
-               vsynctimeperline /= maxvpos_nom;
                
-               max -= frameskiptime + maxvpos_nom / 10;
+#if 0
+               max -= frameskiptime;
+#endif
                frameskiptime = 0;
                if (max < 0) {
                        max = 0;
                        vsynctimeperline = 1;
                } else {
-                       vsynctimeperline = max / maxvpos_nom;
+                       vsynctimeperline = max / (maxvpos_nom + 1);
                }
-               vsyncmaxtime = max + curr_time;
+               vsyncmaxtime = curr_time + max;
        
        } else {
 
@@ -5313,7 +5331,7 @@ static void framewait (void)
                curr_time = read_processor_time ();
                vsyncmintime = curr_time;
                vsyncmaxtime = vsyncwaittime = curr_time + vsynctimebase;
-               vsynctimeperline = vsynctimebase / maxvpos_nom;
+               vsynctimeperline = vsynctimebase / (maxvpos_nom + 1);
                if (didrender)
                        show_screen ();
                frame_shown = true;
@@ -5742,6 +5760,7 @@ static void hsync_handler_pre (bool onvsync)
                hardware_line_completed (next_lineno);
                if (doflickerfix () && interlace_seen > 0)
                        hsync_scandoubler ();
+               notice_resolution_seen (GET_RES_AGNUS (bplcon0), interlace_seen > 0);
        }
 
 #ifdef A2065
@@ -5925,10 +5944,10 @@ static void hsync_handler_post (bool onvsync)
                        vsyncmintime += vsynctimeperline;
                        is_syncline = 0;
                        if (!vblank_found_chipset) {
-                               if ((int)vsyncmaxtime - (int)vsyncmintime >= 0) {
+                               if ((int)vsyncmaxtime - (int)vsyncmintime > 0 && (int)vsyncwaittime - (int)vsyncmintime > 0) {
                                        frame_time_t rpt = read_processor_time ();
                                        /* Extra time left? Do some extra CPU emulation */
-                                       if ((int)vsyncmintime - (int)rpt >= vsynctimeperline) {
+                                       if ((int)vsyncmintime - (int)rpt > 0) {
                                                is_syncline = -1;
                                        }
                                }
index 1a9a4234c3bf30987a802d395784a00b885befee..83b42930edb1d73c23a5fb6a459ebb4e08a5d894 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -3287,6 +3287,7 @@ void DSKLEN (uae_u16 v, int hpos)
                                        pos += 16;
                                        pos %= drv->tracklen;
                                }
+                               drv->mfmpos = pos;
                                INTREQ (0x8000 | 0x1000);
                                done = 1;
 
@@ -3302,6 +3303,7 @@ void DSKLEN (uae_u16 v, int hpos)
                                        pos += 16;
                                        pos %= drv->tracklen;
                                }
+                               drv->mfmpos = pos;
                                drive_write_data (drv);
                                done = 1;
                        }
index b95c7946b36685d9a1f82ee86d8c0fedccca38d4..113c9d4985996583685c0a18eeb05f9ce0ff44a5 100644 (file)
@@ -341,7 +341,7 @@ static int gclow, gcloh, gclox, gcloy;
 void get_custom_topedge (int *x, int *y)
 {
        if (isnativevidbuf ()) {
-               *x = visible_left_border;
+               *x = visible_left_border + (DISPLAY_LEFT_SHIFT << currprefs.gfx_resolution);
                *y = minfirstline << currprefs.gfx_vresolution;
        } else {
                *x = 0;
@@ -1875,12 +1875,6 @@ static void pfield_expand_dp_bplcon (void)
        ecsshres = bplres == RES_SUPERHIRES && (currprefs.chipset_mask & CSMASK_ECS_DENISE) && !(currprefs.chipset_mask & CSMASK_AGA);
 #endif
 
-       if (bplres > frame_res)
-               frame_res = bplres;
-       if (bplres > 0)
-               can_use_lores = 0;
-       frame_res_lace = (dp_for_drawing->bplcon0 & 4) != 0;
-
        plf1pri = dp_for_drawing->bplcon2 & 7;
        plf2pri = (dp_for_drawing->bplcon2 >> 3) & 7;
        plf_sprite_mask = 0xFFFF0000 << (4 * plf2pri);
@@ -2367,6 +2361,7 @@ static void init_drawing_frame (void)
                                                        changed_prefs.gfx_vresolution = nl;
                                                        write_log (_T("RES -> %d LINE -> %d\n"), nr, nl);
                                                        config_changed = 1;
+                                                       //activate_debugger ();
                                                }
                                                if (src->width > 0 && src->height > 0) {
                                                        if (memcmp (dst, src, sizeof *dst)) {
@@ -2903,6 +2898,16 @@ static void gfxbuffer_reset (void)
        gfxvidinfo.drawbuffer.unlockscr          = dummy_unlock;
 }
 
+void notice_resolution_seen (int res, bool lace)
+{
+       if (res > frame_res)
+               frame_res = res;
+       if (res > 0)
+               can_use_lores = 0;
+       if (!frame_res_lace && lace)
+               frame_res_lace = lace;
+}
+
 bool notice_interlace_seen (bool lace)
 {
        bool changed = false;
index 75e6f7dac15f8894b57d416bee88aeac013c8e7c..dbdd29ee98c25d2bf073eb724e5b29d2102d299b 100644 (file)
--- a/gayle.cpp
+++ b/gayle.cpp
@@ -920,6 +920,7 @@ static int get_gayle_ide_reg (uaecptr addr)
 static uae_u32 ide_read_reg (int ide_reg)
 {
        uae_u8 v = 0;
+       bool isdrive = ide->hdhfd.size != 0;
 
        switch (ide_reg)
        {
@@ -932,29 +933,37 @@ static uae_u32 ide_read_reg (int ide_reg)
                v = ide->regs->ide_error;
                break;
        case IDE_NSECTOR:
-               if (ide->regs->ide_devcon & 0x80)
-                       v = ide->regs->ide_nsector2;
-               else
-                       v = ide->regs->ide_nsector;
+               if (isdrive) {
+                       if (ide->regs->ide_devcon & 0x80)
+                               v = ide->regs->ide_nsector2;
+                       else
+                               v = ide->regs->ide_nsector;
+               }
                break;
        case IDE_SECTOR:
-               if (ide->regs->ide_devcon & 0x80)
-                       v = ide->regs->ide_sector2;
-               else
-                       v = ide->regs->ide_sector;
-               check_maxtransfer (2);
+               if (isdrive) {
+                       if (ide->regs->ide_devcon & 0x80)
+                               v = ide->regs->ide_sector2;
+                       else
+                               v = ide->regs->ide_sector;
+                       check_maxtransfer (2);
+               }
                break;
        case IDE_LCYL:
-               if (ide->regs->ide_devcon & 0x80)
-                       v = ide->regs->ide_lcyl2;
-               else
-                       v = ide->regs->ide_lcyl;
+               if (isdrive) {
+                       if (ide->regs->ide_devcon & 0x80)
+                               v = ide->regs->ide_lcyl2;
+                       else
+                               v = ide->regs->ide_lcyl;
+               }
                break;
        case IDE_HCYL:
-               if (ide->regs->ide_devcon & 0x80)
-                       v = ide->regs->ide_hcyl2;
-               else
-                       v = ide->regs->ide_hcyl;
+               if (isdrive) {
+                       if (ide->regs->ide_devcon & 0x80)
+                               v = ide->regs->ide_hcyl2;
+                       else
+                               v = ide->regs->ide_hcyl;
+               }
                break;
        case IDE_SELECT:
                v = ide->regs->ide_select;
@@ -962,7 +971,7 @@ static uae_u32 ide_read_reg (int ide_reg)
        case IDE_STATUS:
                ide->irq = 0; /* fall through */
        case IDE_DEVCON: /* ALTSTATUS when reading */
-               if (ide->hdhfd.size == 0) {
+               if (!isdrive) {
                        v = 0;
                        if (ide->regs->ide_error)
                                v |= IDE_STATUS_ERR;
@@ -972,16 +981,16 @@ static uae_u32 ide_read_reg (int ide_reg)
                }
                break;
        }
-       if (IDE_LOG > 2 && ide_reg > 0)
-               write_log (_T("IDE%d register %d->%02X\n"), ide->num, ide_reg, (uae_u32)v & 0xff);
+       if (IDE_LOG > 2 && ide_reg > 0 && (1 || ide->num > 0))
+               write_log (_T("IDE%d GET register %d->%02X\n"), ide->num, ide_reg, (uae_u32)v & 0xff);
        return v;
 }
 
 static void ide_write_reg (int ide_reg, uae_u32 val)
 {
        ide->regs->ide_devcon &= ~0x80; /* clear HOB */
-       if (IDE_LOG > 2 && ide_reg > 0)
-               write_log (_T("IDE%d register %d=%02X\n"), ide->num, ide_reg, (uae_u32)val & 0xff);
+       if (IDE_LOG > 2 && ide_reg > 0 && (1 || ide->num > 0))
+               write_log (_T("IDE%d PUT register %d=%02X\n"), ide->num, ide_reg, (uae_u32)val & 0xff);
        switch (ide_reg)
        {
        case IDE_DRVADDR:
index 2594764662d98b84c8fe59f1940f34aa59b154fc..656c2e152a8b0df76838176de4be51fe02e20237 100644 (file)
@@ -105,7 +105,7 @@ extern uae_u16 INTREQR (void);
 #define VBLANK_SPRITE_NTSC 20
 #define VBLANK_HZ_PAL 50
 #define VBLANK_HZ_NTSC 60
-#define EQU_ENDLINE_PAL 9
+#define EQU_ENDLINE_PAL 8
 #define EQU_ENDLINE_NTSC 10
 
 extern int maxhpos, maxhpos_short;
index 45fa0389846149df5857c60647574000f8e6bc2a..f0eb1dfd60944fd84741e2faae5588850a79c690 100644 (file)
@@ -277,6 +277,7 @@ extern void init_hardware_for_drawing_frame (void);
 extern void reset_drawing (void);
 extern void drawing_init (void);
 extern bool notice_interlace_seen (bool);
+extern void notice_resolution_seen (int, bool);
 extern void frame_drawn (void);
 extern void redraw_frame (void);
 extern int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy);
index b2050072d130f679593355c9933d2cd78e1a6fe4..ca6200567211e770daaeaa5b9f140580eaf2488e 100644 (file)
@@ -192,6 +192,7 @@ extern int getjoystickstate (int mouse);
 void setmousestate (int mouse, int axis, int data, int isabs);
 extern int getmousestate (int mouse);
 extern void inputdevice_updateconfig (struct uae_prefs *prefs);
+extern void inputdevice_updateconfig_internal (struct uae_prefs *prefs);
 extern void inputdevice_devicechange (struct uae_prefs *prefs);
 
 extern int inputdevice_translatekeycode (int keyboard, int scancode, int state);
index 82185d74cb772040d1d294fa38ae7b2589a34173..387ddc03ea6345da907942e72561608ea32680b7 100644 (file)
@@ -174,7 +174,6 @@ struct apmode
 {
        int gfx_fullscreen;
        int gfx_display;
-       TCHAR gfx_display_name[256]; 
        int gfx_vsync;
        // 0 = immediate flip
        // -1 = wait for flip, before frame ends
@@ -545,6 +544,8 @@ extern void target_default_options (struct uae_prefs *, int type);
 extern void target_fixup_options (struct uae_prefs *);
 extern int target_cfgfile_load (struct uae_prefs *, const TCHAR *filename, int type, int isdefault);
 extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type);
+extern int target_get_display (const TCHAR*);
+extern const TCHAR *target_get_display_name (int);
 
 extern int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int ignorelink, int userconfig);
 extern int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int);
index 834c53a4a0afe95a3831b0172a76b683182a5b62..bf57cfd1fce6ed073782bd962ced3033a623465f 100644 (file)
@@ -4749,7 +4749,8 @@ static void resetinput (void)
        }
 }
 
-void inputdevice_updateconfig (struct uae_prefs *prefs)
+
+void inputdevice_updateconfig_internal (struct uae_prefs *prefs)
 {
        int i;
 
@@ -4760,15 +4761,6 @@ void inputdevice_updateconfig (struct uae_prefs *prefs)
        copyjport (&changed_prefs, &currprefs, 2);
        copyjport (&changed_prefs, &currprefs, 3);
 
-#ifdef RETROPLATFORM
-       rp_input_change (0);
-       rp_input_change (1);
-       rp_input_change (2);
-       rp_input_change (3);
-       for (i = 0; i < MAX_JPORTS; i++)
-               rp_update_gameport (i, -1, 0);
-#endif
-
        resetinput ();
 
        joysticks = prefs->joystick_settings[prefs->input_selected_setting];
@@ -4797,8 +4789,22 @@ void inputdevice_updateconfig (struct uae_prefs *prefs)
 
        disableifempty (prefs);
        scanevents (prefs);
+}
 
+void inputdevice_updateconfig (struct uae_prefs *prefs)
+{
+       inputdevice_updateconfig_internal (prefs);
+       
        config_changed = 1;
+
+#ifdef RETROPLATFORM
+       rp_input_change (0);
+       rp_input_change (1);
+       rp_input_change (2);
+       rp_input_change (3);
+       for (int i = 0; i < MAX_JPORTS; i++)
+               rp_update_gameport (i, -1, 0);
+#endif
 }
 
 /* called when devices get inserted or removed
index b3ed6c0e2b13b5637adf1bf28f77ecc6ce08c78c..75e324779ee716f2ddeac4ece76bdbcc4b7bc9df 100644 (file)
@@ -1239,7 +1239,7 @@ static const struct hidquirk quirks[] =  {
        { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD },
        { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD },
        { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER },
-       { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER },
+//     { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER },
        { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING },
        { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING },
        { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING },
@@ -1543,7 +1543,6 @@ static bool initialize_rawinput (void)
                                                                                                                did->axissort[axiscnt] = hidtable[ht].priority * 2 + l;
                                                                                                                did->axismappings[axiscnt] = acnt;
                                                                                                                memcpy (&did->hidvcaps[axiscnt], &vcaps[i], sizeof HIDP_VALUE_CAPS);
-                                                                                                               fixhidvcaps (&rdi->hid, &did->hidvcaps[axiscnt]);
                                                                                                                did->axistype[axiscnt] = l + 1;
                                                                                                                axiscnt++;
                                                                                                        }
index 22a822d968b73227d496b9f8a26f639a4172088b..d447279a2200aaf4691061aeae4cb3420111916c 100644 (file)
@@ -1897,8 +1897,6 @@ static int restoredeviceobjects (void)
 
        createmask2texture (currprefs.gfx_filteroverlay);
 
-       if (!createtexture (tout_w, tout_h, window_w, window_h))
-               return 0;
        createledtexture ();
 
        hr = D3DXCreateSprite (d3ddev, &sprite);
@@ -2322,6 +2320,8 @@ bool D3D_alloctexture (int w, int h)
 
        if (!createamigatexture (tin_w, tin_h))
                return false;
+       if (!createtexture (tout_w, tout_h, window_w, window_h))
+               return false;
        return true;
 }
 
@@ -2777,6 +2777,11 @@ uae_u8 *D3D_locktexture (int *pitch, bool fullupdate)
        if (!isd3d () || !texture)
                return NULL;
 
+       if (locked) {
+               write_log (_T("%s: texture already locked!\n"), D3DHEAD);
+               return NULL;
+       }
+
        lock.pBits = NULL;
        lock.Pitch = 0;
        hr = texture->LockRect (0, &lock, NULL, fullupdate ? D3DLOCK_DISCARD : D3DLOCK_NO_DIRTY_UPDATE);
index d528c915990820b2accd3091c3d3c8e41f2cee0d..bee318889671a15e34f982a1b9194b31ffbc4a30 100644 (file)
@@ -1182,7 +1182,7 @@ int DirectDraw_Start (void)
        DirectDraw_get_GUIDs ();
 
        guid = NULL;
-       if (isfullscreen () > 0) {
+       if (isfullscreen ()) {
                MultiDisplay *md = getdisplay (&currprefs);
                int disp = md - Displays;
                if (disp < 0)
index d95ef9822dbcc60e14d58b16747a50caa133bfa8..2e26f2140fde8126f119e7ca1b4ce89a8c2d9a21 100644 (file)
@@ -401,7 +401,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
        }
        hfd->handle = xcalloc (struct hardfilehandle, 1);
        hfd->handle->h = INVALID_HANDLE_VALUE;
-       hfd_log (_T("hfd open: '%s'\n"), name);
+       hfd_log (_T("hfd attempting to open: '%s'\n"), name);
        if (name[0] == ':') {
                hdf_init_target ();
                i = isharddrive (name);
index 51d2bd2a4cef47bf08d9b820c03fe6de31501892..64ea3deef1b6b848f95ae87c197aa0a9708e1278 100644 (file)
@@ -182,14 +182,15 @@ bool port_get_custom (int inputmap_port, TCHAR *out)
        _tcscpy (p, KEYBOARDCUSTOM);
        p += _tcslen (p);
        kb = inputdevice_get_device_total (IDTYPE_JOYSTICK) + inputdevice_get_device_total (IDTYPE_MOUSE);
+       int kbnum = 0;
        for (int i = 0; customeventorder[i]; i++) {
                int evtnum = events[i];
-               for (int j = 0; j < inputdevicefunc_keyboard.get_widget_num (kb); j++) {
+               for (int j = 0; j < inputdevicefunc_keyboard.get_widget_num (kbnum); j++) {
                        int flags, port;
-                       if (inputdevice_get_mapping (kb, j, &flags, &port, NULL, NULL, 0) == evtnum) {
+                       if (inputdevice_get_mapping (kb + kbnum, j, &flags, &port, NULL, NULL, 0) == evtnum) {
                                if (port == inputmap_port + 1) {
                                        uae_u32 kc = 0;
-                                       inputdevicefunc_keyboard.get_widget_type (kb, j, NULL, &kc);
+                                       inputdevicefunc_keyboard.get_widget_type (kbnum, j, NULL, &kc);
                                        if (!first)
                                                *p++ = ' ';
                                        first = false;
@@ -213,17 +214,16 @@ int port_insert_custom (int inputmap_port, int devicetype, DWORD flags, const TC
 
        kb = inputdevice_get_device_total (IDTYPE_JOYSTICK) + inputdevice_get_device_total (IDTYPE_MOUSE);
 
-       inputdevice_updateconfig (&changed_prefs);
+       inputdevice_updateconfig_internal (&changed_prefs);
        inputdevice_compa_prepare_custom (&changed_prefs, inputmap_port, JSEM_MODE_JOYSTICK);
-       inputdevice_updateconfig (&changed_prefs);
+       inputdevice_updateconfig_internal (&changed_prefs);
        max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, &events, &axistable);
-       write_log (L"custom='%s' max=%d port=%d\n", custom, max, inputmap_port);
+       write_log (_T("custom='%s' max=%d port=%d kb=%d kbnum=%d\n"), custom, max, inputmap_port, kb, inputdevice_get_device_total (IDTYPE_KEYBOARD));
        if (!max)
                return FALSE;
 
        while (p && p[0]) {
                int idx = -1, kc = -1;
-               int wdnum = -1;
                const TCHAR *p2 = _tcschr (p, '=');
                if (!p2)
                        break;
@@ -247,25 +247,29 @@ int port_insert_custom (int inputmap_port, int devicetype, DWORD flags, const TC
                        break;
                evtnum = events[idx];
 
-               write_log (L"evt=%d kc=%d\n", evtnum, kc);
+               write_log (_T("kb=%d evt=%d kc=%d\n"), kb, evtnum, kc);
 
                for (int j = 0; j < inputdevice_get_device_total (IDTYPE_KEYBOARD); j++) {
-                       for (int i = 0; i < inputdevicefunc_keyboard.get_widget_num (kb + j); i++) {
+                       int wdnum = -1;
+                       for (int i = 0; i < inputdevicefunc_keyboard.get_widget_num (j); i++) {
                                uae_u32 kc2 = 0;
-                               inputdevicefunc_keyboard.get_widget_type (kb + j, i, NULL, &kc2);
+                               inputdevicefunc_keyboard.get_widget_type (j, i, NULL, &kc2);
                                if (kc == kc2) {
                                        wdnum = i;
                                        break;
                                }
                        }
                        if (wdnum >= 0) {
+                               write_log (_T("kb=%d (%s) wdnum=%d\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), wdnum);
                                inputdevice_set_gameports_mapping (&changed_prefs, kb + j, wdnum, evtnum, inputmap_port);
                                inputdevice_set_gameports_mapping (&currprefs, kb + j, wdnum, evtnum, inputmap_port);
+                       } else {
+                               write_log (_T("kb=%d (%): keycode %x not found!\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), kc);
                        }
                }
        }
 
-       inputdevice_updateconfig (&changed_prefs);
+       inputdevice_updateconfig_internal (&changed_prefs);
        inputdevice_updateconfig (&currprefs);
        return TRUE;
 }
@@ -565,9 +569,7 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
        minimized = 0;
        if (display) {
                p->gfx_apmode[APMODE_NATIVE].gfx_display = display;
-               p->gfx_apmode[APMODE_NATIVE].gfx_display_name[0] = 0;
                p->gfx_apmode[APMODE_RTG].gfx_display = display;
-               p->gfx_apmode[APMODE_RTG].gfx_display_name[0] = 0;
                if (sm->dwScreenMode & RP_SCREENMODE_FULLWINDOW)
                        fs = 2;
                else
index 46a23bf6bae08883b5151d9462bfd5b858343965..59ed8110b17dd8185f424194e6dd9fb83fd4d1c5 100644 (file)
@@ -19,8 +19,8 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA _T("")
-#define WINUAEBETA _T("Beta 6")
-#define WINUAEDATE MAKEBD(2012, 4, 13)
+#define WINUAEBETA _T("Beta 7")
+#define WINUAEDATE MAKEBD(2012, 4, 18)
 #define WINUAEEXTRA _T("")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 #define WINUAEREV _T("")
index 97e9d258004c1f9e900825fb02da577f729118f8..5ac88073d9f3425983e30692b0bc606659a557ff 100644 (file)
@@ -150,7 +150,7 @@ static void vsync_sleep (bool preferbusy)
        } else {
                dowait = false;
        }
-       if (dowait && currprefs.m68k_speed >= 0)
+       if (dowait && (currprefs.m68k_speed >= 0 || currprefs.m68k_speed_throttle < 0))
                sleep_millis_main (1);
 }
 
@@ -260,19 +260,8 @@ static struct MultiDisplay *getdisplay2 (struct uae_prefs *p, int index)
        int display = index < 0 ? p->gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display - 1 : index;
 
        max = 0;
-       while (Displays[max].monitorname) {
-               if (index < 0) {
-                       struct MultiDisplay *md = &Displays[max];
-                       if (screen_is_picasso) {
-                               if (p->gfx_apmode[APMODE_RTG].gfx_display_name[0] && !_tcscmp (md->adaptername, p->gfx_apmode[APMODE_RTG].gfx_display_name))
-                                       return md;
-                       } else {
-                               if (p->gfx_apmode[APMODE_NATIVE].gfx_display_name[0] && !_tcscmp (md->adaptername, p->gfx_apmode[APMODE_NATIVE].gfx_display_name))
-                                       return md;
-                       }
-               }
+       while (Displays[max].monitorname)
                max++;
-       }
        if (max == 0) {
                gui_message (_T("no display adapters! Exiting"));
                exit (0);
@@ -302,6 +291,29 @@ void desktop_coords (int *dw, int *dh, int *ax, int *ay, int *aw, int *ah)
        *ah = amigawin_rect.bottom - *ay;
 }
 
+int target_get_display (const TCHAR *name)
+{
+       for (int i = 0; Displays[i].monitorname; i++) {
+               struct MultiDisplay *md = &Displays[i];
+               if (!_tcscmp (md->adapterid, name))
+                       return i + 1;
+               if (!_tcscmp (md->adaptername, name))
+                       return i + 1;
+               if (!_tcscmp (md->monitorname, name))
+                       return i + 1;
+       }
+       return -1;
+}
+const TCHAR *target_get_display_name (int num)
+{
+       if (num <= 0)
+               return NULL;
+       struct MultiDisplay *md = getdisplay2 (NULL, num - 1);
+       if (!md)
+               return NULL;
+       return md->monitorname;
+}
+
 void centerdstrect (RECT *dr)
 {
        if(!(currentmode->flags & (DM_DX_FULLSCREEN | DM_D3D_FULLSCREEN | DM_W_FULLSCREEN)))
@@ -579,6 +591,25 @@ static void sortmodes (struct MultiDisplay *md)
        }
 }
 
+#if 0
+static void sortmonitors (void)
+{
+       for (int i = 0; Displays[i].monitorid; i++) {
+               for (int j = i + 1; Displays[j].monitorid; j++) {
+                       int comp = (Displays[j].primary ? 1 : 0) - (Displays[i].primary ? 1 : 0);
+                       if (!comp)
+                               comp = _tcsicmp (Displays[i].adapterid, Displays[j].adapterid);
+                       if (comp > 0) {
+                               struct MultiDisplay md;
+                               memcpy (&md, &Displays[i], sizeof MultiDisplay);
+                               memcpy (&Displays[i], &Displays[j], sizeof MultiDisplay);
+                               memcpy (&Displays[j], &md, sizeof MultiDisplay);
+                       }
+               }
+       }
+}
+#endif
+
 static void modesList (struct MultiDisplay *md)
 {
        int i, j;
@@ -674,6 +705,7 @@ void enumeratedisplays (void)
                }
        }
        EnumDisplayMonitors (NULL, NULL, monitorEnumProc, NULL);
+       //sortmonitors ();
 }
 
 void sortdisplays (void)
@@ -1461,8 +1493,6 @@ int check_prefs_changed_gfx (void)
        c |= currprefs.gfx_scandoubler != changed_prefs.gfx_scandoubler ? (2 | 8) : 0;
        c |= currprefs.gfx_apmode[APMODE_NATIVE].gfx_display != changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display ? (2|4|8) : 0;
        c |= currprefs.gfx_apmode[APMODE_RTG].gfx_display != changed_prefs.gfx_apmode[APMODE_RTG].gfx_display ? (2|4|8) : 0;
-       c |= _tcscmp (currprefs.gfx_apmode[APMODE_NATIVE].gfx_display_name, changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display_name) ? (2|4|8) : 0;
-       c |= _tcscmp (currprefs.gfx_apmode[APMODE_RTG].gfx_display_name, changed_prefs.gfx_apmode[APMODE_RTG].gfx_display_name) ? (2|4|8) : 0;
        c |= currprefs.gfx_blackerthanblack != changed_prefs.gfx_blackerthanblack ? (2 | 8) : 0;
        c |= currprefs.gfx_apmode[0].gfx_backbuffers != changed_prefs.gfx_apmode[0].gfx_backbuffers ? (2 | 8) : 0;
        c |= currprefs.gfx_apmode[0].gfx_interlaced != changed_prefs.gfx_apmode[0].gfx_interlaced ? (2 | 8) : 0;
@@ -1536,8 +1566,6 @@ int check_prefs_changed_gfx (void)
                currprefs.gfx_scandoubler = changed_prefs.gfx_scandoubler;
                currprefs.gfx_apmode[APMODE_NATIVE].gfx_display = changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display;
                currprefs.gfx_apmode[APMODE_RTG].gfx_display = changed_prefs.gfx_apmode[APMODE_RTG].gfx_display;
-               _tcscpy (currprefs.gfx_apmode[APMODE_NATIVE].gfx_display_name, changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display_name);
-               _tcscpy (currprefs.gfx_apmode[APMODE_RTG].gfx_display_name, changed_prefs.gfx_apmode[APMODE_RTG].gfx_display_name);
                currprefs.gfx_blackerthanblack = changed_prefs.gfx_blackerthanblack;
                currprefs.gfx_apmode[0].gfx_backbuffers = changed_prefs.gfx_apmode[0].gfx_backbuffers;
                currprefs.gfx_apmode[0].gfx_interlaced = changed_prefs.gfx_apmode[0].gfx_interlaced;
@@ -2330,8 +2358,6 @@ end:
        if (index >= 0) {
                currprefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display = 
                        changed_prefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display = index;
-               currprefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display_name[0] =
-                       changed_prefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display_name[0] = 0;
                write_log (L"Can't find mode %dx%d ->\n", currentmode->native_width, currentmode->native_height);
                write_log (L"Monitor switched to '%s'\n", md->adaptername);
        }
@@ -2571,7 +2597,7 @@ bool vsync_busywait_check (void)
 {
        return vblankthread_mode == VBLANKTH_ACTIVE || vblankthread_mode == VBLANKTH_ACTIVE_WAIT;
 }
-
+#if 0
 static void vsync_notvblank (void)
 {
        for (;;) {
@@ -2585,13 +2611,12 @@ static void vsync_notvblank (void)
                vsync_sleep (true);
        }
 }
-
+#endif
 frame_time_t vsync_busywait_end (void)
 {
        if (!dooddevenskip) {
-               vsync_notvblank ();
                while (!vblank_found && vblankthread_mode == VBLANKTH_ACTIVE) {
-                       vsync_sleep (currprefs.m68k_speed < 0);
+                       vsync_sleep (currprefs.m68k_speed < 0 && currprefs.m68k_speed_throttle == 0);
                }
        }
        changevblankthreadmode_fast (VBLANKTH_ACTIVE_WAIT);
@@ -2600,6 +2625,8 @@ frame_time_t vsync_busywait_end (void)
 
 void vsync_busywait_start (void)
 {
+       int vp = 0;
+       struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[1] : &currprefs.gfx_apmode[0];
 #if 0
        struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[1] : &currprefs.gfx_apmode[0];
        if (!dooddevenskip) {
@@ -2853,7 +2880,7 @@ skip:
 
        vblankbasefull = (syncbase / tsum2);
        vblankbasewait1 = (syncbase / tsum2) * 75 / 100;
-       vblankbasewait2 = (syncbase / tsum2) * 70 / 100;
+       vblankbasewait2 = (syncbase / tsum2) * 55 / 100;
        vblankbasewait3 = (syncbase / tsum2) * 90 / 100;
        vblankbaselace = lace;
        write_log (_T("VSync %s: %.6fHz/%.1f=%.6fHz. MinV=%d MaxV=%d%s Units=%d\n"),
index 6fa45181e9be7f8e34101c9df533f1546fb7ff66..b0312668905279440f071469c593d641cae4ede9 100644 (file)
@@ -11722,7 +11722,7 @@ static void input_swap (HWND hDlg)
 
 static void input_find (HWND hDlg, int mode, int set);
 static int rawmode;
-static int inputmap_remap_counter;
+static int inputmap_remap_counter, inputmap_view_offset;
 
 static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
 {
@@ -11759,9 +11759,10 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw
                if (wtype < 0) {
                        if (!state)
                                return;
+                       HWND h = GetDlgItem (hDlg, IDC_INPUTMAPLIST);
+                       // F11
                        if (inputmap == 1) {
                                int mode, *events, *axistable;
-                               HWND h = GetDlgItem (hDlg, IDC_INPUTMAPLIST);
                                inputmap_remap_counter++;
                                ListView_EnsureVisible (h, inputmap_remap_counter, FALSE);
                                ListView_SetItemState (h, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
@@ -11769,6 +11770,16 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw
                                int max = inputdevice_get_compatibility_input (&workprefs, inputmap_port, &mode, &events, &axistable);
                                if (inputmap_remap_counter >= max)
                                        inputmap_remap_counter = -1;
+                       } else if (inputmap == 2) {
+                               int itemcnt = ListView_GetItemCount (h);
+                               if (inputmap_view_offset >= itemcnt - 1 || inputmap_view_offset < 0) {
+                                       inputmap_view_offset = 0;
+                               } else {
+                                       inputmap_view_offset += ListView_GetCountPerPage (h);
+                                       if (inputmap_view_offset >= itemcnt)
+                                               inputmap_view_offset = itemcnt - 1;
+                               }
+                               ListView_EnsureVisible (h, inputmap_view_offset, FALSE);
                        }
                        return;
                }
@@ -11851,6 +11862,7 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw
                                                ListView_SetItemState (h, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
                                                ListView_SetItemState (h, inputmap_index, LVIS_SELECTED , LVIS_SELECTED);
                                                ListView_SetItemState (h, inputmap_index, LVIS_FOCUSED, LVIS_FOCUSED);
+                                               inputmap_view_offset = inputmap_index;
                                                found = true;
                                        }
                                }
@@ -11976,6 +11988,7 @@ static void input_test (HWND hDlg, int port)
        inputmap_port_remap = -1;
        inputmap_port = port;
        inputmap_remap_counter = -1;
+       inputmap_view_offset = 0;
        updatePanel (INPUTMAP_ID);
 }
 
index 1c482e5597f2d9a9f19babd5814e1be4faed05b0..38ab1204a5d5403a816afe2a7bee17410d4bcd0b 100644 (file)
@@ -2,6 +2,24 @@
 - restore only single input target to default.
 - hdd from command line
 
+Beta 7:
+
+- DirectDraw full-window mode on non-primary monitor was blank.
+- Adjusted (again) fastest possible CPU mode extra CPU time scheduling, trying to find balance between better
+  timing syncronization and not causing unnecessary slowdowns on some systems..
+- OCS Denise bug emulation update, PAL STREQU counts are 8 (short field) or 9 (long field) lines, not static 9 lines.
+  (Probably no program cares)
+- F11 in gameports/input test mode shows next page (if list is longer than visible area).
+- Manual display positioning X coordinate offset fixed (Filter panel or gfx_center_horizontal_position)
+  Origin should be hardware position 0 (same as sprites), not first possible visible position.
+- Fastest possible low latency vsync should work better again (b2), plus some other adjustments done, CPU throttling
+  supported.
+- Autoresolution worked badly in some situations.
+- Removed USB_DEVICE_ID_RETRO_ADAPTER from USB "quirks" list, apparently it is working correctly according
+  to firmware sources. (Perhaps older version was wrong, not exactly sure why it was included in Linux HID quirks list)
+- Save also selected monitor name (gfx_display_name) to config file because order of displays can change when removing
+  or adding monitors or replacing display cards.
+
 Beta 6:
 
 - Most CDFS RockRidge file comments were truncated. (Very stupid bug)