]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1530b6.zip
authorToni Wilen <twilen@winuae.net>
Sun, 26 Oct 2008 11:10:35 +0000 (13:10 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:43:28 +0000 (21:43 +0200)
19 files changed:
blitter.c
cfgfile.c
custom.c
debug.c
disk.c
include/options.h
main.c
memory.c
od-win32/dxwrap.c
od-win32/picasso96_win.c
od-win32/picasso96_win.h
od-win32/resources/resource
od-win32/resources/resource.h
od-win32/resources/winuae.rc
od-win32/win32.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuaechangelog.txt

index 43eabc09dcba57c66d321ecfe77cb388d127a815..80be495d1eb9793bb4b8c289961c0dedcca60833 100755 (executable)
--- a/blitter.c
+++ b/blitter.c
@@ -1226,7 +1226,7 @@ uae_u8 *save_blitter (int *len, uae_u8 *dstptr)
     if (dstptr)
        dstbak = dst = dstptr;
     else
-       dstbak = dst = (uae_u8*)malloc (16);
+       dstbak = dst = xmalloc (16);
     save_u32(((bltstate != BLT_done) ? 0 : 1) | forced);
     *len = dst - dstbak;
     return dstbak;
index 5911848ef496f771da35007dc14b091ffa8861ce..71e1805dc904b078d414bf6e75d631378018b8bf 100755 (executable)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -1083,8 +1083,29 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value)
     }
 
     if (cfgfile_string (option, value, "statefile", tmpbuf, sizeof (tmpbuf))) {
-       savestate_state = STATE_DORESTORE;
        strcpy (savestate_fname, tmpbuf);
+       if (zfile_exists (savestate_fname)) {
+           savestate_state = STATE_DORESTORE;
+       } else {
+           int ok = 0;
+           if (savestate_fname[0]) {
+               for (;;) {
+                   char *p;
+                   if (my_existsdir (savestate_fname)) {
+                       ok = 1;
+                       break;
+                   }
+                   p = strrchr (savestate_fname, '\\');
+                   if (!p)
+                       p = strrchr (savestate_fname, '/');
+                   if (!p)
+                       break;
+                   *p = 0;
+               }
+           }
+           if (!ok)
+               savestate_fname[0] = 0;
+       }
        return 1;
     }
 
index 60ddffdbf3af863938f1f016b6c9e9786014e6ee..02fd41bda11107dbad0403060b4634b3811f57ec 100755 (executable)
--- a/custom.c
+++ b/custom.c
@@ -110,7 +110,7 @@ uae_u16 customhack_get (struct customhack *ch, int hpos)
 }
 #endif
 
-static uae_u16 last_custom_value;
+uae_u16 last_custom_value;
 
 static unsigned int n_consecutive_skipped = 0;
 static unsigned int total_skipped = 0;
@@ -4631,7 +4631,7 @@ static void CIA_vsync_prehandler (void)
 }
 
 static uaecptr prevbpl[MAXVPOS][8];
-static void hsync_scandoubler (int line, int lof, int nextline_how2)
+static void hsync_scandoubler (int line, int lof)
 {
     int i;
     uaecptr bpl[8];
@@ -4644,7 +4644,7 @@ static void hsync_scandoubler (int line, int lof, int nextline_how2)
     next_lineno++;
     reset_decisions ();
     finish_decisions ();
-    hsync_record_line_state (next_lineno, nextline_how, thisline_changed);
+    hsync_record_line_state (next_lineno, nln_normal, thisline_changed);
     hardware_line_completed (next_lineno);
 
     for (i = 0; i < 8; i++) {
@@ -4721,10 +4721,10 @@ static void hsync_handler (void)
        ahi_hsync ();
     }
 
-    if ((currprefs.chipset_mask & CSMASK_AGA) || (!currprefs.chipset_mask & CSMASK_ECS_AGNUS))
-       last_custom_value = uaerand ();
+    if (currprefs.chipset_mask & CSMASK_AGA)
+       last_custom_value = 0xfff;
     else
-       last_custom_value = 0xffff;
+       last_custom_value = uaerand ();
 
     if (currprefs.produce_sound)
        audio_hsync (1);
@@ -4796,8 +4796,10 @@ static void hsync_handler (void)
        if ((bplcon0 & 4) && currprefs.gfx_linedbl)
            notice_interlace_seen ();
        nextline_how = nln_normal;
-       if (currprefs.gfx_linedbl && (doublescan <= 0 || interlace_seen)) {
-           int nln_prev = nextline_how;
+       if (currprefs.gfx_linedbl && doublescan < 0) {
+           lineno *= 2;
+           hsync_scandoubler (lineno, lof);
+       } else if (currprefs.gfx_linedbl && (doublescan == 0 || interlace_seen)) {
            lineno *= 2;
            nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack;
            if ((bplcon0 & 4) || (interlace_seen && !lof)) {
@@ -4808,8 +4810,6 @@ static void hsync_handler (void)
                    nextline_how = nln_upper;
                }
            }
-           if (doublescan < 0)
-               hsync_scandoubler (lineno, lof, nln_prev);
        }
        prev_lineno = next_lineno;
        next_lineno = lineno;
@@ -5334,8 +5334,6 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput)
      case 0x01E: v = INTREQR (); break;
      case 0x07C: v = DENISEID (); break;
 
-     case 0x02E: v = 0xffff; break; /* temporary hack */
-
 #ifdef AGA
      case 0x180: case 0x182: case 0x184: case 0x186: case 0x188: case 0x18A:
      case 0x18C: case 0x18E: case 0x190: case 0x192: case 0x194: case 0x196:
@@ -5348,7 +5346,15 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput)
 #endif
 
      default:
-       /* reading write-only register causes write with last value in bus */
+       /* OCS/ECS:
+        * reading write-only register causes write with last value in chip
+        * bus (custom registers, chipram, slowram)
+        * and finally returns all ones
+        * AGA:
+        * only writes to custom registers change last value, read returns
+        * last value which then changes to all ones (following read will return
+        * all ones)
+        */
        v = last_custom_value;
        if (!noput) {
            int r;
@@ -5356,8 +5362,14 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput)
            decide_line (hpos);
            decide_fetch (hpos);
            decide_blitter (hpos);
-           v = last_custom_value;
-           r = custom_wput_copper (hpos, addr, v, 1);
+           r = custom_wput_copper (hpos, addr, last_custom_value, 1);
+           if (currprefs.chipset_mask & CSMASK_AGA) {
+               v = last_custom_value;
+               last_custom_value = 0xffff;
+           } else {
+               v = 0xffff;
+           }
+
        }
        return v;
     }
@@ -5607,8 +5619,6 @@ static int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int n
      default:
        if (!noget)
            custom_wget_1 (addr, 1);
-       if (!(currprefs.chipset_mask & CSMASK_AGA) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS))
-           last_custom_value = 0xffff;
        return 1;
     }
     return 0;
@@ -5765,7 +5775,7 @@ uae_u8 *restore_custom (uae_u8 *src)
     dmacon = RW & ~(0x2000|0x4000); /* 096 DMACON */
     CLXCON(RW);                        /* 098 CLXCON */
     intena = RW;               /* 09A INTENA */
-    intreq = intreqr = RW;     /* 09C INTREQ */
+    intreq = intreqr = RW | 0x20; /* 09C INTREQ */
     adkcon = RW;               /* 09E ADKCON */
     for (i = 0; i < 8; i++)
        bplpt[i] = RL;
diff --git a/debug.c b/debug.c
index 02be180de2d6b2ac517282cab5f8feda65ec0463..2056a3d05c91d4ca30c2e7965690414017b7e052 100755 (executable)
--- a/debug.c
+++ b/debug.c
@@ -399,6 +399,14 @@ static void converter (char **c)
     console_out_f ("0x%08X = %%%s = %u = %d\n", v, s, v, (uae_s32)v);
 }
 
+int notinrom (void)
+{
+    uaecptr pc = munge24(m68k_getpc (&regs));
+    if (pc < 0x00e00000 || pc > 0x00ffffff)
+       return 1;
+    return 0;
+}
+
 static uae_u32 lastaddr (void)
 {
     if (currprefs.z3fastmem_size)
@@ -1433,6 +1441,8 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp)
            }
            return 0;
        }
+//     if (!notinrom ())
+//         return 1;
        mwhit.pc = M68K_GETPC;
        mwhit.addr = addr;
        mwhit.rwi = rwi;
@@ -3024,14 +3034,6 @@ void debug (void)
     inputdevice_acquire (TRUE);
 }
 
-int notinrom (void)
-{
-    uaecptr pc = munge24(m68k_getpc (&regs));
-    if (pc < 0x00e00000 || pc > 0x00ffffff)
-       return 1;
-    return 0;
-}
-
 const char *debuginfo (int mode)
 {
     static char txt[100];
diff --git a/disk.c b/disk.c
index a14f98d01514f9550f7d0b686493c7a0d499007b..2acc159889635d9073481aa4e5af410268b64bf4 100755 (executable)
--- a/disk.c
+++ b/disk.c
@@ -2727,7 +2727,6 @@ static void DISK_start (void)
        }
        drv->floppybitcounter = 0;
     }
-    dma_enable = (adkcon & 0x400) ? 0 : 1;
 }
 
 static int linecounter;
@@ -2819,6 +2818,8 @@ void DSKLEN (uae_u16 v, int hpos)
     if ((v & 0x8000) && (dsklen & 0x8000)) {
        dskdmaen = 2;
        DISK_start ();
+       if (!(v & 0x4000))
+           dma_enable = (adkcon & 0x400) ? 0 : 1;
     }
     if (!(v & 0x8000)) {
        if (dskdmaen) {
@@ -2891,9 +2892,9 @@ void DSKLEN (uae_u16 v, int hpos)
        noselected = 1;
     } else {
        if (disk_debug_logging > 0) {
-           write_log ("disk %s DMA started, drvmask=%x track %d mfmpos %d\n",
+           write_log ("disk %s DMA started, drvmask=%x track %d mfmpos %d dmaen=%d\n",
                dskdmaen == 3 ? "write" : "read", selected ^ 15,
-               floppy[dr].cyl * 2 + side, floppy[dr].mfmpos);
+               floppy[dr].cyl * 2 + side, floppy[dr].mfmpos, dma_enable);
            disk_dma_debugmsg ();
        }
     }
index 9482681c1633ec7ea3f98bb8f6d23b89a5587edb..1142e73c022e24592c07bb52b7b4b7fd4d230f75 100755 (executable)
@@ -317,6 +317,7 @@ struct uae_prefs {
     int win32_rtgscaleifsmall;
     int win32_rtgallowscaling;
     int win32_rtgscaleaspectratio;
+    int win32_rtgvblankrate;
     int win32_borderless;
     int win32_ctrl_F11_is_quit;
     int win32_automount_removable;
diff --git a/main.c b/main.c
index 6dbce833a6c9ae62616f0ae1451dd22123654bf4..4dafce199c98d7fc4f7c413fd83fa6e08d1c4dc7 100755 (executable)
--- a/main.c
+++ b/main.c
@@ -558,6 +558,9 @@ void reset_all_systems (void)
 {
     init_eventtab ();
 
+#ifdef PICASSO96
+    picasso_reset ();
+#endif
 #ifdef SCSIEMU
     scsi_reset ();
     scsidev_reset ();
index 4cc2c6d2d97199a278795b37469a01a9adb28f0c..cee76cf72d737a5fee93fc15ad1d9a3f7c9b0565 100755 (executable)
--- a/memory.c
+++ b/memory.c
@@ -36,6 +36,7 @@ int candirect = -1;
 /* Set by each memory handler that does not simply access real memory. */
 int special_mem;
 #endif
+extern uae_u16 last_custom_value;
 
 static int isdirectjit (void)
 {
@@ -1255,7 +1256,7 @@ static uae_u32 REGPARAM2 chipmem_lget_ce2 (uaecptr addr)
 
 static uae_u32 REGPARAM2 chipmem_wget_ce2 (uaecptr addr)
 {
-    uae_u16 *m;
+    uae_u16 *m, v;
 
 #ifdef JIT
     special_mem |= S_READ;
@@ -1263,7 +1264,9 @@ static uae_u32 REGPARAM2 chipmem_wget_ce2 (uaecptr addr)
     addr &= chipmem_mask;
     m = (uae_u16 *)(chipmemory + addr);
     ce2_timeout ();
-    return do_get_mem_word (m);
+    v = do_get_mem_word (m);
+    last_custom_value = v;
+    return v;
 }
 
 static uae_u32 REGPARAM2 chipmem_bget_ce2 (uaecptr addr)
@@ -1299,6 +1302,7 @@ static void REGPARAM2 chipmem_wput_ce2 (uaecptr addr, uae_u32 w)
     addr &= chipmem_mask;
     m = (uae_u16 *)(chipmemory + addr);
     ce2_timeout ();
+    last_custom_value = w;
     do_put_mem_word (m, w);
 }
 
@@ -1325,17 +1329,22 @@ uae_u32 REGPARAM2 chipmem_lget (uaecptr addr)
 
 static uae_u32 REGPARAM2 chipmem_wget (uaecptr addr)
 {
-    uae_u16 *m;
+    uae_u16 *m, v;
 
     addr &= chipmem_mask;
     m = (uae_u16 *)(chipmemory + addr);
-    return do_get_mem_word (m);
+    v = do_get_mem_word (m);
+    last_custom_value = v;
+    return v;
 }
 
 static uae_u32 REGPARAM2 chipmem_bget (uaecptr addr)
 {
+    uae_u8 v;
     addr &= chipmem_mask;
-    return chipmemory[addr];
+    v = chipmemory[addr];
+    last_custom_value = (v << 8) | v;
+    return v;
 }
 
 void REGPARAM2 chipmem_lput (uaecptr addr, uae_u32 l)
@@ -1353,12 +1362,14 @@ void REGPARAM2 chipmem_wput (uaecptr addr, uae_u32 w)
 
     addr &= chipmem_mask;
     m = (uae_u16 *)(chipmemory + addr);
+    last_custom_value = w;
     do_put_mem_word (m, w);
 }
 
 void REGPARAM2 chipmem_bput (uaecptr addr, uae_u32 b)
 {
     addr &= chipmem_mask;
+    last_custom_value = (b << 8) | b;
     chipmemory[addr] = b;
 }
 
index b6a97629366487be34b75cce67dd4d9983303588..883684f3c4399fcb4b2cea053df02b58e633a7b3 100755 (executable)
@@ -701,6 +701,7 @@ void DirectDraw_GetPrimaryPixelFormat (DDSURFACEDESC2 *desc)
 }
 DWORD DirectDraw_CurrentRefreshRate (void)
 {
+    DirectDraw_GetDisplayMode ();
     return dxdata.native.dwRefreshRate;
 }
 
index 9daff11964ee9123367bfe108e973957bad36e62..3e67f1227bdf27df00d0321b47c825bd0ff60a50 100755 (executable)
@@ -46,6 +46,7 @@
 #include "savestate.h"
 #include "autoconf.h"
 #include "traps.h"
+#include "native2amiga.h"
 
 #if defined(PICASSO96)
 
@@ -128,7 +129,7 @@ static int cursorwidth, cursorheight, cursorok;
 static uae_u32 cursorrgb[4], cursorrgbn[4];
 static int reloadcursor, cursorvisible, cursordeactivate;
 static uaecptr boardinfo;
-
+static int interrupt_enabled;
 
 static uaecptr uaegfx_resname,
     uaegfx_resid,
@@ -657,14 +658,34 @@ static int doskip (void)
     return framecnt > 0;
 }
 
+static void picasso_trigger_vblank (void)
+{
+    if (!boardinfo || !uaegfx_base || !interrupt_enabled)
+       return;
+    put_long (uaegfx_base + CARD_VBLANKCODE + 6 + 2, boardinfo + PSSO_BoardInfo_SoftInterrupt);
+    put_byte (uaegfx_base + CARD_VBLANKFLAG, 1);
+    INTREQ_f (0x8000 | 0x2000);
+}
+
 void picasso_handle_vsync (void)
 {
     static int vsynccnt;
+    int isvsync = 1;
     
 #ifdef RETROPLATFORM
     rp_vsync ();
 #endif
 
+    if (currprefs.chipset_refreshrate >= 100) {
+       vsynccnt++;
+       if (vsynccnt < 2)
+           isvsync = 0;
+       vsynccnt = 0;
+    }
+
+    if (isvsync && currprefs.win32_rtgvblankrate == 0 && !(currprefs.gfx_pfullscreen && currprefs.gfx_pvsync))
+       picasso_trigger_vblank ();
+
     if (!picasso_on)
        return;
     if (dx_islost ())
@@ -672,19 +693,15 @@ void picasso_handle_vsync (void)
 
     framecnt++;
     mouseupdate ();
-    
-    if (currprefs.chipset_refreshrate >= 100) {
-       vsynccnt++;
-       if (vsynccnt < 2)
-           return;
-       vsynccnt = 0;
-    }
-    if (doskip () && p96skipmode == 0) {
-       ;
-    } else {
-       flushpixels ();
+
+    if (isvsync) {
+       if (doskip () && p96skipmode == 0) {
+           ;
+       } else {
+           flushpixels ();
+       }
+       gfx_unlock_picasso ();
     }
-    gfx_unlock_picasso ();
 }
 
 static int set_panning_called = 0;
@@ -2117,10 +2134,13 @@ static void inituaegfx (uaecptr ABI)
     hwsprite = 1;
     flags |= BIF_HARDWARESPRITE;
 #endif
-    put_long (ABI + PSSO_BoardInfo_Flags, flags);
     if (flags & BIF_NOBLITTER)
        write_log ("P96: blitter disabled in devs:monitors/uaegfx!\n");
 
+    flags |= BIF_VBLANKINTERRUPT;
+
+    put_long (ABI + PSSO_BoardInfo_Flags, flags);
+
     put_word (ABI + PSSO_BoardInfo_MaxHorResolution + 0, planar.width);
     put_word (ABI + PSSO_BoardInfo_MaxHorResolution + 2, chunky.width);
     put_word (ABI + PSSO_BoardInfo_MaxHorResolution + 4, hicolour.width);
@@ -3229,30 +3249,38 @@ void picasso_handle_hsync (void)
 
     if (currprefs.gfxmem_size == 0)
        return;
+    if (currprefs.win32_rtgvblankrate == 0)
+       return;
+    if (p96hsync < 0) {
+       p96hsync++;
+       if (p96hsync == 0)
+           p96hsync = p96syncrate;
+       return;
+    }
     if (WIN32GFX_IsPicassoScreen () && currprefs.gfx_pfullscreen && currprefs.gfx_pvsync) {
        if (DirectDraw_GetVerticalBlankStatus ())
-           p96hsync = 0;
+           p96hsync = -maxvpos / 3;
     } else {
        p96hsync--;
     }
     if (p96hsync <= 0) {
-       if (uae_boot_rom) {
-           int off = get_long (rtarea_base + 36) + 12 - 1;
-           if (off >= 0 && off < 0x10000)
-               rtarea[off]++;
-       }
-       p96hsync = p96syncrate;
+       picasso_trigger_vblank ();
+       if (p96hsync == 0)
+           p96hsync = p96syncrate;
     }
 }
 
 void init_hz_p96 (void)
 {
     int rate;
+
     p96syncrate = maxvpos * vblank_hz;
-    if (isfullscreen () > 0)
+    if (currprefs.win32_rtgvblankrate < 0) 
        rate = DirectDraw_CurrentRefreshRate ();
-    else
+    else if (currprefs.win32_rtgvblankrate == 0)
        rate = abs (currprefs.gfx_refreshrate);
+    else
+       rate = currprefs.win32_rtgvblankrate;
     if (rate <= 0)
        rate = 60;
     p96syncrate /= rate;
@@ -3980,6 +4008,16 @@ void InitPicasso96 (void)
 
 #endif
 
+static uae_u32 REGPARAM2 picasso_SetInterrupt (TrapContext *ctx)
+{
+    struct regstruct *regs = &ctx->regs;
+    uaecptr bi = m68k_areg (regs, 0);
+    uae_u32 onoff = m68k_dreg (regs, 0);
+    interrupt_enabled = onoff;
+    //write_log ("Picasso_SetInterrupt(%08x,%d)\n", bi, onoff);
+    return onoff;
+}
+
 #ifdef UAEGFX_INTERNAL
 
 #define PUTABI(func) \
@@ -4012,7 +4050,6 @@ void InitPicasso96 (void)
     if (ABI) \
        put_long (ABI + func, start);
 
-
 static uaecptr inituaegfxfuncs (uaecptr start, uaecptr ABI)
 {
     uaecptr old = here ();
@@ -4091,7 +4128,47 @@ static uaecptr inituaegfxfuncs (uaecptr start, uaecptr ABI)
     RTGNONE(PSSO_BoardInfo_SetClearMask);
     RTGNONE(PSSO_BoardInfo_SetReadPlane);
 
-    RTGNONE(PSSO_BoardInfo_WaitVerticalSync); /* FIXME */
+#if 1
+    RTGNONE(PSSO_BoardInfo_WaitVerticalSync);
+#else
+    PUTABI (PSSO_BoardInfo_WaitVerticalSync);
+    dl (0x48e7203e);   // movem.l d2/a5/a6,-(sp)
+    dl (0x2c68003c);
+    dw (0x93c9);
+    dl (0x4eaefeda);
+    dw (0x2440);
+    dw (0x70ff);
+    dl (0x4eaefeb6);
+    dw (0x7400);
+    dw (0x1400);
+    dw (0x6b40);
+    dw (0x49f9);
+    dl (uaegfx_base + CARD_VSYNCLIST);
+    dw (0x47f9);
+    dl (uaegfx_base + CARD_VSYNCLIST + CARD_VSYNCMAX * 8);
+    dl (0x4eaeff88);
+    dw (0xb9cb);
+    dw (0x6606);
+    dl (0x4eaeff82);
+    dw (0x601c);
+    dw (0x4a94);
+    dw (0x6704);
+    dw (0x508c);
+    dw (0x60ee);
+    dw (0x288a);
+    dl (0x29420004);
+    dl (0x4eaeff82);
+    dw (0x7000);
+    dw (0x05c0);
+    dl (0x4eaefec2);
+    dw (0x4294);
+    dw (0x7000);
+    dw (0x1002);
+    dw (0x6b04);
+    dl (0x4eaefeb0);
+    dl (0x4cdf7c04);
+    dw (RTS);
+#endif
     RTGNONE(PSSO_BoardInfo_WaitBlitter);
 
 #if 0
@@ -4125,13 +4202,21 @@ static uaecptr inituaegfxfuncs (uaecptr start, uaecptr ABI)
     RTGCALLDEFAULT(PSSO_BoardInfo_UpdatePlanar, PSSO_BoardInfo_UpdatePlanarDefault);
     RTGCALLDEFAULT(PSSO_BoardInfo_DrawLine, PSSO_BoardInfo_DrawLineDefault);
 
-    write_log ("uaegfx.card magic code: %08X-%08X\n", start, here ());
+    RTGCALL2(PSSO_BoardInfo_SetInterrupt, picasso_SetInterrupt);
+
+    write_log ("uaegfx.card magic code: %08X-%08X ABI=%08X\n", start, here (), ABI);
 
     ptr = here ();
     org (old);
     return ptr;
 }
 
+void picasso_reset (void)
+{
+    uaegfx_base = 0;
+    interrupt_enabled = 0;
+}
+
 void uaegfx_install_code (void)
 {
     uaecptr start = here ();
@@ -4157,6 +4242,32 @@ static uae_u32 REGPARAM2 gfx_expunge (TrapContext *context)
     return 0;
 }
 
+static uaecptr uaegfx_vblankname;
+static void initvblankirq (TrapContext *ctx, uaecptr base)
+{
+    uaecptr p = base + CARD_VBLANKIRQ;
+    uaecptr c = base + CARD_VBLANKCODE;
+
+    put_word (p + 8, 0x020a);
+    put_long (p + 10, uaegfx_vblankname);
+    put_long (p + 18, c);
+
+    put_word (c, 0x41f9); c += 2;                  // lea CARD_VBLANKLAG,a0
+    put_long (c, base + CARD_VBLANKFLAG); c += 4;
+    put_word (c, 0x43f9); c += 2;                  // lea uaegfx_base + PSSO_BoardInfo_SoftInterrupt,a1
+    put_long (c, 0); c += 4;
+    put_word (c, 0x4a10); c += 2;                  // tst.b (a0)
+    put_word (c, 0x670a); c += 2;                  // beq.s label
+    put_word (c, 0x4210); c += 2;                  // clr.b (a0)
+    put_long (c, 0x2c780004); c += 4;              // move.l 4.w,a6
+    put_long (c, 0x4eaeff4c); c += 4;              // jsr Cause(a6)
+    put_word (c, 0x7000); c += 2;                  // label: moveq #0,d0
+    put_word (c, RTS); c += 2;                     // rts
+    m68k_areg (&ctx->regs, 1) = p;
+    m68k_dreg (&ctx->regs, 0) = 13; /* EXTER */
+    CallLib (ctx, get_long (4), -168); /* AddIntServer */
+}
+
 static uaecptr uaegfx_card_install (TrapContext *ctx, uae_u32 extrasize)
 {
     uae_u32 functable, datatable, a2;
@@ -4164,7 +4275,8 @@ static uaecptr uaegfx_card_install (TrapContext *ctx, uae_u32 extrasize)
     uaecptr findcardfunc, initcardfunc;
     uaecptr exec = get_long (4);
 
-    uaegfx_resid = ds ("UAE Graphics Card 3.0");
+    uaegfx_resid = ds ("UAE Graphics Card 3.1");
+    uaegfx_vblankname = ds ("UAE Graphics Card VBLANK");
 
     /* Open */
     openfunc = here ();
@@ -4217,6 +4329,8 @@ static uaecptr uaegfx_card_install (TrapContext *ctx, uae_u32 extrasize)
     put_long (uaegfx_base + CARD_RESLIST, uaegfx_base + CARD_SIZEOF);
     put_long (uaegfx_base + CARD_RESLISTSIZE, extrasize);
 
+    initvblankirq (ctx, uaegfx_base);
+
     write_log ("uaegfx.card %d.%d init @%08X\n", UAEGFX_VERSION, UAEGFX_REVISION, uaegfx_base);
     return uaegfx_base;
 }
@@ -4283,6 +4397,7 @@ uae_u8 *restore_p96 (uae_u8 *src)
     init_picasso_screen_called = 0;
     set_gc_called = !!(flags & 2);
     set_panning_called = !!(flags & 4);
+    interrupt_enabled = !!(flags & 32);
     changed_prefs.gfxmem_size = restore_u32 ();
     picasso96_state.Address = restore_u32 ();
     picasso96_state.RGBFormat = restore_u32 ();
@@ -4320,7 +4435,7 @@ uae_u8 *save_p96 (int *len, uae_u8 *dstptr)
        dstbak = dst = malloc (1000);
     save_u32 (2);
     save_u32 ((picasso_on ? 1 : 0) | (set_gc_called ? 2 : 0) | (set_panning_called ? 4 : 0) |
-       (hwsprite ? 8 : 0) | (cursorvisible ? 16 : 0));
+       (hwsprite ? 8 : 0) | (cursorvisible ? 16 : 0) | (interrupt_enabled ? 32 : 0));
     save_u32 (currprefs.gfxmem_size);
     save_u32 (picasso96_state.Address);
     save_u32 (picasso96_state.RGBFormat);
index a34da8a8cf1f8ce80ae10b25f8216226205b97dd..b2560cd342df15e940d34fad91eabda489769264 100755 (executable)
@@ -461,15 +461,15 @@ struct Line {
 #define BIB_HARDWARESPRITE      0      /* board has hardware sprite */
 #define BIB_NOMEMORYMODEMIX     1      /* board does not support modifying planar bitmaps while displaying chunky and vice versa */
 #define BIB_NEEDSALIGNMENT      2      /* bitmaps have to be aligned (not yet supported!) */
+#define BIB_CACHEMODECHANGE     3      /* board memory may be set to Imprecise (060) or Nonserialised (040) */
+#define BIB_VBLANKINTERRUPT     4      /* board can cause a hardware interrupt on a vertical retrace */
 #define BIB_DBLSCANDBLSPRITEY   8      /* hardware sprite y position is doubled on doublescan display modes */
 #define BIB_ILACEHALFSPRITEY    9      /* hardware sprite y position is halved on interlace display modes */
 #define BIB_ILACEDBLROWOFFSET  10      /* doubled row offset in interlaced display modes needs additional horizontal bit */
-
 #define BIB_FLICKERFIXER       12      /* board can flicker fix Amiga RGB signal */
 #define BIB_VIDEOCAPTURE       13      /* board can capture video data to a memory area */
 #define BIB_VIDEOWINDOW                14      /* board can display a second mem area as a pip */
 #define BIB_BLITTER            15      /* board has blitter */
-
 #define BIB_HIRESSPRITE                16      /* mouse sprite has double resolution */
 #define BIB_BIGSPRITE          17      /* user wants big mouse sprite */
 #define BIB_BORDEROVERRIDE     18      /* user wants to override system overscan border prefs */
@@ -479,12 +479,15 @@ struct Line {
 #define BIB_NOMASKBLITS                22      /* perform blits without taking care of mask */
 #define BIB_NOC2PBLITS         23      /* use CPU for planar to chunky conversions */
 #define BIB_NOBLITTER          24      /* disable all blitter functions */
+#define BIB_OVERCLOCK          31      /* enable overclocking for some boards */
 
 #define BIB_IGNOREMASK BIB_NOMASKBLITS
 
 #define BIF_HARDWARESPRITE     (1 << BIB_HARDWARESPRITE)
 #define BIF_NOMEMORYMODEMIX    (1 << BIB_NOMEMORYMODEMIX)
 #define BIF_NEEDSALIGNMENT     (1 << BIB_NEEDSALIGNMENT)
+#define BIF_CACHEMODECHANGE    (1 << BIB_CACHEMODECHANGE)
+#define BIF_VBLANKINTERRUPT    (1 << BIB_VBLANKINTERRUPT)
 #define BIF_DBLSCANDBLSPRITEY  (1 << BIB_DBLSCANDBLSPRITEY)
 #define BIF_ILACEHALFSPRITEY   (1 << BIB_ILACEHALFSPRITEY)
 #define BIF_ILACEDBLROWOFFSET  (1 << BIB_ILACEDBLROWOFFSET)
@@ -501,6 +504,7 @@ struct Line {
 #define BIF_NOMASKBLITS                (1 << BIB_NOMASKBLITS)
 #define BIF_NOC2PBLITS         (1 << BIB_NOC2PBLITS)
 #define BIF_NOBLITTER          (1 << BIB_NOBLITTER)
+#define BIF_OVERCLOCK          (1 << BIB_OVERCLOCK)
 
 #define BIF_IGNOREMASK         BIF_NOMASKBLITS
 
@@ -554,6 +558,7 @@ extern void picasso_handle_vsync (void);
 extern void init_hz_p96 (void);
 extern void picasso_handle_hsync (void);
 extern int picasso_palette (void);
+extern void picasso_reset (void);
 
 /* This structure describes the UAE-side framebuffer for the Picasso
  * screen.  */
@@ -591,7 +596,10 @@ extern int p96hsync_counter;
 #define CARD_RESLIST (CARD_NAME + 4)
 #define CARD_RESLISTSIZE (CARD_RESLIST + 4)
 #define CARD_BOARDINFO (CARD_RESLISTSIZE + 4)
-#define CARD_END (CARD_BOARDINFO + 4)
+#define CARD_VBLANKIRQ (CARD_BOARDINFO + 4)
+#define CARD_VBLANKFLAG (CARD_VBLANKIRQ + 22)
+#define CARD_VBLANKCODE (CARD_VBLANKFLAG + 4)
+#define CARD_END (CARD_VBLANKCODE + 16 * 2)
 #define CARD_SIZEOF CARD_END
 
 #endif
index 661f643063357509b9a555713a5072420f4247c9..6891c960515228ef9fc270327d5a7b3413c5f02e 100755 (executable)
 #define IDC_DF0QQ                       1678
 #define IDC_DF1Q                        1679
 #define IDC_QUICKSTART_HOSTCONFIG       1679
-#define IDC_FILE_ASSOCIATE              1679
 #define IDC_DF1QQ                       1680
 #define IDC_QUICKSTART_SETCONFIG        1681
 #define IDC_CONFIGAUTO                  1682
 #define IDC_RTG_16BIT                   1788
 #define IDC_PATHS_CONFIGCACHE           1788
 #define IDC_RTG_24BIT                   1789
+#define IDC_ASSOCIATELIST               1789
 #define IDC_RTG_32BIT                   1790
+#define IDC_ASSOCIATE_OFF               1790
 #define IDC_DD_SURFACETYPE              1791
 #define IDC_RTG_SCALE_ALLOW             1791
 #define IDC_RTG_SCALE_ASPECTRATIO       1792
+#define IDC_ASSOCIATE_ON                1792
+#define IDC_RTG_VBLANKRATE              1793
 #define ID__FLOPPYDRIVES                40004
 #define ID_FLOPPYDRIVES_DF0             40005
 #define ID_ST_CONFIGURATION             40010
index 661f643063357509b9a555713a5072420f4247c9..6891c960515228ef9fc270327d5a7b3413c5f02e 100755 (executable)
 #define IDC_DF0QQ                       1678
 #define IDC_DF1Q                        1679
 #define IDC_QUICKSTART_HOSTCONFIG       1679
-#define IDC_FILE_ASSOCIATE              1679
 #define IDC_DF1QQ                       1680
 #define IDC_QUICKSTART_SETCONFIG        1681
 #define IDC_CONFIGAUTO                  1682
 #define IDC_RTG_16BIT                   1788
 #define IDC_PATHS_CONFIGCACHE           1788
 #define IDC_RTG_24BIT                   1789
+#define IDC_ASSOCIATELIST               1789
 #define IDC_RTG_32BIT                   1790
+#define IDC_ASSOCIATE_OFF               1790
 #define IDC_DD_SURFACETYPE              1791
 #define IDC_RTG_SCALE_ALLOW             1791
 #define IDC_RTG_SCALE_ASPECTRATIO       1792
+#define IDC_ASSOCIATE_ON                1792
+#define IDC_RTG_VBLANKRATE              1793
 #define ID__FLOPPYDRIVES                40004
 #define ID_FLOPPYDRIVES_DF0             40005
 #define ID_ST_CONFIGURATION             40010
index d8fa293270e67bd0981f0c58c69a39d4219f410c..f496a0dbbec69cdefcfb2439900e881841229c68 100755 (executable)
@@ -151,14 +151,16 @@ BEGIN
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,128,162,10
     CONTROL         "Match host and RTG color depth if possible",IDC_RTG_MATCH_DEPTH,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,116,163,10
-    COMBOBOX        IDC_RTG_8BIT,211,107,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_RTG_16BIT,211,123,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_RTG_24BIT,211,139,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_RTG_32BIT,211,155,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_RTG_8BIT,211,91,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_RTG_16BIT,211,106,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_RTG_24BIT,211,121,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_RTG_32BIT,211,136,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
     CONTROL         "Always scale in windowed mode",IDC_RTG_SCALE_ALLOW,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,140,162,10
-    COMBOBOX        IDC_RTG_SCALE_ASPECTRATIO,131,155,57,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    RTEXT           "Scale aspect ratio",-1,24,156,99,10,SS_CENTERIMAGE
+    COMBOBOX        IDC_RTG_SCALE_ASPECTRATIO,211,155,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Aspect ratio:",-1,153,156,52,10,SS_CENTERIMAGE
+    RTEXT           "Refresh rate:",-1,22,157,51,10,SS_CENTERIMAGE
+    COMBOBOX        IDC_RTG_VBLANKRATE,77,155,68,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
 END
 
 IDD_CPU DIALOGEX 0, 0, 300, 226
@@ -720,7 +722,7 @@ BEGIN
     RTEXT           "HD Controller:",IDC_STATIC,42,51,52,10,SS_CENTERIMAGE
 END
 
-IDD_MISC2 DIALOGEX 0, 0, 300, 92
+IDD_MISC2 DIALOGEX 0, 0, 300, 244
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD
 FONT 8, "MS Sans Serif", 0, 0, 0x1
 BEGIN
@@ -737,6 +739,10 @@ BEGIN
     COMBOBOX        IDC_MINIMIZED_PRIORITY,207,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
     CONTROL         "Pause emulation",IDC_MINIMIZED_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,50,69,10
     CONTROL         "Disable sound",IDC_MINIMIZED_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,63,79,10
+    CONTROL         "",IDC_ASSOCIATELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,19,94,164,100
+    GROUPBOX        "File Extension Associations",IDC_STATIC,8,83,186,138
+    PUSHBUTTON      "Deassociate all",IDC_ASSOCIATE_OFF,108,200,75,14
+    PUSHBUTTON      "Associate all",IDC_ASSOCIATE_ON,19,200,75,14
 END
 
 IDD_DISK DIALOGEX 0, 0, 300, 242
@@ -771,30 +777,29 @@ STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD
 FONT 8, "MS Sans Serif", 0, 0, 0x1
 BEGIN
     LTEXT           "System ROMs:",IDC_PATHS_ROML,14,4,260,8,SS_CENTERIMAGE
-    EDITTEXT        IDC_PATHS_ROM,14,17,261,15,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PATHS_ROMS,281,17,11,15
-    LTEXT           "Configuration files:",IDC_PATHS_CONFIGL,14,35,121,8,SS_CENTERIMAGE
-    EDITTEXT        IDC_PATHS_CONFIG,14,47,261,15,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PATHS_CONFIGS,281,47,11,15
-    LTEXT           "Screenshots:",IDC_PATHS_SCREENSHOTL,14,66,260,8,SS_CENTERIMAGE
-    EDITTEXT        IDC_PATHS_SCREENSHOT,14,78,261,15,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PATHS_SCREENSHOTS,281,78,11,15
-    LTEXT           "State files:",IDC_PATHS_STATEFILEL,14,97,260,8,SS_CENTERIMAGE
-    EDITTEXT        IDC_PATHS_SAVESTATE,14,109,261,15,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PATHS_SAVESTATES,281,109,11,15
-    LTEXT           "Videos:",IDC_PATHS_AVIOUTPUTL,14,127,260,8,SS_CENTERIMAGE
-    EDITTEXT        IDC_PATHS_AVIOUTPUT,14,139,261,15,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PATHS_AVIOUTPUTS,281,139,11,15
-    LTEXT           "Saveimages:",IDC_PATHS_SAVEIMAGEL,14,158,260,8,SS_CENTERIMAGE
-    EDITTEXT        IDC_PATHS_SAVEIMAGE,14,170,261,15,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PATHS_SAVEIMAGES,281,170,11,15
-    PUSHBUTTON      "Reset to defaults",IDC_PATHS_DEFAULT,14,191,92,14
-    PUSHBUTTON      "Rescan ROMs",IDC_ROM_RESCAN,14,209,92,14
-    PUSHBUTTON      "Clear registry",IDC_RESETREGISTRY,112,227,77,14
-    COMBOBOX        IDC_PATHS_DEFAULTTYPE,112,191,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    PUSHBUTTON      "Clear disk history",IDC_RESETDISKHISTORY,14,227,92,14
-    CONTROL         "Cache Configuration files",IDC_PATHS_CONFIGCACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,177,35,117,10
-    PUSHBUTTON      "Associate file extensions",IDC_FILE_ASSOCIATE,112,209,164,14
+    EDITTEXT        IDC_PATHS_ROM,14,16,261,15,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PATHS_ROMS,281,16,11,15
+    LTEXT           "Configuration files:",IDC_PATHS_CONFIGL,14,34,121,8,SS_CENTERIMAGE
+    EDITTEXT        IDC_PATHS_CONFIG,14,45,261,15,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PATHS_CONFIGS,281,45,11,15
+    LTEXT           "Screenshots:",IDC_PATHS_SCREENSHOTL,14,63,260,8,SS_CENTERIMAGE
+    EDITTEXT        IDC_PATHS_SCREENSHOT,14,74,261,15,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PATHS_SCREENSHOTS,281,74,11,15
+    LTEXT           "State files:",IDC_PATHS_STATEFILEL,14,92,260,8,SS_CENTERIMAGE
+    EDITTEXT        IDC_PATHS_SAVESTATE,14,104,261,15,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PATHS_SAVESTATES,281,104,11,15
+    LTEXT           "Videos:",IDC_PATHS_AVIOUTPUTL,14,122,260,8,SS_CENTERIMAGE
+    EDITTEXT        IDC_PATHS_AVIOUTPUT,14,134,261,15,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PATHS_AVIOUTPUTS,281,134,11,15
+    LTEXT           "Saveimages:",IDC_PATHS_SAVEIMAGEL,14,152,261,8,SS_CENTERIMAGE
+    EDITTEXT        IDC_PATHS_SAVEIMAGE,14,163,261,15,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PATHS_SAVEIMAGES,281,163,11,15
+    PUSHBUTTON      "Reset to defaults",IDC_PATHS_DEFAULT,14,184,92,14
+    PUSHBUTTON      "Rescan ROMs",IDC_ROM_RESCAN,14,200,92,14
+    PUSHBUTTON      "Clear registry",IDC_RESETREGISTRY,111,200,92,14
+    COMBOBOX        IDC_PATHS_DEFAULTTYPE,112,184,163,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Clear disk history",IDC_RESETDISKHISTORY,14,216,92,14
+    CONTROL         "Cache Configuration files",IDC_PATHS_CONFIGCACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,177,34,117,10
 END
 
 IDD_QUICKSTART DIALOGEX 0, 0, 300, 242
@@ -1090,8 +1095,8 @@ BEGIN
     IDS_ABOUT               "About"
     IDS_LOADSAVE            "Configurations"
     IDS_AVIOUTPUT           "Output"
-    IDS_PORTS               "Game & I/O ports"
-    IDS_MISC1               "Misc"
+    IDS_PORTS               "Game & IO ports"
+    IDS_MISC1               "Miscellaneous"
     IDS_MEMORY              "RAM"
     IDS_CPU                 "CPU and FPU"
     IDS_CHIPSET             "Chipset"
@@ -1101,7 +1106,7 @@ END
 
 STRINGTABLE 
 BEGIN
-    IDS_MISC2               "Priority"
+    IDS_MISC2               "Pri. & Extensions"
     IDS_PATHS               "Paths"
     IDS_QUICKSTART          "Quickstart"
     IDS_FRONTEND            "Frontend"
index cc86fb1dbe675b684cb092306d590e870b28ceed..463145d06d15ad6460836fb4527e0b52ffd9e996 100755 (executable)
@@ -335,6 +335,9 @@ static void setcursor (int oldx, int oldy)
     int y = (amigawin_rect.bottom - amigawin_rect.top) / 2;
     mouseposx = oldx - x;
     mouseposy = oldy - y;
+//    write_log ("%d %d %d %d %d - %d %d %d %d %d\n",
+//     x, amigawin_rect.left, amigawin_rect.right, mouseposx, oldx,
+//     y, amigawin_rect.top, amigawin_rect.bottom, mouseposy, oldy);
     if (oldx >= 30000 || oldy >= 30000 || oldx <= -30000 || oldy <= -30000) {
        mouseposx = mouseposy = 0;
        oldx = oldy = 0;
@@ -1952,6 +1955,7 @@ void target_default_options (struct uae_prefs *p, int type)
        p->win32_rtgscaleifsmall = 1;
        p->win32_rtgallowscaling = 0;
        p->win32_rtgscaleaspectratio = -1;
+       p->win32_rtgvblankrate = 0;
     }
     if (type == 1 || type == 0) {
        p->win32_uaescsimode = get_aspi (p->win32_uaescsimode);
@@ -1998,6 +2002,10 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
     cfgfile_target_dwrite (f, "rtg_scale_aspect_ratio=%d:%d\n",
        p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio >> 8) : -1,
        p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio & 0xff) : -1);
+    if (p->win32_rtgvblankrate <= 0)
+       cfgfile_target_dwrite (f, "rtg_vblank=%s\n", p->win32_rtgvblankrate < 0 ? "real" : "chipset");
+    else
+       cfgfile_target_dwrite (f, "rtg_vblank=%d\n", p->win32_rtgvblankrate);
     cfgfile_target_dwrite (f, "borderless=%s\n", p->win32_borderless ? "true" : "false");
     cfgfile_target_dwrite (f, "uaescsimode=%s\n", scsimode[p->win32_uaescsimode]);
     cfgfile_target_dwrite (f, "soundcard=%d\n", p->win32_soundcard);
@@ -2075,6 +2083,19 @@ int target_parse_option (struct uae_prefs *p, char *option, char *value)
        return 1;
     }
 
+    if (cfgfile_string (option, value, "rtg_vblank", tmpbuf, sizeof tmpbuf)) {
+       if (!strcmp (tmpbuf, "real")) {
+           p->win32_rtgvblankrate = -1;
+           return 1;
+       }
+       if (!strcmp (tmpbuf, "chipset")) {
+           p->win32_rtgvblankrate = 0;
+           return 1;
+       }
+       p->win32_rtgvblankrate = atol (tmpbuf);
+       return 1;
+    }
+
     if (cfgfile_string (option, value, "rtg_scale_aspect_ratio", tmpbuf, sizeof tmpbuf)) {
        int v1, v2;
        char *s;
@@ -2458,6 +2479,7 @@ static int shell_deassociate (const char *extension)
     const char *progid = "WinUAE";
     int def = !strcmp (extension, ".uae");
     char rpath1[MAX_DPATH], rpath2[MAX_DPATH], progid2[MAX_DPATH];
+    UAEREG *fkey;
 
     if (extension == NULL || strlen (extension) < 1 || extension[0] != '.')
        return 0;
@@ -2478,7 +2500,9 @@ static int shell_deassociate (const char *extension)
     if (!def)
        strcat (rpath2, extension);
     SHDeleteKey (rkey, rpath2);
-    SHChangeNotify (SHCNE_ASSOCCHANGED, 0, 0, 0); 
+    fkey = regcreatetree (NULL, "FileAssociations");
+    regdelete (fkey, extension);
+    regclosetree (fkey);
     return 1;
 }
 
@@ -2490,6 +2514,7 @@ static int shell_associate_2 (const char *extension, const char *shellcommand, c
     DWORD disposition;
     const char *progid = "WinUAE";
     int def = !strcmp (extension, ".uae");
+    UAEREG *fkey;
 
     strcpy (progid2, progid);
     strcat (progid2, ext2 ? ext2 : extension);
@@ -2534,24 +2559,156 @@ static int shell_associate_2 (const char *extension, const char *shellcommand, c
            RegCloseKey (key1);
        }
     }
+    fkey = regcreatetree (NULL, "FileAssociations");
+    regsetstr (fkey, extension, "");
+    regclosetree (fkey);
     return 1;
 }
 static int shell_associate (const char *extension, const char *command, const char *perceivedtype, const char *description, const char *ext2)
 {
-    return shell_associate_2 (extension, NULL, command, perceivedtype, description, ext2);
+    int v = shell_associate_2 (extension, NULL, command, perceivedtype, description, ext2);
+    if (!strcmp (extension, ".uae"))
+       shell_associate_2 (extension, "edit", "-f \"%1\" -s use_gui=yes", "text", description, NULL);
+    return v;
+}
+
+static int shell_associate_is (const char *extension)
+{
+    char rpath1[MAX_DPATH], rpath2[MAX_DPATH];
+    char progid2[MAX_DPATH], tmp[MAX_DPATH];
+    DWORD size;
+    HKEY rkey, key1;
+    const char *progid = "WinUAE";
+    int def = !strcmp (extension, ".uae");
+
+    strcpy (progid2, progid);
+    strcat (progid2, extension);
+    if (os_winnt_admin > 1)
+        rkey = HKEY_LOCAL_MACHINE;
+    else
+        rkey = HKEY_CURRENT_USER;
+
+    strcpy (rpath1, "Software\\Classes\\");
+    strcpy (rpath2, rpath1);
+    strcat (rpath2, extension);
+    size = sizeof tmp;
+    if (RegOpenKeyEx (rkey, rpath2, 0, KEY_READ, &key1) == ERROR_SUCCESS) {
+       if (RegQueryValueEx (key1, NULL, NULL, NULL, tmp, &size) == ERROR_SUCCESS) {
+           if (strcmp (tmp, def ? progid : progid2)) {
+               RegCloseKey (key1);
+               return 0;
+           }
+       }
+       RegCloseKey (key1);
+    }
+    strcpy (rpath2, rpath1);
+    strcat (rpath2, progid);
+    if (!def)
+       strcat (rpath2, extension);
+    if (RegOpenKeyEx (rkey, rpath2, 0, KEY_READ, &key1) == ERROR_SUCCESS) {
+       RegCloseKey (key1);
+       return 1;
+    }
+    return 0;
+}
+
+struct assext exts[] = {
+    { ".uae", "-f \"%1\"", "WinUAE configuration file", },
+    { ".adf", "-0 \"%1\" -s use_gui=no", "WinUAE floppy disk image" },
+    { ".adz", "-0 \"%1\" -s use_gui=no", "WinUAE floppy disk image" },
+    { ".dms", "-0 \"%1\" -s use_gui=no", "WinUAE floppy disk image" },
+    { ".fdi", "-0 \"%1\" -s use_gui=no", "WinUAE floppy disk image" },
+    { ".ipf", "-0 \"%1\" -s use_gui=no", "WinUAE floppy disk image" },
+    { ".uss", "-s statefile=\"%1\" -s use_gui=no", "WinUAE statefile" },
+    { NULL }
+};
+
+static void associate_init_extensions (void)
+{
+    int i;
+
+    for (i = 0; exts[i].ext; i++) {
+       exts[i].enabled = 0;
+       if (shell_associate_is (exts[i].ext))
+           exts[i].enabled = 1;
+    }
+    // associate .uae by default when running for the first time
+    if (!regexiststree (NULL, "FileAssociations")) {
+       UAEREG *fkey;
+       if (exts[0].enabled == 0) {
+           shell_associate (exts[0].ext, exts[0].cmd, NULL, exts[0].desc, NULL);
+           exts[0].enabled = shell_associate_is (exts[0].ext);
+       }
+        fkey = regcreatetree (NULL, "FileAssociations");
+       regsetstr (fkey, exts[0].ext, "");
+       regclosetree (fkey);
+    }
+#if 0
+    UAEREG *fkey;
+    fkey = regcreatetree (NULL, "FileAssociations");
+    if (fkey) {
+       int ok = 1;
+       char tmp[MAX_DPATH];
+       strcpy (tmp, "Following file associations:\n");
+       for (i = 0; exts[i].ext; i++) {
+           char tmp2[10];
+           int size = sizeof tmp;
+           int is1 = exts[i].enabled;
+           int is2 = regquerystr (fkey, exts[i].ext, tmp2, &size);
+           if (is1 == 0 && is2 != 0) {
+               strcat (tmp, exts[i].ext);
+               strcat (tmp, "\n");
+               ok = 0;
+           }
+       }
+       if (!ok) {
+           char szTitle[MAX_DPATH];
+           WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH);
+           strcat (szTitle, BetaStr);
+           if (MessageBox (NULL, tmp, szTitle, MB_YESNO | MB_TASKMODAL) == IDOK) {
+               for (i = 0; exts[i].ext; i++) {
+                   char tmp2[10];
+                   int size = sizeof tmp;
+                   int is1 = exts[i].enabled;
+                   int is2 = regquerystr (fkey, exts[i].ext, tmp2, &size);
+                   if (is1 == 0 && is2 != 0) {
+                       regdelete (fkey, exts[i].ext);
+                       shell_associate (exts[i].ext, exts[i].cmd, NULL, exts[i].desc, NULL);
+                       exts[i].enabled = shell_associate_is (exts[i].ext);
+                   }
+               }
+           } else {
+               for (i = 0; exts[i].ext; i++) {
+                   if (!exts[i].enabled)
+                       regdelete (fkey, exts[i].ext);
+               }
+           }
+       }
+    }
+#endif
 }
 
-static char *exts[] = { ".adz", ".dms", ".ipf", NULL };
 void associate_file_extensions (void)
 {
     int i;
-    shell_associate_2 (".uae", "edit", "-f \"%1\" -s use_gui=yes", "text", "WinUAE configuration file", NULL);
-    shell_associate (".uae", "-f \"%1\"", "text", "WinUAE configuration file", NULL);
-    shell_associate (".uss", "-s statefile=\"%1\" -s use_gui=no", NULL, "WinUAE statefile", NULL);
-    shell_associate (".adf", "-0 \"%1\" -s use_gui=no", NULL, "WinUAE floppy disk image", NULL);
-    for (i = 0; exts[i]; i++)
-        shell_associate (exts[i], NULL, NULL, "WinUAE floppy disk image", ".adf");
-    SHChangeNotify (SHCNE_ASSOCCHANGED, 0, 0, 0); 
+    int modified = 0;
+
+    for (i = 0; exts[i].ext; i++) {
+       int already = shell_associate_is (exts[i].ext);
+       if (exts[i].enabled == 0 && already) {
+           shell_deassociate (exts[i].ext);
+           exts[i].enabled = shell_associate_is (exts[i].ext);
+           if (exts[i].enabled)
+               modified = 1;
+       } else if (exts[i].enabled && already == 0) {
+           shell_associate (exts[i].ext, exts[i].cmd, NULL, exts[i].desc, NULL);
+           exts[i].enabled = shell_associate_is (exts[i].ext);
+           if (exts[i].enabled == 0)
+               modified = 1;
+       }
+    }
+    if (modified)
+       SHChangeNotify (SHCNE_ASSOCCHANGED, 0, 0, 0); 
 }
 
 static void WIN32_HandleRegistryStuff(void)
@@ -2632,6 +2789,7 @@ static void WIN32_HandleRegistryStuff(void)
     fetch_path ("InputPath", path, sizeof (path));
     createdir (path);
     regclosetree (read_disk_history ());
+    associate_init_extensions ();
     read_rom_list ();
     load_keyring (NULL, NULL);
 }
index d68354ede48ec2a1414c1db702ca4f92e842c3c7..0aa29d88ca5152733a0de497abd738ac4f7978bf 100755 (executable)
@@ -17,8 +17,8 @@
 
 #define WINUAEPUBLICBETA 1
 
-#define WINUAEBETA "4"
-#define WINUAEDATE MAKEBD(2008, 10, 12)
+#define WINUAEBETA "6"
+#define WINUAEDATE MAKEBD(2008, 10, 26)
 #define WINUAEEXTRA ""
 #define WINUAEREV ""
 
@@ -154,4 +154,13 @@ struct sound_device
 extern struct sound_device sound_devices[MAX_SOUND_DEVICES];
 extern struct sound_device record_devices[MAX_SOUND_DEVICES];
 
+struct assext {
+    char *ext;
+    char *cmd;
+    char *desc;
+    int enabled;
+};
+struct assext exts[];
+void associate_file_extensions (void);
+
 #endif
index d6bd285cb4723e99c671c8aa4118aec0e106a37c..3779d9d3a140f92b7dac6e12db857a3a8738a514 100755 (executable)
@@ -295,6 +295,7 @@ static int set_ddraw_2 (void)
                goto oops;
            return -1;
        }
+       GetWindowRect (hAmigaWnd, &amigawin_rect);
     }
 
     if (dd) {
@@ -1040,6 +1041,7 @@ int check_prefs_changed_gfx (void)
     c |= currprefs.win32_rtgscaleifsmall != changed_prefs.win32_rtgscaleifsmall ? 8 : 0;
     c |= currprefs.win32_rtgallowscaling != changed_prefs.win32_rtgallowscaling ? 8 : 0;
     c |= currprefs.win32_rtgscaleaspectratio != changed_prefs.win32_rtgscaleaspectratio ? 8 : 0;
+    c |= currprefs.win32_rtgvblankrate != changed_prefs.win32_rtgvblankrate ? 8 : 0;
 
     if (display_change_requested || c)
     {
@@ -1097,6 +1099,7 @@ int check_prefs_changed_gfx (void)
        currprefs.win32_rtgscaleifsmall = changed_prefs.win32_rtgscaleifsmall;
        currprefs.win32_rtgallowscaling = changed_prefs.win32_rtgallowscaling;
        currprefs.win32_rtgscaleaspectratio = changed_prefs.win32_rtgscaleaspectratio;
+       currprefs.win32_rtgvblankrate = changed_prefs.win32_rtgvblankrate;
 
        inputdevice_unacquire ();
        if ((c & 16) || ((c & 8) && keepfsmode)) {
index 36c07df1e8b5b2508ed748379ea529f213052120..55a2daf7da5f2a92c6f2bb2640f734bf97e24007 100755 (executable)
@@ -1232,12 +1232,12 @@ void gui_display (int shortcut)
            savestate_state = 0;
        }
     } else if (shortcut >= 0 && shortcut < 4) {
-       DiskSelection(hAmigaWnd, IDC_DF0+shortcut, 0, &changed_prefs, 0);
+       DiskSelection (hAmigaWnd, IDC_DF0 + shortcut, 0, &changed_prefs, 0);
     } else if (shortcut == 5) {
-       if (DiskSelection(hAmigaWnd, IDC_DOSAVESTATE, 9, &changed_prefs, 0))
+       if (DiskSelection (hAmigaWnd, IDC_DOSAVESTATE, 9, &changed_prefs, 0))
            save_state (savestate_fname, "Description!");
     } else if (shortcut == 4) {
-       if (DiskSelection(hAmigaWnd, IDC_DOLOADSTATE, 10, &changed_prefs, 0))
+       if (DiskSelection (hAmigaWnd, IDC_DOLOADSTATE, 10, &changed_prefs, 0))
            savestate_state = STATE_DORESTORE;
     }
     manual_painting_needed--; /* So that WM_PAINT doesn't need to use custom refreshing */
@@ -1355,7 +1355,27 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
            break;
            case 9:
            case 10:
-               fetch_path ("StatefilePath", init_path, sizeof (init_path));
+           {
+               int ok = 0;
+               if (savestate_fname[0]) {
+                   strcpy (init_path, savestate_fname);
+                   for (;;) {
+                       char *p;
+                       if (my_existsdir (init_path)) {
+                           ok = 1;
+                           break;
+                       }
+                       p = strrchr (init_path, '\\');
+                       if (!p)
+                           p = strrchr (init_path, '/');
+                       if (!p)
+                           break;
+                       *p = 0;
+                   }
+               }
+               if (!ok)
+                   fetch_path ("StatefilePath", init_path, sizeof (init_path));
+           }
            break;
            case 15:
            case 16:
@@ -2578,12 +2598,14 @@ static int clicked_entry = -1;
 #define INPUT_COLUMNS 4
 #define HARDDISK_COLUMNS 8
 #define DISK_COLUMNS 3
+#define MISC2_COLUMNS 2
 #define MAX_COLUMN_HEADING_WIDTH 20
 
 #define LV_LOADSAVE 1
 #define LV_HARDDISK 2
 #define LV_INPUT 3
 #define LV_DISK 4
+#define LV_MISC2 5
 
 static int listview_num_columns;
 
@@ -2626,6 +2648,12 @@ void InitializeListView (HWND hDlg)
        WIN32GUI_LoadUIString(IDS_INPUTAUTOFIRE, column_heading[2], MAX_COLUMN_HEADING_WIDTH);
        strcpy (column_heading[3], "#");
        list = GetDlgItem(hDlg, IDC_INPUTLIST);
+    } else if (hDlg == pages[MISC2_ID]) {
+       listview_num_columns = MISC2_COLUMNS;
+       lv_type = LV_MISC2;
+       strcpy (column_heading[0], "Extension");
+       strcpy (column_heading[1], "");
+       list = GetDlgItem (hDlg, IDC_ASSOCIATELIST);
     } else {
        listview_num_columns = DISK_COLUMNS;
        lv_type = LV_DISK;
@@ -2634,29 +2662,38 @@ void InitializeListView (HWND hDlg)
        WIN32GUI_LoadUIString(IDS_DISK_DRIVENAME, column_heading[2], MAX_COLUMN_HEADING_WIDTH);
        list = GetDlgItem (hDlg, IDC_DISK);
     }
-    cachedlist = list;
 
-    ListView_DeleteAllItems(list);
+    cachedlist = list;
+    ListView_DeleteAllItems (list);
 
     for(i = 0; i < listview_num_columns; i++)
-       listview_column_width[i] = ListView_GetStringWidth(list, column_heading[i]) + 15;
+       listview_column_width[i] = ListView_GetStringWidth (list, column_heading[i]) + 15;
 
     // If there are no columns, then insert some
     lvcolumn.mask = LVCF_WIDTH;
-    if(ListView_GetColumn(list, 1, &lvcolumn) == FALSE)
-    {
-       for(i = 0; i < listview_num_columns; i++)
-       {
+    if (ListView_GetColumn (list, 1, &lvcolumn) == FALSE) {
+       for(i = 0; i < listview_num_columns; i++) {
            lvcolumn.mask     = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
            lvcolumn.iSubItem = i;
            lvcolumn.fmt      = LVCFMT_LEFT;
            lvcolumn.pszText  = column_heading[i];
            lvcolumn.cx       = listview_column_width[i];
-           ListView_InsertColumn(list, i, &lvcolumn);
+           ListView_InsertColumn (list, i, &lvcolumn);
        }
     }
-    if (lv_type == LV_INPUT)
-    {
+    if (lv_type == LV_MISC2) {
+       listview_column_width[0] = 180;
+       listview_column_width[1] = 10;
+       for (i = 0; exts[i].ext; i++) {
+           lvstruct.mask     = LVIF_TEXT | LVIF_PARAM;
+           lvstruct.pszText  = exts[i].ext;
+           lvstruct.lParam   = 0;
+           lvstruct.iItem    = i;
+           lvstruct.iSubItem = 0;
+           result = ListView_InsertItem (list, &lvstruct);
+           ListView_SetItemText (list, result, 1, exts[i].enabled ? "*" : "");
+       }
+    } else if (lv_type == LV_INPUT) {
        for (i = 0; input_total_devices && i < inputdevice_get_widget_num (input_selected_device); i++) {
            char name[100];
            inputdevice_get_widget_type (input_selected_device, i, name);
@@ -2665,8 +2702,8 @@ void InitializeListView (HWND hDlg)
            lvstruct.lParam   = 0;
            lvstruct.iItem    = i;
            lvstruct.iSubItem = 0;
-           result = ListView_InsertItem(list, &lvstruct);
-           width = ListView_GetStringWidth(list, lvstruct.pszText) + 15;
+           result = ListView_InsertItem (list, &lvstruct);
+           width = ListView_GetStringWidth (list, lvstruct.pszText) + 15;
            if( width > listview_column_width[0])
                listview_column_width[0] = width;
            entry++;
@@ -2675,9 +2712,7 @@ void InitializeListView (HWND hDlg)
        listview_column_width [2] = 65;
        listview_column_width [3] = 30;
        update_listview_input (hDlg);
-    }
-    else if (lv_type == LV_DISK)
-    {
+    } else if (lv_type == LV_DISK) {
        for (i = 0; i < MAX_SPARE_DRIVES; i++) {
            int drv;
            sprintf (tmp, "%d", i + 1);
@@ -2704,7 +2739,7 @@ void InitializeListView (HWND hDlg)
            if (drv >= 0)
                sprintf (tmp, "DF%d:", drv);
            ListView_SetItemText (list, result, 2, tmp);
-           width = ListView_GetStringWidth(list, lvstruct.pszText) + 15;
+           width = ListView_GetStringWidth (list, lvstruct.pszText) + 15;
            if (width > listview_column_width[0])
                listview_column_width[0] = width;
            entry++;
@@ -2713,9 +2748,7 @@ void InitializeListView (HWND hDlg)
        listview_column_width[1] = 336;
        listview_column_width[2] = 50;
 
-    }
-    else if (lv_type == LV_HARDDISK)
-    {
+    } else if (lv_type == LV_HARDDISK) {
 #ifdef FILESYS
        for(i = 0; i < workprefs.mountitems; i++)
        {
@@ -2830,28 +2863,23 @@ void InitializeListView (HWND hDlg)
        }
 #endif
     }
-
-    if(result != -1) {
-       if(GetWindowRect(list, &rect)) {
-           ScreenToClient(hDlg, (LPPOINT)&rect);
-           ScreenToClient(hDlg, (LPPOINT)&rect.right);
-           if(listview_num_columns == 2) {
-               if((temp = rect.right - rect.left - listview_column_width[0] - 4) > listview_column_width[1])
+    if (result != -1) {
+       if (GetWindowRect (list, &rect)) {
+           ScreenToClient (hDlg, (LPPOINT)&rect);
+           ScreenToClient (hDlg, (LPPOINT)&rect.right);
+           if (listview_num_columns == 2) {
+               if ((temp = rect.right - rect.left - listview_column_width[0] - 30) > listview_column_width[1])
                    listview_column_width[1] = temp;
            }
        }
-
        // Adjust our column widths so that we can see the contents...
-       for(i = 0; i < listview_num_columns; i++) {
-           ListView_SetColumnWidth(list, i, listview_column_width[i]);
-       }
-
+       for(i = 0; i < listview_num_columns; i++)
+           ListView_SetColumnWidth (list, i, listview_column_width[i]);
        // Turn on full-row-select option
-       ListView_SetExtendedListViewStyle(list, LVS_EX_FULLROWSELECT);
-
+       ListView_SetExtendedListViewStyle (list, LVS_EX_FULLROWSELECT);
        // Redraw the items in the list...
-       items = ListView_GetItemCount(list);
-       ListView_RedrawItems(list, 0, items);
+       items = ListView_GetItemCount (list);
+       ListView_RedrawItems (list, 0, items);
     }
 }
 
@@ -3783,9 +3811,6 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
            configurationcache = IsDlgButtonChecked (hDlg, IDC_PATHS_CONFIGCACHE) ? 1 : 0;
            regsetint (NULL, "ConfigurationCache", configurationcache);
            break;
-           case IDC_FILE_ASSOCIATE:
-           associate_file_extensions ();
-           break;
 
        }
        recursive--;
@@ -5279,6 +5304,7 @@ static void enable_for_memorydlg (HWND hDlg)
     ew (hDlg, IDC_RTG_SCALE, rtg2);
     ew (hDlg, IDC_RTG_SCALE_ALLOW, rtg2);
     ew (hDlg, IDC_RTG_SCALE_ASPECTRATIO, rtg2);
+    ew (hDlg, IDC_RTG_VBLANKRATE, rtg2);
 }
 
 static void values_to_memorydlg (HWND hDlg)
@@ -5391,10 +5417,29 @@ static void values_to_memorydlg (HWND hDlg)
        (workprefs.picasso96_modeflags & RGBFF_A8B8G8R8) ? 2 :
        (workprefs.picasso96_modeflags & RGBFF_R8G8B8A8) ? 3 :
        (workprefs.picasso96_modeflags & RGBFF_B8G8R8A8) ? 4 : 0, 0);
+    if (workprefs.win32_rtgvblankrate <= 0 ||
+       workprefs.win32_rtgvblankrate == 50 ||
+       workprefs.win32_rtgvblankrate == 60 ||
+       workprefs.win32_rtgvblankrate == 70 ||
+       workprefs.win32_rtgvblankrate == 75) {
+       SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_SETCURSEL,
+           (workprefs.win32_rtgvblankrate == 0) ? 0 :
+           (workprefs.win32_rtgvblankrate < 0) ? 1 :
+           (workprefs.win32_rtgvblankrate == 50) ? 2 :
+           (workprefs.win32_rtgvblankrate == 60) ? 3 :
+           (workprefs.win32_rtgvblankrate == 70) ? 4 :
+           (workprefs.win32_rtgvblankrate == 75) ? 5 : 0, 0);
+    } else {
+       char tmp[10];
+       sprintf (tmp, "%d", workprefs.win32_rtgvblankrate);
+       SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, WM_SETTEXT, 0, (LPARAM)tmp);
+    }
+       
 
     CheckDlgButton (hDlg, IDC_RTG_SCALE, workprefs.win32_rtgscaleifsmall);
     CheckDlgButton (hDlg, IDC_RTG_SCALE_ALLOW, workprefs.win32_rtgallowscaling);
     CheckDlgButton (hDlg, IDC_RTG_MATCH_DEPTH, workprefs.win32_rtgmatchdepth);
+
     //CheckDlgButton (hDlg, IDC_RTG_LEDS, (workprefs.leds_on_screen & STATUSLINE_RTG) ? 1 : 0);
 
     SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_SETCURSEL,
@@ -5521,6 +5566,13 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA
            SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)"15:9");
            SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)"16:9");
            SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)"16:10");
+           SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_RESETCONTENT, 0, 0);
+           SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)"Chipset");
+           SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)"Real");
+           SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)"50");
+           SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)"60");
+           SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)"70");
+           SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)"75");
 
        case WM_USER:
            recursive++;
@@ -5637,6 +5689,24 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA
                            mask |= RGBFF_B8G8R8A8;
                    }
                    break;
+                   case IDC_RTG_VBLANKRATE:
+                   tmp[0] = 0;
+                   v = SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_GETCURSEL, 0, 0L);
+                   if (v != CB_ERR) {
+                       if (v == 0) {
+                           workprefs.win32_rtgvblankrate = 0;
+                       } else if (v == 1) {
+                           workprefs.win32_rtgvblankrate = -1;
+                       } else {
+                           v = SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_GETLBTEXT, (WPARAM)v, (LPARAM)tmp);
+                       }
+                   } else {
+                       v = SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, WM_GETTEXT, (WPARAM)sizeof tmp, (LPARAM)tmp);
+                   }
+                   if (tmp[0])
+                       workprefs.win32_rtgvblankrate = atol (tmp);
+                   write_log ("%d\n", workprefs.win32_rtgvblankrate);
+                   break;
                }
                workprefs.picasso96_modeflags = mask;
                values_to_memorydlg (hDlg);
@@ -6085,7 +6155,7 @@ static void values_to_miscdlg (HWND hDlg)
 static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
     char txt[100];
-    int v;
+    int v, i;
     static int recursive;
 
     if (recursive)
@@ -6123,8 +6193,23 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
        }
     break;
 
-    case WM_COMMAND:
+    case WM_NOTIFY:
+       if (((LPNMHDR) lParam)->idFrom == IDC_ASSOCIATELIST) {
+           int entry, col;
+           HWND list;
+           NM_LISTVIEW *nmlistview;
+           nmlistview = (NM_LISTVIEW *) lParam;
+           list = nmlistview->hdr.hwndFrom;
+           if (nmlistview->hdr.code == NM_DBLCLK) {
+               entry = listview_entry_from_click (list, &col);
+               exts[entry].enabled = exts[entry].enabled ? 0 : 1;
+               associate_file_extensions ();
+               InitializeListView (hDlg);
+           }
+       }
+    break;
 
+    case WM_COMMAND:
        if (currentpage == MISC1_ID) {
            if (HIWORD (wParam) == CBN_SELENDOK || HIWORD (wParam) == CBN_KILLFOCUS || HIWORD (wParam) == CBN_EDITCHANGE)  {
                switch (LOWORD (wParam))
@@ -6174,6 +6259,18 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 
        switch(wParam)
        {
+       case IDC_ASSOCIATE_ON:
+           for (i = 0; exts[i].ext; i++)
+               exts[i].enabled = 1;
+           associate_file_extensions ();
+           InitializeListView (hDlg);
+       break;
+       case IDC_ASSOCIATE_OFF:
+           for (i = 0; exts[i].ext; i++)
+               exts[i].enabled = 0;
+           associate_file_extensions ();
+           InitializeListView (hDlg);
+       break;
        case IDC_DOSAVESTATE:
            if (DiskSelection(hDlg, wParam, 9, &workprefs, 0))
                save_state (savestate_fname, "Description!");
@@ -6281,6 +6378,7 @@ static INT_PTR CALLBACK MiscDlgProc2 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
     currentpage = MISC2_ID;
     if (msg == WM_INITDIALOG) {
        pages[MISC2_ID] = hDlg;
+       InitializeListView (hDlg);
        values_to_miscdlg (hDlg);
        enable_for_miscdlg (hDlg);
        return TRUE;
index 52f35004e1e8f473fd99c469b10efc26aecf7c9b..6dc9bfdf76fe30910b04188f6ab5166771341d8c 100755 (executable)
@@ -1,4 +1,38 @@
 
+Beta 6:
+
+- Picasso96 vblank rewritten again, now uses build-in Picasso96 vblank
+  hardware interrupt support. It really works now, WaitTOF() does not
+  waste CPU time anymore
+- added Picasso96 vblank rate configuration in GUI. Chipset = RTG
+  vblank is same as chipset refresh rate (same as in previous versions)
+  Real = real host-side refresh rate. <value> = refresh rate. Currently
+  this only affects vertical blank waiting functions
+- "Associate all"-button didn't work
+- fullscreen to another fullscreen resolution switch on non-primary
+  display could have frozen emulation in some cases
+- statefile-configuration parameter also sets default statefile path
+- 150b23 "disk write does not start if wordsync is enabled" was not
+  exactly right, disk write works normally if wordsync is enabled and
+  previous read detected wordsync. Internal "Wordsync detected" flag
+  apparently only gets reset when disk read is started. Kick Off 2
+  save, most likely many other programs too..
+
+
+Beta 5:
+
+- moved file extension stuff to half-empty priority panel, replaced
+  button with list and added (de)associate all buttons. Extension
+  command line visible and editable? Perhaps later..
+- Improved emulation of reads from write-only custom register after
+  some boring real Amiga testing.. (still not exactly right)
+  S.E.X by Fantasys works now. (does MOVE.L INTREQ,D0 when it should
+  have been MOVE.W INTREQR,D0.. This only worked accidentally)
+- Picasso96 vblank wait implemented without busy waiting. Was in pre
+  1.5.0 but busy waited, was "lost" when RTG was rewritten
+- sometimes first vertical blank interrupt was missed when loading
+  statefile if statefile was created when blitter was active
+
 Beta 4:
 
 - midline resolution support changed again (should be "good enough" now,