]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
3600b5
authorToni Wilen <twilen@winuae.net>
Sat, 30 Sep 2017 17:12:27 +0000 (20:12 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 30 Sep 2017 17:12:27 +0000 (20:12 +0300)
cfgfile.cpp
include/statusline.h
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt

index 463125012f4dd82f1fa6ce2692b30747f7150f64..bbf332415f1ff1b6025747303119ea87e90c925b 100644 (file)
@@ -343,6 +343,72 @@ static const TCHAR *obsolete[] = {
 
 #define UNEXPANDED _T("$(FILE_PATH)")
 
+
+static TCHAR *cfgfile_unescape(const TCHAR *s, const TCHAR **endpos, TCHAR separator, bool min)
+{
+       bool quoted = false;
+       TCHAR *s2 = xmalloc(TCHAR, _tcslen(s) + 1);
+       TCHAR *p = s2;
+       if (s[0] == '\"') {
+               s++;
+               quoted = true;
+       }
+       int i;
+       for (i = 0; s[i]; i++) {
+               TCHAR c = s[i];
+               if (quoted && c == '\"') {
+                       i++;
+                       break;
+               }
+               if (c == separator) {
+                       i++;
+                       break;
+               }
+               if (c == '\\' && !min) {
+                       char v = 0;
+                       TCHAR c2;
+                       c = s[i + 1];
+                       switch (c)
+                       {
+                       case 'X':
+                       case 'x':
+                               c2 = _totupper(s[i + 2]);
+                               v = ((c2 >= 'A') ? c2 - 'A' : c2 - '0') << 4;
+                               c2 = _totupper(s[i + 3]);
+                               v |= (c2 >= 'A') ? c2 - 'A' : c2 - '0';
+                               *p++ = c2;
+                               i += 2;
+                               break;
+                       case 'r':
+                               *p++ = '\r';
+                               break;
+                       case '\n':
+                               *p++ = '\n';
+                               break;
+                       default:
+                               *p++ = c;
+                               break;
+                       }
+                       i++;
+               }
+               else {
+                       *p++ = c;
+               }
+       }
+       *p = 0;
+       if (endpos)
+               *endpos = &s[i];
+       return s2;
+}
+static TCHAR *cfgfile_unescape(const TCHAR *s, const TCHAR **endpos)
+{
+       return cfgfile_unescape(s, endpos, 0, false);
+}
+static TCHAR *cfgfile_unescape_min(const TCHAR *s)
+{
+       return cfgfile_unescape(s, NULL, 0, true);
+}
+
 static TCHAR *cfgfile_option_find_it(const TCHAR *s, const TCHAR *option, bool checkequals)
 {
        TCHAR buf[MAX_DPATH];
@@ -363,8 +429,15 @@ static TCHAR *cfgfile_option_find_it(const TCHAR *s, const TCHAR *option, bool c
                                *tmpp2++ = 0;
                }
                if (!strcasecmp(p, option)) {
-                       if (checkequals && tmpp2)
+                       if (checkequals && tmpp2) {
+                               if (tmpp2[0] == '"') {
+                                       TCHAR *n = cfgfile_unescape_min(tmpp2);
+                                       _tcscpy(tmpp2, n);
+                                       xfree(n);
+                                       return tmpp2;
+                               }
                                return tmpp2;
+                       }
                        return p;
                }
                p = tmpp;
@@ -486,66 +559,6 @@ static TCHAR *cfgfile_escape_min(const TCHAR *s)
        return my_strdup(s);
 }
 
-static TCHAR *cfgfile_unescape (const TCHAR *s, const TCHAR **endpos, TCHAR separator)
-{
-       bool quoted = false;
-       TCHAR *s2 = xmalloc (TCHAR, _tcslen (s) + 1);
-       TCHAR *p = s2;
-       if (s[0] == '\"') {
-               s++;
-               quoted = true;
-       }
-       int i;
-       for (i = 0; s[i]; i++) {
-               TCHAR c = s[i];
-               if (quoted && c == '\"') {
-                       i++;
-                       break;
-               }
-               if (c == separator) {
-                       i++;
-                       break;
-               }
-               if (c == '\\') {
-                       char v = 0;
-                       TCHAR c2;
-                       c = s[i + 1];
-                       switch (c)
-                       {
-                               case 'X':
-                               case 'x':
-                               c2 = _totupper (s[i + 2]);
-                               v = ((c2 >= 'A') ? c2 - 'A' : c2 - '0') << 4;
-                               c2 = _totupper (s[i + 3]);
-                               v |= (c2 >= 'A') ? c2 - 'A' : c2 - '0';
-                               *p++ = c2;
-                               i += 2;
-                               break;
-                               case 'r':
-                               *p++ = '\r';
-                               break;
-                               case '\n':
-                               *p++ = '\n';
-                               break;
-                               default:
-                               *p++ = c;
-                               break;
-                       }
-                       i++;
-               } else {
-                       *p++ = c;
-               }
-       }
-       *p = 0;
-       if (endpos)
-               *endpos = &s[i];
-       return s2;
-}
-static TCHAR *cfgfile_unescape (const TCHAR *s, const TCHAR **endpos)
-{
-       return cfgfile_unescape (s, endpos, 0);
-}
-
 static TCHAR *getnextentry (const TCHAR **valuep, const TCHAR separator)
 {
        TCHAR *s;
@@ -560,7 +573,7 @@ static TCHAR *getnextentry (const TCHAR **valuep, const TCHAR separator)
                value++;
                *valuep = value;
        } else {
-               s = cfgfile_unescape (value, valuep, separator);
+               s = cfgfile_unescape (value, valuep, separator, false);
        }
        return s;
 }
@@ -904,6 +917,34 @@ static void cfgfile_dwrite_path (struct zfile *f, struct multipath *mp, const TC
        xfree (s);
 }
 
+static void cfgfile_adjust_path(TCHAR *path, int maxsz, struct multipath *mp)
+{
+       if (path[0] == 0)
+               return;
+       TCHAR *s = target_expand_environment(path, NULL, 0);
+       _tcsncpy(path, s, maxsz - 1);
+       path[maxsz - 1] = 0;
+       if (mp) {
+               for (int i = 0; i < MAX_PATHS; i++) {
+                       if (mp->path[i][0] && _tcscmp(mp->path[i], _T(".\\")) != 0 && _tcscmp(mp->path[i], _T("./")) != 0 && (path[0] != '/' && path[0] != '\\' && !_tcschr(path, ':'))) {
+                               TCHAR np[MAX_DPATH];
+                               _tcscpy(np, mp->path[i]);
+                               fixtrailing(np);
+                               _tcscat(np, s);
+                               fullpath(np, sizeof np / sizeof(TCHAR));
+                               if (zfile_exists(np)) {
+                                       _tcsncpy(path, np, maxsz - 1);
+                                       path[maxsz - 1] = 0;
+                                       break;
+                               }
+                       }
+               }
+       } else {
+               fullpath(path, maxsz);
+       }
+       xfree(s);
+}
+
 static void write_filesys_config (struct uae_prefs *p, struct zfile *f)
 {
        TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH], tmp3[MAX_DPATH], hdcs[MAX_DPATH];
@@ -976,7 +1017,10 @@ static void write_filesys_config (struct uae_prefs *p, struct zfile *f)
                        zfile_fputs (f, tmp2);
 #endif
                } else if (ci->type == UAEDEV_HDF || ci->type == UAEDEV_CD || ci->type == UAEDEV_TAPE) {
-                       TCHAR *sfilesys = cfgfile_escape_min(ci->filesys);
+                       TCHAR filesyspath[MAX_DPATH];
+                       _tcscpy(filesyspath, ci->filesys);
+                       cfgfile_adjust_path(filesyspath, MAX_DPATH, NULL);
+                       TCHAR *sfilesys = cfgfile_escape_min(filesyspath);
                        TCHAR *sgeometry = cfgfile_escape(ci->geometry, NULL, true);
                        _stprintf (tmp, _T("%s,%s:%s,%d,%d,%d,%d,%d,%s,%s"),
                                ci->readonly ? _T("ro") : _T("rw"),
@@ -1200,13 +1244,17 @@ static void cfgfile_write_rom_settings(const struct expansionboardsettings *ebs,
                bitcnt += eb->bitshift;
                if (eb->type == EXPANSIONBOARD_STRING) {
                        if (settingstring) {
+                               TCHAR tmp[MAX_DPATH];
                                const TCHAR *p = settingstring;
                                for (int i = 0; i < sstr; i++) {
                                        p += _tcslen(p) + 1;
                                }
                                if (buf[0])
                                        _tcscat(buf, _T(","));
-                               _stprintf(buf, _T("%s=%s"), eb->configname, p);
+                               TCHAR *cs = cfgfile_escape_min(p);
+                               _stprintf(tmp, _T("%s=%s"), eb->configname, cs);
+                               _tcscat(buf, tmp);
+                               xfree(cs);
                                sstr++;
                        }
                } else if (eb->type == EXPANSIONBOARD_MULTI) {
@@ -1313,7 +1361,7 @@ static void cfgfile_write_board_rom(struct uae_prefs *prefs, struct zfile *f, st
                                                _tcscat(buf2, _T(","));
                                        _tcscat(buf2, tmp);
                                }
-                               if (br->roms[i].device_settings && ert->settings) {
+                               if ((br->roms[i].device_settings || br->roms[i].configtext[0]) && ert->settings) {
                                        cfgfile_write_rom_settings(ert->settings, buf2, br->roms[i].device_settings, br->roms[i].configtext);
                                }
                                if (is_custom_romboard(br)) {
@@ -2081,7 +2129,6 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite_bool(f, _T("cd32cd"), p->cs_cd32cd);
        cfgfile_dwrite_bool(f, _T("cd32c2p"), p->cs_cd32c2p);
        cfgfile_dwrite_bool(f, _T("cd32nvram"), p->cs_cd32nvram);
-       cfgfile_dwrite_bool(f, _T("cd32cubo"), p->cs_cd32cubo);
        cfgfile_dwrite(f, _T("cd32nvram_size"), _T("%d"), p->cs_cd32nvram_size / 1024);
        cfgfile_dwrite_bool(f, _T("cdtvcd"), p->cs_cdtvcd);
        cfgfile_dwrite_bool(f, _T("cdtv-cr"), p->cs_cdtvcr);
@@ -2534,31 +2581,11 @@ static int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR
        return 1;
 }
 
-
 static int cfgfile_path (const TCHAR *option, const TCHAR *value, const TCHAR *name, TCHAR *location, int maxsz, struct multipath *mp)
 {
        if (!cfgfile_string (option, value, name, location, maxsz))
                return 0;
-       TCHAR *s = target_expand_environment (location, NULL, 0);
-       _tcsncpy (location, s, maxsz - 1);
-       location[maxsz - 1] = 0;
-       if (mp) {
-               for (int i = 0; i < MAX_PATHS; i++) {
-                       if (mp->path[i][0] && _tcscmp (mp->path[i], _T(".\\")) != 0 && _tcscmp (mp->path[i], _T("./")) != 0 && (location[0] != '/' && location[0] != '\\' && !_tcschr(location, ':'))) {
-                               TCHAR np[MAX_DPATH];
-                               _tcscpy (np, mp->path[i]);
-                               fixtrailing (np);
-                               _tcscat (np, s);
-                               fullpath (np, sizeof np / sizeof (TCHAR));
-                               if (zfile_exists (np)) {
-                                       _tcsncpy (location, np, maxsz - 1);
-                                       location[maxsz - 1] = 0;
-                                       break;
-                               }
-                       }
-               }
-       }
-       xfree (s);
+       cfgfile_adjust_path(location, maxsz, mp);
        return 1;
 }
 
@@ -4395,7 +4422,7 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA
                // quoted special case
                if (tmpp2[0] == '\"') {
                        const TCHAR *end;
-                       TCHAR *n = cfgfile_unescape (tmpp2, &end, 0);
+                       TCHAR *n = cfgfile_unescape (tmpp2, &end, 0, false);
                        if (!n)
                                goto invalid_fs;
                        _tcscpy (uci.rootdir, n);
@@ -4423,7 +4450,7 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA
                // quoted special case
                if (tmpp2[0] == '\"') {
                        const TCHAR *end;
-                       TCHAR *n = cfgfile_unescape (tmpp2, &end, 0);
+                       TCHAR *n = cfgfile_unescape (tmpp2, &end, 0, false);
                        if (!n)
                                goto invalid_fs;
                        _tcscpy (uci.rootdir, n);
@@ -4452,7 +4479,7 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA
                        // quoted special case
                        if (tmpp2[0] == '\"') {
                                const TCHAR *end;
-                               TCHAR *n = cfgfile_unescape (tmpp2, &end, 0);
+                               TCHAR *n = cfgfile_unescape (tmpp2, &end, 0, false);
                                if (!n)
                                        goto invalid_fs;
                                _tcscpy (uci.filesys, n);
@@ -4482,7 +4509,7 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA
                                        }
                                        if (tmpp2[0]) {
                                                if (tmpp2[0] == '\"') {
-                                                       n = cfgfile_unescape (tmpp2, &end, 0);
+                                                       n = cfgfile_unescape (tmpp2, &end, 0, false);
                                                        if (!n)
                                                                goto invalid_fs;
                                                        _tcscpy(uci.geometry, n);
@@ -4962,7 +4989,6 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_yesno(option, value, _T("cd32cd"), &p->cs_cd32cd)
                || cfgfile_yesno(option, value, _T("cd32c2p"), &p->cs_cd32c2p)
                || cfgfile_yesno(option, value, _T("cd32nvram"), &p->cs_cd32nvram)
-               || cfgfile_yesno(option, value, _T("cd32cubo"), &p->cs_cd32cubo)
                || cfgfile_yesno(option, value, _T("cdtvcd"), &p->cs_cdtvcd)
                || cfgfile_yesno(option, value, _T("cdtv-cr"), &p->cs_cdtvcr)
                || cfgfile_yesno(option, value, _T("cdtvram"), &p->cs_cdtvram)
@@ -7097,7 +7123,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type)
        p->cs_agnusrev = -1;
        p->cs_deniserev = -1;
        p->cs_mbdmac = 0;
-       p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = p->cs_cd32fmv = p->cs_cd32cubo = false;
+       p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = p->cs_cd32fmv = false;
        p->cs_cd32nvram_size = 1024;
        p->cs_cdtvcd = p->cs_cdtvram = false;
        p->cs_cdtvcard = 0;
@@ -7377,7 +7403,7 @@ static void buildin_default_prefs (struct uae_prefs *p)
        p->cs_agnusrev = -1;
        p->cs_deniserev = -1;
        p->cs_mbdmac = 0;
-       p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = p->cs_cd32fmv = p->cs_cd32cubo = false;
+       p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = p->cs_cd32fmv = false;
        p->cs_cdtvcd = p->cs_cdtvram = p->cs_cdtvcard = false;
        p->cs_ide = 0;
        p->cs_pcmcia = 0;
@@ -7742,7 +7768,7 @@ static int bip_cd32 (struct uae_prefs *p, int config, int compa, int romcheck)
                if (!configure_rom (p, roms, romcheck))
                        return 0;
        } else if (config > 1) {
-               p->cs_cd32cubo = true;
+               addbcromtype(p, ROMTYPE_CUBO, true, NULL, 0);
        }
        return 1;
 }
index cebe4b74bed7cd600c69b190aed4bd4244f22b6f..8b554b5a9def333b5002384305bf08e32003d58a 100644 (file)
@@ -35,6 +35,7 @@ extern void statusline_getpos(int *x, int *y, int width, int height, int hx, int
 #define STATUSTYPE_DISPLAY 2
 #define STATUSTYPE_INPUT 3
 #define STATUSTYPE_CD 4
+#define STATUSTYPE_OTHER 5
 
 extern bool createstatusline(void);
 extern void deletestatusline(void);
index 45ae35870ae40d57946e982902dcd6d6f859ece6..3b976c95ec666f35ed8d06e86dfa31287bf930da 100644 (file)
@@ -113,7 +113,7 @@ const static GUID GUID_DEVINTERFACE_MOUSE = { 0x378de44c, 0x56ef, 0x11d1,
 extern int harddrive_dangerous, do_rdbdump;
 extern int no_rawinput, no_directinput, no_windowsmouse;
 extern int force_directsound;
-extern int log_a2065, a2065_promiscuous;
+extern int log_a2065, a2065_promiscuous, log_ethernet;
 extern int rawinput_enabled_hid, rawinput_log;
 extern int log_filesys;
 extern int forcedframelatency;
@@ -5581,6 +5581,7 @@ extern int log_cd32;
 extern int scanline_adjust;
 extern int log_ld;
 extern int logitech_lcd;
+extern uae_s64 max_avi_size;
 
 extern DWORD_PTR cpu_affinity, cpu_paffinity;
 static DWORD_PTR original_affinity = -1;
@@ -5598,6 +5599,21 @@ static int getval (const TCHAR *s)
                return 0;
        return v;
 }
+
+static uae_s64 getval64(const TCHAR *s)
+{
+       int base = 10;
+       uae_s64 v;
+       TCHAR *endptr;
+
+       if (s[0] == '0' && _totupper(s[1]) == 'X')
+               s += 2, base = 16;
+       v = _wcstoui64(s, &endptr, base);
+       if (*endptr != '\0' || *s == '\0')
+               return 0;
+       return v;
+}
+
 #if 0
 static float getvalf (const TCHAR *s)
 {
@@ -5928,6 +5944,15 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2)
        }
 #endif
 
+       if (!_tcscmp(arg, _T("max_avi_size"))) {
+               max_avi_size = getval64(np);
+               return 2;
+       }
+
+       if (!_tcscmp(arg, _T("ethlog"))) {
+               log_ethernet = getval(np);
+               return 2;
+       }
        if (!_tcscmp(arg, _T("scanlineadjust"))) {
                scanline_adjust = getval(np);
                return 2;
index c9458f6388493dd4d9156c4dc6e9b5754e7b5fd7..ce4e76a8ddb365e6dd5f10096266f8021517e27c 100644 (file)
 #define LANG_DLL_FULL_VERSION_MATCH 1
 
 #if WINUAEPUBLICBETA
-#define WINUAEBETA _T("4")
+#define WINUAEBETA _T("5")
 #else
 #define WINUAEBETA _T("")
 #endif
 
-#define WINUAEDATE MAKEBD(2017, 9, 10)
+#define WINUAEDATE MAKEBD(2017, 9, 30)
 
 //#define WINUAEEXTRA _T("AmiKit Preview")
 //#define WINUAEEXTRA _T("Amiga Forever Edition")
index ee1aebc96e6dd33039b27b024954f39974d0c59a..1c15da0a8382f6a294618fc83651e5c2323c5470 100644 (file)
@@ -8939,7 +8939,6 @@ static struct expansionrom_gui accelerator_gui_item;
 static void reset_expansionrom_gui(HWND hDlg, struct expansionrom_gui *eg, DWORD itemselector, DWORD selector, DWORD checkbox, DWORD stringbox)
 {
        eg->expansionrom_gui_settings = NULL;
-       eg->expansionrom_gui_item = 0;
        eg->expansionrom_gui_ebs = NULL;
        eg->expansionrom_gui_string[0] = 0;
        hide(hDlg, itemselector, 1);
@@ -8956,7 +8955,8 @@ static void create_expansionrom_gui(HWND hDlg, struct expansionrom_gui *eg, cons
        static int recursive;
        const struct expansionboardsettings *eb;
        if (eg->expansionrom_gui_ebs != ebs) {
-               eg->expansionrom_gui_item = 0;
+               if (eg->expansionrom_gui_ebs)
+                       eg->expansionrom_gui_item = 0;
                reset = true;
        }
        eg->expansionrom_gui_ebs = ebs;
@@ -8979,11 +8979,16 @@ static void create_expansionrom_gui(HWND hDlg, struct expansionrom_gui *eg, cons
                return;
        recursive++;
 
+retry:
        int item = eg->expansionrom_gui_item;
        hide(hDlg, itemselector, 0);
        int bitcnt = 0;
        for (int i = 0; i < item; i++) {
                const struct expansionboardsettings *eb = &ebs[i];
+               if (eb->name == NULL) {
+                       eg->expansionrom_gui_item = 0;
+                       goto retry;
+               }
                if (eb->type == EXPANSIONBOARD_STRING) {
                        ;
                } else if (eb->type == EXPANSIONBOARD_MULTI) {
index a0460670bd237b77280218973c1f18c6c5ce9d5b..0b5d04e2f03b86225d8287763815ec0dbd946fd0 100644 (file)
@@ -4,6 +4,27 @@ JIT Direct current rules are less complex now. It automatically switches off onl
   - RTG VRAM is outside of reserved natmem space. Workaround: Move RTG in earlier position using Hardware info GUI panel.\r
   Note that in 64-bit version RTG VRAM must be inside of reserved natmem space. (Outside = error message and return back to GUI)\r
 \r
+Beta 5:\r
+\r
+- Do not fallback to standard D3D9 from D3D9Ex if -nod3dshader command line is used, removed also other now mostly useless fallbacks.\r
+- Reduce CPU Idle when DMA operation is active (directory filesystem/UAE HDF or true DMA SCSI controller).\r
+- If Wait for blitter was enabled, blit used all available cycles and statefile was saved when blit was active: CPU state was saved before PC was increased. Restoring statefile would incorrectly restart the blit.\r
+- Action Replay III CIA read/write internal NMI triggers need small delay (NMI must be delayed until following instruction completes). Fixes Virus Test "Boot" option hang.\r
+- 341b2 mouse/joystick button release when input is uncaptured didn't fully set the new state.\r
+- Include "JIT direct switched off: reason" message in error log.\r
+- Relative path mode ignored Filesys path.\r
+- Host FPU mode: set host FPU round to nearest mode temporarily (if needed) before calling any native C-library trigonometric functions, other rounding modes can return (very) wrong results.\r
+- AVI recording file splitting (2G limit) flushed sound buffers causing random sound glitches. Added -max_avi_size <bytes> -command line parameter to set split size.\r
+\r
+Cubo CD32 updates:\r
+\r
+- Cubo is now an expansion device under custom controllers, DIP switches and hardware feature enable/disable settings are also in expansion config. Cubo config needs to be made from scratch.\r
+- NVRAM (Only in some later models) emulated, saved with CD32 nvram file. (1024 byte CD32 NVRAM + 2048 bytes Cubo + 16 byte Cubo RTC)\r
+- PIC protection emulated (not used by all games), added configurable Cubo PIC language string (2 characters) and game specific security key string (4 characters).\r
+- RTC (Only in some later models) emulated. Saved at the end of CD32 NVRAM file (16 bytes), games use unused timer registers as non-volatile data storage.\r
+\r
+- TODO: emulate different hardware variants. (different coin counter bits etc.. Information needed!) Current emulation supports latest (Odeon Twister 1/2?) version, only coin and ticket dispenser ("hopper" and "suzo" in service menu) are not implemented.\r
+\r
 Beta 4:\r
 \r
 - If DirectDraw mode surface allocation fails, retry it with smaller size.\r