]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2420b4
authorToni Wilen <twilen@winuae.net>
Sun, 3 Jun 2012 10:38:28 +0000 (13:38 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 3 Jun 2012 10:38:28 +0000 (13:38 +0300)
20 files changed:
blitter.cpp
bsdsocket.cpp
custom.cpp
drawing.cpp
filesys.cpp
include/options.h
inputdevice.cpp
memory.cpp
od-win32/dinput.cpp
od-win32/resources/resource
od-win32/resources/winuae.rc
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt
sampler.cpp
specialmonitors.cpp [changed mode: 0644->0755]
zfile.cpp
zfile_archive.cpp

index 700c382f5e08ca0a8f9e3a7225cf0fd78972ea1d..fe7219f8c5823e0395789e32a4a4cf35c03f97a3 100644 (file)
@@ -102,22 +102,22 @@ number of cycles, initial cycle, main cycle
 
 static const int blit_cycle_diagram[][DIAGSIZE] =
 {
-       { 2, 0,0,           0,0 },              /* 0 */
-       { 2, 0,0,           0,4 },              /* 1 */
-       { 2, 0,3,           0,3 },              /* 2 */
-       { 3, 0,3,0,         0,3,4 },    /* 3 */
-       { 3, 0,2,0,         0,2,0 },    /* 4 */
-       { 3, 0,2,0,         0,2,4 },    /* 5 */
-       { 3, 0,2,3,         0,2,3 },    /* 6 */
-       { 4, 0,2,3,0,   0,2,3,4 },  /* 7 */
-       { 2, 1,0,           1,0 },              /* 8 */
-       { 2, 1,0,           1,4 },              /* 9 */
-       { 2, 1,3,           1,3 },              /* A */
-       { 3, 1,3,0,         1,3,4, },   /* B */
-       { 3, 1,2,0,         1,2,0 },    /* C */
-       { 3, 1,2,0,         1,2,4 },    /* D */
-       { 3, 1,2,3,         1,2,3 },    /* E */
-       { 4, 1,2,3,0,   1,2,3,4 }       /* F */
+       { 2, 0,0,           0,0 },              /* 0   -- */
+       { 2, 0,0,           0,4 },              /* 1   -D */
+       { 2, 0,3,           0,3 },              /* 2   -C */
+       { 3, 0,3,0,         0,3,4 },    /* 3  -CD */
+       { 3, 0,2,0,         0,2,0 },    /* 4  -B- */
+       { 3, 0,2,0,         0,2,4 },    /* 5  -BD */
+       { 3, 0,2,3,         0,2,3 },    /* 6  -BC */
+       { 4, 0,2,3,0,   0,2,3,4 },  /* 7 -BCD */
+       { 2, 1,0,           1,0 },              /* 8   A- */
+       { 2, 1,0,           1,4 },              /* 9   AD */
+       { 2, 1,3,           1,3 },              /* A   AC */
+       { 3, 1,3,0,         1,3,4, },   /* B  ACD */
+       { 3, 1,2,0,         1,2,0 },    /* C  AB- */
+       { 3, 1,2,0,         1,2,4 },    /* D  ABD */
+       { 3, 1,2,3,         1,2,3 },    /* E  ABC */
+       { 4, 1,2,3,0,   1,2,3,4 }       /* F ABCD */
 };
 
 /*
index 97157d96fad32668ab82b4c791e2479403507452..bdb876b1eb720d5c7ad0ce1f80f8252cbc3b6b25 100644 (file)
@@ -1027,25 +1027,6 @@ static uae_u32 REGPARAM2 bsdsocklib_getprotobynumber (TrapContext *context)
        return sb->sb_errno ? 0 : sb->protoent;
 }
 
-/* *------ syslog functions */
-/* Syslog(level, format, ap)(d0/a0/a1) */
-static uae_u32 REGPARAM2 bsdsocklib_vsyslog (TrapContext *context)
-{
-       uae_char format_dst[256];
-       TCHAR *s;
-
-       uae_u32 level = m68k_dreg (regs, 0);
-       uaecptr format = m68k_areg (regs, 0);
-       uaecptr params = m68k_areg (regs, 1);
-
-       strcpyah_safe (format_dst, format, sizeof format_dst);
-
-       s = au (format_dst);
-       write_log (_T("SYSLOG: %s\n"), s);
-       xfree (s);
-       return 0;
-}
-
 /* *------ AmiTCP/IP 1.1 extensions */
 /* Dup2Socket(fd1, fd2)(d0/d1) */
 static uae_u32 REGPARAM2 bsdsocklib_Dup2Socket (TrapContext *context)
@@ -1108,6 +1089,86 @@ static uae_u32 errnotextptrs[sizeof (errortexts) / sizeof (*errortexts)];
 static const uae_u32 number_sys_error = sizeof (errortexts) / sizeof (*errortexts);
 
 
+/* *------ syslog functions */
+/* Syslog(level, format, ap)(d0/a0/a1) */
+static uae_u32 REGPARAM2 bsdsocklib_vsyslog (TrapContext *context)
+{
+#if 0
+       struct socketbase *sb = get_socketbase (context);
+       uae_char format_dst[512];
+       char out[256];
+       TCHAR *s;
+       uae_u8 paramtable[32 * 4];
+       int paramcnt, len;
+       uae_char *found = NULL;
+
+       uae_u32 level = m68k_dreg (regs, 0);
+       uaecptr format = m68k_areg (regs, 0);
+       uaecptr params = m68k_areg (regs, 1);
+
+       strcpyah_safe (format_dst, format, sizeof format_dst);
+
+       ((uae_u8**)paramtable)[0] = (uae_u8*)format_dst;
+       paramcnt = 4;
+       for (int i = 0; format_dst[i]; i++) {
+               if (format_dst[i] == '%') {
+                       if (found)
+                               found = NULL;
+                       else
+                               found = &format_dst[i];
+                       len = 4;
+               } else if (found) {
+                       char c = toupper (format_dst[i]);
+                       if (c < 'A' || c > 'Z')
+                               continue;
+                       if (c == 'H') {
+                               len = 2;
+                               continue;
+                       }
+                       if (c == 'M') {
+                               int err = sb->sb_errno;
+                               if (sb->sb_errno < 0 || sb->sb_errno >= sizeof (errortexts) / sizeof (*errortexts))
+                                       err = sizeof (errortexts) / sizeof (*errortexts) - 1;
+                               int errlen = _tcslen (errortexts[err]) - (&format_dst[i] - found);
+                               memmove (&format_dst[i] + errlen, &format_dst[i] + 1, strlen (&format_dst[i] + 1) + 1);
+                               ua_copy (found, sizeof format_dst, errortexts[err]);
+                               i += errlen - 1;
+                               continue;
+                       }
+
+                       if (c == 'P' || c == 'S' || c == 'N') {
+                               uaecptr pt = get_long (params);
+                               if (!valid_address (pt, 2))
+                                       goto end;
+                               ((uae_u8**)(paramtable + paramcnt))[0] = get_real_address (pt);
+                               params += 4;
+                               paramcnt += sizeof (uae_u8*);
+                       } else {
+                               if (len == 2)
+                                       ((uae_u16*)(paramtable + paramcnt))[0] = get_word (params);
+                               else
+                                       ((uae_u32*)(paramtable + paramcnt))[0] = get_long (params);
+                               params += len;
+                               paramcnt += len;
+                       }
+                       found = NULL;
+               }
+       }
+
+       va_list parms;
+       va_start (parms, paramtable);
+       _vsnprintf (out, sizeof out, format_dst, parms);
+       va_end (parms);
+
+       s = au (out);
+       write_log (_T("SYSLOG: %s\n"), s);
+       xfree (s);
+
+end:
+#endif
+       return 0;
+}
+
 static const TCHAR *herrortexts[] =
 {_T("No error"), _T("Unknown host"), _T("Host name lookup failure"), _T("Unknown server error"),
 _T("No address associated with name")};
index 393e74b71aa715a2af63b44fbdd0490356207b0f..6fe80877323a963cfd10ed6d8773807b46d7902f 100644 (file)
@@ -5460,34 +5460,35 @@ static bool framewait (void)
        status = 1;
 
        int clockadjust = 0;
-#if 0
-       static uae_u32 prevtick;
-       static int frametickcnt;
-
-       uae_u32 tick = read_system_time (); // milliseconds
-       uae_s32 tickdiff = tick - prevtick;
-       uae_s32 framems = (frametickcnt * 1000) / (int)(vblank_hz + 0.5);
-       if (abs (framems - tickdiff) >= 2000) {
-               framems = 0;
-               tickdiff = 0;
-               prevtick = tick;
-               frametickcnt = 0;
-               write_log (_T("!\n"));
-       } else {
-               frametickcnt++;
-       }
-       int diff = (framems - tickdiff) / 1;
-       if (diff < -5000)
-               diff = -5000;
-       else if (diff > 5000)
-               diff = 5000;
-       clockadjust = -vsynctimebase * diff / 1000;
-       clockadjust *= 100;
-       write_log (_T("%d:%d:%d\n"), framems - tickdiff, diff, clockadjust);
-#endif
+       int vstb = vsynctimebase;
 
        if (currprefs.m68k_speed < 0) {
 
+#if 0
+               static uae_u32 prevtick;
+               static int frametickcnt;
+
+               uae_u32 tick = read_system_time (); // milliseconds
+               uae_s32 tickdiff = tick - prevtick;
+               uae_s32 framems = (frametickcnt * 1000) / (int)(vblank_hz + 0.5);
+               if (abs (framems - tickdiff) >= 2000) {
+                       framems = 0;
+                       tickdiff = 0;
+                       prevtick = tick;
+                       frametickcnt = 0;
+                       write_log (_T("Clock sync reset!\n"));
+               } else {
+                       frametickcnt++;
+               }
+               int diff = (framems - tickdiff) / 1;
+               if (diff < -100)
+                       diff = -100;
+               else if (diff > 100)
+                       diff = 100;
+               clockadjust = -vsynctimebase * diff / 10000;
+               //write_log (_T("%05d:%05d:%05d\n"), framems - tickdiff, diff, clockadjust);
+#endif
+
                if (!frame_rendered && !picasso_on)
                        frame_rendered = render_screen (false);
 
@@ -5506,11 +5507,11 @@ static bool framewait (void)
 
                int max;
                int adjust = 0;
-               if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vsynctimebase / 2)
+               if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vstb / 2)
                        adjust += curr_time - vsyncwaittime;
                adjust += clockadjust;
-               max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
-               vsyncwaittime = curr_time + vsynctimebase - adjust;
+               max = vstb * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
+               vsyncwaittime = curr_time + vstb - adjust;
                vsyncmintime = curr_time;
 
                if (max < 0) {
@@ -5522,7 +5523,7 @@ static bool framewait (void)
                vsyncmaxtime = curr_time + max;
 
                if (0)
-                       write_log (_T("%06d:%06d/%06d\n"), adjust, vsynctimeperline, vsynctimebase);
+                       write_log (_T("%06d:%06d/%06d\n"), adjust, vsynctimeperline, vstb);
        
        } else {
 
@@ -5546,17 +5547,17 @@ static bool framewait (void)
                idletime += read_processor_time() - start;
                curr_time = read_processor_time ();
                vsyncmintime = curr_time;
-               vsyncmaxtime = vsyncwaittime = curr_time + vsynctimebase;
+               vsyncmaxtime = vsyncwaittime = curr_time + vstb;
                if (frame_rendered) {
                        show_screen ();
                        t += read_processor_time () - curr_time;
                }
                t += frameskipt_avg;
-               vsynctimeperline = (vsynctimebase - t) / 3;
+               vsynctimeperline = (vstb - t) / 3;
                if (vsynctimeperline < 0)
                        vsynctimeperline = 0;
-               else if (vsynctimeperline > vsynctimebase / 3)
-                       vsynctimeperline = vsynctimebase / 3;
+               else if (vsynctimeperline > vstb / 3)
+                       vsynctimeperline = vstb / 3;
                
                frame_shown = true;
 
@@ -6064,12 +6065,26 @@ static void hsync_handler_post (bool onvsync)
        bool ciasyncs = !(bplcon0 & 2) || ((bplcon0 & 2) && currprefs.genlock);
        CIA_hsync_posthandler (ciasyncs);
        if (currprefs.cs_ciaatod > 0) {
+#if 0
+               static uae_s32 oldtick;
+               uae_s32 tick = read_system_time (); // milliseconds
+               int ms = 1000 / (currprefs.cs_ciaatod == 2 ? 60 : 50);
+               if (tick - oldtick > 2000 || tick - oldtick < -2000) {
+                       oldtick = tick - ms;
+                       write_log (_T("RESET\n"));
+               } 
+               if (tick - oldtick >= ms) {
+                       CIA_vsync_posthandler (1);
+                       oldtick += ms;
+               }
+#else
                static int cia_hsync;
                cia_hsync -= 256;
                if (cia_hsync <= 0) {
                        CIA_vsync_posthandler (1);
                        cia_hsync += ((MAXVPOS_PAL * MAXHPOS_PAL * 50 * 256) / (maxhpos * (currprefs.cs_ciaatod == 2 ? 60 : 50)));
                }
+#endif
        } else if (currprefs.cs_ciaatod == 0 && onvsync) {
                CIA_vsync_posthandler (ciasyncs);
        }
index 6f7ea8f149e3b8b6f74f5dc19b689dec918b2986..27ef0970088d62bb0634f0ac23d1acc0cec771ca 100644 (file)
@@ -1781,11 +1781,21 @@ static void pfield_doline (int lineno)
 
 void init_row_map (void)
 {
+       static uae_u8 *oldbufmem;
+       static int oldheight, oldpitch;
+
        int i, j;
        if (gfxvidinfo.drawbuffer.height_allocated > MAX_VIDHEIGHT) {
                write_log (_T("Resolution too high, aborting\n"));
                abort ();
        }
+       if (oldbufmem && oldbufmem == gfxvidinfo.drawbuffer.bufmem &&
+               oldheight == gfxvidinfo.drawbuffer.height_allocated &&
+               oldpitch == gfxvidinfo.drawbuffer.rowbytes)
+               return;
+       oldbufmem = gfxvidinfo.drawbuffer.bufmem;
+       oldheight = gfxvidinfo.drawbuffer.height_allocated;
+       oldpitch = gfxvidinfo.drawbuffer.rowbytes;
        j = 0;
        for (i = gfxvidinfo.drawbuffer.height_allocated; i < MAX_VIDHEIGHT + 1; i++)
                row_map[i] = row_tmp;
index 100e9065f814f4723e4a80dc456253d695a5642f..e8e763762cb04a4244032d429de4cd685a5acc04 100644 (file)
@@ -6024,6 +6024,26 @@ static TCHAR *device_dupfix (uaecptr expbase, TCHAR *devname)
        return my_strdup (newname);
 }
 
+static const TCHAR *dostypes (uae_u32 dostype)
+{
+       static TCHAR dt[32];
+       int j;
+
+       j = 0;
+       for (int i = 0; i < 4; i++) {
+               uae_u8 c = dostype >> ((3 - i) * 8);
+               if (c >= ' ' && c <= 'z') {
+                       dt[j++] = c;
+               } else {
+                       dt[j++] = '\\';
+                       _stprintf (&dt[j], _T("%d"), c);
+                       j += _tcslen (&dt[j]);
+               }
+       }
+       dt[j] = 0;
+       return dt;
+}
+
 static void dump_partinfo (struct hardfiledata *hfd, uae_u8 *pp)
 {
        TCHAR *s;
@@ -6047,7 +6067,7 @@ static void dump_partinfo (struct hardfiledata *hfd, uae_u8 *pp)
        lowcyl = rl (pp + 36);
        highcyl = rl (pp + 40);
 
-       write_log (_T("RDB: '%s' dostype=%08X\n"), s, dostype);
+       write_log (_T("RDB: '%s' dostype=%08X (%s)\n"), s, dostype, dostypes (dostype));
        write_log (_T("BlockSize: %d, Surfaces: %d, SectorsPerBlock %d\n"),
                blocksize, surfaces, spb);
        write_log (_T("SectorsPerTrack: %d, Reserved: %d, LowCyl %d, HighCyl %d, Size %dM\n"),
@@ -6057,7 +6077,7 @@ static void dump_partinfo (struct hardfiledata *hfd, uae_u8 *pp)
 
        block = lowcyl * surfaces * spt;
        if (hdf_read (hfd, buf, (uae_u64)blocksize * block, sizeof buf)) {
-               write_log (_T("First block %d dostype: %08X\n"), block, rl (buf));
+               write_log (_T("First block %d dostype: %08X (%s)\n"), block, rl (buf), dostypes (rl (buf)));
        } else {
                write_log (_T("First block %d read failed!\n"), block);
        }
@@ -6120,7 +6140,7 @@ static void dump_rdb (UnitInfo *uip, struct hardfiledata *hfd, uae_u8 *bufrdb, u
                uae_u32 dostype = rl (buf + 32);
                int version = (buf[36] << 8) | buf[37];
                int revision = (buf[38] << 8) | buf[39];
-               write_log (_T("LSEG: %08x (%d.%d)\n"), dostype, version, revision);
+               write_log (_T("LSEG: %08x (%s) %d.%d\n"), dostype, dostypes (dostype), version, revision);
        }
 }
 
@@ -6286,7 +6306,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
        for (;;) {
                if (fileblock == -1) {
                        if (!fsnode)
-                               write_log (_T("RDB: FS %08X not in FileSystem.resource or in RDB\n"), dostype);
+                               write_log (_T("RDB: FS %08X (%s) not in FileSystem.resource or in RDB\n"), dostype, dostypes (dostype));
                        goto error;
                }
                if (!legalrdbblock (uip, fileblock)) {
@@ -6307,9 +6327,9 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
        newversion = (buf[36] << 8) | buf[37];
        newrevision = (buf[38] << 8) | buf[39];
 
-       write_log (_T("RDB: RDB filesystem %08X version %d.%d\n"), dostype, newversion, newrevision);
+       write_log (_T("RDB: RDB filesystem %08X (%s) version %d.%d\n"), dostype, dostypes (dostype), newversion, newrevision);
        if (fsnode) {
-               write_log (_T("RDB: %08X in FileSystem.resource version %d.%d\n"), dostype, oldversion, oldrevision);
+               write_log (_T("RDB: %08X (%s) in FileSystem.resource version %d.%d\n"), dostype, dostypes (dostype), oldversion, oldrevision);
        }
        if (newversion * 65536 + newrevision <= oldversion * 65536 + oldrevision && oldversion >= 0) {
                write_log (_T("RDB: FS in FileSystem.resource is newer or same, ignoring RDB filesystem\n"));
@@ -6403,13 +6423,13 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket)
                _tcscpy (tmp + i, _T("FastFileSystem"));
        }
        if (tmp[0] == 0) {
-               write_log (_T("RDB: no filesystem for dostype 0x%08X\n"), dostype);
+               write_log (_T("RDB: no filesystem for dostype 0x%08X (%s)\n"), dostype, dostypes (dostype));
                if ((dostype & 0xffffff00) == 0x444f5300)
                        return FILESYS_HARDFILE;
                write_log (_T("RDB: mounted without filesys\n"));
                return FILESYS_HARDFILE;
        }
-       write_log (_T("RDB: fakefilesys, trying to load '%s', dostype 0x%08X\n"), tmp, dostype);
+       write_log (_T("RDB: fakefilesys, trying to load '%s', dostype 0x%08X (%s)\n"), tmp, dostype, dostypes (dostype));
        zf = zfile_fopen (tmp, _T("rb"), ZFD_NORMAL);
        if (!zf) {
                write_log (_T("RDB: filesys not found\n"));
@@ -6430,7 +6450,7 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket)
        uip->rdb_filesyssize = size;
        put_long (parmpacket + PP_FSSIZE, uip->rdb_filesyssize);
        addfakefilesys (parmpacket, dostype);
-       write_log (_T("HDF: faked RDB filesystem %08X loaded\n"), dostype);
+       write_log (_T("HDF: faked RDB filesystem %08X (%s) loaded\n"), dostype, dostypes (dostype));
        return FILESYS_HARDFILE;
 }
 
index f76ce8a261cb2cd264380adde502f75a3c751aa0..99caefa95cd49a95f6fe52d216724e19c1f80754 100644 (file)
@@ -432,6 +432,7 @@ struct uae_prefs {
        bool win32_middle_mouse;
        bool win32_logfile;
        bool win32_notaskbarbutton;
+       bool win32_nonotificationicon;
        bool win32_alwaysontop;
        bool win32_powersavedisabled;
        bool win32_minimize_inactive;
index f1595ad662e575c7e59e4d7b19cea773c5252e16..e7f5a3d5395108f1577900f80231e7e1d0ea87f7 100644 (file)
@@ -3330,6 +3330,8 @@ static void process_custom_event (struct uae_input_device *id, int offset, int s
        int idx, slotoffset, flags, custompos, qual;
        TCHAR *custom;
 
+       queue_input_event (-1, NULL, -1, 0, 0, 1);
+
        if (!id)
                return;
        
@@ -3356,8 +3358,6 @@ static void process_custom_event (struct uae_input_device *id, int offset, int s
        if (sub != 0)
                return;
 
-       queue_input_event (-1, NULL, -1, 0, 0, 1);
-
        slotoffset = 0;
        if (!checkqualifiers (id->eventid[offset][slotoffset], id->flags[offset][slotoffset], qualmask)) {
                slotoffset = 4;
@@ -4991,6 +4991,10 @@ static int inputdevice_translatekeycode_2 (int keyboard, int scancode, int state
                                if (qualifiercheckonly)
                                        continue;
 
+                               if (!state) {
+                                       process_custom_event (na, j, state, qualmask, autofire, k);
+                               }
+
                                // if evt == caps and scan == caps: sync with native caps led
                                if (evt == INPUTEVENT_KEY_CAPS_LOCK) {
                                        int v;
index b6f48db65344bebe2637d52ce8d7b9fa5008dac7..a0ed858fd367b61a596b36558121a74311a00e9b 100644 (file)
@@ -51,6 +51,16 @@ static bool canjit (void)
                return false;
        return true;
 }
+static bool needmman (void)
+{
+       if (canjit ())
+               return true;
+#ifdef _WIN32  
+       if (currprefs.rtgmem_size)
+               return true;
+#endif
+       return false;
+}
 
 static void nocanbang (void)
 {
@@ -1941,7 +1951,7 @@ static shmpiece *find_shmpiece (uae_u8 *base)
 
 static void delete_shmmaps (uae_u32 start, uae_u32 size)
 {
-       if (!canjit ())
+       if (!needmman ())
                return;
 
        while (size) {
@@ -1988,7 +1998,7 @@ static void add_shmmaps (uae_u32 start, addrbank *what)
        shmpiece *y;
        uae_u8 *base = what->baseaddr;
 
-       if (!canjit ())
+       if (!needmman ())
                return;
        if (!base)
                return;
@@ -2020,7 +2030,7 @@ uae_u8 *mapped_malloc (size_t s, const TCHAR *file)
        shmpiece *x;
        static int recurse;
 
-       if (!canjit ()) {
+       if (!needmman ()) {
                nocanbang ();
                return xcalloc (uae_u8, s + 4);
        }
@@ -2077,7 +2087,7 @@ static void allocate_memory (void)
        /* emulate 0.5M+0.5M with 1M Agnus chip ram aliasing */
        if ((allocated_chipmem != currprefs.chipmem_size || allocated_bogomem != currprefs.bogomem_size) &&
                currprefs.chipmem_size == 0x80000 && currprefs.bogomem_size >= 0x80000 &&
-               (currprefs.chipset_mask & CSMASK_ECS_AGNUS) && !(currprefs.chipset_mask & CSMASK_AGA) && !canjit ()) {
+               (currprefs.chipset_mask & CSMASK_ECS_AGNUS) && !(currprefs.chipset_mask & CSMASK_AGA) && !needmman ()) {
                        int memsize1, memsize2;
                        if (chipmemory)
                                mapped_free (chipmemory);
index 875e42c8d187c1860f8f41abb45c67da986f851d..ad5f25e14679462069f5cdc661eda2b692067fe9 100644 (file)
@@ -1530,9 +1530,10 @@ static bool initialize_rawinput (void)
                        } else if (type == RIM_TYPEHID) {
                                if (rdpdevice (buf1))
                                        continue;
-                               if (rdi->hid.usUsage != 4 && rdi->hid.usUsage != 5) {
+                               if (rdi->hid.usUsage != 4 && rdi->hid.usUsage != 5)
+                                       continue;
+                               if (rdi->hid.usUsagePage >= 0xff00) // vendor specific
                                        continue;
-                               }
                                for (i = 0; hidnorawinput[i].vid; i++) {
                                        if (rdi->hid.dwProductId == hidnorawinput[i].pid && rdi->hid.dwVendorId == hidnorawinput[i].vid)
                                                break;
index d4509d77552fa272f3c9b654cf25eb74ae43e925..ba3ac16718c5e4d7edf1f55b6051feb4d9eee6be 100644 (file)
 #define IDS_FILTEROVERLAYTYPE_MASKS     379
 #define IDS_FILTEROVERLAYTYPE_OVERLAYS  380
 #define IDS_AUTOSCALE_INTEGER_AUTOSCALE 381
+#define IDS_WSTYLE_BORDERLESS           382
+#define IDS_WSTYLE_MINIMAL              383
+#define IDS_WSTYLE_STANDARD             384
+#define IDS_WSTYLE_EXTENDED             385
 #define IDS_QS_MODELS                   1000
 #define IDS_QS_MODEL_A500               1001
 #define IDS_QS_MODEL_A500P              1002
 #define IDC_MIDILIST                    1023
 #define IDC_MIDIOUTLIST                 1023
 #define IDC_DA_MODE                     1023
-#define IDC_SHOWGUI                     1024
 #define IDC_MIDIINLIST                  1024
 #define IDC_RESOLUTION2                 1024
 #define IDC_DISPLAYSELECT               1024
 #define IDC_SCREENMODE_NATIVE           1026
 #define IDC_PRINTERTYPELIST             1026
 #define IDC_FASTMEM                     1027
-#define IDC_SHOWLEDS                    1027
 #define IDC_PORT1_JOYS                  1027
 #define IDC_SCREENMODE_RTG              1027
 #define IDC_DONGLELIST                  1027
 #define IDC_MBMEM1                      1028
 #define IDC_PORT_TABLET_CURSOR          1028
-#define IDC_SHOWLEDSRTG                 1028
 #define IDC_SAMPLERLIST                 1028
 #define IDC_DISPLAY_BUFFERCNT           1028
 #define IDC_PORT0_JOYSMODE              1029
 #define IDC_PARALLEL                    1033
 #define IDC_PORT0_AF                    1033
 #define IDC_PORT1_AF                    1034
-#define IDC_JULIAN                      1040
 #define IDC_FOCUSMINIMIZE               1041
 #define IDC_FASTTEXT                    1043
 #define IDC_FASTRAM                     1044
 #define IDC_FLUSHPRINTER                1510
 #define IDC_MAPDRIVES_REMOVABLE         1510
 #define IDC_PORT0_TEST                  1510
-#define IDC_CACHETEXT2                  1510
 #define IDC_SCREENRESTEXT               1511
 #define IDC_MAPDRIVES_AUTO              1511
 #define IDC_PORT0_TEST2                 1511
 #define IDC_STATEREC_CAPTURE2           1533
 #define IDC_ACTIVE_PAUSE                1534
 #define IDC_ACTIVE_NOSOUND              1535
+#define IDC_STATECLEAR                  1536
 #define IDC_SER_SHARED                  1553
 #define IDC_SER_CTSRTS                  1554
 #define IDC_SER_DIRECT                  1555
 #define IDC_JITENABLE                   1584
 #define IDC_DISASSEMBLY                 1585
 #define IDC_MMUENABLE                   1585
-#define IDC_CTRLF11                     1586
-#define IDC_FASTCOPPER                  1588
 #define IDC_COLLISION0                  1589
 #define IDC_COLLISION1                  1590
 #define IDC_AUDIOSYNC                   1590
 #define IDC_INPUTTYPE                   1607
 #define IDC_INPUTSELECTTEXT             1608
 #define IDC_NOUAEFSDB                   1608
-#define IDC_NOTASKBARBUTTON             1608
-#define IDC_CLOCKSYNC                   1609
 #define IDC_INPUTDEVICE                 1609
 #define IDC_MAPROM                      1609
 #define IDC_NORECYCLEBIN                1609
 #define IDC_AVIOUTPUT_FILE              1611
 #define IDC_INPUTLIST                   1611
 #define IDC_CATWEASEL                   1611
-#define IDC_CLIPBOARDSHARE              1611
 #define IDC_INPUTAMIGA                  1612
-#define IDC_BORDERLESS                  1612
-#define IDC_POWERSAVE                   1612
 #define IDC_AVIOUTPUT_VIDEO             1613
 #define IDC_INPUTAUTOFIRE               1613
 #define IDC_PORT_MOUSETRICK             1613
-#define IDC_NATIVECODE                  1613
 #define IDC_AVIOUTPUT_AUDIO             1614
 #define IDC_INPUTCOPYFROM               1614
 #define IDC_SANA2                       1614
 #define IDC_CD_SELECT                   1807
 #define IDC_FASTMEMAUTOCONFIG           1808
 #define IDC_RTG_DISPLAYSELECT           1809
+#define IDC_MISCLIST                    1810
+#define IDC_STATENAME                   1811
 #define ID__FLOPPYDRIVES                40004
 #define ID_FLOPPYDRIVES_DF0             40005
 #define ID_ST_CONFIGURATION             40010
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NO_MFC                     1
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        370
+#define _APS_NEXT_RESOURCE_VALUE        386
 #define _APS_NEXT_COMMAND_VALUE         40050
-#define _APS_NEXT_CONTROL_VALUE         1810
+#define _APS_NEXT_CONTROL_VALUE         1812
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif
index 628bbc458c316a777fb196866942fab47f91f11e..543781f732bae6a499741112eae679319389d186 100644 (file)
@@ -132,10 +132,10 @@ BEGIN
     CONTROL         "Double",IDC_LM_DOUBLED,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,164,45,10\r
     CONTROL         "Scanlines",IDC_LM_SCANLINES,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,231,180,46,10\r
     COMBOBOX        IDC_DA_MODE,4,218,58,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "",IDC_DA_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,67,214,101,20\r
+    CONTROL         "",IDC_DA_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,67,214,96,20\r
     LTEXT           "FPS adj.:",IDC_REFRESH2TEXT,9,193,32,8\r
     CONTROL         "",IDC_FRAMERATE2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,40,188,99,20\r
-    EDITTEXT        IDC_RATE2TEXT,143,192,41,12,ES_AUTOHSCROLL\r
+    EDITTEXT        IDC_RATE2TEXT,143,192,46,12,ES_AUTOHSCROLL\r
     COMBOBOX        IDC_RESOLUTIONDEPTH,134,27,46,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
     CONTROL         "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,125,89,10\r
     COMBOBOX        IDC_SCREENMODE_NATIVE,39,85,63,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
@@ -482,42 +482,28 @@ IDD_MISC1 DIALOGEX 0, 0, 300, 237
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
 FONT 8, "MS Sans Serif", 0, 0, 0x1\r
 BEGIN\r
-    GROUPBOX        "Miscellaneous Options",IDC_STATIC,4,2,293,165\r
-    CONTROL         "Untrap = middle button",IDC_JULIAN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,19,110,10\r
-    CONTROL         "Show GUI on startup",IDC_SHOWGUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,43,109,10\r
-    CONTROL         "Native on-screen display",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182,103,109,10\r
-    CONTROL         "Don't show taskbar button",IDC_NOTASKBARBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,67,109,10\r
-    CONTROL         "Use CTRL-F11 to quit",IDC_CTRLF11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,55,110,10\r
+    GROUPBOX        "Miscellaneous Options",IDC_STATIC,169,2,128,131\r
     GROUPBOX        "Keyboard LEDs",IDC_STATIC,3,207,294,29\r
     COMBOBOX        IDC_KBLED1,10,218,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     COMBOBOX        IDC_KBLED2,78,218,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     COMBOBOX        IDC_KBLED3,145,218,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    GROUPBOX        "Logging",IDC_STATIC,4,167,151,38\r
-    CONTROL         "Create log file",IDC_CREATELOGFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,41,176,72,10\r
-    CONTROL         "Illegal memory accesses",IDC_ILLEGAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,41,188,95,10\r
-    GROUPBOX        "State Files",IDC_STATIC,162,167,135,38\r
-    PUSHBUTTON      "Load state...",IDC_DOLOADSTATE,175,182,49,14\r
-    PUSHBUTTON      "Save state...",IDC_DOSAVESTATE,235,182,49,14\r
-    CONTROL         "Always on top",IDC_ALWAYSONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,79,98,10\r
+    GROUPBOX        "State Files",IDC_STATIC,3,168,293,38\r
+    PUSHBUTTON      "Load state...",IDC_DOLOADSTATE,178,183,55,14\r
+    PUSHBUTTON      "Save state...",IDC_DOSAVESTATE,237,183,55,14\r
     CONTROL         "USB mode",IDC_KBLED_USB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,217,219,64,10\r
-    COMBOBOX        IDC_SCSIMODE,213,26,80,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    COMBOBOX        IDC_LANGUAGE,153,144,122,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    GROUPBOX        "Language",IDC_STATIC,138,134,154,27\r
-    CONTROL         "Disable screensaver",IDC_POWERSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,91,109,10\r
-    COMBOBOX        IDC_DD_SURFACETYPE,213,78,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
-    RTEXT           "DirectDraw display buffer:",IDC_STATIC,112,79,97,10,SS_CENTERIMAGE\r
-    RTEXT           "SCSI and CD/DVD access method:",IDC_STATIC,151,12,126,10,SS_CENTERIMAGE\r
-    CONTROL         "Synchronize clock",IDC_CLOCKSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,103,111,10\r
-    CONTROL         "Faster RTG [] Enables less accurate custom chipset emulation mode when Picasso96 is enabled.",IDC_FASTERRTG,\r
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,19,115,111,10\r
-    CONTROL         "RTG on-screen display",IDC_SHOWLEDSRTG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182,114,109,10\r
-    RTEXT           "Graphics API:",IDC_STATIC,130,62,79,10,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_DXMODE,213,60,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Minimize when focus is lost",IDC_FOCUSMINIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,31,110,10\r
-    RTEXT           "Windowed style:",IDC_STATIC,128,45,81,10,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_WINDOWEDMODE,213,43,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Clipboard sharing",IDC_CLIPBOARDSHARE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,127,111,10\r
-    CONTROL         "Allow native code",IDC_NATIVECODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,139,111,10\r
+    COMBOBOX        IDC_SCSIMODE,194,26,80,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    COMBOBOX        IDC_LANGUAGE,197,146,77,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    GROUPBOX        "Language",IDC_STATIC,169,133,127,33\r
+    COMBOBOX        IDC_DD_SURFACETYPE,194,114,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+    CTEXT           "DirectDraw:",IDC_STATIC,175,101,117,10,SS_CENTERIMAGE\r
+    CTEXT           "SCSI and CD/DVD access:",IDC_STATIC,175,12,117,10,SS_CENTERIMAGE\r
+    CTEXT           "Graphics API:",IDC_STATIC,175,72,117,10,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_DXMODE,194,85,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+    CTEXT           "Windowed style:",IDC_STATIC,175,42,117,10,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_WINDOWEDMODE,194,56,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+    CONTROL         "",IDC_MISCLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,3,5,162,161\r
+    EDITTEXT        IDC_STATENAME,8,183,144,13,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP\r
+    CONTROL         "",IDC_STATECLEAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,158,185,9,10\r
 END\r
 \r
 IDD_HARDFILE DIALOGEX 0, 0, 299, 249\r
@@ -835,7 +821,7 @@ IDD_DISK DIALOGEX 0, 0, 300, 242
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_CONTROL | DS_CENTER | DS_CENTERMOUSE | WS_CHILD\r
 FONT 8, "MS Sans Serif", 0, 0, 0x0\r
 BEGIN\r
-    CONTROL         "",IDC_DISKLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,6,292,196\r
+    CONTROL         "",IDC_DISKLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,4,4,292,198\r
     PUSHBUTTON      "Remove floppy disk image",IDC_DISKLISTREMOVE,156,223,101,15\r
     COMBOBOX        IDC_DISKTEXT,3,205,293,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "Insert floppy disk image",IDC_DISKLISTINSERT,41,223,101,15\r
@@ -1711,6 +1697,8 @@ BEGIN
     IDS_FILTEROVERLAYTYPE_MASKS "Masks"\r
     IDS_FILTEROVERLAYTYPE_OVERLAYS "Overlays"\r
     IDS_AUTOSCALE_INTEGER_AUTOSCALE "Auto Integer scaling"\r
+    IDS_WSTYLE_BORDERLESS   "Borderless"\r
+    IDS_WSTYLE_MINIMAL      "Minimal"\r
 END\r
 \r
 STRINGTABLE\r
@@ -1720,6 +1708,12 @@ BEGIN
     IDS_AUTODETECT          "Autodetect"\r
 END\r
 \r
+STRINGTABLE\r
+BEGIN\r
+    IDS_WSTYLE_STANDARD     "Standard"\r
+    IDS_WSTYLE_EXTENDED     "Extended"\r
+END\r
+\r
 #endif    // English resources\r
 /////////////////////////////////////////////////////////////////////////////\r
 \r
index 5abe9b06b14bc500aa1744e47ef3205a7790e45d..de892f0510f1da005f344c21749d06070b741b4c 100644 (file)
@@ -2880,8 +2880,9 @@ void target_default_options (struct uae_prefs *p, int type)
                //p->win32_active_nocapture_priority = 1;
                p->win32_inactive_priority = 2;
                p->win32_iconified_priority = 3;
-               p->win32_notaskbarbutton = 0;
-               p->win32_alwaysontop = 0;
+               p->win32_notaskbarbutton = false;
+               p->win32_nonotificationicon = false;
+               p->win32_alwaysontop = false;
                p->win32_guikey = -1;
                p->win32_automount_removable = 0;
                p->win32_automount_drives = 0;
@@ -3006,6 +3007,7 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
 
        cfgfile_target_dwrite (f, _T("cpu_idle"), _T("%d"), p->cpu_idle);
        cfgfile_target_dwrite_bool (f, _T("notaskbarbutton"), p->win32_notaskbarbutton);
+       cfgfile_target_dwrite_bool (f, _T("nonotificationicon"), p->win32_nonotificationicon);
        cfgfile_target_dwrite_bool (f, _T("always_on_top"), p->win32_alwaysontop);
        cfgfile_target_dwrite_bool (f, _T("no_recyclebin"), p->win32_norecyclebin);
        if (p->win32_guikey >= 0)
@@ -3078,6 +3080,7 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *
                || cfgfile_intval (option, value, _T("midiin_device"), &p->win32_midiindev, 1)
                || cfgfile_intval (option, value, _T("samplersoundcard"), &p->win32_samplersoundcard, 1)
                || cfgfile_yesno (option, value, _T("notaskbarbutton"), &p->win32_notaskbarbutton)
+               || cfgfile_yesno (option, value, _T("nonotificationicon"), &p->win32_nonotificationicon)
                || cfgfile_yesno (option, value, _T("always_on_top"), &p->win32_alwaysontop)
                || cfgfile_yesno (option, value, _T("powersavedisabled"), &p->win32_powersavedisabled)
                || cfgfile_string (option, value, _T("exec_before"), p->win32_commandpathstart, sizeof p->win32_commandpathstart / sizeof (TCHAR))
@@ -5530,6 +5533,9 @@ void systray (HWND hwnd, int remove)
        NOTIFYICONDATA nid;
        BOOL v;
 
+       if (!remove && currprefs.win32_nonotificationicon)
+               return;
+
 #ifdef RETROPLATFORM
        if (rp_isactive ())
                return;
index 977eb0878e82e2771c473529007676f4bc21ad10..b918c5f68facec7d1f4047ce295271e313c339ed 100644 (file)
@@ -19,8 +19,8 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA _T("")
-#define WINUAEBETA _T("3")
-#define WINUAEDATE MAKEBD(2012, 5, 25)
+#define WINUAEBETA _T("4")
+#define WINUAEDATE MAKEBD(2012, 6, 3)
 #define WINUAEEXTRA _T("")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 #define WINUAEREV _T("")
index d79ba3aaa278e8bc4b6c6c71058c5277015104b6..57f641d5393611d50caf8c2c553e1ce89c3a677c 100644 (file)
@@ -1524,6 +1524,7 @@ int check_prefs_changed_gfx (void)
 
        c |= currprefs.win32_alwaysontop != changed_prefs.win32_alwaysontop ? 32 : 0;
        c |= currprefs.win32_notaskbarbutton != changed_prefs.win32_notaskbarbutton ? 32 : 0;
+       c |= currprefs.win32_nonotificationicon != changed_prefs.win32_nonotificationicon ? 32 : 0;
        c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 32 : 0;
        c |= currprefs.win32_statusbar != changed_prefs.win32_statusbar ? 32 : 0;
        c |= currprefs.win32_rtgmatchdepth != changed_prefs.win32_rtgmatchdepth ? 2 : 0;
@@ -1596,6 +1597,7 @@ int check_prefs_changed_gfx (void)
                currprefs.gfx_apmode[1].gfx_backbuffers = changed_prefs.gfx_apmode[1].gfx_backbuffers;
 
                currprefs.win32_alwaysontop = changed_prefs.win32_alwaysontop;
+               currprefs.win32_nonotificationicon = changed_prefs.win32_nonotificationicon;
                currprefs.win32_notaskbarbutton = changed_prefs.win32_notaskbarbutton;
                currprefs.win32_borderless = changed_prefs.win32_borderless;
                currprefs.win32_statusbar = changed_prefs.win32_statusbar;
@@ -2198,6 +2200,8 @@ void machdep_free (void)
 
 int graphics_init (void)
 {
+       systray (hHiddenWnd, TRUE);
+       systray (hHiddenWnd, FALSE);
        gfxmode_reset ();
        return open_windows (1);
 }
index 02c39c1d24600a9babca0586f4c793ff2b068e83..68564edac122fa40d70426e0ffd9a1bb0305732d 100644 (file)
@@ -3539,6 +3539,7 @@ static int clicked_entry = -1;
 #define DISK_COLUMNS 3
 #define MISC2_COLUMNS 2
 #define INPUTMAP_COLUMNS 1
+#define MISC1_COLUMNS 1
 #define MAX_COLUMN_HEADING_WIDTH 20
 
 #define LV_LOADSAVE 1
@@ -3547,13 +3548,44 @@ static int clicked_entry = -1;
 #define LV_DISK 4
 #define LV_MISC2 5
 #define LV_INPUTMAP 6
-#define LV_MAX 7
+#define LV_MISC1 7
+#define LV_MAX 8
 
 static int lv_oldidx[LV_MAX];
 static int lv_old_type = -1;
 
 static int listview_num_columns;
 
+struct miscentry
+{
+       int type;
+       int canactive;
+       TCHAR *name;
+       bool *b;
+       int *i;
+       int ival, imask;
+};
+
+static struct miscentry misclist[] = { 
+       { 0, 1, _T("Untrap = middle button"),  &workprefs.win32_middle_mouse },
+       { 0, 1, _T("Minimize when focus is lost"), &workprefs.win32_minimize_inactive },
+       { 0, 0, _T("Show GUI on startup"), &workprefs.start_gui },
+       { 0, 1, _T("Use CTRL-F11 to quit"), &workprefs.win32_ctrl_F11_is_quit },
+       { 0, 1, _T("Don't show taskbar button"), &workprefs.win32_notaskbarbutton },
+       { 0, 1, _T("Don't show notification icon"), &workprefs.win32_nonotificationicon },
+       { 0, 1, _T("Always on top"), &workprefs.win32_alwaysontop },
+       { 0, 1, _T("Disable screensaver"), &workprefs.win32_powersavedisabled },
+       { 0, 0, _T("Synchronize clock"), &workprefs.tod_hack },
+       { 0, 1, _T("Faster RTG"), &workprefs.picasso96_nocustom },
+       { 0, 0, _T("Clipboard sharing"), &workprefs.clipboard_sharing },
+       { 0, 1, _T("Allow native code"), &workprefs.native_code },
+       { 0, 1, _T("Native on-screen display"), NULL, &workprefs.leds_on_screen, STATUSLINE_CHIPSET, STATUSLINE_CHIPSET },
+       { 0, 1, _T("RTG on-screen display"), NULL, &workprefs.leds_on_screen, STATUSLINE_RTG, STATUSLINE_RTG },
+       { 0, 0, _T("Create winuaelog.txt log"), &workprefs.win32_logfile },
+       { 0, 0, _T("Log illegal memory accesses"), &workprefs.illegal_mem },
+       { 0, NULL }
+};
+
 void InitializeListView (HWND hDlg)
 {
        int lv_type;
@@ -3572,11 +3604,13 @@ void InitializeListView (HWND hDlg)
        int items = 0, result = 0, i, j, entry = 0, temp = 0;
        TCHAR tmp[10], tmp2[MAX_DPATH];
        int listview_column_width[HARDDISK_COLUMNS];
+       DWORD extraflags = 0;
 
        if (cachedlist) {
-               if (lv_old_type >= 0)
+               if (lv_old_type >= 0) {
                        lv_oldidx[lv_old_type] = ListView_GetTopIndex (cachedlist);
                        lv_oldidx[lv_old_type] += ListView_GetCountPerPage (cachedlist) - 1;
+               }
                cachedlist = NULL;
        }
 
@@ -3610,7 +3644,7 @@ void InitializeListView (HWND hDlg)
 
                listview_num_columns = INPUTMAP_COLUMNS;
                lv_type = LV_INPUTMAP;
-               column_heading[0][0] = NULL;
+               column_heading[0][0] = 0;
                list = GetDlgItem (hDlg, IDC_INPUTMAPLIST);
 
        } else if (hDlg == pages[MISC2_ID]) {
@@ -3621,6 +3655,14 @@ void InitializeListView (HWND hDlg)
                _tcscpy (column_heading[1], _T(""));
                list = GetDlgItem (hDlg, IDC_ASSOCIATELIST);
 
+       } else if (hDlg == pages[MISC1_ID]) {
+
+               listview_num_columns = MISC1_COLUMNS;
+               lv_type = LV_MISC1;
+               column_heading[0][0] = 0;
+               list = GetDlgItem (hDlg, IDC_MISCLIST);
+               extraflags = LVS_EX_CHECKBOXES;
+
        } else {
 
                listview_num_columns = DISK_COLUMNS;
@@ -3632,7 +3674,9 @@ void InitializeListView (HWND hDlg)
 
        }
 
-       int flags = LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT | LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT;
+       int flags = LVS_EX_DOUBLEBUFFER | extraflags;
+       if (lv_type != LV_MISC1)
+               flags |= LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT | LVS_EX_FULLROWSELECT;
        ListView_SetExtendedListViewStyleEx (list, flags , flags);
        ListView_DeleteAllItems (list);
 
@@ -3695,6 +3739,33 @@ void InitializeListView (HWND hDlg)
                listview_column_width[0] = 400;
                update_listview_inputmap (hDlg);
 
+       } else if (lv_type == LV_MISC1) {
+
+               listview_column_width[0] = 150;
+               for (i = 0; misclist[i].name; i++) {
+                       struct miscentry *me = &misclist[i];
+                       int type = me->type;
+                       bool checked = false;
+
+                       if (me->b) {
+                               checked = *me->b;
+                       } else if (me->i) {
+                               checked = ((*me->i) & me->imask) != 0;
+                       }
+
+                       lvstruct.mask     = LVIF_TEXT | LVIF_PARAM;
+                       lvstruct.pszText  = me->name;
+                       lvstruct.lParam   = 0;
+                       lvstruct.iItem    = i;
+                       lvstruct.iSubItem = 0;
+                       result = ListView_InsertItem (list, &lvstruct);
+                       ListView_SetItemState (list, i, INDEXTOSTATEIMAGEMASK(type ? 0 : (checked ? 2 : 1)), LVIS_STATEIMAGEMASK);
+                       width = ListView_GetStringWidth (list, lvstruct.pszText) + 30;
+                       if (width > listview_column_width[0])
+                               listview_column_width[0] = width;
+                       entry++;
+               }
+
        } else if (lv_type == LV_DISK) {
 
                for (i = 0; i < MAX_SPARE_DRIVES; i++) {
@@ -5378,12 +5449,10 @@ static void enable_for_chipsetdlg (HWND hDlg)
 #if !defined (CPUEMU_12)
        ew (hDlg, IDC_CYCLEEXACT, FALSE);
 #endif
-       ew (hDlg, IDC_FASTCOPPER, enable);
        ew (hDlg, IDC_GENLOCK, full_property_sheet);
        ew (hDlg, IDC_BLITIMM, enable);
        if (enable == FALSE) {
                workprefs.immediate_blits = 0;
-               CheckDlgButton (hDlg, IDC_FASTCOPPER, FALSE);
                CheckDlgButton (hDlg, IDC_BLITIMM, FALSE);
        }
        ew (hDlg, IDC_CS_EXT, workprefs.cs_compatible ? TRUE : FALSE);
@@ -5445,21 +5514,21 @@ static void init_frequency_combo (HWND hDlg, int dmode)
                freq = storedrefreshrates[i].rate;
                if (freq < 0) {
                        freq = -freq;
-                       _stprintf (hz, L"(%dHz)", freq);
+                       _stprintf (hz, _T("(%dHz)"), freq);
                } else {
-                       _stprintf (hz, L"%dHz", freq);
+                       _stprintf (hz, _T("%dHz"), freq);
                }
                if (freq == 50 || freq == 100 || (freq * 2 == 50 && lace))
-                       _tcscat (hz, L" PAL");
+                       _tcscat (hz, _T(" PAL"));
                if (freq == 60 || freq == 120 || (freq * 2 == 60 && lace))
-                       _tcscat (hz, L" NTSC");
+                       _tcscat (hz, _T(" NTSC"));
                if (lace) {
                        TCHAR tmp[10];
-                       _stprintf (tmp, L" (%di)", freq * 2);
+                       _stprintf (tmp, _T(" (%di)"), freq * 2);
                        _tcscat (hz, tmp);
                }
                if (storedrefreshrates[i].type & REFRESH_RATE_RAW)
-                       _tcscat (hz, L" (*)");
+                       _tcscat (hz, _T(" (*)"));
                if (abs (workprefs.gfx_apmode[0].gfx_refreshrate) == freq)
                        _tcscpy (hz2, hz);
                SendDlgItemMessage (hDlg, IDC_REFRESHRATE, CB_ADDSTRING, 0, (LPARAM)hz);
@@ -6589,6 +6658,7 @@ static void enable_for_memorydlg (HWND hDlg)
        ew (hDlg, IDC_RTG_SCALE_ASPECTRATIO, rtg2);
        ew (hDlg, IDC_RTG_VBLANKRATE, rtg2);
        ew (hDlg, IDC_RTG_BUFFERCNT, rtg2);
+       ew (hDlg, IDC_RTG_DISPLAYSELECT, rtg2);
 }
 
 static int manybits (int v, int mask)
@@ -6874,6 +6944,7 @@ static void expansion_net (HWND hDlg)
 {
        int i, cnt;
        TCHAR tmp[MAX_DPATH];
+       bool notset = true;
 
        SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_RESETCONTENT, 0, 0);
        WIN32GUI_LoadUIString (IDS_NETDISCONNECTED, tmp, sizeof tmp / sizeof (TCHAR));
@@ -6888,11 +6959,15 @@ static void expansion_net (HWND hDlg)
                                ndd[i].mac[0], ndd[i].mac[1], ndd[i].mac[2], ndd[i].mac[3], ndd[i].mac[4], ndd[i].mac[5]);
                        _stprintf (tmp, _T("%s %s"), mac, ndd[i].desc);
                        SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_ADDSTRING, 0, (LPARAM)tmp);
-                       if (!_tcsicmp (workprefs.a2065name, mac) || !_tcsicmp (workprefs.a2065name, ndd[i].name))
+                       if (!_tcsicmp (workprefs.a2065name, mac) || !_tcsicmp (workprefs.a2065name, ndd[i].name)) {
                                SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_SETCURSEL, cnt, 0);
+                               notset = false;
+                       }
                        cnt++;
                }
        }
+       if (notset)
+               SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_SETCURSEL, 0, 0);
 }
 
 static void enable_for_expansiondlg (HWND hDlg)
@@ -7455,17 +7530,11 @@ static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP
 static void enable_for_miscdlg (HWND hDlg)
 {
        if (!full_property_sheet) {
-               ew (hDlg, IDC_JULIAN, TRUE);
-               ew (hDlg, IDC_CTRLF11, TRUE);
-               ew (hDlg, IDC_SHOWGUI, FALSE);
                ew (hDlg, IDC_NOSPEED, TRUE);
                ew (hDlg, IDC_NOSPEEDPAUSE, TRUE);
                ew (hDlg, IDC_NOSOUND, TRUE);
                ew (hDlg, IDC_DOSAVESTATE, TRUE);
                ew (hDlg, IDC_SCSIMODE, FALSE);
-               ew (hDlg, IDC_CLOCKSYNC, FALSE);
-               ew (hDlg, IDC_CLIPBOARDSHARE, FALSE);
-               ew (hDlg, IDC_NATIVECODE, FALSE);
        } else {
 #if !defined (SCSIEMU)
                EnableWindow (GetDlgItem(hDlg, IDC_SCSIMODE), TRUE);
@@ -7593,11 +7662,13 @@ static void misc_lang (HWND hDlg)
 {
        int i, idx = 0, cnt = 0, lid;
        WORD langid = -1;
+       TCHAR tmp[MAX_DPATH];
 
        if (regqueryint (NULL, _T("Language"), &lid))
                langid = (WORD)lid;
+       WIN32GUI_LoadUIString (IDS_AUTODETECT, tmp, sizeof tmp / sizeof (TCHAR));
        SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_RESETCONTENT, 0, 0);
-       SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)_T("Autodetect"));
+       SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)tmp);
        SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)_T("English (built-in)"));
        if (langid == 0)
                idx = 1;
@@ -7645,23 +7716,9 @@ static void misc_setlang (int v)
 
 static void values_to_miscdlg (HWND hDlg)
 {
-       if (currentpage == MISC1_ID) {
+       TCHAR tmp[MAX_DPATH];
 
-               CheckDlgButton (hDlg, IDC_FOCUSMINIMIZE, workprefs.win32_minimize_inactive);
-               CheckDlgButton (hDlg, IDC_ILLEGAL, workprefs.illegal_mem);
-               CheckDlgButton (hDlg, IDC_SHOWGUI, workprefs.start_gui);
-               CheckDlgButton (hDlg, IDC_JULIAN, workprefs.win32_middle_mouse);
-               CheckDlgButton (hDlg, IDC_CREATELOGFILE, workprefs.win32_logfile);
-               CheckDlgButton (hDlg, IDC_CTRLF11, workprefs.win32_ctrl_F11_is_quit);
-               CheckDlgButton (hDlg, IDC_SHOWLEDS, (workprefs.leds_on_screen & STATUSLINE_CHIPSET) ? 1 : 0);
-               CheckDlgButton (hDlg, IDC_SHOWLEDSRTG, (workprefs.leds_on_screen & STATUSLINE_RTG) ? 1 : 0);
-               CheckDlgButton (hDlg, IDC_NOTASKBARBUTTON, workprefs.win32_notaskbarbutton);
-               CheckDlgButton (hDlg, IDC_ALWAYSONTOP, workprefs.win32_alwaysontop);
-               CheckDlgButton (hDlg, IDC_CLOCKSYNC, workprefs.tod_hack);
-               CheckDlgButton (hDlg, IDC_CLIPBOARDSHARE, workprefs.clipboard_sharing);
-               CheckDlgButton (hDlg, IDC_NATIVECODE, workprefs.native_code);
-               CheckDlgButton (hDlg, IDC_POWERSAVE, workprefs.win32_powersavedisabled);
-               CheckDlgButton (hDlg, IDC_FASTERRTG, workprefs.picasso96_nocustom);
+       if (currentpage == MISC1_ID) {
 
                misc_kbled (hDlg, IDC_KBLED1, workprefs.keyboard_leds[0]);
                misc_kbled (hDlg, IDC_KBLED2, workprefs.keyboard_leds[1]);
@@ -7684,10 +7741,15 @@ static void values_to_miscdlg (HWND hDlg)
                SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_SETCURSEL, ddforceram, 0);
 
                SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_RESETCONTENT, 0, 0);
-               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Borderless"));
-               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Minimal"));
-               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Standard"));
-               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Extended"));
+
+               WIN32GUI_LoadUIString (IDS_WSTYLE_BORDERLESS, tmp, sizeof tmp / sizeof (TCHAR));
+               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
+               WIN32GUI_LoadUIString (IDS_WSTYLE_MINIMAL, tmp, sizeof tmp / sizeof (TCHAR));
+               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
+               WIN32GUI_LoadUIString (IDS_WSTYLE_STANDARD, tmp, sizeof tmp / sizeof (TCHAR));
+               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
+               WIN32GUI_LoadUIString (IDS_WSTYLE_EXTENDED, tmp, sizeof tmp / sizeof (TCHAR));
+               SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
                SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_SETCURSEL,
                        workprefs.win32_borderless ? 0 : (workprefs.win32_statusbar + 1),
                        0);
@@ -7707,6 +7769,23 @@ static void values_to_miscdlg (HWND hDlg)
        }
 }
 
+static void setstatefilename (HWND hDlg)
+{
+       TCHAR *s = _tcsrchr (workprefs.statefile, '\\');
+       if (s) {
+               s++;
+       } else {
+               s = _tcsrchr (workprefs.statefile, '/');
+               if (s)
+                       s++;
+       }
+       if (!s)
+               s = workprefs.statefile;
+       SetDlgItemText (hDlg, IDC_STATENAME, s);
+       ew (hDlg, IDC_STATECLEAR, workprefs.statefile[0] != 0);
+       setchecked (hDlg, IDC_STATECLEAR, workprefs.statefile[0] != 0);
+}
+
 static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
        int v, i;
@@ -7718,6 +7797,14 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
        switch (msg)
        {
+       case WM_INITDIALOG:
+               pages[currentpage] = hDlg;
+               InitializeListView (hDlg);
+               values_to_miscdlg (hDlg);
+               enable_for_miscdlg (hDlg);
+               setstatefilename (hDlg);
+               recursive--;
+               return TRUE;
 
        case WM_USER:
                values_to_miscdlg (hDlg);
@@ -7751,8 +7838,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                if (((LPNMHDR) lParam)->idFrom == IDC_ASSOCIATELIST) {
                        int entry, col;
                        HWND list;
-                       NM_LISTVIEW *nmlistview;
-                       nmlistview = (NM_LISTVIEW *) lParam;
+                       NM_LISTVIEW *nmlistview = (NM_LISTVIEW *)lParam;
                        list = nmlistview->hdr.hwndFrom;
                        if (nmlistview->hdr.code == NM_DBLCLK) {
                                entry = listview_entry_from_click (list, &col);
@@ -7760,6 +7846,22 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                                associate_file_extensions ();
                                InitializeListView (hDlg);
                        }
+               } else if (((LPNMHDR) lParam)->idFrom == IDC_MISCLIST) {
+                       NM_LISTVIEW *nmlistview = (NM_LISTVIEW *)lParam;
+                       if (nmlistview->hdr.code == LVN_ITEMCHANGED) {
+                               int item = nmlistview->iItem;
+                               if (item >= 0) {
+                                       struct miscentry *me = &misclist[item];
+                                       bool checked = (nmlistview->uNewState & LVIS_STATEIMAGEMASK) == 0x2000;
+                                       if (me->b) {
+                                               *me->b = checked;
+                                       } else if (me->i) {
+                                               *me->i &= ~me->imask;
+                                               if (checked)
+                                                       *me->i |= me->ival & me->imask;
+                                       }
+                               }
+                       }
                }
                break;
 
@@ -7836,42 +7938,24 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                        associate_file_extensions ();
                        InitializeListView (hDlg);
                        break;
+               case IDC_STATECLEAR:
+                       savestate_initsave (NULL, 0, 0, false);
+                       _tcscpy (workprefs.statefile, savestate_fname);
+                       setstatefilename (hDlg);
+                       break;
                case IDC_DOSAVESTATE:
-                       if (DiskSelection(hDlg, wParam, 9, &workprefs, 0))
+                       workprefs.statefile[0] = 0;
+                       if (DiskSelection(hDlg, wParam, 9, &workprefs, 0)) {
                                save_state (savestate_fname, _T("Description!"));
+                               _tcscpy (workprefs.statefile, savestate_fname);
+                       }
+                       setstatefilename (hDlg);
                        break;
                case IDC_DOLOADSTATE:
                        if (DiskSelection(hDlg, wParam, 10, &workprefs, 0))
                                savestate_state = STATE_DORESTORE;
-                       break;
-               case IDC_ILLEGAL:
-                       workprefs.illegal_mem = ischecked (hDlg, IDC_ILLEGAL);
-                       break;
-               case IDC_JULIAN:
-                       workprefs.win32_middle_mouse = ischecked (hDlg, IDC_JULIAN);
-                       break;
-               case IDC_FOCUSMINIMIZE:
-                       workprefs.win32_minimize_inactive = ischecked (hDlg, IDC_FOCUSMINIMIZE);
-                       break;
-               case IDC_SHOWLEDS:
-                       workprefs.leds_on_screen &= ~STATUSLINE_CHIPSET;
-                       if (ischecked (hDlg, IDC_SHOWLEDS))
-                               workprefs.leds_on_screen |= STATUSLINE_CHIPSET;
-                       break;
-               case IDC_SHOWLEDSRTG:
-                       workprefs.leds_on_screen &= ~STATUSLINE_RTG;
-                       if (ischecked (hDlg, IDC_SHOWLEDSRTG))
-                               workprefs.leds_on_screen |= STATUSLINE_RTG;
-                       break;
-               case IDC_SHOWGUI:
-                       workprefs.start_gui = ischecked (hDlg, IDC_SHOWGUI);
-                       break;
-               case IDC_CREATELOGFILE:
-                       workprefs.win32_logfile = ischecked (hDlg, IDC_CREATELOGFILE);
-                       enable_for_miscdlg(hDlg);
-                       break;
-               case IDC_POWERSAVE:
-                       workprefs.win32_powersavedisabled = ischecked (hDlg, IDC_POWERSAVE);
+                       _tcscpy (workprefs.statefile, savestate_fname);
+                       setstatefilename (hDlg);
                        break;
                case IDC_INACTIVE_NOSOUND:
                        if (!ischecked (hDlg, IDC_INACTIVE_NOSOUND))
@@ -7903,30 +7987,9 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                        workprefs.win32_iconified_nosound = ischecked (hDlg, IDC_MINIMIZED_NOSOUND);
                        enable_for_miscdlg (hDlg);
                        break;
-               case IDC_CTRLF11:
-                       workprefs.win32_ctrl_F11_is_quit = ischecked (hDlg, IDC_CTRLF11);
-                       break;
-               case IDC_CLOCKSYNC:
-                       workprefs.tod_hack = ischecked (hDlg, IDC_CLOCKSYNC);
-                       break;
-               case IDC_CLIPBOARDSHARE:
-                       workprefs.clipboard_sharing = ischecked (hDlg, IDC_CLIPBOARDSHARE);
-                       break;
-               case IDC_NATIVECODE:
-                       workprefs.native_code = ischecked (hDlg, IDC_NATIVECODE);
-                       break;
-               case IDC_NOTASKBARBUTTON:
-                       workprefs.win32_notaskbarbutton = ischecked (hDlg, IDC_NOTASKBARBUTTON);
-                       break;
-               case IDC_ALWAYSONTOP:
-                       workprefs.win32_alwaysontop = ischecked (hDlg, IDC_ALWAYSONTOP);
-                       break;
                case IDC_KBLED_USB:
                        workprefs.win32_kbledmode = ischecked (hDlg, IDC_KBLED_USB) ? 1 : 0;
                        break;
-               case IDC_FASTERRTG:
-                       workprefs.picasso96_nocustom = ischecked (hDlg, IDC_FASTERRTG);
-                       break;
                }
                recursive--;
                return TRUE;
@@ -7938,25 +8001,12 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 static INT_PTR CALLBACK MiscDlgProc1 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
        currentpage = MISC1_ID;
-       if (msg == WM_INITDIALOG) {
-               pages[MISC1_ID] = hDlg;
-               values_to_miscdlg (hDlg);
-               enable_for_miscdlg (hDlg);
-               return TRUE;
-       }
        return MiscDlgProc (hDlg, msg, wParam, lParam);
 }
 
 static INT_PTR CALLBACK MiscDlgProc2 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
        currentpage = MISC2_ID;
-       if (msg == WM_INITDIALOG) {
-               pages[MISC2_ID] = hDlg;
-               InitializeListView (hDlg);
-               values_to_miscdlg (hDlg);
-               enable_for_miscdlg (hDlg);
-               return TRUE;
-       }
        return MiscDlgProc (hDlg, msg, wParam, lParam);
 }
 
index bd704e3faadb06e92d7099a6aa438d3229f094f8..f0a9b21c63df83e70d8100262ca83082ba0910bd 100644 (file)
@@ -3,6 +3,21 @@
 - hdd from command line
 - no-buffer tearing updates
 
+Beta 4:
+
+- Custom input event autofire wasn't always canceled when shortcut included qualifier(s).
+- Do not crash if 7zip unpacking fails because out of memory or process address space.
+  (Big compressed CD images and 32-bit Windows)
+- Log also RDB dostype in text format.
+- Replaced misc panel checkboxes with scrolling checkbox list view. Now there is unlimited space
+  for all kinds of on/off options that I previously refused to add because of lack of GUI space.
+- Added disable notification icon option.
+- Loading statefile using GUI now remembers statefile filename, allowing to save configuration files with
+  statefile (running configuration file will automatically load the statefile). This required manual config
+  file editing previously. Statefile path and checkbox that "forgets" stored path added to GUI.
+- Ignore vendor specific USB usage pages (Do not list for example some Logitech USB mouse/keyboard receiver dongles)
+- Z2 RTG + 68EC020 fixed, RTG requires memory mapping. (Memory mapping was originally JIT only and 68EC020 is not JIT compatible)
+
 Beta 3:
 
 - FPS led was always yellow in most non low latency vsync modes.
index 99144d32e8a8fdf6880ff2ce24775239fa593df3..868ec9ed6d3b1c6c39cbb4eaf729ca5f2ce8bb7a 100644 (file)
@@ -118,10 +118,11 @@ uae_u8 sampler_getsample (int channel)
                inited = 1;
                oldcycles = get_cycles ();
                oldoffset = -1;
+               diffsample = 0;
                safepos = -RECORDBUFFER / 10 * SAMPLESIZE;
                hr = lpDSB2r->GetCurrentPosition (&t, &cap_pos);
                cap_pos += safepos;
-               if (cap_pos > 10 * RECORDBUFFER * SAMPLESIZE)
+               if (cap_pos >= 10 * RECORDBUFFER * SAMPLESIZE)
                        cap_pos += RECORDBUFFER * SAMPLESIZE;
                if (cap_pos >= RECORDBUFFER * SAMPLESIZE)
                        cap_pos -= RECORDBUFFER * SAMPLESIZE;
@@ -129,7 +130,7 @@ uae_u8 sampler_getsample (int channel)
                        sampler_free ();
                        return 0;
                }
-               clockspersample = sampler_evtime / samplerate + 41000;
+               clockspersample = sampler_evtime / samplerate;
        }
        if (clockspersample < 1)
                return 0;
@@ -225,6 +226,9 @@ void sampler_vsync (void)
        if (!inited)
                return;
        vsynccnt++;
+       if (vsynccnt > 1) {
+               oldcycles = get_cycles ();
+       }
        if (vsynccnt > 50) {
                sampler_free ();
                return;
old mode 100644 (file)
new mode 100755 (executable)
index b18ae016e9d2b4d51fa3bc3712e114ccb49071f2..3dfa65ea74455eaf8a3399ca1596116aae299a69 100644 (file)
--- a/zfile.cpp
+++ b/zfile.cpp
@@ -2204,7 +2204,7 @@ size_t zfile_fwrite (const void *b, size_t l1, size_t l2, struct zfile *z)
        if (z->parent && z->useparent)
                return 0;
        if (z->data) {
-               int off = z->seek + l1 * l2;
+               uae_s64 off = z->seek + l1 * l2;
                if (z->allocsize == 0) {
                        write_log (_T("zfile_fwrite(data,%s) but allocsize=0!\n"), z->name);
                        return 0;
index 51b5b0f87dcd797ae2fb051a96dfb0f707f1cb45..4ec91cfa6b3e621e033afc6d9c436b3045635646 100644 (file)
@@ -627,16 +627,20 @@ static struct zfile *archive_access_7z (struct znode *zn)
        size_t outSizeProcessed;
        struct SevenZContext *ctx;
 
+       z = zfile_fopen_empty (NULL, zn->fullname, zn->size);
+       if (!z)
+               return NULL;
        ctx = (struct SevenZContext*)zv->handle;
        res = SzArEx_Extract (&ctx->db, &ctx->lookStream.s, zn->offset,
                &ctx->blockIndex, &ctx->outBuffer, &ctx->outBufferSize,
                &offset, &outSizeProcessed,
                &allocImp, &allocTempImp);
        if (res == SZ_OK) {
-               z = zfile_fopen_empty (NULL, zn->fullname, zn->size);
                zfile_fwrite (ctx->outBuffer + offset, zn->size, 1, z);
        } else {
                write_log (_T("7Z: SzExtract %s returned %d\n"), zn->fullname, res);
+               zfile_fclose (z);
+               z = NULL;
        }
        return z;
 }
@@ -1005,6 +1009,8 @@ static struct znode *addfile (struct zvolume *zv, struct zfile *zf, const TCHAR
        struct zfile *z;
 
        z = zfile_fopen_empty (zf, path, size);
+       if (!z)
+               return NULL;
        zfile_fwrite (data, size, 1, z);
        memset (&zai, 0, sizeof zai);
        zai.name = my_strdup (path);