]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc2020b5.zip
authorToni Wilen <twilen@winuae.net>
Fri, 22 Jan 2010 18:30:10 +0000 (20:30 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:50:48 +0000 (21:50 +0200)
40 files changed:
akiko.c
blitter.c
blkdev.c
blkdev_cdimage.c
cdtv.c
cfgfile.c
cia.c
custom.c
disk.c
gencpu.c
include/blkdev.h
include/cpu_prefetch.h
include/cpummu.h
include/custom.h
include/disk.h
include/gfxfilter.h
include/inputdevice.h
include/options.h
include/savestate.h
include/zfile.h
inputdevice.c
newcpu.c
od-win32/blkdev_win32_ioctl.c
od-win32/blkdev_win32_spti.c
od-win32/direct3d.c
od-win32/direct3d.h
od-win32/resources/resource
od-win32/resources/winuae.rc
od-win32/rp.c
od-win32/rp.h
od-win32/win32.c
od-win32/win32.h
od-win32/win32_scale2x.c
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/win32gui.h
od-win32/winuaechangelog.txt
savestate.c
zfile.c
zfile_archive.c

diff --git a/akiko.c b/akiko.c
index 77d553375e18069276c697aa0e4ca653f1528c46..71a1e837d10755206003973394e531964da94ce6 100644 (file)
--- a/akiko.c
+++ b/akiko.c
@@ -1149,9 +1149,11 @@ static void do_hunt (void)
                sys_command_close (DF_IOCTL, ou);
        }
        if (sys_command_open (DF_IOCTL, i) > 0) {
+               struct device_info di = { 0 };
+               sys_command_info (DF_IOCTL, 0, &di);
                unitnum = i;
                cd_hunt = 0;
-               write_log (L"CD32: autodetected unit %d\n", unitnum);
+               write_log (L"CD32: autodetected unit %d ('%s')\n", unitnum, di.label);
        }
 }
 
index ebfac6864a07f93a416db6a612e635814c00c98b..4e44ce07dd2e41fb6dc15927de84b77a75449012 100644 (file)
--- a/blitter.c
+++ b/blitter.c
@@ -300,7 +300,7 @@ static void blitter_interrupt (int hpos, int done)
        if (!done && (!currprefs.blitter_cycle_exact || (currprefs.chipset_mask & CSMASK_AGA)))
                return;
        blit_interrupt = 1;
-       INTREQ (0x8040);
+       send_interrupt (6, 2);
        if (debug_dma)
                record_dma_event (DMA_EVENT_BLITIRQ, hpos, vpos);
 }
@@ -971,7 +971,7 @@ void decide_blitter (int hpos)
        if (blt_delayed_irq > 0 && hsync) {
                blt_delayed_irq--;
                if (!blt_delayed_irq)
-                       INTREQ (0x8040);
+                       send_interrupt (6, 2);
        }
 
        if (bltstate == BLT_done)
index 1c6fe48732268f1087e2cadcf0bd9cfc3932dfc5..a51893e51ae842eb82f9ef1f1fe1bdc471730baa 100644 (file)
--- a/blkdev.c
+++ b/blkdev.c
 
 #include "blkdev.h"
 #include "scsidev.h"
+#include "savestate.h"
 
 static struct device_functions *device_func[2];
 static int have_ioctl;
 
 #ifdef _WIN32
 
-static int initialized;
-
 #include "od-win32/win32.h"
 
 extern struct device_functions devicefunc_win32_aspi;
@@ -31,6 +30,7 @@ static void install_driver (int flags)
 {
        int installed = 0;
 
+       device_func[DF_IOCTL] = NULL;
        device_func[DF_SCSI] = &devicefunc_win32_aspi;
        if (devicefunc_cdimage.openbus (0)) {
                device_func[DF_IOCTL] = &devicefunc_cdimage;
@@ -69,7 +69,6 @@ void sys_command_close (int mode, int unitnum)
 
 void device_func_reset (void)
 {
-       initialized = 0;
        have_ioctl = 0;
 }
 
@@ -78,8 +77,6 @@ int device_func_init (int flags)
        int support_scsi = 0, support_ioctl = 0;
        int oflags = (flags & DEVICE_TYPE_SCSI) ? 0 : (1 << INQ_ROMD);
 
-       if (initialized)
-               return initialized;
        install_driver (flags);
        if (device_func[DF_IOCTL])
                have_ioctl = 1;
@@ -88,7 +85,6 @@ int device_func_init (int flags)
        support_scsi = device_func[DF_SCSI]->openbus (oflags) ? 1 : 0;
        if (have_ioctl)
                support_ioctl = device_func[DF_IOCTL]->openbus (1 << INQ_ROMD) ? 1 : 0;
-       initialized = 1;
        write_log (L"support_scsi = %d support_ioctl = %d\n", support_scsi, support_ioctl);
        return (support_scsi ? (1 << DF_SCSI) : 0) | (support_ioctl ? (1 << DF_IOCTL) : 0);
 }
@@ -250,7 +246,8 @@ int sys_command_ismedia (int mode, int unitnum, int quick)
                if (quick)
                        return -1;
                memset(&di, 0, sizeof di);
-               device_func[DF_SCSI]->info (unitnum, &di);
+               if (device_func[DF_SCSI]->info (unitnum, &di) == NULL)
+                       return -1;
                return di.media_inserted;
        } else {
                return device_func[DF_IOCTL]->ismedia (unitnum, quick);
@@ -438,3 +435,32 @@ void scsi_log_after (uae_u8 *data, int datalen, uae_u8 *sense, int senselen)
                write_log (L"\n");
        }
 }
+
+uae_u8 *save_cd (int num, int *len)
+{
+       uae_u8 *dstbak, *dst;
+
+       if (num != 0)
+               return NULL;
+       if (!currprefs.cdimagefile[0])
+               return NULL;
+
+       dstbak = dst = xmalloc (4 + 256);
+       save_u32 (4);
+       save_string (currprefs.cdimagefile);
+       *len = dst - dstbak;
+       return dstbak;
+}
+
+uae_u8 *restore_cd (int unit, uae_u8 *src)
+{
+       uae_u32 flags;
+       TCHAR *s;
+
+       flags = restore_u32 ();
+       s = restore_string ();
+       if ((flags & 4) && unit == 0)
+               _tcscpy (changed_prefs.cdimagefile, s);
+       return src;
+}
+
index 3db377fb8a43f7a5ceacf96df8c7ca45fb9faff4..d53f5ca1c1849ccc1fdd8c28c9ebd06c9697672d 100644 (file)
@@ -15,6 +15,9 @@
 #include "gui.h"
 #include "fsdb.h"
 #include "threaddep/thread.h"
+#ifdef RETROPLATFORM
+#include "rp.h"
+#endif
 
 #define USE 1
 
@@ -57,7 +60,8 @@ static int cdda_start, cdda_end;
 static int msf2lsn (int        msf)
 {
        int sector = (((msf >> 16) & 0xff) * 60 * 75 + ((msf >> 8) & 0xff) * 75 + ((msf >> 0) & 0xff));
-       return sector - 150;
+       sector -= 150;
+       return sector;
 }
 
 /* convert logical sector number -> minutes, seconds and frames */
@@ -385,18 +389,21 @@ static void *cdda_play_func (void *v)
                        if (oldplay != cdda_play) {
                                struct cdtoc *t;
                                int sector;
+
+                               cdda_pos = cdda_start;
+                               oldplay = cdda_play;
+
                                sector = cdda_start;
                                t = findtoc (&sector);
-                               if (!t)
+                               if (!t) {
                                        write_log (L"CDDA: illegal sector number %d\n", cdda_start);
-                               else
+                               } else {
                                        write_log (L"CDDA: playing track %d (file '%s', offset %d, secoffset %d)\n",
                                                t->track, t->fname, t->offset, sector);
-                               cdda_pos = cdda_start;
-                               oldplay = cdda_play;
-                               if (t->mp3 && !t->data) {
-                                       if (mp3decoder_open ()) {
-                                               t->data = mp3decoder_get (t->handle, t->filesize);
+                                       if (t->mp3 && !t->data) {
+                                               if (mp3decoder_open ()) {
+                                                       t->data = mp3decoder_get (t->handle, t->filesize);
+                                               }
                                        }
                                }
                        }
@@ -408,31 +415,32 @@ static void *cdda_play_func (void *v)
                        }
                        bufon[bufnum] = 0;
 
-                       if ((cdda_pos < cdda_end || cdda_end == 0xffffffff) && !cdda_paused && cdda_play) {
+                       if ((cdda_pos < cdda_end || cdda_end == 0xffffffff) && !cdda_paused && cdda_play > 0) {
                                struct cdtoc *t;
-                               int sector;
-
-                               sector = cdda_pos;
-                               t = findtoc (&sector);
-                               if (t && t->handle) {
-                                       if (t->mp3) {
-                                               if (t->data)
-                                                       memcpy (px[bufnum], t->data + sector * t->size + t->offset, t->size * num_sectors);
-                                               else
-                                                       memset (px[bufnum], 0, t->size * num_sectors);
-                                       } else {
-                                               zfile_fseek (t->handle, sector * t->size + t->offset, SEEK_SET);
-                                               if (zfile_fread (px[bufnum], t->size, num_sectors, t->handle) < num_sectors) {
-                                                       int i = num_sectors - 1;
-                                                       memset (px[bufnum], 0, t->size * num_sectors);
-                                                       while (i > 0) {
-                                                               if (zfile_fread (px[bufnum], t->size, i, t->handle) == i)
-                                                                       break;
-                                                               i--;
+                               int sector, cnt;
+                               int dofinish = 0;
+
+                               memset (px[bufnum], 0, num_sectors * 2352);
+                               for (cnt = 0; cnt < num_sectors; cnt++) {
+                                       sector = cdda_pos;
+
+                                       cdda_pos++;
+                                       if (cdda_pos - num_sectors < cdda_end && cdda_pos >= cdda_end)
+                                               dofinish = 1;
+                                       cd_last_pos = cdda_pos;
+
+                                       t = findtoc (&sector);
+                                       if (t) {
+                                               if (t->handle && !(t->ctrl & 4)) {
+                                                       uae_u8 *dst = px[bufnum] + cnt * t->size;
+                                                       if (t->mp3 && t->data) {
+                                                               memcpy (dst, t->data + sector * t->size + t->offset, t->size);
+                                                       } else if (!t->mp3) {
+                                                               if (sector * t->size + t->offset + t->size < t->filesize) {
+                                                                       zfile_fseek (t->handle, sector * t->size + t->offset, SEEK_SET);
+                                                                       zfile_fread (dst, t->size, 1, t->handle);
+                                                               }
                                                        }
-                                                       if (i == 0)
-                                                               write_log (L"CDDA: read error, track %d (file '%s' offset %d secoffset %d)\n",
-                                                                       t->track, t->fname, t->offset, sector);
                                                }
                                        }
                                }
@@ -453,10 +461,11 @@ static void *cdda_play_func (void *v)
                                        break;
                                }
 
-                               cdda_pos += num_sectors;
-                               if (cdda_pos >= cdda_end)
+                               if (dofinish) {
                                        cdda_play_finished = 1;
-                               cd_last_pos = cdda_pos;
+                                       cdda_play = -1;
+                                       cdda_pos = cdda_end + 1;
+                               }
 
                        }
 
@@ -539,7 +548,7 @@ static uae_u8 *command_qcode (int unitnum)
        p = buf;
 
        status = AUDIO_STATUS_NO_STATUS;
-       if (cdda_play) {
+       if (cdda_play > 0) {
                status = AUDIO_STATUS_IN_PROGRESS;
                if (cdda_paused)
                        status = AUDIO_STATUS_PAUSED;
@@ -693,11 +702,11 @@ static TCHAR *nextstring (TCHAR **sp)
        return out;
 }
 
-static int open_device (int unitnum)
+static int parse_image (void)
 {
        struct zfile *zcue;
        TCHAR *fname, *fnametype;
-       int tracknum;
+       int tracknum, index0, pregap;
        int offset, secoffset, newfile;
        int i;
        TCHAR *p;
@@ -706,12 +715,13 @@ static int open_device (int unitnum)
        TCHAR *img = currprefs.cdimagefile;
        int ctrl;
 
-       if (unitnum || !img)
+       if (!img)
                return 0;
-       zcue = zfile_fopen (img, L"rb", 0);
+       zcue = zfile_fopen (img, L"rb", ZFD_ARCHIVE);
        if (!zcue)
                return 0;
 
+       oldcurdir[0] = 0;
        fname = NULL;
        fnametype = NULL;
        tracknum = 0;
@@ -719,10 +729,10 @@ static int open_device (int unitnum)
        secoffset = 0;
        newfile = 0;
        ctrl = 0;
+       index0 = -1;
+       pregap = 0;
 
-       zfile_fseek (zcue, 0, SEEK_END);
-       siz = zfile_ftell (zcue);
-       zfile_fseek (zcue, 0, SEEK_SET);
+       siz = zfile_size (zcue);
        if (siz >= 16384) {
                if ((siz % 2048) == 0 || (siz % 2352) == 0) {
                        struct cdtoc *t = &toc[0];
@@ -732,6 +742,7 @@ static int open_device (int unitnum)
                        t->fname = my_strdup (img);
                        t->handle = zcue;
                        t->size = (siz % 2048) == 0 ? 2048 : 2352;
+                       t->filesize = siz;
                        write_log (L"CUE: plain CD image mounted!\n");
                        zcue = NULL;
                        goto isodone;
@@ -789,6 +800,8 @@ static int open_device (int unitnum)
                        TCHAR *tracktype;
                        
                        p += 5;
+                       //pregap = 0;
+                       index0 = -1;
                        tracknum = _tstoi (nextstring (&p));
                        tracktype = nextstring (&p);
                        size = 2352;
@@ -819,14 +832,14 @@ static int open_device (int unitnum)
                                }
 
                                newfile = 0;
-                               ztrack = zfile_fopen (fname, L"rb", 0);
+                               ztrack = zfile_fopen (fname, L"rb", ZFD_ARCHIVE);
                                if (!ztrack) {
                                        TCHAR tmp[MAX_DPATH];
                                        _tcscpy (tmp, fname);
                                        p = tmp + _tcslen (tmp);
                                        while (p > tmp) {
                                                if (*p == '/' || *p == '\\') {
-                                                       ztrack = zfile_fopen (p + 1, L"rb", 0);
+                                                       ztrack = zfile_fopen (p + 1, L"rb", ZFD_ARCHIVE);
                                                        if (ztrack) {
                                                                xfree (fname);
                                                                fname = my_strdup (p + 1);
@@ -836,6 +849,20 @@ static int open_device (int unitnum)
                                                p--;
                                        }
                                }
+                               if (!ztrack) {
+                                       TCHAR tmp[MAX_DPATH];
+                                       TCHAR *s2;
+                                       _tcscpy (tmp, zfile_getname (zcue));
+                                       s2 = _tcsrchr (tmp, '\\');
+                                       if (!s2)
+                                               s2 = _tcsrchr (tmp, '/');
+                                       if (s2) {
+                                               s2[0] = 0;
+                                               _tcscat (tmp, L"\\");
+                                               _tcscat (tmp, fname);
+                                               ztrack = zfile_fopen (tmp, L"rb", ZFD_ARCHIVE);
+                                       }
+                               }
                                t->track = tracknum;
                                t->ctrl = ctrl;
                                t->adr = 1;
@@ -844,10 +871,18 @@ static int open_device (int unitnum)
                                t->fname = my_strdup (fname);
                                if (tracknum > tracks)
                                        tracks = tracknum;
-                               zfile_fseek (t->handle, 0, SEEK_END);
-                               t->filesize = zfile_ftell (t->handle);
-                               zfile_fseek (t->handle, 0, SEEK_SET);
+                               if (t->handle)
+                                       t->filesize = zfile_size (t->handle);
                        }
+               } else if (!_tcsnicmp (p, L"PREGAP", 6)) {
+                       TCHAR *tt;
+                       int tn;
+                       p += 6;
+                       tt = nextstring (&p);
+                       tn = _tstoi (tt) * 60 * 75;
+                       tn += _tstoi (tt + 3) * 75;
+                       tn += _tstoi (tt + 6);
+                       pregap += tn;
                } else if (!_tcsnicmp (p, L"INDEX", 5)) {
                        int idxnum;
                        int tn = 0;
@@ -858,10 +893,13 @@ static int open_device (int unitnum)
                        tn = _tstoi (tt) * 60 * 75;
                        tn += _tstoi (tt + 3) * 75;
                        tn += _tstoi (tt + 6);
-                       if (tracknum >= 1 && tracknum <= 99) {
+                       if (idxnum == 0) {
+                               index0 = tn;
+                       } else if (idxnum == 1 && tracknum >= 1 && tracknum <= 99) {
                                struct cdtoc *t = &toc[tracknum - 1];
                                if (!t->address) {
                                        t->address = tn + secoffset;
+                                       t->address += pregap;
                                        if (tracknum > 1) {
                                                offset += t->address - t[-1].address;
                                        } else {
@@ -902,10 +940,12 @@ static int open_device (int unitnum)
 isodone:
        if (tracks && toc[tracks - 1].handle) {
                struct cdtoc *t = &toc[tracks - 1];
-               int size = t->filesize - offset * t->size;
+               int size = t->filesize ;
+               if (!secoffset)
+                       size -= offset * t->size;
                if (size < 0)
                        size = 0;
-               toc[tracks].address = toc[tracks - 1].address + size / t->size;
+               toc[tracks].address = t->address + size / t->size;
        }
        xfree (fname);
        if (oldcurdir[0])
@@ -920,7 +960,7 @@ isodone:
                write_log (L"%7d %02d:%02d:%02d",
                        t->address, (msf >> 16) & 0xff, (msf >> 8) & 0xff, (msf >> 0) & 0xff);
                if (i < tracks)
-                       write_log (L" %s %x %10d %s", (t->ctrl & 4) ? L"DATA" : L"CDA ", t->ctrl, t->offset, t->handle == NULL ? L"FILE ERROR" : L"");
+                       write_log (L" %s %x %10d %s", (t->ctrl & 4) ? L"DATA" : L"CDA ", t->ctrl, t->offset, t->handle == NULL ? L"[FILE ERROR]" : L"");
                write_log (L"\n");
                if (i < tracks)
                        write_log (L" - %s\n", t->fname);
@@ -929,7 +969,8 @@ isodone:
        mp3decoder_close ();
        return 1;
 }
-static void close_device (int unitnum)
+
+static void unload_image (void)
 {
        int i;
 
@@ -943,14 +984,65 @@ static void close_device (int unitnum)
        tracks = 0;
 }
 
+static int open_device (int unitnum)
+{
+       if (unitnum)
+               return 0;
+       return parse_image ();
+}
+
+static void close_device (int unitnum)
+{
+       unload_image ();
+}
+
+static int imagechange;
+static TCHAR newfile[MAX_DPATH];
+
+void cdimage_vsync (void)
+{
+       if (imagechange == 0)
+               return;
+       imagechange--;
+       if (imagechange > 0)
+               return;
+       _tcscpy (currprefs.cdimagefile, newfile);
+       _tcscpy (changed_prefs.cdimagefile, newfile);
+       newfile[0] = 0;
+       write_log (L"CD: delayed insert '%s'\n", currprefs.cdimagefile);
+       parse_image ();
+#ifdef RETROPLATFORM
+               rp_cd_change (0, 0);
+#endif
+}
+
 static int ismedia (int unitnum, int quick)
 {
+
+       if (_tcscmp (changed_prefs.cdimagefile, currprefs.cdimagefile)) {
+               _tcscpy (newfile, changed_prefs.cdimagefile);
+               changed_prefs.cdimagefile[0] = currprefs.cdimagefile[0] = 0;
+               imagechange = 5 * 50;
+               write_log (L"CD: eject\n");
+               unload_image ();
+#ifdef RETROPLATFORM
+               rp_cd_change (unitnum, 1);
+#endif
+       }
        return currprefs.cdimagefile[0] ? 1 : 0;
 }
 
 static int open_bus (int flags)
 {
-       return ismedia (0, 1);
+       int v;
+       if (imagechange)
+               return 1;
+       v = ismedia (0, 1);
+#ifdef RETROPLATFORM
+       if (v)
+               rp_cd_change (0, 0);
+#endif
+       return v;
 }
 
 static void close_bus (void)
@@ -972,7 +1064,7 @@ static struct device_info *info_device (int unitnum, struct device_info *di)
        di->write_protected = 1;
        di->type = INQ_ROMD;
        di->id = 1;
-       _tcscpy (di->label, L"IMG");
+       _tcscpy (di->label, L"IMG_EMU");
        return di;
 }
 
diff --git a/cdtv.c b/cdtv.c
index 887620cca5fb5af9c3f1bc342219450839303ad3..59a65a825873c67187285c46073a4c6c49d7208e 100644 (file)
--- a/cdtv.c
+++ b/cdtv.c
@@ -878,9 +878,11 @@ static void do_hunt (void)
                sys_command_close (DF_IOCTL, unitnum);
        }
        if (sys_command_open (DF_IOCTL, i) > 0) {
+               struct device_info di = { 0 };
+               sys_command_info (DF_IOCTL, 0, &di);
                unitnum = i;
                cd_hunt = 0;
-               write_log (L"CDTV: autodetected unit %d\n", unitnum);
+               write_log (L"CDTV: autodetected unit %d ('%s')\n", unitnum, di.label);
        } else {
                unitnum = -1;
        }
index 42fa6bb5e68f7ec425478474b56b3952401f9abc..8edaed6385c72a32550362037d4bb57bcdce0b9f 100644 (file)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -144,7 +144,6 @@ static const TCHAR *lorestype1[] = { L"lores", L"hires", L"superhires" };
 static const TCHAR *lorestype2[] = { L"true", L"false" };
 static const TCHAR *loresmode[] = { L"normal", L"filtered", 0 };
 #ifdef GFXFILTER
-static const TCHAR *filtermode1[] = { L"no_16", L"bilinear_16", L"no_32", L"bilinear_32", 0 };
 static const TCHAR *filtermode2[] = { L"0x", L"1x", L"2x", L"3x", L"4x", 0 };
 #endif
 static const TCHAR *cartsmode[] = { L"none", L"hrtmon", 0 };
@@ -169,6 +168,7 @@ static const TCHAR *joyportmodes[] = { NULL, L"mouse", L"djoy", L"ajoy", L"cdtvj
 static const TCHAR *epsonprinter[] = { L"none", L"ascii", L"epson_matrix_9pin", L"epson_matrix_24pin", L"epson_matrix_48pin", 0 };
 static const TCHAR *aspects[] = { L"none", L"vga", L"tv", 0 };
 static const TCHAR *vsyncmodes[] = { L"false", L"true", L"autoswitch", 0 };
+static const TCHAR *filterapi[] = { L"directdraw", L"direct3d", 0 };
 static const TCHAR *dongles[] =
 {
        L"none",
@@ -655,6 +655,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_write_str (f, L"gfx_center_vertical", centermode1[p->gfx_ycenter]);
        cfgfile_write_str (f, L"gfx_colour_mode", colormode1[p->color_mode]);
        cfgfile_write_bool (f, L"gfx_blacker_than_black", p->gfx_blackerthanblack);
+       cfgfile_write_str (f, L"gfx_api", filterapi[p->gfx_api]);
 
 #ifdef GFXFILTER
        if (p->gfx_filter > 0) {
@@ -669,7 +670,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
                                        cfgfile_dwrite_str (f, L"gfx_filter", uf->cfgname);
                                if (uf->type == p->gfx_filter) {
                                        if (uf->x[0]) {
-                                               cfgfile_dwrite_str (f, L"gfx_filter_mode", filtermode1[p->gfx_filter_filtermode]);
+                                               cfgfile_dwrite_str (f, L"gfx_filter_mode", filtermode2[1]);
                                        } else {
                                                int mt[4], i = 0;
                                                if (uf->x[1])
@@ -705,6 +706,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite (f, L"gfx_filter_gamma", L"%d", p->gfx_filter_gamma);
        cfgfile_dwrite (f, L"gfx_filter_blur", L"%d", p->gfx_filter_blur);
        cfgfile_dwrite (f, L"gfx_filter_noise", L"%d", p->gfx_filter_noise);
+       cfgfile_dwrite_bool (f, L"gfx_filter_bilinear", p->gfx_filter_bilinear);
        cfgfile_dwrite_str (f, L"gfx_filter_keep_aspect", aspects[p->gfx_filter_keep_aspect]);
        cfgfile_dwrite_str (f, L"gfx_filter_autoscale", autoscale[p->gfx_filter_autoscale]);
        cfgfile_dwrite (f, L"gfx_filter_aspect_ratio", L"%d:%d",
@@ -761,6 +763,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite_bool (f, L"resetwarning", p->cs_resetwarning);
        cfgfile_dwrite_bool (f, L"denise_noehb", p->cs_denisenoehb);
        cfgfile_dwrite_bool (f, L"agnus_bltbusybug", p->cs_agnusbltbusybug);
+       cfgfile_dwrite_bool (f, L"ics_agnus", p->cs_dipagnus);
 
        cfgfile_write (f, L"fastmem_size", L"%d", p->fastmem_size / 0x100000);
        cfgfile_write (f, L"a3000mem_size", L"%d", p->mbresmem_low_size / 0x100000);
@@ -1047,6 +1050,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, L"gfx_filter_gamma", &p->gfx_filter_gamma, 1)
                || cfgfile_intval (option, value, L"gfx_filter_blur", &p->gfx_filter_blur, 1)
                || cfgfile_intval (option, value, L"gfx_filter_noise", &p->gfx_filter_noise, 1)
+               || cfgfile_intval (option, value, L"gfx_filter_bilinear", &p->gfx_filter_bilinear, 1)
                || cfgfile_intval (option, value, L"gfx_luminance", &p->gfx_luminance, 1)
                || cfgfile_intval (option, value, L"gfx_contrast", &p->gfx_contrast, 1)
                || cfgfile_intval (option, value, L"gfx_gamma", &p->gfx_gamma, 1)
@@ -1114,6 +1118,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_strval (option, value, L"gfx_max_horizontal", &p->gfx_max_horizontal, maxhoriz, 0)
                || cfgfile_strval (option, value, L"gfx_max_vertical", &p->gfx_max_vertical, maxvert, 0)
                || cfgfile_strval (option, value, L"gfx_filter_autoscale", &p->gfx_filter_autoscale, autoscale, 0)
+               || cfgfile_strval (option, value, L"gfx_api", &p->gfx_api, filterapi, 0)
                || cfgfile_strval (option, value, L"magic_mousecursor", &p->input_magic_mouse_cursor, magiccursors, 0)
                || cfgfile_strval (option, value, L"gfx_filter_keep_aspect", &p->gfx_filter_keep_aspect, aspects, 0)
                || cfgfile_strval (option, value, L"absolute_mouse", &p->input_tablet, abspointers, 0))
@@ -1145,14 +1150,18 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                        *s++ = 0;
                p->gfx_filtershader[0] = 0;
                p->gfx_filter = 0;
-               while(uaefilters[i].name) {
-                       if (!_tcscmp (uaefilters[i].cfgname, value)) {
-                               p->gfx_filter = uaefilters[i].type;
-                               if (s)
-                                       _tcscpy (p->gfx_filtershader, s);
-                               break;
+               if (!_tcscmp (value, L"direct3d")) {
+                       p->gfx_api = 1; // forwards compatibiity
+               } else {
+                       while(uaefilters[i].name) {
+                               if (!_tcscmp (uaefilters[i].cfgname, value)) {
+                                       p->gfx_filter = uaefilters[i].type;
+                                       if (s)
+                                               _tcscpy (p->gfx_filtershader, s);
+                                       break;
+                               }
+                               i++;
                        }
-                       i++;
                }
                return 1;
        }
@@ -1164,9 +1173,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                        while(uaefilters[i].name) {
                                uf = &uaefilters[i];
                                if (uf->type == p->gfx_filter) {
-                                       if (uf->x[0]) {
-                                               cfgfile_strval (option, value, L"gfx_filter_mode", &p->gfx_filter_filtermode, filtermode1, 0);
-                                       } else {
+                                       if (!uf->x[0]) {
                                                int mt[4], j;
                                                i = 0;
                                                if (uf->x[1])
@@ -1593,6 +1600,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, TCHAR *option, TCHAR *va
                || cfgfile_yesno (option, value, L"ksmirror_a8", &p->cs_ksmirror_a8)
                || cfgfile_yesno (option, value, L"resetwarning", &p->cs_resetwarning)
                || cfgfile_yesno (option, value, L"denise_noehb", &p->cs_denisenoehb)
+               || cfgfile_yesno (option, value, L"ics_agnus", &p->cs_dipagnus)
                || cfgfile_yesno (option, value, L"agnus_bltbusybug", &p->cs_agnusbltbusybug)
 
                || cfgfile_yesno (option, value, L"kickshifter", &p->kickshifter)
@@ -3294,6 +3302,7 @@ void default_prefs (struct uae_prefs *p, int type)
        p->gfx_filtershader[0] = 0;
        p->gfx_filter_horiz_zoom_mult = 0;
        p->gfx_filter_vert_zoom_mult = 0;
+       p->gfx_filter_bilinear = 0;
        p->gfx_filter_filtermode = 0;
        p->gfx_filter_scanlineratio = (1 << 4) | 1;
        p->gfx_filter_keep_aspect = 0;
@@ -3635,6 +3644,8 @@ static int bip_a1000 (struct uae_prefs *p, int config, int compa, int romcheck)
        p->dfxtype[1] = DRV_NONE;
        p->cs_compatible = CP_A1000;
        p->cs_slowmemisfast = 1;
+       p->cs_dipagnus = 1;
+       p->cs_agnusbltbusybug = 1;
        built_in_chipset_prefs (p);
        if (config > 0)
                p->cs_denisenoehb = 1;
@@ -4026,6 +4037,7 @@ int built_in_chipset_prefs (struct uae_prefs *p)
                p->cs_ksmirror_e0 = 0;
                p->cs_rtc = 0;
                p->cs_agnusbltbusybug = 1;
+               p->cs_dipagnus = 1;
                break;
        case CP_A1200: // A1200
                p->cs_ide = IDE_A600A1200;
diff --git a/cia.c b/cia.c
index f7476ac84ba144c12e81e199025983f901ef4e47..e0c6d8b682a8617bc4ecd743f6870407f907f0b3 100644 (file)
--- a/cia.c
+++ b/cia.c
@@ -88,7 +88,7 @@ static void RethinkICRA (void)
 {
        if (ciaaimask & ciaaicr) {
                ciaaicr |= 0x80;
-               INTREQ_0 (0x8000 | 0x0008);
+               send_interrupt (3, 2);
        }
 }
 
@@ -96,7 +96,7 @@ static void RethinkICRB (void)
 {
        if (ciabimask & ciabicr) {
                ciabicr |= 0x80;
-               INTREQ_0 (0x8000 | 0x2000);
+               send_interrupt (13, 2);
        }
 }
 
index c2f534981db6b5431f765e42f7ba700a3e3e6ae0..3af8f31f46c4c287c2442b74a0f1cd2f6a2f28ea 100644 (file)
--- a/custom.c
+++ b/custom.c
@@ -51,6 +51,7 @@
 #include "a2091.h"
 #include "a2065.h"
 #include "ncr_scsi.h"
+#include "blkdev.h"
 
 #define CUSTOM_DEBUG 0
 #define SPRITE_DEBUG 0
@@ -2578,7 +2579,7 @@ static void finish_decisions (void)
        diw_hcounter += maxhpos * 2;
        if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE) && vpos == equ_vblank_endline - 1)
                diw_hcounter++;
-       if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) || vpos > equ_vblank_endline) {
+       if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) || vpos > equ_vblank_endline || (currprefs.cs_dipagnus && vpos == 0)) {
                diw_hcounter = maxhpos * 2;
                last_hdiw = 2 - 1;
        }
@@ -3386,13 +3387,19 @@ STATIC_INLINE int use_eventmode (void)
        return currprefs.cpu_cycle_exact != 0;
 }
 
-static void send_interrupt (void)
+static void send_interrupt_do (uae_u32 v)
 {
-       int lev = intlev ();
-       if (lev < 0)
-               lev = 0;
-       if (lev != regs.ipl)
-               event2_newevent_xx (-1, 5 * CYCLE_UNIT, lev, prepare_interrupt);
+       INTREQ_0 (0x8000 | (1 << v));
+}
+
+void send_interrupt (int num, int delay)
+{
+       if (use_eventmode () && delay > 0) {
+               if (!(intreqr & (1 << num)))
+                       event2_newevent_xx (-1, delay * CYCLE_UNIT, num, send_interrupt_do);
+       } else {
+               send_interrupt_do (num);
+       }
 }
 
 STATIC_INLINE void INTENA (uae_u16 v)
@@ -3402,11 +3409,15 @@ STATIC_INLINE void INTENA (uae_u16 v)
        if (v & 0x40)
                write_log (L"INTENA %04X (%04X) %p\n", intena, v, M68K_GETPC);
 #endif
+#if 0
        if (use_eventmode ()) {
                send_interrupt ();
        } else if (v & 0x8000) {
                doint ();
        }
+#endif
+       if (v & 0x8000)
+               doint ();
 }
 
 void INTREQ_0 (uae_u16 v)
@@ -3420,6 +3431,7 @@ void INTREQ_0 (uae_u16 v)
        if (v & (0x80 | 0x100 | 0x200 | 0x400))
                audio_update_irq (v);
        intreqr = intreq;
+#if 0
        if (use_eventmode ()) {
                if (tmp != intreq)
                        send_interrupt ();
@@ -3430,6 +3442,8 @@ void INTREQ_0 (uae_u16 v)
        } else {
                doint ();
        }
+#endif
+       doint ();
 }
 
 void INTREQ (uae_u16 data)
@@ -5090,7 +5104,6 @@ static void vsync_handler (void)
        if ((intreq & 0x0020) && (intena & 0x0020))
                write_log (L"vblank interrupt not cleared\n");
 #endif
-       INTREQ (0x8000 | 0x0020);
        if (bplcon0 & 4)
                lof ^= 1;
 
@@ -5098,6 +5111,7 @@ static void vsync_handler (void)
        picasso_handle_vsync ();
 #endif
        audio_vsync ();
+       cdimage_vsync ();
 
        if (quit_program > 0) {
                /* prevent possible infinite loop at wait_cycles().. */
@@ -5414,6 +5428,14 @@ static void hsync_handler (void)
                if (currprefs.cs_ciaatod == 0)
                        CIA_vsync_prehandler (!(bplcon0 & 2) || ((bplcon0 & 2) && currprefs.genlock));
        }
+       // DIP Agnus (8361): vblank interrupt is triggered on line 1!
+       if (currprefs.cs_dipagnus) {
+               if (vpos == 1)
+                       send_interrupt (5, 0);
+       } else {
+               if (vpos == 0)
+                       send_interrupt (5, 0);
+       }
 
 #ifdef CPUEMU_12
        if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) {
@@ -6825,7 +6847,6 @@ void check_prefs_changed_custom (void)
        currprefs.gfx_filter_horiz_offset = changed_prefs.gfx_filter_horiz_offset;
        currprefs.gfx_filter_vert_offset = changed_prefs.gfx_filter_vert_offset;
        currprefs.gfx_filter_scanlines = changed_prefs.gfx_filter_scanlines;
-       currprefs.gfx_filter_filtermode = changed_prefs.gfx_filter_filtermode;
 #endif
 }
 
diff --git a/disk.c b/disk.c
index f3e1318a331d90db61153c4a7ba7f01237e7154b..76a7d7cc8033beed23044098318efd5487ad0d5b 100644 (file)
--- a/disk.c
+++ b/disk.c
@@ -196,7 +196,7 @@ int disk_debug_track = -1;
 
 static uae_u16 bigmfmbufw[0x4000 * DDHDMULT];
 static drive floppy[MAX_FLOPPY_DRIVES];
-static TCHAR dfxhistory[MAX_PREVIOUS_FLOPPIES][MAX_DPATH];
+static TCHAR dfxhistory[2][MAX_PREVIOUS_FLOPPIES][MAX_DPATH];
 
 static uae_u8 exeheader[]={0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00};
 static uae_u8 bootblock[]={
@@ -2116,7 +2116,7 @@ void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk
        xfree (chunk);
        zfile_fclose (f);
        if (f)
-               DISK_history_add (name, -1, TRUE);
+               DISK_history_add (name, -1, HISTORY_FLOPPY, TRUE);
 
 }
 
@@ -2208,14 +2208,14 @@ void disk_eject (int num)
        update_drive_gui (num);
 }
 
-int DISK_history_add (const TCHAR *name, int idx, int donotcheck)
+int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck)
 {
        int i;
 
        if (idx >= MAX_PREVIOUS_FLOPPIES)
                return 0;
        if (name == NULL) {
-               dfxhistory[idx][0] = 0;
+               dfxhistory[type][idx][0] = 0;
                return 1;
        }
        if (name[0] == 0)
@@ -2227,35 +2227,35 @@ int DISK_history_add (const TCHAR *name, int idx, int donotcheck)
        if (idx >= 0) {
                if (idx >= MAX_PREVIOUS_FLOPPIES)
                        return 0;
-               dfxhistory[idx][0] = 0;
+               dfxhistory[type][idx][0] = 0;
                for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++) {
-                       if (!_tcscmp (dfxhistory[i], name))
+                       if (!_tcscmp (dfxhistory[type][i], name))
                                return 0;
                }
-               _tcscpy (dfxhistory[idx], name);
+               _tcscpy (dfxhistory[type][idx], name);
                return 1;
        }
        for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++) {
-               if (!_tcscmp (dfxhistory[i], name)) {
+               if (!_tcscmp (dfxhistory[type][i], name)) {
                        while (i < MAX_PREVIOUS_FLOPPIES - 1) {
-                               _tcscpy (dfxhistory[i], dfxhistory[i + 1]);
+                               _tcscpy (dfxhistory[type][i], dfxhistory[type][i + 1]);
                                i++;
                        }
-                       dfxhistory[MAX_PREVIOUS_FLOPPIES - 1][0] = 0;
+                       dfxhistory[type][MAX_PREVIOUS_FLOPPIES - 1][0] = 0;
                        break;
                }
        }
        for (i = MAX_PREVIOUS_FLOPPIES - 2; i >= 0; i--)
-               _tcscpy (dfxhistory[i + 1], dfxhistory[i]);
-       _tcscpy (dfxhistory[0], name);
+               _tcscpy (dfxhistory[type][i + 1], dfxhistory[type][i]);
+       _tcscpy (dfxhistory[type][0], name);
        return 1;
 }
 
-TCHAR *DISK_history_get (int idx)
+TCHAR *DISK_history_get (int idx, int type)
 {
        if (idx >= MAX_PREVIOUS_FLOPPIES)
-               return 0;
-       return dfxhistory[idx];
+               return NULL;
+       return dfxhistory[type][idx];
 }
 
 static void disk_insert_2 (int num, const TCHAR *name, int forced)
@@ -2270,7 +2270,7 @@ static void disk_insert_2 (int num, const TCHAR *name, int forced)
                return;
        _tcscpy (drv->newname, name);
        _tcscpy (currprefs.df[num], name);
-       DISK_history_add (name, -1, 0);
+       DISK_history_add (name, -1, HISTORY_FLOPPY, 0);
        if (name[0] == 0) {
                disk_eject (num);
        } else if (!drive_empty(drv) || drv->dskchange_time > 0) {
@@ -3515,7 +3515,7 @@ uae_u8 *save_disk (int num, int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = malloc (2+1+1+1+1+4+4+256);
+               dstbak = dst = xmalloc (2+1+1+1+1+4+4+256);
        save_u32 (drv->drive_id);           /* drive type ID */
        save_u8 ((drv->motoroff ? 0:1) | ((disabled & (1 << num)) ? 2 : 0) | (drv->idbit ? 4 : 0) | (drv->dskchange ? 8 : 0));
        save_u8 (drv->cyl);                 /* cylinder */
@@ -3555,7 +3555,7 @@ uae_u8 *save_floppy(int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = (uae_u8*)malloc(2+1+1+1+1+2);
+               dstbak = dst = xmalloc (2 + 1 + 1 + 1 + 1 + 2);
        save_u16 (word);                /* current fifo (low word) */
        save_u8 (bitoffset);    /* dma bit offset */
        save_u8 (dma_enable);   /* disk sync found */
index 76e77f9ad450131ec25f4ce568a5fcec4eec66bd..8376962ce57e079b22bb575d6534099bae3ac485 100644 (file)
--- a/gencpu.c
+++ b/gencpu.c
@@ -2096,22 +2096,26 @@ static void gen_opcode (unsigned long int opcode)
                fill_prefetch_full ();
                break;
        case i_RTE:
-               if (cpu_level == 0) {
-                       genamode (Aipi, "7", sz_word, "sr", 1, 0, GF_NOREFILL);
-                       genamode (Aipi, "7", sz_long, "pc", 1, 0, GF_NOREFILL);
-                       printf ("\tregs.sr = sr;\n");
-                       setpc ("pc");
-                       printf ("\tMakeFromSR ();\n");
+               if (using_mmu) {
+                       printf ("\tm68k_do_rte_mmu ();\n");
                } else {
-                       int old_brace_level = n_braces;
-                       if (next_cpu_level < 0)
-                               next_cpu_level = 0;
-                       genamode (Aipi, "7", sz_word, "sr", 1, 0, 0);
-                       genamode (Aipi, "7", sz_long, "pc", 1, 0, 0);
-                       genamode (Aipi, "7", sz_word, "format", 1, 0, 0);
-                       printf ("\tm68k_do_rte (pc, sr, format, 0x%04x);\n", opcode);
+                       if (cpu_level == 0) {
+                               genamode (Aipi, "7", sz_word, "sr", 1, 0, GF_NOREFILL);
+                               genamode (Aipi, "7", sz_long, "pc", 1, 0, GF_NOREFILL);
+                               printf ("\tregs.sr = sr;\n");
+                               setpc ("pc");
+                               printf ("\tMakeFromSR ();\n");
+                       } else {
+                               int old_brace_level = n_braces;
+                               if (next_cpu_level < 0)
+                                       next_cpu_level = 0;
+                               genamode (Aipi, "7", sz_word, "sr", 1, 0, 0);
+                               genamode (Aipi, "7", sz_long, "pc", 1, 0, 0);
+                               genamode (Aipi, "7", sz_word, "format", 1, 0, 0);
+                               printf ("\tm68k_do_rte (pc, sr, format, 0x%04x);\n", opcode);
+                       }
+                       /* PC is set and prefetch filled. */
                }
-               /* PC is set and prefetch filled. */
                m68k_pc_offset = 0;
                fill_prefetch_full ();
                break;
@@ -2155,11 +2159,18 @@ static void gen_opcode (unsigned long int opcode)
                break;
        case i_UNLK:
                // ce confirmed
-               genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
-               printf ("\tm68k_areg (regs, 7) = src;\n");
-               genamode (Aipi, "7", sz_long, "old", 1, 0, 0);
-               fill_prefetch_next ();
-               genastore ("old", curi->smode, "srcreg", curi->size, "src");
+               if (using_mmu) {
+                       genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
+                       printf ("\tuae_s32 old = get_long_mmu (src);\n");
+                       printf ("\tm68k_areg (regs, 7) = src + 4;\n");
+                       printf ("\tm68k_areg (regs, srcreg) = old;\n");
+               } else {
+                       genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
+                       printf ("\tm68k_areg (regs, 7) = src;\n");
+                       genamode (Aipi, "7", sz_long, "old", 1, 0, 0);
+                       fill_prefetch_next ();
+                       genastore ("old", curi->smode, "srcreg", curi->size, "src");
+               }
                break;
        case i_RTS:
                if (using_ce)
index e91f5880d6a10002c808920ac561a5965c3c98e1..d6d61b38d301c8ae6c361d9bf5ec3a4b78824ff9 100644 (file)
@@ -41,6 +41,7 @@ struct device_info {
     int bus, target, lun;
     int id;
     TCHAR label[MAX_DPATH];
+       TCHAR ident[16];
 };
 
 struct device_scsi_info {
@@ -140,3 +141,5 @@ void scsi_atapi_fixup_post (uae_u8 *scsi_cmd, int len, uae_u8 *olddata, uae_u8 *
 
 void scsi_log_before (uae_u8 *cdb, int cdblen, uae_u8 *data, int datalen);
 void scsi_log_after (uae_u8 *data, int datalen, uae_u8 *sense, int senselen);
+
+extern void cdimage_vsync (void);
\ No newline at end of file
index d378bc41d9743b747f63cc92f901325c8f7d7e5a..ca77e7bf91c99825910e29ec9c3e91864e3046bb 100644 (file)
@@ -14,7 +14,7 @@ STATIC_INLINE uae_u32 get_long_prefetch (int o)
 
 STATIC_INLINE void prefetch_common_ce000 (void)
 {
-       regs.lastfetch = get_cycles () + CYCLE_UNIT;
+       regs.lastfetch = get_cycles ();
 }
 
 #ifdef CPUEMU_20
index 27727e5b1e0844e8d4b2656da3069d886a2b8cc5..8408bddc49aa7316b9e0b1f2a112f38262723dd4 100644 (file)
@@ -573,6 +573,7 @@ STATIC_INLINE uae_u32 next_ilong_mmu (void)
 }
 
 extern void m68k_do_rts_mmu (void);
+extern void m68k_do_rte_mmu (void);
 extern void m68k_do_bsr_mmu (uaecptr oldpc, uae_s32 offset);
 
 struct mmufixup
index ceded2fd14aa845d29b5993b67079aabdccaa965..e0cc8731d576d23275126942ad9d08965f03b896 100644 (file)
@@ -76,6 +76,7 @@ extern int joy0button, joy1button;
 extern void INTREQ (uae_u16);
 extern void INTREQ_0 (uae_u16);
 extern void INTREQ_f (uae_u32);
+extern void send_interrupt (int num, int delay);
 extern uae_u16 INTREQR (void);
 
 /* maximums for statically allocated tables */
index e095b8d2926acd2bdc97033564fc94e05272f191..cb5b3d9779d2b52dfd575b5fd1ed6d0d59053cca 100644 (file)
@@ -8,6 +8,9 @@
 
 typedef enum { DRV_NONE = -1, DRV_35_DD = 0, DRV_35_HD, DRV_525_SD, DRV_35_DD_ESCOM } drive_type;
 
+#define HISTORY_FLOPPY 0
+#define HISTORY_CD 1
+
 extern void DISK_init (void);
 extern void DISK_free (void);
 extern void DISK_select (uae_u8 data);
@@ -26,8 +29,8 @@ extern int disk_getwriteprotect (const TCHAR *name);
 extern int disk_setwriteprotect (int num, const TCHAR *name, int protect);
 extern void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk_name);
 extern void dumpdisk (void);
-extern int DISK_history_add (const TCHAR *name, int idx, int donotcheck);
-extern TCHAR *DISK_history_get (int idx);
+extern int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck);
+extern TCHAR *DISK_history_get (int idx, int type);
 int DISK_examine_image (struct uae_prefs *p, int num, uae_u32 *crc32);
 extern TCHAR *DISK_get_saveimagepath (const TCHAR *name);
 extern void DISK_reinsert (int num);
index da348e845de651afc166f28935215b561f793d8d..605186d8c55bde0b8ed7dd8cd0e876f0afb6c4e4 100644 (file)
@@ -9,6 +9,7 @@ extern void S2X_refresh (void);
 extern void S2X_render (void);
 extern void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd);
 extern void S2X_free (void);
+extern int S2X_getmult (void);
 
 extern void PAL_init (void);
 extern void PAL_1x1_32 (uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, int height);
@@ -43,14 +44,13 @@ extern void _cdecl hq4x_16 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD)
 extern void _cdecl hq4x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
 
 #define UAE_FILTER_NULL 1
-#define UAE_FILTER_DIRECT3D 2
-//#define UAE_FILTER_OPENGL 3
-#define UAE_FILTER_SCALE2X 3
+#define UAE_FILTER_SCALE2X 2
+#define UAE_FILTER_HQ 3
 #define UAE_FILTER_SUPEREAGLE 4
 #define UAE_FILTER_SUPER2XSAI 5
 #define UAE_FILTER_2XSAI 6
 #define UAE_FILTER_PAL 7
-#define UAE_FILTER_HQ 8
+#define UAE_FILTER_LAST 7
 
 #define UAE_FILTER_MODE_16 16
 #define UAE_FILTER_MODE_16_16 16
index 36db61f0e75fcf5b946550d3f53f8ee0fb01bea1..0931b198acec8c2e3a03a59f499dc2587d312f7f 100644 (file)
@@ -196,6 +196,7 @@ extern int inputdevice_uaelib (TCHAR *, TCHAR *);
 #define INPREC_VSYNC 6
 #define INPREC_CIAVSYNC 7
 #define INPREC_END 0xff
+#define INPREC_QUIT 0xfe
 
 extern int input_recording;
 extern void inprec_close (void);
index 31dc91d423e25f2e327a19a3ffa8aa1f616b600e..572a1c6d969adfbce223a62dc4d5e503e3984cd4 100644 (file)
@@ -181,6 +181,7 @@ struct uae_prefs {
     int gfx_saturation, gfx_luminance, gfx_contrast, gfx_gamma;
     int gfx_blackerthanblack;
     int gfx_backbuffers;
+       int gfx_api;
     int color_mode;
 
     int gfx_filter;
@@ -192,6 +193,7 @@ struct uae_prefs {
     int gfx_filter_horiz_zoom_mult, gfx_filter_vert_zoom_mult;
     int gfx_filter_horiz_offset, gfx_filter_vert_offset;
     int gfx_filter_filtermode;
+       int gfx_filter_bilinear;
     int gfx_filter_noise, gfx_filter_blur;
     int gfx_filter_saturation, gfx_filter_luminance, gfx_filter_contrast, gfx_filter_gamma;
     int gfx_filter_keep_aspect, gfx_filter_aspect;
@@ -250,6 +252,7 @@ struct uae_prefs {
     int cs_slowmemisfast;
     int cs_resetwarning;
     int cs_denisenoehb;
+       int cs_dipagnus;
     int cs_agnusbltbusybug;
 
     TCHAR df[4][MAX_DPATH];
index fe294f855525f5bf9db4a9c871d09693961877f1..82eb8774bb5e4c3d166b689dfe988d3c827843a2 100644 (file)
@@ -100,6 +100,9 @@ extern uae_u8 *save_gayle (int *len);
 extern uae_u8 *restore_ide (uae_u8 *src);
 extern uae_u8 *save_ide (int num, int *len);
 
+extern uae_u8 *save_cd (int num, int *len);
+extern uae_u8 *restore_cd (int, uae_u8 *src);
+
 extern uae_u8 *save_configuration (int *len);
 extern uae_u8 *restore_configuration (uae_u8 *src);
 extern uae_u8 *save_log (int, int *len);
index 57cda6eaf3b1bc0907d2207e9fc86252d99d2d8d..3117fac1c4b599d1fa633378833cac7e441b6278 100644 (file)
@@ -21,6 +21,7 @@ extern int zfile_exists (const TCHAR *name);
 extern void zfile_fclose (struct zfile *);
 extern uae_s64 zfile_fseek (struct zfile *z, uae_s64 offset, int mode);
 extern uae_s64 zfile_ftell (struct zfile *z);
+extern uae_s64 zfile_size (struct zfile *z);
 extern size_t zfile_fread  (void *b, size_t l1, size_t l2, struct zfile *z);
 extern size_t zfile_fwrite  (void *b, size_t l1, size_t l2, struct zfile *z);
 extern TCHAR *zfile_fgets (TCHAR *s, int size, struct zfile *z);
@@ -72,6 +73,7 @@ extern TCHAR *zfile_geterror (void);
 #define ZFILE_STATEFILE 6
 #define ZFILE_NVR 7
 #define ZFILE_HDFRDB 8
+#define ZFILE_CDIMAGE 9
 
 extern const TCHAR *uae_archive_extensions[];
 extern const TCHAR *uae_ignoreextensions[];
index 9a2e188a753f0819684d5070409260c4e1cd0044..faa2e0ee89c68780e2153345508fe1c0d26968c8 100644 (file)
@@ -271,6 +271,10 @@ int inprec_pstart (uae_u8 type)
        if (p[5 + 1] == INPREC_END) {
                inprec_close ();
                return 0;
+       } else if (p[5 + 1] == INPREC_QUIT) {
+               inprec_close ();
+               uae_quit ();
+               return 0;
        }
        hc_orig = hc;
        hc /= inprec_div;
index f4ff92c2c1e303d52078d29d52cbf1f988df1b28..bffbb6cb187f88456c2ff78f18d0ed08a33a8971 100644 (file)
--- a/newcpu.c
+++ b/newcpu.c
@@ -1456,6 +1456,9 @@ static void Exception_mmu (int nr, uaecptr oldpc)
        }
        if (nr == 2) {
 
+               write_log (L"%08x %08x %08x\n", currpc, oldpc, regs.mmu_fault_addr);
+               if (currpc == 0x0013b5e2)
+                       activate_debugger ();
                // bus error
                for (i = 0 ; i < 7 ; i++) {
                        m68k_areg (regs, 7) -= 4;
@@ -2575,7 +2578,7 @@ static evt interrupt_cycle;
 STATIC_INLINE int time_for_interrupt (void)
 {
        if (interrupt_cycles_active) {
-               if (interrupt_cycle != regs.lastfetch) {
+               if (regs.lastfetch - interrupt_cycle >= 2 * CYCLE_UNIT) {
                        interrupt_cycles_active = 0;
                        return 1;
                } else {
@@ -2585,27 +2588,15 @@ STATIC_INLINE int time_for_interrupt (void)
        return 1;
 }
 
-void prepare_interrupt (uae_u32 lev)
-{
-       // CPU IPLx lines change state now
-       // but we may need to wait for next S4 state
-       // before CPU sees it
-       regs.ipl = lev;
-       if (currprefs.cpu_model == 68000) {
-               interrupt_cycle = get_cycles ();
-               if ((regs.lastfetch - interrupt_cycle) >= 0) {
-                       // interrupt arrived too late
-                       // wait for next memory cycle
-                       interrupt_cycles_active = 1;
-               }
-       }
-       set_special (SPCFLAG_INT);
-}
-
 void doint (void)
 {
-       if (currprefs.cpu_cycle_exact)
+       regs.ipl = intlev ();
+       if (currprefs.cpu_cycle_exact) {
+               set_special (SPCFLAG_INT);
+               interrupt_cycle = get_cycles ();
+               interrupt_cycles_active = 1;
                return;
+       }
        if (currprefs.cpu_compatible)
                set_special (SPCFLAG_INT);
        else
@@ -2686,10 +2677,9 @@ STATIC_INLINE int do_specialties (int cycles)
                        do_copper ();
 
                if (currprefs.cpu_cycle_exact) {
-                       if (time_for_interrupt ()) {
-                               int intr = regs.ipl;
-                               if (intr > 0 && intr > regs.intmask)
-                                       do_interrupt (intr);
+                       if (regs.ipl > 0 && regs.ipl > regs.intmask) {
+                               if (time_for_interrupt ())
+                                       do_interrupt (regs.ipl);
                        }
                } else {
                        if (regs.spcflags & (SPCFLAG_INT | SPCFLAG_DOINT)) {
@@ -2733,10 +2723,9 @@ STATIC_INLINE int do_specialties (int cycles)
                do_trace ();
 
        if (currprefs.cpu_cycle_exact) {
-               if (time_for_interrupt ()) {
-                       int intr = regs.ipl;
-                       if (intr > 0 && intr > regs.intmask)
-                               do_interrupt (intr);
+               if (regs.ipl > 0 && (regs.ipl > regs.intmask || regs.ipl == 7)) {
+                       if (time_for_interrupt ())
+                               do_interrupt (regs.ipl);
                }
        } else {
                if (regs.spcflags & SPCFLAG_INT) {
@@ -4329,6 +4318,16 @@ void flush_mmu (uaecptr addr, int n)
 {
 }
 
+void m68k_do_rte_mmu (void)
+{
+       uaecptr src = m68k_areg (regs, 7);
+       uae_s16 sr = get_word_mmu (src);
+       uae_s32 pc = get_long_mmu (src + 2);
+       uae_s16 format = get_word_mmu (src + 6);
+       m68k_areg (regs, 7) += 8;
+       m68k_do_rte (pc, sr, format, 0x4e73);
+}
+
 void m68k_do_rts_mmu (void)
 {
        m68k_setpc (get_long_mmu (m68k_areg (regs, 7)));
index 1a6593da366aa6f569bc46d04c7c77a3e3573aa7..84daaf6b19d79def2eeb933697559bb03074acdd 100644 (file)
 #include <winioctl.h>
 #include <setupapi.h>   // for SetupDiXxx functions.
 #include <stddef.h>
+#ifdef RETROPLATFORM
+#include "rp.h"
+#endif
 
 #include <ntddscsi.h>
 
+#define IOCTL_DATA_BUFFER 8192
+#define CDDA_BUFFERS 6
+
 struct dev_info_ioctl {
        HANDLE h;
        uae_u8 *tempbuffer;
@@ -52,11 +58,9 @@ struct dev_info_ioctl {
        uae_u32 cd_last_pos;
        HWAVEOUT cdda_wavehandle;
        int cdda_start, cdda_end;
+       uae_u8 subcode[96 * CDDA_BUFFERS];
 };
 
-#define IOCTL_DATA_BUFFER 8192
-#define CDDA_BUFFERS 6
-
 static int MCICDA;
 
 static struct dev_info_ioctl ciw32[MAX_TOTAL_DEVICES];
@@ -287,7 +291,6 @@ static void *cdda_play (void *v)
        int unitnum = ciw32 - ciw;
        int cdda_pos;
        int num_sectors = CDDA_BUFFERS;
-       int quit = 0;
        int bufnum;
        int buffered;
        uae_u8 *px[2], *p;
@@ -351,15 +354,24 @@ static void *cdda_play (void *v)
                                seterrormode (unitnum);
                                rri.DiskOffset.QuadPart = 2048 * (cdda_pos - 150);
                                rri.SectorCount = num_sectors;
-                               rri.TrackMode = CDDA;
-                               if (!DeviceIoControl (ciw->h, IOCTL_CDROM_RAW_READ, &rri, sizeof rri, px[bufnum], num_sectors * 2352, &len, NULL)) {
-                                       DWORD err = GetLastError ();
-                                       write_log (L"IOCTL_CDROM_RAW_READ CDDA returned %d\n", err);
-                                       quit = 1;
+                               rri.TrackMode = RawWithSubCode;
+                               if (!DeviceIoControl (ciw->h, IOCTL_CDROM_RAW_READ, &rri, sizeof rri, px[bufnum], num_sectors * CD_RAW_SECTOR_WITH_SUBCODE_SIZE, &len, NULL)) {
+                                       rri.TrackMode = CDDA;
+                                       if (!DeviceIoControl (ciw->h, IOCTL_CDROM_RAW_READ, &rri, sizeof rri, px[bufnum], num_sectors * 2352, &len, NULL)) {
+                                               DWORD err = GetLastError ();
+                                               write_log (L"IOCTL_CDROM_RAW_READ CDDA returned %d\n", err);
+                                               ciw->cdda_play_finished = 1;
+                                               ciw->cdda_play = -1;
+                                       }
+                               } else {
+                                       for (i = 0; i < num_sectors; i++) {
+                                               memcpy (ciw->subcode + i * 96, px[bufnum] + CD_RAW_SECTOR_WITH_SUBCODE_SIZE * i + 2352, 96);
+                                       }
+                                       for (i = 1; i < num_sectors; i++) {
+                                               memmove (px[bufnum] + 2352 * i, px[bufnum] + CD_RAW_SECTOR_WITH_SUBCODE_SIZE * i, 2352);
+                                       }
                                }
                                reseterrormode (unitnum);
-                               if (quit)
-                                       break;
                
                                bufon[bufnum] = 1;
                                if (volume != ciw->cdda_volume || volume_main != currprefs.sound_volume) {
@@ -378,8 +390,11 @@ static void *cdda_play (void *v)
                                }
 
                                cdda_pos += num_sectors;
-                               if (cdda_pos >= ciw->cdda_end)
+                               if (cdda_pos - num_sectors < ciw->cdda_end && cdda_pos >= ciw->cdda_end) {
                                        ciw->cdda_play_finished = 1;
+                                       ciw->cdda_play = -1;
+                                       cdda_pos = ciw->cdda_end;
+                               }
                                ciw->cd_last_pos = cdda_pos;
 
                        }
@@ -1166,7 +1181,7 @@ static int open_bus (int flags)
 static int ioctl_ismedia (int unitnum, int quick)
 {
        if (!unitcheck (unitnum))
-               return 0;
+               return -1;
        if (quick) {
                struct dev_info_ioctl *ciw = &ciw32[unitnum];
                return ciw->mediainserted;
@@ -1203,6 +1218,9 @@ void win32_ioctl_media_change (TCHAR driveletter, int insert)
                        write_log (L"IOCTL: media change %c %d\n", driveletter, insert);
                        ciw32[i].mediainserted = insert;
                        scsi_do_disk_change (driveletter, insert);
+#ifdef RETROPLATFORM
+                       rp_cd_change (i, insert ? 0 : 1);
+#endif
                }
        }
 }
index eb2a20c83855875d530d14f33b1ddf4a19b21c1c..7a63ea613787abca4b97c46de780ca003b408527 100644 (file)
@@ -22,6 +22,9 @@
 #include "blkdev.h"
 #include "scsidev.h"
 #include "gui.h"
+#ifdef RETROPLATFORM
+#include "rp.h"
+#endif
 
 #include <stddef.h>
 
@@ -48,6 +51,7 @@ struct dev_info_spti {
        TCHAR *drvpath;
        TCHAR *name;
        TCHAR *inquirydata;
+       TCHAR *ident;
        int mediainserted;
        HANDLE handle;
        int isatapi;
@@ -479,7 +483,7 @@ static struct device_info *info_device (int unitnum, struct device_info *di)
 {
        struct dev_info_spti *dispti;
        if (unitnum >= MAX_TOTAL_DEVICES || dev_info[unitnum].handle == INVALID_HANDLE_VALUE)
-               return 0;
+               return NULL;
        dispti = &dev_info[unitnum];
        _tcscpy (di->label, dispti->name);
        di->bus = 0;
@@ -508,6 +512,9 @@ void win32_spti_media_change (TCHAR driveletter, int insert)
                                write_log (L"SPTI: media change %c %d\n", driveletter, insert);
                                dev_info[i].mediainserted = now;
                                scsi_do_disk_change (i + 1, insert);
+#ifdef RETROPLATFORM
+                               rp_cd_change (i, now ? 0 : 1);
+#endif
                        }
                }
        }
index 05bc53949ce385d182895e4e1843d232457356a6..3784c1c4c816882ab61c340f7bbee8c154257d8e 100644 (file)
@@ -784,7 +784,7 @@ static void setupscenescaled (void)
        hr = IDirect3DDevice9_SetTextureStageState (d3ddev, 0, D3DTSS_ALPHAOP,   D3DTOP_MODULATE);
        hr = IDirect3DDevice9_SetTextureStageState (d3ddev, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
        hr = IDirect3DDevice9_SetTextureStageState (d3ddev, 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
-       switch (currprefs.gfx_filter_filtermode & 1)
+       switch (currprefs.gfx_filter_bilinear)
        {
        case 0:
                v = D3DTEXF_POINT;
@@ -980,6 +980,8 @@ static void createscanlines (int force)
        l1 = (currprefs.gfx_filter_scanlineratio >> 0) & 15;
        l2 = (currprefs.gfx_filter_scanlineratio >> 4) & 15;
 
+       if (l1 + l2 <= 0)
+               return;
        hr = IDirect3DTexture9_LockRect (sltexture, 0, &locked, NULL, 0);
        if (FAILED (hr)) {
                write_log (L"SL IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
@@ -1147,10 +1149,11 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth
        D3D_free ();
        D3D_canshaders ();
        d3d_enabled = 0;
-       if (currprefs.gfx_filter != UAE_FILTER_DIRECT3D) {
+       if (!currprefs.gfx_api) {
                _tcscpy (errmsg, L"D3D: not enabled");
                return errmsg;
        }
+
        d3dx = LoadLibrary (L"d3dx9_42.dll");
        if (d3dx == NULL) {
                _tcscpy (errmsg, L"Direct3D: August 2009 or newer DirectX Runtime required.\n\nhttp://go.microsoft.com/fwlink/?linkid=56513");
@@ -1290,6 +1293,9 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth
                tex_square, tex_pow2, tex_dynamic,
                max_texture_w, max_texture_h);
 
+       t_w *= S2X_getmult ();
+       t_h *= S2X_getmult ();
+
        if (max_texture_w < t_w || max_texture_h < t_h) {
                _stprintf (errmsg, L"Direct3D: %d * %d or bigger texture support required\nYour card's maximum texture size is only %d * %d",
                        t_w, t_h, max_texture_w, max_texture_h);
@@ -1336,7 +1342,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth
 
        hr = D3DXCreateSprite (d3ddev, &sprite);
        if (FAILED (hr)) {
-               write_log (L"LED D3DXSprite filaed: %s\n", D3D_ErrorString (hr));
+               write_log (L"LED D3DXSprite failed: %s\n", D3D_ErrorString (hr));
        }
 
        createscanlines (1);
@@ -1515,7 +1521,7 @@ void D3D_unlocktexture (void)
                D3D_render2 (0);
 }
 
-int D3D_locktexture (void)
+uae_u8 *D3D_locktexture (int *pitch)
 {
        D3DLOCKED_RECT locked;
        HRESULT hr;
@@ -1528,7 +1534,7 @@ int D3D_locktexture (void)
                                ShowWindow (d3dhwnd, SW_MINIMIZE);
                        }
                }
-               return 0;
+               return NULL;
        }
 
        locked.pBits = NULL;
@@ -1538,18 +1544,16 @@ int D3D_locktexture (void)
                if (hr != D3DERR_DRIVERINTERNALERROR) {
                        write_log (L"IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
                        D3D_unlocktexture ();
-                       return 0;
+                       return NULL;
                }
        }
        if (locked.pBits == NULL || locked.Pitch == 0) {
                write_log (L"IDirect3DTexture9_LockRect return NULL texture\n");
                D3D_unlocktexture ();
-               return 0;
+               return NULL;
        }
-       gfxvidinfo.bufmem = locked.pBits;
-       gfxvidinfo.rowbytes = locked.Pitch;
-       init_row_map ();
-       return 1;
+       *pitch = locked.Pitch;
+       return locked.pBits;
 }
 
 void D3D_refresh (void)
index 6cf5c0ee281b45176ab3801542119fceae6ddd97..ebc0cef53d185d9f2711cfc928b2102672b55825 100644 (file)
@@ -5,7 +5,7 @@ extern const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, in
 extern void D3D_render (void);
 extern void D3D_getpixelformat (int depth,int *rb, int *bb, int *gb, int *rs, int *bs, int *gs, int *ab, int *ar, int *a);
 extern void D3D_refresh (void);
-extern int D3D_locktexture(void);
+extern uae_u8 *D3D_locktexture(int*);
 extern void D3D_unlocktexture(void);
 extern void D3D_guimode (int guion);
 extern HDC D3D_getDC(HDC hdc);
index 81682de6d1483ffae4fba80ee4a6607ea8e8926f..e4efc72ccb2f8320fd91abb1abb1a81fe8c7f2e3 100644 (file)
 #define IDS_RES_HIRES                   357
 #define IDS_RES_SUPERHIRES              358
 #define IDS_PRINTER_EPSON48             359
+#define IDS_SELECTCD                    360
+#define IDS_CD                          361
 #define IDS_QS_MODELS                   1000
 #define IDS_QS_MODEL_A500               1001
 #define IDS_QS_MODEL_A500P              1002
 #define IDC_PATHS_RIPS                  1680
 #define IDC_QUICKSTART_SETCONFIG        1681
 #define IDC_CONFIGAUTO                  1682
+#define IDC_CD0Q_TYPE                   1682
 #define IDC_DF0TEXTQ                    1683
 #define IDC_CONFIGNOLINK                1683
 #define IDC_DF0WPQ                      1684
 #define IDC_DBG_CCR                     1744
 #define IDC_CS_NOEHB                    1744
 #define IDC_DBG_AMEM                    1745
-#define IDC_CS_BLITTERBUG               1745
+#define IDC_CS_DIPAGNUS                 1745
 #define IDC_DBG_SP_VBR                  1746
 #define IDC_DBG_MMISC                   1747
 #define IDC_DBG_PC                      1748
 #define IDC_RTG_SCALE_ASPECTRATIO       1792
 #define IDC_ASSOCIATE_ON                1792
 #define IDC_RTG_VBLANKRATE              1793
+#define IDC_DF0WPTEXTQ                  1793
+#define IDC_DF1WPTEXTQ                  1794
+#define IDC_FILTERD3D                   1795
 #define ID__FLOPPYDRIVES                40004
 #define ID_FLOPPYDRIVES_DF0             40005
 #define ID_ST_CONFIGURATION             40010
 #define _APS_3D_CONTROLS                     1
 #define _APS_NEXT_RESOURCE_VALUE        354
 #define _APS_NEXT_COMMAND_VALUE         40045
-#define _APS_NEXT_CONTROL_VALUE         1793
+#define _APS_NEXT_CONTROL_VALUE         1796
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif
index 65614471010d5aea620a774e93dc5664098a39e8..06b65b763965539eb9862bec0d184324769a8b65 100644 (file)
@@ -661,7 +661,7 @@ BEGIN
     CONTROL         "CIA ROM Overlay",IDC_CS_CIAOVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,95,80,10\r
     CONTROL         "KB Reset Warning",IDC_CS_RESETWARNING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,159,80,10\r
     CONTROL         "No-EHB Denise",IDC_CS_NOEHB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,94,159,80,10\r
-    CONTROL         "Blitter Busy Bug",IDC_CS_BLITTERBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,159,80,10\r
+    CONTROL         "A1000 Agnus (8361)",IDC_CS_DIPAGNUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,159,94,10\r
 END\r
 \r
 IDD_AVIOUTPUT DIALOGEX 0, 0, 288, 217\r
@@ -753,8 +753,9 @@ BEGIN
     COMBOBOX        IDC_FILTERASPECT,14,151,73,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
     CONTROL         "Keep aspect ratio",IDC_FILTERKEEPASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,168,85,10\r
     RTEXT           "Automatic scaling:",-1,9,38,79,10,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_FILTERAUTOSCALE,105,36,140,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+    COMBOBOX        IDC_FILTERAUTOSCALE,132,36,83,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
     COMBOBOX        IDC_FILTERASPECT2,14,180,73,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+    CONTROL         "Direct3D",IDC_FILTERD3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,38,63,10\r
 END\r
 \r
 IDD_HARDDRIVE DIALOGEX 0, 0, 380, 76\r
@@ -872,22 +873,23 @@ BEGIN
     GROUPBOX        "Host Configuration",IDC_QUICKSTART_HOST,3,91,294,33\r
     RTEXT           "Configuration:",IDC_STATIC,5,105,55,10,SS_CENTERIMAGE\r
     COMBOBOX        IDC_QUICKSTART_HOSTCONFIG,65,103,225,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    GROUPBOX        "Emulated Floppy Drives",IDC_QUICKSTART_DF,3,126,294,84\r
-    CONTROL         "Floppy drive DF0:",IDC_DF0QENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,10,136,72,15\r
-    PUSHBUTTON      "Select disk image",IDC_DF0QQ,85,136,98,15\r
-    RTEXT           "Write-protected",IDC_STATIC,185,139,56,10,SS_CENTERIMAGE\r
+    GROUPBOX        "Emulated Drives",IDC_QUICKSTART_DF,3,126,294,84\r
+    CONTROL         "Floppy drive DF0:",IDC_DF0QENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,136,72,15\r
+    PUSHBUTTON      "Select image file",IDC_DF0QQ,85,136,98,15\r
+    RTEXT           "Write-protected",IDC_DF0WPTEXTQ,185,139,56,10,SS_CENTERIMAGE\r
     CONTROL         "",IDC_DF0WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,137,10,15\r
     PUSHBUTTON      "Eject",IDC_EJECT0Q,261,136,30,15\r
     COMBOBOX        IDC_DF0TEXTQ,9,154,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP\r
     CONTROL         "Floppy drive DF1:",IDC_DF1QENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,172,71,15\r
-    PUSHBUTTON      "Select disk image",IDC_DF1QQ,85,172,98,15\r
-    RTEXT           "Write-protected",IDC_STATIC,185,175,55,10,SS_CENTERIMAGE\r
+    PUSHBUTTON      "Select image file",IDC_DF1QQ,85,172,98,15\r
+    RTEXT           "Write-protected",IDC_DF1WPTEXTQ,185,175,55,10,SS_CENTERIMAGE\r
     CONTROL         "",IDC_DF1WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,246,173,10,15\r
     PUSHBUTTON      "Eject",IDC_EJECT1Q,261,172,30,15\r
     COMBOBOX        IDC_DF1TEXTQ,9,190,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "Set configuration",IDC_QUICKSTART_SETCONFIG,9,219,72,15,NOT WS_VISIBLE\r
     GROUPBOX        "Mode",IDC_STATIC,190,211,107,27,BS_LEFT\r
     CONTROL         "Start in Quickstart mode",IDC_QUICKSTARTMODE,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,197,222,94,10\r
+    COMBOBOX        IDC_CD0Q_TYPE,191,173,63,50,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP\r
 END\r
 \r
 IDD_FRONTEND DIALOGEX 0, 0, 420, 242\r
@@ -1493,6 +1495,8 @@ BEGIN
     IDS_RES_HIRES           "Hires (normal)"\r
     IDS_RES_SUPERHIRES      "SuperHires"\r
     IDS_PRINTER_EPSON48     "Epson Matrix Printer Emulation, 48pin"\r
+    IDS_SELECTCD            "Select a CD image file..."\r
+    IDS_CD                  "CD image files"\r
 END\r
 \r
 #endif    // English (Neutral) resources\r
index 15ad220b1b20f6fd5cbce74ea38c5eed5529ea3d..381d15ad1e11fe6e0587ffb06623a2d1d60d05a9 100644 (file)
@@ -27,6 +27,7 @@
 #include "filesys.h"
 #include "savestate.h"
 #include "gfxfilter.h"
+#include "blkdev.h"
 
 static int initialized;
 static RPGUESTINFO guestinfo;
@@ -766,6 +767,17 @@ void rp_fixup_options (struct uae_prefs *p)
                        rp_harddrive_image_change (num, uci->rootdir);
                }
        }
+       for (i = 0; i < MAX_TOTAL_DEVICES; i++) {
+               int v = sys_command_ismedia (DF_IOCTL, i, 1);
+               if (v >= 0) {
+                       struct device_info di = { 0 };
+                       sys_command_info (DF_IOCTL, i, &di);
+                       cd_mask |= 1 << i;
+                       RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL);
+                       rp_cd_image_change (i, v == 0 ? L"" : di.ident);
+               }
+
+       }
 
        rp_update_volume (&currprefs);
        rp_turbo (currprefs.turbo_emulation);
@@ -841,6 +853,10 @@ void rp_harddrive_image_change (int num, const TCHAR *name)
 {
        rp_device_change (RP_DEVICE_HD, num, name);
 }
+void rp_cd_image_change (int num, const TCHAR *name)
+{
+       rp_device_change (RP_DEVICE_CD, num, name);
+}
 
 void rp_floppydrive_change (int num, int removed)
 {
index ad0dede9052fd77d65c829734ee52c697f167965..425641933d45d480700997ebc4d94866253059d9 100644 (file)
@@ -34,3 +34,4 @@ extern int log_rp;
 extern void rp_input_change (int num);
 extern void rp_disk_image_change (int num, const TCHAR *name);
 extern void rp_harddrive_image_change (int num, const TCHAR *name);
+extern void rp_cd_image_change (int num, const TCHAR *name);
index 3ac8ca1784940c024e0e6ac58001b15589007a0e..dc5fe567b7a383180b0fd98a656c2a8c39fe20dd 100644 (file)
@@ -2803,6 +2803,8 @@ void fetch_path (TCHAR *name, TCHAR *out, int size)
                return;
        if (!_tcscmp (name, L"FloppyPath"))
                _tcscat (out, L"..\\shared\\adf\\");
+       if (!_tcscmp (name, L"CDPath"))
+               _tcscat (out, L"..\\shared\\cd\\");
        if (!_tcscmp (name, L"hdfPath"))
                _tcscat (out, L"..\\shared\\hdf\\");
        if (!_tcscmp (name, L"KickstartPath"))
@@ -2811,6 +2813,8 @@ void fetch_path (TCHAR *name, TCHAR *out, int size)
                _tcscat (out, L"Configurations\\");
        if (start_data >= 0)
                regquerystr (NULL, name, out, &size); 
+       if (GetFileAttributes (out) == INVALID_FILE_ATTRIBUTES)
+               _tcscpy (out, start_path_data);
        if (out[0] == '\\' && (_tcslen (out) >= 2 && out[1] != '\\')) { /* relative? */
                _tcscpy (out, start_path_data);
                if (start_data >= 0) {
@@ -3417,7 +3421,8 @@ static void WIN32_HandleRegistryStuff (void)
        _tcscpy (savestate_fname, path);
        fetch_path (L"InputPath", path, sizeof (path) / sizeof (TCHAR));
        createdir (path);
-       regclosetree (read_disk_history ());
+       regclosetree (read_disk_history (HISTORY_FLOPPY));
+       regclosetree (read_disk_history (HISTORY_CD));
        associate_init_extensions ();
        read_rom_list ();
        load_keyring (NULL, NULL);
index 47aeea342dfc14c288769dab47f9a99f2471a933..d9f69898f1a8b5e03cecaa07bf86c326483c6a50 100644 (file)
@@ -18,8 +18,8 @@
 #define WINUAEPUBLICBETA 1
 #define LANG_DLL 1
 
-#define WINUAEBETA L"Beta 4"
-#define WINUAEDATE MAKEBD(2010, 1, 16)
+#define WINUAEBETA L"Beta 5"
+#define WINUAEDATE MAKEBD(2010, 1, 22)
 #define WINUAEEXTRA L""
 #define WINUAEREV L""
 
index dea867886733ba922d099125017940ebb389c728..6635d58ab1e82a66bbe8d8ce090dfe0731b2007b 100644 (file)
@@ -14,6 +14,7 @@
 #include "dxwrap.h"
 #include "statusline.h"
 #include "drawing.h"
+#include "direct3d.h"
 
 #include <float.h>
 
@@ -21,12 +22,6 @@ struct uae_filter uaefilters[] =
 {
        { UAE_FILTER_NULL, 0, 1, L"Null filter", L"null", 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0, 0 },
 
-       { UAE_FILTER_DIRECT3D, 0, 1, L"Direct3D", L"direct3d", 1, 0, 0, 0, 0 },
-
-#ifdef OPENGL
-       { UAE_FILTER_OPENGL, 0, 1, L"OpenGL (unsupported)", L"opengl", 1, 0, 0, 0, 0 },
-#endif
-
        { UAE_FILTER_SCALE2X, 0, 2, L"Scale2X", L"scale2x", 0, 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0, 0 },
 
        { UAE_FILTER_HQ, 0, 2, L"hq2x/3x/4x", L"hqx", 0, 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 },
@@ -51,6 +46,7 @@ static uae_u8 *tempsurf2, *tempsurf3;
 static int cleartemp;
 static uae_u32 rc[256], gc[256], bc[256];
 static int deskw, deskh;
+static int d3d;
 
 void getfilteroffset (int *dx, int *dy, int *mx, int *my)
 {
@@ -474,8 +470,12 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd)
        int res_shift;
 
        S2X_free ();
+       d3d = currprefs.gfx_api;
        changed_prefs.leds_on_screen = currprefs.leds_on_screen = currprefs.leds_on_screen | STATUSLINE_TARGET;
 
+       if (d3d)
+               dd = ad;
+
        if (dd == 32)
                alloc_colors_rgb (8, 8, 8, 16, 8, 0, 0, 0, 0, 0, rc, gc, bc);
        else
@@ -509,27 +509,34 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd)
        amiga_depth = ad;
        scale = mult;
 
-       temp_width = dst_width * 3;
-       if (temp_width > dxcaps.maxwidth)
-               temp_width = dxcaps.maxwidth;
-       temp_height = dst_height * 3;
-       if (temp_height > dxcaps.maxheight)
-               temp_height = dxcaps.maxheight;
-       if (temp_width < dst_width)
-               temp_width = dst_width;
-       if (temp_height < dst_height)
-               temp_height = dst_height;
+       if (d3d) {
+               temp_width = dst_width * mult;
+               temp_height = dst_height * mult;
+       } else {
+               temp_width = dst_width * 3;
+               if (temp_width > dxcaps.maxwidth)
+                       temp_width = dxcaps.maxwidth;
+               temp_height = dst_height * 3;
+               if (temp_height > dxcaps.maxheight)
+                       temp_height = dxcaps.maxheight;
+               if (temp_width < dst_width)
+                       temp_width = dst_width;
+               if (temp_height < dst_height)
+                       temp_height = dst_height;
+       }
 
        if (usedfilter->type == UAE_FILTER_HQ) {
                int w = amiga_width > dst_width ? amiga_width : dst_width;
                int h = amiga_height > dst_height ? amiga_height : dst_height;
                tempsurf2 = xmalloc (w * h * (amiga_depth / 8) * ((scale + 1) / 2));
                tempsurf3 = xmalloc (w * h *(dst_depth / 8) * 4 * scale);
-               tempsurf = allocsystemsurface (temp_width, temp_height);
+               if (!d3d)
+                       tempsurf = allocsystemsurface (temp_width, temp_height);
        } else {
-               tempsurf = allocsurface (temp_width, temp_height);
+               if (!d3d)
+                       tempsurf = allocsurface (temp_width, temp_height);
        }
-       if (!tempsurf)
+       if (!tempsurf && !d3d)
                write_log (L"DDRAW: failed to create temp surface (%dx%d)\n", temp_width, temp_height);
 
 }
@@ -542,6 +549,7 @@ void S2X_render (void)
        RECT sr, dr, zr;
        DDSURFACEDESC2 desc;
        DWORD pitch;
+       uae_u8 *surfstart;
 
        aw = amiga_width;
        ah = amiga_height;
@@ -552,30 +560,39 @@ void S2X_render (void)
                return;
        if (aw < 16)
                return;
-       if (tempsurf == NULL)
-               return;
 
        sptr = gfxvidinfo.bufmem;
        endsptr = gfxvidinfo.bufmemend;
        bufmem_ptr = sptr;
 
-       if (cleartemp) {
-               clearsurface (tempsurf);
-               cleartemp = 0;
+       if (d3d) {
+               surfstart = D3D_locktexture (&pitch);
+               if (surfstart == NULL)
+                       return;
+       } else {
+               if (tempsurf == NULL)
+                       return;
+               if (cleartemp) {
+                       clearsurface (tempsurf);
+                       cleartemp = 0;
+               }
+               if (!locksurface (tempsurf, &desc))
+                       return;
+               pitch = desc.lPitch;
+               surfstart = (uae_u8*)desc.lpSurface;
        }
-       if (!locksurface (tempsurf, &desc))
-               return;
-       pitch = desc.lPitch;
-       dptr = (uae_u8*)desc.lpSurface;
+       dptr = surfstart;
        enddptr = dptr + pitch * temp_height;
-       dptr = getfilterrect1 (&sr, &dr, dst_depth, aw, ah, scale, temp_width, temp_height, dptr, pitch);
+       if (!d3d) {
+               dptr = getfilterrect1 (&sr, &dr, dst_depth, aw, ah, scale, temp_width, temp_height, dptr, pitch);
+       }
 
        if (!dptr) /* weird things can happen */
                goto end;
-       if (dptr < (uae_u8*)desc.lpSurface)
-               goto endfail;
+       if (dptr < surfstart)
+               dptr = surfstart;
 
-       if (usedfilter->type == UAE_FILTER_SCALE2X ) { /* 16+32/2X */
+       if (usedfilter->type == UAE_FILTER_SCALE2X) { /* 16+32/2X */
 
                if (amiga_depth == 16 && dst_depth == 16) {
                        AdMame2x (sptr, gfxvidinfo.rowbytes, dptr, pitch, aw, ah);
@@ -685,24 +702,26 @@ void S2X_render (void)
 
        }
 
-endfail:
-
        if (ok == 0 && currprefs.gfx_filter) {
                usedfilter = &uaefilters[0];
                changed_prefs.gfx_filter = usedfilter->type;
        }
 
 end:
-       unlocksurface (tempsurf);
-
-       getfilterrect2 (&dr, &sr, &zr, dst_width, dst_height, aw, ah, scale, temp_width, temp_height);
-       //write_log (L"(%d %d %d %d) - (%d %d %d %d) (%d %d)\n", dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top);
-       OffsetRect (&sr, zr.left, zr.top);
-       if (sr.left >= 0 && sr.top >= 0 && sr.right < temp_width && sr.bottom < temp_height) {
-               if (sr.left < sr.right && sr.top < sr.bottom)
-                       DirectDraw_BlitRect (NULL, &dr, tempsurf, &sr);
+       if (d3d) {
+               D3D_unlocktexture ();
+       } else {
+               unlocksurface (tempsurf);
+       
+               getfilterrect2 (&dr, &sr, &zr, dst_width, dst_height, aw, ah, scale, temp_width, temp_height);
+               //write_log (L"(%d %d %d %d) - (%d %d %d %d) (%d %d)\n", dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top);
+               OffsetRect (&sr, zr.left, zr.top);
+               if (sr.left >= 0 && sr.top >= 0 && sr.right < temp_width && sr.bottom < temp_height) {
+                       if (sr.left < sr.right && sr.top < sr.bottom)
+                               DirectDraw_BlitRect (NULL, &dr, tempsurf, &sr);
+               }
+               statusline ();
        }
-       statusline ();
 }
 
 void S2X_refresh (void)
@@ -711,4 +730,28 @@ void S2X_refresh (void)
        S2X_render ();
 }
 
+int S2X_getmult (void)
+{
+       int j, i;
+
+       if (!usedfilter)
+               return 1;
+       j = 0;
+       for (i = 1; i <= 4; i++) {
+               if (usedfilter->x[i])
+                       j++;
+       }
+       i = currprefs.gfx_filter_filtermode;
+       if (i >= j)
+               i = 0;
+       j = 0;
+       while (i >= 0) {
+               while (!usedfilter->x[j])
+                       j++;
+               if(i-- > 0)
+                       j++;
+       }
+       return j;
+}
+
 #endif
index 7bbe33b9b8696b267a28ffd666a6cf90ff7ce97a..705dab616255994d7cc566c3e15eb0b513a4003b 100644 (file)
@@ -803,6 +803,8 @@ void flush_screen (int a, int b)
                OGL_render ();
 #endif
        } else if (currentmode->flags & DM_D3D) {
+               if (currentmode->flags & DM_SWSCALE)
+                       S2X_render ();
                return;
 #ifdef GFXFILTER
        } else if (currentmode->flags & DM_SWSCALE) {
@@ -837,7 +839,15 @@ int lockscr (void)
 #ifdef D3D
                if (D3D_needreset ())
                        WIN32GFX_DisplayChangeRequested ();
-               ret = D3D_locktexture ();
+               if (currentmode->flags & DM_SWSCALE) {
+                       ret = 1;
+               } else {
+                       gfxvidinfo.bufmem = D3D_locktexture (&gfxvidinfo.rowbytes);
+                       if (gfxvidinfo.bufmem) {
+                               init_row_map ();
+                               ret = 1;
+                       }
+               }
 #endif
        } else if (currentmode->flags & DM_SWSCALE) {
                ret = 1;
@@ -850,9 +860,9 @@ int lockscr (void)
 void unlockscr (void)
 {
        if (currentmode->flags & DM_D3D) {
-#ifdef D3D
+               if (currentmode->flags & DM_SWSCALE)
+                       return;
                D3D_unlocktexture ();
-#endif
        } else if (currentmode->flags & DM_SWSCALE) {
                return;
        } else if (currentmode->flags & DM_DDRAW) {
@@ -1012,24 +1022,18 @@ static void updatemodes (void)
                        if (currentmode->current_depth < 15)
                                currentmode->current_depth = 16;
                }
-               if (!screen_is_picasso) {
-                       if (usedfilter->type == UAE_FILTER_DIRECT3D) {
-                               flags |= DM_D3D;
-                               if (flags & DM_DX_FULLSCREEN) {
-                                       flags &= ~DM_DX_FULLSCREEN;
-                                       flags |= DM_D3D_FULLSCREEN;
-                               }
-                               flags &= ~DM_DDRAW;
-                       }
-#if defined (OPENGL)
-                       if (usedfilter->type == UAE_FILTER_OPENGL) {
-                               flags |= DM_OPENGL;
-                               flags &= ~DM_DDRAW;
-                       }
-#endif
-               } 
        }
 #endif
+       if (!screen_is_picasso) {
+               if (currprefs.gfx_api) {
+                       flags |= DM_D3D;
+                       if (flags & DM_DX_FULLSCREEN) {
+                               flags &= ~DM_DX_FULLSCREEN;
+                               flags |= DM_D3D_FULLSCREEN;
+                       }
+                       flags &= ~DM_DDRAW;
+               }
+       } 
        currentmode->flags = flags;
        if (flags & DM_SWSCALE)
                currentmode->fullfill = 1;
@@ -1188,10 +1192,12 @@ int check_prefs_changed_gfx (void)
        c |= currprefs.gfx_pvsync != changed_prefs.gfx_pvsync ? 2 | 16 : 0;
        c |= currprefs.gfx_refreshrate != changed_prefs.gfx_refreshrate ? 2 | 16 : 0;
        c |= currprefs.gfx_autoresolution != changed_prefs.gfx_autoresolution ? (2|8) : 0;
+       c |= currprefs.gfx_api != changed_prefs.gfx_api ? (1|8) : 0;
 
        c |= currprefs.gfx_filter != changed_prefs.gfx_filter ? (2|8) : 0;
        c |= _tcscmp (currprefs.gfx_filtershader, changed_prefs.gfx_filtershader) ? (2|8|32) : 0;
        c |= currprefs.gfx_filter_filtermode != changed_prefs.gfx_filter_filtermode ? (2|8|32) : 0;
+       c |= currprefs.gfx_filter_bilinear != changed_prefs.gfx_filter_bilinear ? (2|8|32) : 0;
        c |= currprefs.gfx_filter_horiz_zoom_mult != changed_prefs.gfx_filter_horiz_zoom_mult ? (1|8) : 0;
        c |= currprefs.gfx_filter_vert_zoom_mult != changed_prefs.gfx_filter_vert_zoom_mult ? (1|8) : 0;
        c |= currprefs.gfx_filter_noise != changed_prefs.gfx_filter_noise ? (1|8) : 0;
@@ -1232,17 +1238,10 @@ int check_prefs_changed_gfx (void)
 
                currprefs.gfx_autoresolution = changed_prefs.gfx_autoresolution;
                currprefs.color_mode = changed_prefs.color_mode;
+               currprefs.gfx_api = changed_prefs.gfx_api;
 
                if (changed_prefs.gfx_afullscreen == 1) { 
-                       if (currprefs.gfx_filter == UAE_FILTER_DIRECT3D && changed_prefs.gfx_filter != UAE_FILTER_DIRECT3D)
-                               display_change_requested = 1;
-#ifdef OPENGL
-                       if (currprefs.gfx_filter == UAE_FILTER_OPENGL && changed_prefs.gfx_filter != UAE_FILTER_OPENGL)
-                               display_change_requested = 1;
-                       if (changed_prefs.gfx_filter == UAE_FILTER_OPENGL && currprefs.gfx_filter != UAE_FILTER_OPENGL)
-                               display_change_requested = 1;
-#endif
-                       if (changed_prefs.gfx_filter == UAE_FILTER_DIRECT3D && currprefs.gfx_filter != UAE_FILTER_DIRECT3D)
+                       if (currprefs.gfx_api != changed_prefs.gfx_api)
                                display_change_requested = 1;
                }
 
@@ -1255,6 +1254,7 @@ int check_prefs_changed_gfx (void)
                currprefs.gfx_filter = changed_prefs.gfx_filter;
                _tcscpy (currprefs.gfx_filtershader, changed_prefs.gfx_filtershader);
                currprefs.gfx_filter_filtermode = changed_prefs.gfx_filter_filtermode;
+               currprefs.gfx_filter_bilinear = changed_prefs.gfx_filter_bilinear;
                currprefs.gfx_filter_horiz_zoom_mult = changed_prefs.gfx_filter_horiz_zoom_mult;
                currprefs.gfx_filter_vert_zoom_mult = changed_prefs.gfx_filter_vert_zoom_mult;
                currprefs.gfx_filter_noise = changed_prefs.gfx_filter_noise;
@@ -1785,13 +1785,8 @@ void gfx_set_picasso_state (int on)
        updatemodes ();
        update_gfxparams ();
        clearscreen ();
-       if (currprefs.gfx_afullscreen != currprefs.gfx_pfullscreen ||
-               (currprefs.gfx_afullscreen == 1 && (currprefs.gfx_filter == UAE_FILTER_DIRECT3D
-#ifdef OPENGL
-               || currprefs.gfx_filter == UAE_FILTER_OPENGL
-#endif
-               ))) {
-                       mode = 1;
+       if (currprefs.gfx_afullscreen != currprefs.gfx_pfullscreen || (currprefs.gfx_afullscreen == 1 && currprefs.gfx_api)) {
+               mode = 1;
        } else {
                mode = modeswitchneeded (&wc);
                if (!mode)
@@ -2414,31 +2409,11 @@ static BOOL doInit (void)
                                currentmode->amiga_width = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
                                currentmode->amiga_height = AMIGA_HEIGHT_MAX << (currprefs.gfx_linedbl ? 1 : 0);
                                if (usedfilter) {
-                                       if (usedfilter->x[0]) {
-                                               currentmode->current_depth = (currprefs.gfx_filter_filtermode / 2) ? 32 : 16;
+                                       mult = S2X_getmult ();
+                                       if ((usedfilter->x[mult] & (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) == (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) {
+                                               currentmode->current_depth = currentmode->native_depth;
                                        } else {
-                                               int j, i;
-                                               j = 0;
-                                               for (i = 1; i <= 4; i++) {
-                                                       if (usedfilter->x[i])
-                                                               j++;
-                                               }
-                                               i = currprefs.gfx_filter_filtermode;
-                                               if (i >= j)
-                                                       i = 0;
-                                               j = 0;
-                                               while (i >= 0) {
-                                                       while (!usedfilter->x[j])
-                                                               j++;
-                                                       if(i-- > 0)
-                                                               j++;
-                                               }
-                                               if ((usedfilter->x[j] & (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) == (UAE_FILTER_MODE_16 | UAE_FILTER_MODE_32)) {
-                                                       currentmode->current_depth = currentmode->native_depth;
-                                               } else {
-                                                       currentmode->current_depth = (usedfilter->x[j] & UAE_FILTER_MODE_16) ? 16 : 32;
-                                               }
-                                               mult = j;
+                                               currentmode->current_depth = (usedfilter->x[mult] & UAE_FILTER_MODE_32) ? 32 : 16;
                                        }
                                }
                                currentmode->pitch = currentmode->amiga_width * currentmode->current_depth >> 3;
@@ -2482,15 +2457,7 @@ static BOOL doInit (void)
 
                ;
 
-       } else if (!(currentmode->flags & DM_SWSCALE)) {
-
-               int size = currentmode->amiga_width * currentmode->amiga_height * gfxvidinfo.pixbytes;
-               gfxvidinfo.realbufmem = xmalloc (size);
-               gfxvidinfo.bufmem = gfxvidinfo.realbufmem;
-               gfxvidinfo.rowbytes = currentmode->amiga_width * gfxvidinfo.pixbytes;
-               gfxvidinfo.bufmemend = gfxvidinfo.bufmem + size;
-
-       } else if (!(currentmode->flags & DM_D3D)) {
+       } else if (currentmode->flags & DM_SWSCALE) {
 
                int w = currentmode->amiga_width * 2;
                int h = currentmode->amiga_height * 2;
@@ -2501,6 +2468,14 @@ static BOOL doInit (void)
                gfxvidinfo.rowbytes = w * 2 * gfxvidinfo.pixbytes;
                gfxvidinfo.bufmemend = gfxvidinfo.realbufmem + size - gfxvidinfo.rowbytes;
 
+       } else if (currentmode->flags & DM_D3D) {
+
+               int size = currentmode->amiga_width * currentmode->amiga_height * gfxvidinfo.pixbytes;
+               gfxvidinfo.realbufmem = xmalloc (size);
+               gfxvidinfo.bufmem = gfxvidinfo.realbufmem;
+               gfxvidinfo.rowbytes = currentmode->amiga_width * gfxvidinfo.pixbytes;
+               gfxvidinfo.bufmemend = gfxvidinfo.bufmem + size;
+
        }
 
        init_row_map ();
index 97b02be885fa18351f2c7582c3fb526b703e9be6..55bf7ce53528813851ecfb21f0edc3d1a6745d08 100644 (file)
@@ -95,6 +95,7 @@
 #define USS_FORMAT_STRING_SAVE L"(*.uss)\0*.uss\0"
 #define HDF_FORMAT_STRING L"(*.hdf;*.vhd;*.rdf;*.hdz;*.rdz)\0*.hdf;*.vhd;*.rdf;*.hdz;*.rdz\0"
 #define INP_FORMAT_STRING L"(*.inp)\0*.inp\0"
+#define  CD_FORMAT_STRING L"(*.cue;*.iso)\0*.cue;*.iso\0"
 #define CONFIG_HOST L"Host"
 #define CONFIG_HARDWARE L"Hardware"
 
@@ -134,6 +135,13 @@ void WIN32GUI_LoadUIString (DWORD id, TCHAR *string, DWORD dwStringLen)
                LoadString (hInst, id, string, dwStringLen);
 }
 
+static DWORD quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1;
+static DWORD quickstart_floppy = 1, quickstart_cd = 0;
+static DWORD quickstart_cdtype = 0;
+static int quickstart_ok, quickstart_ok_floppy;
+static void addfloppytype (HWND hDlg, int n);
+static void addfloppyhistory (HWND hDlg);
+
 static int C_PAGES;
 #define MAX_C_PAGES 30
 static int LOADSAVE_ID = -1, MEMORY_ID = -1, KICKSTART_ID = -1, CPU_ID = -1,
@@ -160,6 +168,19 @@ static void ew (HWND hDlg, DWORD id, int enable)
                SendMessage (hDlg, WM_NEXTDLGCTL, 0, FALSE);
        EnableWindow (w, !!enable);
 }
+static void hide (HWND hDlg, DWORD id, int hide)
+{
+       HWND w;
+       if (id < 0)
+               return;
+       w = GetDlgItem (hDlg, id);
+       if (!w)
+               return;
+       if (hide && w == GetFocus ())
+               SendMessage (hDlg, WM_NEXTDLGCTL, 0, FALSE);
+       ShowWindow (w, hide ? SW_HIDE : SW_SHOW);
+}
+
 
 static int CALLBACK BrowseForFolderCallback (HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
 {
@@ -399,18 +420,18 @@ int DirectorySelection (HWND hDlg, const GUID *guid, TCHAR *path)
        return val;
 }
 
-void write_disk_history (void)
+static void write_disk_history2 (int type)
 {
        int i, j;
        TCHAR tmp[16];
        UAEREG *fkey;
 
-       fkey = regcreatetree (NULL, L"DiskImageMRUList");
+       fkey = regcreatetree (NULL, type ? L"CDImageMRUList" : L"DiskImageMRUList");
        if (fkey == NULL)
                return;
        j = 1;
        for (i = 0; i <= MAX_PREVIOUS_FLOPPIES; i++) {
-               TCHAR *s = DISK_history_get (i);
+               TCHAR *s = DISK_history_get (i, type);
                if (s == 0 || _tcslen (s) == 0)
                        continue;
                _stprintf (tmp, L"Image%02d", j);
@@ -425,17 +446,24 @@ void write_disk_history (void)
        }
        regclosetree (fkey);
 }
+void write_disk_history (void)
+{
+       write_disk_history2 (HISTORY_FLOPPY);
+       write_disk_history2 (HISTORY_CD);
+}
 
 void reset_disk_history (void)
 {
        int i;
 
-       for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++)
-               DISK_history_add (NULL, i, 0);
+       for (i = 0; i < MAX_PREVIOUS_FLOPPIES; i++) {
+               DISK_history_add (NULL, i, HISTORY_FLOPPY, 0);
+               DISK_history_add (NULL, i, HISTORY_CD, 0);
+       }
        write_disk_history ();
 }
 
-UAEREG *read_disk_history (void)
+UAEREG *read_disk_history (int type)
 {
        static int regread;
        TCHAR tmp2[1000];
@@ -445,8 +473,8 @@ UAEREG *read_disk_history (void)
        TCHAR tmp[1000];
        DWORD size;
 
-       fkey = regcreatetree (NULL, L"DiskImageMRUList");
-       if (fkey == NULL || regread)
+       fkey = regcreatetree (NULL, type ? L"CDImageMRUList" : L"DiskImageMRUList");
+       if (fkey == NULL || (regread & (1 << type)))
                return fkey;
 
        idx = 0;
@@ -458,11 +486,11 @@ UAEREG *read_disk_history (void)
                if (_tcslen (tmp) == 7) {
                        idx2 = _tstol (tmp + 5) - 1;
                        if (idx2 >= 0)
-                               DISK_history_add (tmp2, idx2, TRUE);
+                               DISK_history_add (tmp2, idx2, type, TRUE);
                }
                idx++;
        }
-       regread = 1;
+       regread |= 1 << type;
        return fkey;
 }
 
@@ -1488,14 +1516,23 @@ static void gui_to_prefs (void)
        updatewinfsmode (&changed_prefs);
 }
 
+static int iscd (int n)
+{
+       if (quickstart_cd && n == 1)
+               return 1;
+       return 0;
+}
+
 static const GUID diskselectionguids[] = {
        { 0x4fa8fa15, 0xc209, 0x4112, { 0x94, 0x7b, 0xc6, 0x00, 0x8e, 0x1f, 0xa3, 0x29 } },
        { 0x32073f09, 0x752d, 0x4783, { 0x84, 0x6c, 0xaa, 0x66, 0x48, 0x84, 0x14, 0x45 } },
        { 0x8047f7ea, 0x8a42, 0x4695, { 0x94, 0x52, 0xf5, 0x0d, 0xb8, 0x43, 0x00, 0x58 } },
        { 0x2412c4e7, 0xf608, 0x4333, { 0x83, 0xd2, 0xa1, 0x2f, 0xdf, 0x66, 0xac, 0xe5 } },
        { 0xe3741dff, 0x11f2, 0x445f, { 0x94, 0xb0, 0xa3, 0xe7, 0x58, 0xe2, 0xcb, 0xb5 } },
-       { 0x2056d641, 0xba13, 0x4312, { 0xaa, 0x75, 0xc5, 0xeb, 0x52, 0xa8, 0x1c, 0xe3 } }
+       { 0x2056d641, 0xba13, 0x4312, { 0xaa, 0x75, 0xc5, 0xeb, 0x52, 0xa8, 0x1c, 0xe3 } },
+       { 0x05aa5db2, 0x470b, 0x4725, { 0x96, 0x03, 0xee, 0x61, 0x30, 0xfc, 0x54, 0x99 } }
 };
+
 static void getfilter (int num, TCHAR *name, int *filter, TCHAR *fname)
 {
        _tcscpy (fname, name);
@@ -1551,6 +1588,18 @@ static UINT_PTR CALLBACK ofnhook (HWND hDlg, UINT message, WPARAM wParam, LPARAM
        return FALSE;
 }
 
+static void selectdisk (struct uae_prefs *prefs, HWND hDlg, int num, int id, TCHAR *full_path)
+{
+       SetDlgItemText (hDlg, id, full_path);
+       if (iscd (num)) {
+               _tcscpy (prefs->cdimagefile, full_path);
+               DISK_history_add (full_path, -1, HISTORY_CD, 0);
+       } else {
+               _tcscpy(prefs->df[num], full_path);
+               DISK_history_add (full_path, -1, HISTORY_FLOPPY, 0);
+       }
+}
+
 
 // Common routine for popping up a file-requester
 // flag - 0 for floppy loading, 1 for floppy creation, 2 for loading hdf, 3 for saving hdf
@@ -1565,6 +1614,7 @@ static UINT_PTR CALLBACK ofnhook (HWND hDlg, UINT message, WPARAM wParam, LPARAM
 // flag = 14 for loading filesystem
 // flag = 15 for loading input
 // flag = 16 for recording input
+// flag = 17 for CD image
 int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, TCHAR *path_out, int *multi)
 {
        static int previousfilter[20];
@@ -1655,6 +1705,11 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
                        fetch_path (L"InputPath", init_path, sizeof (init_path) / sizeof (TCHAR));
                        guid = &diskselectionguids[5];
                        break;
+               case 17:
+                       getfilter(flag, L"CDPath", previousfilter, filtername);
+                       fetch_path (L"CDPath", init_path, sizeof (init_path) / sizeof (TCHAR));
+                       guid = &diskselectionguids[6];
+                       break;
                }
        }
 
@@ -1775,6 +1830,13 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
                _tcscpy (szFilter + _tcslen (szFilter) + 1, ARCHIVE_STRING);
                initialdir = path_out;
                break;
+       case 17:
+               WIN32GUI_LoadUIString (IDS_SELECTCD, szTitle, MAX_DPATH);
+               WIN32GUI_LoadUIString (IDS_CD, szFormat, MAX_DPATH);
+               _stprintf (szFilter, L"%s ", szFormat);
+               memcpy (szFilter + _tcslen (szFilter), CD_FORMAT_STRING, sizeof (CD_FORMAT_STRING) + sizeof (TCHAR));
+               defext = L"CUE";
+               break;
        }
        if (all) {
                p = szFilter;
@@ -1857,28 +1919,20 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
                        break;
                case IDC_DF0:
                case IDC_DF0QQ:
-                       SetDlgItemText (hDlg, IDC_DF0TEXT, full_path);
-                       _tcscpy(prefs->df[0], full_path);
-                       DISK_history_add (full_path, -1, 0);
+                       selectdisk (prefs, hDlg, 0, IDC_DF0TEXT, full_path);
                        next = IDC_DF1;
                        break;
                case IDC_DF1:
                case IDC_DF1QQ:
-                       SetDlgItemText (hDlg, IDC_DF1TEXT, full_path);
-                       _tcscpy(prefs->df[1], full_path);
-                       DISK_history_add (full_path, -1, 0);
+                       selectdisk (prefs, hDlg, 1, IDC_DF1TEXT, full_path);
                        next = IDC_DF2;
                        break;
                case IDC_DF2:
-                       SetDlgItemText (hDlg, IDC_DF2TEXT, full_path);
-                       _tcscpy(prefs->df[2], full_path);
-                       DISK_history_add (full_path, -1, 0);
+                       selectdisk (prefs, hDlg, 2, IDC_DF2TEXT, full_path);
                        next = IDC_DF3;
                        break;
                case IDC_DF3:
-                       SetDlgItemText (hDlg, IDC_DF3TEXT, full_path);
-                       _tcscpy (prefs->df[3], full_path);
-                       DISK_history_add (full_path, -1, 0);
+                       selectdisk (prefs, hDlg, 3, IDC_DF3TEXT, full_path);
                        break;
                case IDC_DOSAVESTATE:
                case IDC_DOLOADSTATE:
@@ -1942,6 +1996,12 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
                                        *amiga_path = 0;
                                        regsetstr (NULL, L"hdfPath", openFileName.lpstrFile);
                                }
+                       } else if (flag == 17) {
+                               amiga_path = _tcsstr (openFileName.lpstrFile, openFileName.lpstrFileTitle);
+                               if (amiga_path && amiga_path != openFileName.lpstrFile) {
+                                       *amiga_path = 0;
+                                       regsetstr (NULL, L"CDPath", openFileName.lpstrFile);
+                               }
                        }
                }
                if (!multi)
@@ -4136,11 +4196,6 @@ static struct amigamodels amodels[] = {
        { -1 }
 };
 
-static DWORD quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1, quickstart_floppy = 1;
-static int quickstart_ok, quickstart_ok_floppy;
-static void addfloppytype (HWND hDlg, int n);
-static void addfloppyhistory (HWND hDlg);
-
 static void enable_for_quickstart (HWND hDlg)
 {
        int v = quickstart_ok && quickstart_ok_floppy ? TRUE : FALSE;
@@ -4153,6 +4208,7 @@ static void load_quickstart (HWND hDlg, int romcheck)
        ew (guiDlg, IDC_RESETAMIGA, FALSE);
        workprefs.nr_floppies = quickstart_floppy;
        quickstart_ok = built_in_prefs (&workprefs, quickstart_model, quickstart_conf, quickstart_compa, romcheck);
+       quickstart_cd = workprefs.dfxtype[0] == DRV_NONE;
        enable_for_quickstart (hDlg);
        addfloppytype (hDlg, 0);
        addfloppytype (hDlg, 1);
@@ -4202,11 +4258,13 @@ static void init_quickstartdlg (HWND hDlg)
                regqueryint (NULL, L"QuickStartConfiguration", &quickstart_conf);
                regqueryint (NULL, L"QuickStartCompatibility", &quickstart_compa);
                regqueryint (NULL, L"QuickStartFloppies", &quickstart_floppy);
+               regqueryint (NULL, L"QuickStartCDType", &quickstart_cdtype);
                if (quickstart) {
                        workprefs.df[0][0] = 0;
                        workprefs.df[1][0] = 0;
                        workprefs.df[2][0] = 0;
                        workprefs.df[3][0] = 0;
+                       workprefs.cdimagefile[0] = 0;
                        load_quickstart (hDlg, 1);
                        quickstarthost (hDlg, hostconf);
                }
@@ -4281,7 +4339,7 @@ static void init_quickstartdlg (HWND hDlg)
        ew (hDlg, IDC_QUICKSTART_COMPATIBILITY, i > 1);
        SendDlgItemMessage (hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETRANGE, TRUE, MAKELONG (0, i > 1 ? i - 1 : 1));
        SendDlgItemMessage (hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETPAGESIZE, 0, 1);
-       SendDlgItemMessagehDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETPOS, TRUE, quickstart_compa);
+       SendDlgItemMessage (hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETPOS, TRUE, quickstart_compa);
 
        SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_RESETCONTENT, 0, 0L);
        WIN32GUI_LoadUIString (IDS_DEFAULT_HOST, tmp1, sizeof (tmp1) / sizeof (TCHAR));
@@ -4472,6 +4530,7 @@ static INT_PTR CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, L
                        case IDC_QUICKSTARTMODE:
                                quickstart = IsDlgButtonChecked (hDlg, IDC_QUICKSTARTMODE);
                                regsetint (NULL, L"QuickStartMode", quickstart);
+                               quickstart_cd = 0;
                                if (quickstart) {
                                        init_quickstartdlg (hDlg);
                                        load_quickstart (hDlg, 0);
@@ -4906,12 +4965,7 @@ static void display_fromselect (int val, int *fs, int *vsync, int p96)
        case 4:
                *fs = 2;
                if (workprefs.gfx_filter == 0 && *fs != ofs) {
-                       if (D3D_goodenough ()) {
-                               workprefs.gfx_filter = 2;
-                               workprefs.gfx_filter_filtermode = 2;
-                       } else {
-                               workprefs.gfx_filter = 1;
-                       }
+                       workprefs.gfx_filter = 1;
                        workprefs.gfx_filter_horiz_zoom = 0;
                        workprefs.gfx_filter_vert_zoom = 0;
                        workprefs.gfx_filter_horiz_zoom_mult = 0;
@@ -5418,7 +5472,7 @@ static void values_to_chipsetdlg2 (HWND hDlg)
        CheckDlgButton (hDlg, IDC_CS_COMPATIBLE, workprefs.cs_compatible);
        CheckDlgButton (hDlg, IDC_CS_RESETWARNING, workprefs.cs_resetwarning);
        CheckDlgButton (hDlg, IDC_CS_NOEHB, workprefs.cs_denisenoehb);
-       CheckDlgButton (hDlg, IDC_CS_BLITTERBUG, workprefs.cs_agnusbltbusybug);
+       CheckDlgButton (hDlg, IDC_CS_DIPAGNUS, workprefs.cs_dipagnus);
        CheckDlgButton (hDlg, IDC_CS_KSMIRROR_E0, workprefs.cs_ksmirror_e0);
        CheckDlgButton (hDlg, IDC_CS_KSMIRROR_A8, workprefs.cs_ksmirror_a8);
        CheckDlgButton (hDlg, IDC_CS_CIAOVERLAY, workprefs.cs_ciaoverlay);
@@ -5493,7 +5547,8 @@ static void values_from_chipsetdlg2 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
        workprefs.cs_compatible = IsDlgButtonChecked (hDlg, IDC_CS_COMPATIBLE);
        workprefs.cs_resetwarning = IsDlgButtonChecked (hDlg, IDC_CS_RESETWARNING);
        workprefs.cs_denisenoehb = IsDlgButtonChecked (hDlg, IDC_CS_NOEHB);
-       workprefs.cs_agnusbltbusybug = IsDlgButtonChecked (hDlg, IDC_CS_BLITTERBUG);
+       workprefs.cs_dipagnus = IsDlgButtonChecked (hDlg, IDC_CS_DIPAGNUS);
+       workprefs.cs_agnusbltbusybug = workprefs.cs_dipagnus;
        workprefs.cs_ksmirror_e0 = IsDlgButtonChecked (hDlg, IDC_CS_KSMIRROR_E0);
        workprefs.cs_ksmirror_a8 = IsDlgButtonChecked (hDlg, IDC_CS_KSMIRROR_A8);
        workprefs.cs_ciaoverlay = IsDlgButtonChecked (hDlg, IDC_CS_CIAOVERLAY);
@@ -5592,7 +5647,7 @@ static void enable_for_chipsetdlg2 (HWND hDlg)
        ew (hDlg, IDC_CS_CDTVRAMEXP, e);
        ew (hDlg, IDC_CS_RESETWARNING, e);
        ew (hDlg, IDC_CS_NOEHB, e);
-       ew (hDlg, IDC_CS_BLITTERBUG, e);
+       ew (hDlg, IDC_CS_DIPAGNUS, e);
        ew (hDlg, IDC_CS_KSMIRROR_E0, e);
        ew (hDlg, IDC_CS_KSMIRROR_A8, e);
        ew (hDlg, IDC_CS_CIAOVERLAY, e);
@@ -8611,16 +8666,16 @@ static void out_floppyspeed (HWND hDlg)
        SetDlgItemText (hDlg, IDC_FLOPPYSPDTEXT, txt);
 }
 
-#define BUTTONSPERFLOPPY 7
+#define BUTTONSPERFLOPPY 8
 static int floppybuttons[][BUTTONSPERFLOPPY] = {
-       { IDC_DF0TEXT,IDC_DF0,IDC_EJECT0,IDC_DF0TYPE,IDC_DF0WP,IDC_SAVEIMAGE0,IDC_DF0ENABLE },
-       { IDC_DF1TEXT,IDC_DF1,IDC_EJECT1,IDC_DF1TYPE,IDC_DF1WP,IDC_SAVEIMAGE1,IDC_DF1ENABLE },
-       { IDC_DF2TEXT,IDC_DF2,IDC_EJECT2,IDC_DF2TYPE,IDC_DF2WP,IDC_SAVEIMAGE2,IDC_DF2ENABLE },
-       { IDC_DF3TEXT,IDC_DF3,IDC_EJECT3,IDC_DF3TYPE,IDC_DF3WP,IDC_SAVEIMAGE3,IDC_DF3ENABLE }
+       { IDC_DF0TEXT,IDC_DF0,IDC_EJECT0,IDC_DF0TYPE,IDC_DF0WP,-1,IDC_SAVEIMAGE0,IDC_DF0ENABLE },
+       { IDC_DF1TEXT,IDC_DF1,IDC_EJECT1,IDC_DF1TYPE,IDC_DF1WP,-1,IDC_SAVEIMAGE1,IDC_DF1ENABLE },
+       { IDC_DF2TEXT,IDC_DF2,IDC_EJECT2,IDC_DF2TYPE,IDC_DF2WP,-1,IDC_SAVEIMAGE2,IDC_DF2ENABLE },
+       { IDC_DF3TEXT,IDC_DF3,IDC_EJECT3,IDC_DF3TYPE,IDC_DF3WP,-1,IDC_SAVEIMAGE3,IDC_DF3ENABLE }
 };
 static int floppybuttonsq[][BUTTONSPERFLOPPY] = {
-       { IDC_DF0TEXTQ,IDC_DF0QQ,IDC_EJECT0Q,-1,IDC_DF0WPQ,-1,IDC_DF0QENABLE },
-       { IDC_DF1TEXTQ,IDC_DF1QQ,IDC_EJECT1Q,-1,IDC_DF1WPQ,-1,IDC_DF1QENABLE },
+       { IDC_DF0TEXTQ,IDC_DF0QQ,IDC_EJECT0Q,-1,IDC_DF0WPQ,IDC_DF0WPTEXTQ,-1,IDC_DF0QENABLE },
+       { IDC_DF1TEXTQ,IDC_DF1QQ,IDC_EJECT1Q,-1,IDC_DF1WPQ,IDC_DF1WPTEXTQ,-1,IDC_DF1QENABLE },
        { -1,-1,-1,-1,-1,-1,-1 },
        { -1,-1,-1,-1,-1,-1,-1 }
 };
@@ -8648,18 +8703,31 @@ static void floppytooltip (HWND hDlg, int num, uae_u32 crc32)
        SendMessage (ToolTipHWND, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
 }
 
-static void addfloppyhistory_2 (HWND hDlg, UAEREG *fkey, int n, int f_text)
+static void addfloppyhistory_2 (HWND hDlg, int n, int f_text)
 {
        int i, j;
-       TCHAR *s;
-       int nn = workprefs.dfxtype[n] + 1;
+       TCHAR *s, *text;
+       UAEREG *fkey;
+       int nn, type;
 
        if (f_text < 0)
                return;
        SendDlgItemMessage (hDlg, f_text, CB_RESETCONTENT, 0, 0);
-       SendDlgItemMessage (hDlg, f_text, WM_SETTEXT, 0, (LPARAM)workprefs.df[n]);
+       if (iscd (n)) {
+               nn = 1;
+               type = HISTORY_CD;
+               text = workprefs.cdimagefile;
+       } else {
+               nn = workprefs.dfxtype[n] + 1;
+               type = HISTORY_FLOPPY;
+               text = workprefs.df[n];
+       }
+       fkey = read_disk_history (type);
+       if (fkey == NULL)
+               return;
+       SendDlgItemMessage (hDlg, f_text, WM_SETTEXT, 0, (LPARAM)text);
        i = 0;
-       while (s = DISK_history_get (i)) {
+       while (s = DISK_history_get (i, type)) {
                TCHAR tmpname[MAX_DPATH], tmppath[MAX_DPATH], *p, *p2;
                if (_tcslen (s) == 0)
                        break;
@@ -8687,18 +8755,18 @@ static void addfloppyhistory_2 (HWND hDlg, UAEREG *fkey, int n, int f_text)
                }
                if (f_text >= 0)
                        SendDlgItemMessage (hDlg, f_text, CB_ADDSTRING, 0, (LPARAM)tmpname);
-               if (!_tcscmp (workprefs.df[n], s)) {
+               if (!_tcscmp (text, s)) {
                        if (f_text >= 0)
                                SendDlgItemMessage (hDlg, f_text, CB_SETCURSEL, i - 1, 0);
                }
                if (nn <= 0)
                        break;
        }
+       regclosetree (fkey);
 }
 
 static void addfloppyhistory (HWND hDlg)
 {
-       UAEREG *fkey;
        int f_text, max, n;
 
        if (currentpage == QUICKSTART_ID)
@@ -8709,7 +8777,6 @@ static void addfloppyhistory (HWND hDlg)
                max = 1;
        else
                return;
-       fkey = read_disk_history ();
        for (n = 0; n < max; n++) {
                if (currentpage == QUICKSTART_ID)
                        f_text = floppybuttonsq[n][0];
@@ -8717,32 +8784,71 @@ static void addfloppyhistory (HWND hDlg)
                        f_text = floppybuttons[n][0];
                else
                        f_text = IDC_DISKTEXT;
-               addfloppyhistory_2 (hDlg, fkey, n, f_text);
+               addfloppyhistory_2 (hDlg, n, f_text);
+       }
+}
+
+static void ejectfloppy (int n)
+{
+       if (iscd (n)) {
+               workprefs.cdimagefile[0] = 0;
+               quickstart_cdtype = 0;
+       } else {
+               workprefs.df[n][0] = 0;
        }
-       regclosetree (fkey);
 }
 
 static void addfloppytype (HWND hDlg, int n)
 {
        int state, chk;
        int nn = workprefs.dfxtype[n] + 1;
+       int showcd = 0;
+       TCHAR *text;
 
        int f_text = floppybuttons[n][0];
        int f_drive = floppybuttons[n][1];
        int f_eject = floppybuttons[n][2];
        int f_type = floppybuttons[n][3];
        int f_wp = floppybuttons[n][4];
-       int f_si = floppybuttons[n][5];
-       int f_enable = floppybuttons[n][6];
+       int f_wptext = floppybuttons[n][5];
+       int f_si = floppybuttons[n][6];
+       int f_enable = floppybuttons[n][7];
 
+       text = workprefs.df[n];
        if (currentpage == QUICKSTART_ID) {
                f_text = floppybuttonsq[n][0];
                f_drive = floppybuttonsq[n][1];
                f_type = -1;
                f_eject = floppybuttonsq[n][2];
                f_wp = floppybuttonsq[n][4];
+               f_wptext = floppybuttonsq[n][5];
                f_si = -1;
-               f_enable = floppybuttonsq[n][6];
+               f_enable = floppybuttonsq[n][7];
+               if (iscd (n))
+                       showcd = 1;
+               if (showcd) {
+                       nn = 1;
+                       hide (hDlg, f_wp, 1);
+                       hide (hDlg, f_wptext, 1);
+                       ew (hDlg, f_enable, FALSE);
+                       SetWindowText (GetDlgItem (hDlg, f_enable), L"CD");
+                       SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_RESETCONTENT, 0, 0L);
+                       SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_ADDSTRING, 0, (LPARAM)L"Autodetect");
+                       SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_ADDSTRING, 0, (LPARAM)L"Image file");
+                       if (workprefs.cdimagefile[0])
+                               quickstart_cdtype = 1;
+                       SendDlgItemMessage (hDlg, IDC_CD0Q_TYPE, CB_SETCURSEL, quickstart_cdtype, 0);
+                       hide (hDlg, IDC_CD0Q_TYPE, 0);
+                       text = workprefs.cdimagefile;
+               } else {
+                       hide (hDlg, f_wp, 0);
+                       hide (hDlg, f_wptext, 0);
+               }
+       }
+       if (!showcd && f_enable > 0 && n == 1 && currentpage == QUICKSTART_ID) {
+               ew (hDlg, f_enable, TRUE);
+               SetWindowText (GetDlgItem (hDlg, f_enable), L"Floppy drive DF1:");
+               hide (hDlg, IDC_CD0Q_TYPE, 1);
        }
 
        if (nn <= 0)
@@ -8752,7 +8858,7 @@ static void addfloppytype (HWND hDlg, int n)
        if (f_type >= 0)
                SendDlgItemMessage (hDlg, f_type, CB_SETCURSEL, nn, 0);
        if (f_si >= 0)
-               ShowWindow (GetDlgItem(hDlg, f_si), zfile_exists (DISK_get_saveimagepath (workprefs.df[n])) ? SW_SHOW : SW_HIDE);
+               ShowWindow (GetDlgItem(hDlg, f_si), !showcd && zfile_exists (DISK_get_saveimagepath (text)) ? SW_SHOW : SW_HIDE);
 
        if (f_text >= 0)
                ew (hDlg, f_text, state);
@@ -8761,18 +8867,21 @@ static void addfloppytype (HWND hDlg, int n)
        if (f_drive >= 0)
                ew (hDlg, f_drive, state);
        if (f_enable >= 0) {
-               if (currentpage == QUICKSTART_ID)
-                       ew (hDlg, f_enable, n > 0 && workprefs.nr_floppies > 0);
-               else
+               if (currentpage == QUICKSTART_ID) {
+                       ew (hDlg, f_enable, (n > 0 && workprefs.nr_floppies > 0) && !showcd);
+               } else {
                        ew (hDlg, f_enable, TRUE);
+               }
                CheckDlgButton(hDlg, f_enable, state ? BST_CHECKED : BST_UNCHECKED);
        }
-       chk = disk_getwriteprotect (workprefs.df[n]) && state == TRUE ? BST_CHECKED : 0;
+       chk = !showcd && disk_getwriteprotect (text) && state == TRUE ? BST_CHECKED : 0;
        if (f_wp >= 0)
                CheckDlgButton(hDlg, f_wp, chk);
-       chk = state && DISK_validate_filename (workprefs.df[n], 0, NULL, NULL) ? TRUE : FALSE;
-       if (f_wp >= 0)
+       chk = !showcd && state && DISK_validate_filename (text, 0, NULL, NULL) ? TRUE : FALSE;
+       if (f_wp >= 0) {
                ew (hDlg, f_wp, chk);
+               ew (hDlg, f_wptext, chk);
+       }
 }
 
 static void getfloppytype (HWND hDlg, int n)
@@ -8787,11 +8896,13 @@ static void getfloppytype (HWND hDlg, int n)
 }
 static void getfloppytypeq (HWND hDlg, int n)
 {
-       int f_enable = currentpage == QUICKSTART_ID ? floppybuttonsq[n][6] : floppybuttons[n][6];
+       int f_enable = currentpage == QUICKSTART_ID ? floppybuttonsq[n][7] : floppybuttons[n][7];
        int chk;
 
        if (f_enable <= 0 || (n == 0 && currentpage == QUICKSTART_ID))
                return;
+       if (iscd (n))
+               return;
        chk = IsDlgButtonChecked (hDlg, f_enable) ? 0 : -1;
        if (chk != workprefs.dfxtype[n]) {
                workprefs.dfxtype[n] = chk;
@@ -8806,7 +8917,7 @@ static void getfloppytypeq (HWND hDlg, int n)
        }
 }
 
-static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen)
+static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen, int type)
 {
        LRESULT val;
        TCHAR *p1, *p2, *p;
@@ -8832,9 +8943,9 @@ static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen)
        }
        xfree (tmp);
        i = 0;
-       while ((p = DISK_history_get (i))) {
+       while ((p = DISK_history_get (i, type))) {
                if (!_tcscmp (p, out)) {
-                       DISK_history_add (out, -1, 0);
+                       DISK_history_add (out, -1, type, 0);
                        break;
                }
                i++;
@@ -8845,11 +8956,16 @@ static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen)
 static void getfloppyname (HWND hDlg, int n)
 {
        int f_text = currentpage == QUICKSTART_ID ? floppybuttonsq[n][0] : floppybuttons[n][0];
+       int cd = iscd (n);
        TCHAR tmp[MAX_DPATH];
 
-       if (getfloppybox (hDlg, f_text, tmp, sizeof (tmp) / sizeof (TCHAR))) {
-               disk_insert (n, tmp);
-               _tcscpy (workprefs.df[n], tmp);
+       if (getfloppybox (hDlg, f_text, tmp, sizeof (tmp) / sizeof (TCHAR), cd ? HISTORY_CD : HISTORY_FLOPPY)) {
+               if (!cd) {
+                       disk_insert (n, tmp);
+                       _tcscpy (workprefs.df[n], tmp);
+               } else {
+                       _tcscpy (workprefs.cdimagefile, tmp);
+               }
        }
 }
 
@@ -8864,13 +8980,18 @@ static void addallfloppies (HWND hDlg)
 
 static void floppysetwriteprotect (HWND hDlg, int n, int protect)
 {
-       disk_setwriteprotect (n, workprefs.df[n], protect);
-       addfloppytype (hDlg, n);
+       if (!iscd (n)) {
+               disk_setwriteprotect (n, workprefs.df[n], protect);
+               addfloppytype (hDlg, n);
+       }
 }
 
 static void deletesaveimage (HWND hDlg, int num)
 {
-       TCHAR *p = DISK_get_saveimagepath (workprefs.df[num]);
+       TCHAR *p;
+       if (!iscd (num))
+               return;
+       p = DISK_get_saveimagepath (workprefs.df[num]);
        if (zfile_exists (p)) {
                DeleteFile (p);
                DISK_reinsert (num);
@@ -8880,11 +9001,14 @@ static void deletesaveimage (HWND hDlg, int num)
 
 static void diskselect (HWND hDlg, WPARAM wParam, struct uae_prefs *p, int drv, TCHAR *defaultpath)
 {
-       MultiDiskSelection (hDlg, wParam, 0, &workprefs, defaultpath);
-       disk_insert (0, p->df[0]);
-       disk_insert (1, p->df[1]);
-       disk_insert (2, p->df[2]);
-       disk_insert (3, p->df[3]);
+       int cd = iscd (drv);
+       MultiDiskSelection (hDlg, wParam, cd ? 17 : 0, &workprefs, defaultpath);
+       if (!cd) {
+               disk_insert (0, p->df[0]);
+               disk_insert (1, p->df[1]);
+               disk_insert (2, p->df[2]);
+               disk_insert (3, p->df[3]);
+       }
        addfloppytype (hDlg, drv);
        addfloppyhistory (hDlg);
 }
@@ -9079,24 +9203,24 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA
                case IDC_EJECT0Q:
                        SetDlgItemText (hDlg, IDC_DF0TEXT, L"");
                        SetDlgItemText (hDlg, IDC_DF0TEXTQ, L"");
-                       workprefs.df[0][0] = 0;
+                       ejectfloppy (0);
                        addfloppytype (hDlg, 0);
                        break;
                case IDC_EJECT1:
                case IDC_EJECT1Q:
                        SetDlgItemText (hDlg, IDC_DF1TEXT, L"");
                        SetDlgItemText (hDlg, IDC_DF1TEXTQ, L"");
-                       workprefs.df[1][0] = 0;
+                       ejectfloppy (1);
                        addfloppytype (hDlg, 1);
                        break;
                case IDC_EJECT2:
                        SetDlgItemText (hDlg, IDC_DF2TEXT, L"");
-                       workprefs.df[2][0] = 0;
+                       ejectfloppy (2);
                        addfloppytype (hDlg, 2);
                        break;
                case IDC_EJECT3:
                        SetDlgItemText (hDlg, IDC_DF3TEXT, L"");
-                       workprefs.df[3][0] = 0;
+                       ejectfloppy (3);
                        addfloppytype (hDlg, 3);
                        break;
                case IDC_SAVEIMAGE0:
@@ -9313,7 +9437,7 @@ static INT_PTR CALLBACK SwapperDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR
 
                        case IDC_DISKLISTINSERT:
                                if (entry >= 0) {
-                                       if (getfloppybox (hDlg, IDC_DISKTEXT, tmp, sizeof (tmp) / sizeof (TCHAR))) {
+                                       if (getfloppybox (hDlg, IDC_DISKTEXT, tmp, sizeof (tmp) / sizeof (TCHAR), HISTORY_FLOPPY)) {
                                                _tcscpy (workprefs.dfxlist[entry], tmp);
                                                addfloppyhistory (hDlg);
                                                InitializeListView (hDlg);
@@ -10563,6 +10687,9 @@ static void enable_for_hw3ddlg (HWND hDlg)
                vv3 = TRUE;
        if (v && uf->x[0])
                vv4 = TRUE;
+       if (workprefs.gfx_api)
+               v = vv = vv2 = vv3 = vv4 = TRUE;
+
        ew (hDlg, IDC_FILTERHZ, v);
        ew (hDlg, IDC_FILTERVZ, v);
        ew (hDlg, IDC_FILTERHZMULT, v && !as);
@@ -10604,7 +10731,8 @@ struct filterxtra {
        int *varw, *varc;
        int min, max, step;
 };
-static struct filterxtra *filter_extra, *filter_selected;
+static struct filterxtra *filter_extra[4], *filter_selected;
+static int filter_selected_num;
 
 static struct filterxtra filter_pal_extra[] =
 {
@@ -10619,6 +10747,7 @@ static struct filterxtra filter_pal_extra[] =
 };
 static struct filterxtra filter_3d_extra[] =
 {
+       L"Bilinear", &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1,
        L"Scanline transparency", &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
        L"Scanline level", &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10,
        NULL
@@ -10635,7 +10764,7 @@ static int *filtervars[] = {
        &workprefs.gfx_filter_luminance, &workprefs.gfx_filter_contrast, &workprefs.gfx_filter_saturation,
        &workprefs.gfx_filter_gamma, &workprefs.gfx_filter_blur, &workprefs.gfx_filter_noise,
        &workprefs.gfx_filter_keep_aspect, &workprefs.gfx_filter_aspect,
-       &workprefs.gfx_filter_autoscale,
+       &workprefs.gfx_filter_autoscale, &workprefs.gfx_filter_bilinear,
        NULL
 };
 static int *filtervars2[] = {
@@ -10649,7 +10778,7 @@ static int *filtervars2[] = {
        &currprefs.gfx_filter_luminance, &currprefs.gfx_filter_contrast, &currprefs.gfx_filter_saturation,
        &currprefs.gfx_filter_gamma, &currprefs.gfx_filter_blur, &currprefs.gfx_filter_noise,
        &currprefs.gfx_filter_keep_aspect, &currprefs.gfx_filter_aspect,
-       &workprefs.gfx_filter_autoscale,
+       &currprefs.gfx_filter_autoscale, &currprefs.gfx_filter_bilinear,
        NULL
 };
 
@@ -10660,8 +10789,8 @@ struct filterpreset {
 static struct filterpreset filterpresets[] =
 {
        { L"PAL",                               UAE_FILTER_PAL,                 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0,  0, 0 },
-       { L"D3D Autoscale",             UAE_FILTER_DIRECT3D,    2, 0, 0, 0, 0, 0, 0,  0, 0, 0, 1, 1, 0, 0, 0,  0, 0, 0, 0,   0,  0, 0, -1, 1 },
-       { L"D3D Full Scaling",  UAE_FILTER_DIRECT3D,    2, 0, 0, 0, 0, 0, 0,  0, 0, 0, 1, 1, 0, 0, 0,  0, 0, 0, 0,   0,  0, 0, -1, 0 },
+       { L"D3D Autoscale",             0,                          2, 0, 0, 0, 0, 0, 0,  0, 0, 0, 1, 1, 0, 0, 0,  0, 0, 0, 0,   0,  0, 0, -1, 1 },
+       { L"D3D Full Scaling",  0,                          2, 0, 0, 0, 0, 0, 0,  0, 0, 0, 1, 1, 0, 0, 0,  0, 0, 0, 0,   0,  0, 0, -1, 0 },
        { NULL }
 };
 
@@ -10722,8 +10851,9 @@ static void setfiltermult (HWND hDlg)
 static void values_to_hw3ddlg (HWND hDlg)
 {
        TCHAR txt[100], tmp[100];
-       int i, j, nofilter, fltnum, modenum;
+       int i, j, fltnum, modenum;
        struct uae_filter *uf;
+       int fxidx = 0, fxcnt;
        UAEREG *fkey;
 
        SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_SETCURSEL,
@@ -10736,6 +10866,7 @@ static void values_to_hw3ddlg (HWND hDlg)
                (workprefs.gfx_filter_aspect == 16 * 256 + 10) ? 6 : 0, 0);
 
        CheckDlgButton (hDlg, IDC_FILTERKEEPASPECT, workprefs.gfx_filter_keep_aspect);
+       CheckDlgButton (hDlg, IDC_FILTERD3D, workprefs.gfx_api);
 
        SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_SETCURSEL,
                workprefs.gfx_filter_keep_aspect, 0);
@@ -10762,35 +10893,15 @@ static void values_to_hw3ddlg (HWND hDlg)
        WIN32GUI_LoadUIString (IDS_NONE, tmp, MAX_DPATH);
        SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
        uf = &uaefilters[0];
-       nofilter = 0; fltnum = 0;
+       fltnum = 0;
        i = 0; j = 1;
        while (uaefilters[i].name) {
-               switch (uaefilters[i].type)
-               {
-#if 0
-#ifndef D3D
-               case UAE_FILTER_DIRECT3D:
-                       nofilter = 1;
-                       break;
-#endif
-#ifndef OPENGL
-               case UAE_FILTER_OPENGL:
-                       nofilter = 1;
-                       break;
-#endif
-#endif
-               default:
-                       nofilter = 0;
-                       break;
-               }
-               if (nofilter == 0) {
-                       SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)uaefilters[i].name);
-                       if (uaefilters[i].type == workprefs.gfx_filter) {
-                               uf = &uaefilters[i];
-                               fltnum = j;
-                       }
-                       j++;
+               SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)uaefilters[i].name);
+               if (uaefilters[i].type == workprefs.gfx_filter) {
+                       uf = &uaefilters[i];
+                       fltnum = j;
                }
+               j++;
                i++;
        }
        if (D3D_canshaders ()) {
@@ -10804,7 +10915,7 @@ static void values_to_hw3ddlg (HWND hDlg)
                        _stprintf (tmp2, L"D3D: %s", wfd.cFileName);
                        tmp2[_tcslen (tmp2) - 3] = 0;
                        SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp2);
-                       if (uf->type == UAE_FILTER_DIRECT3D && !_tcscmp (workprefs.gfx_filtershader, wfd.cFileName))
+                       if (workprefs.gfx_api && !_tcscmp (workprefs.gfx_filtershader, wfd.cFileName))
                                fltnum = j;
                        j++;
                        if (!FindNextFile (h, &wfd)) {
@@ -10815,24 +10926,13 @@ static void values_to_hw3ddlg (HWND hDlg)
        }
        SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_SETCURSEL, fltnum, 0);
 
-       filter_extra = NULL;
+       filter_extra[fxidx] = NULL;
        SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_RESETCONTENT, 0, 0L);
-       if (uf->x[0]) {
-               WIN32GUI_LoadUIString (IDS_3D_NO_FILTER, txt, sizeof (txt) / sizeof (TCHAR));
-               _stprintf (tmp, txt, 16);
-               SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
-               WIN32GUI_LoadUIString (IDS_3D_BILINEAR, txt, sizeof (txt) / sizeof (TCHAR));
-               _stprintf (tmp, txt, 16);
-               SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
-               WIN32GUI_LoadUIString (IDS_3D_NO_FILTER, txt, sizeof (txt) / sizeof (TCHAR));
-               _stprintf (tmp, txt, 32);
-               SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
-               WIN32GUI_LoadUIString (IDS_3D_BILINEAR, txt, sizeof (txt) / sizeof (TCHAR));
-               _stprintf (tmp, txt, 32);
-               SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp);
-               modenum = 4;
-               filter_extra = filter_3d_extra;
-       } else {
+       if (workprefs.gfx_api) {
+               filter_extra[fxidx++] = filter_3d_extra;
+               filter_extra[fxidx] = NULL;
+       }
+       if (!uf->x[0]) {
                modenum = 0;
                for (i = 1; i <= 4; i++) {
                        if (uf->x[i]) {
@@ -10842,35 +10942,43 @@ static void values_to_hw3ddlg (HWND hDlg)
                        }
                }
                if (uf->yuv) {
-                       filter_extra = filter_pal_extra;
+                       filter_extra[fxidx++] = filter_pal_extra;
+                       filter_extra[fxidx] = NULL;
                }
        }
        SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETRANGE, TRUE, MAKELONG (   0, +1000));
        SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPAGESIZE, 0, 1);
-       if (filter_extra) {
+       if (filter_extra[0]) {
+               struct filterxtra *prev = filter_selected;
                int idx2 = -1;
                int idx = SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_GETCURSEL, 0, 0L);
                if (idx == CB_ERR)
                        idx = -1;
+               fxcnt = 0;
+               filter_selected = &filter_extra[0][0];
                SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_RESETCONTENT, 0, 0L);
-               for (i = 0; filter_extra[i].label; i++) {
-                       if (filter_selected == &filter_extra[i] && idx < 0)
-                               idx2 = i;
-                       SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_ADDSTRING, 0, (LPARAM)filter_extra[i].label);
-               }
-               if (idx2 >= 0)
-                       filter_selected = &filter_extra[idx2];
-               else if (idx >= 0)
-                       filter_selected = &filter_extra[idx];
-               else
-                       filter_selected = &filter_extra[0];
-               SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_SETCURSEL, filter_selected - &filter_extra[0], 0);
+               for (j = 0; filter_extra[j]; j++) {
+                       struct filterxtra *fx = filter_extra[j];
+                       for (i = 0; fx[i].label; i++) {
+                               if (prev == &fx[i] && idx < 0) {
+                                       idx2 = i;
+                                       filter_selected = &fx[idx2];
+                                       filter_selected_num = fxcnt;
+                               }
+                               SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_ADDSTRING, 0, (LPARAM)fx[i].label);
+                               if (idx == 0) {
+                                       filter_selected = &fx[i];
+                                       filter_selected_num = fxcnt;
+                               }
+                               fxcnt++;
+                               idx--;
+                       }
+               }
+               SendDlgItemMessage (hDlg, IDC_FILTERXTRA, CB_SETCURSEL, filter_selected_num, 0);
                SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETRANGE, TRUE, MAKELONG (filter_selected->min, filter_selected->max));
                SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPAGESIZE, 0, filter_selected->step);
-               if (filter_selected) {
-                       SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPOS, TRUE, *(filter_selected->varw));
-                       SetDlgItemInt (hDlg, IDC_FILTERXLV, *(filter_selected->varw), TRUE);
-               }
+               SendDlgItemMessage (hDlg, IDC_FILTERXL, TBM_SETPOS, TRUE, *(filter_selected->varw));
+               SetDlgItemInt (hDlg, IDC_FILTERXLV, *(filter_selected->varw), TRUE);
        }
 
        if (workprefs.gfx_filter_filtermode >= modenum)
@@ -11044,10 +11152,10 @@ static void filter_handle (HWND hDlg)
                workprefs.gfx_filtershader[0] = 0;
                workprefs.gfx_filter = 0;
                if (item > 0) {
-                       item--;
-                       if (item > UAE_FILTER_PAL) {
-                               item = UAE_FILTER_DIRECT3D - 1;
+                       if (item > UAE_FILTER_LAST) {
                                _stprintf (workprefs.gfx_filtershader, L"%s.fx", tmp + 5);
+                       } else {
+                               item--;
                        }
                        workprefs.gfx_filter = uaefilters[item].type;
                        item = SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_GETCURSEL, 0, 0L);
@@ -11058,7 +11166,7 @@ static void filter_handle (HWND hDlg)
                                hw3d_changed = 1;
                        }
                }
-               if (workprefs.gfx_filter == 0)
+               if (workprefs.gfx_filter == 0 && !workprefs.gfx_api)
                        workprefs.gfx_filter_autoscale = 0;
        }
        enable_for_hw3ddlg (hDlg);
@@ -11125,6 +11233,9 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                        filter_preset (hDlg, wParam);
                        recursive++;
                        break;
+               case IDC_FILTERD3D:
+                       workprefs.gfx_api = IsDlgButtonChecked (hDlg, IDC_FILTERD3D) ? 1 : 0;
+                       break;
                case IDC_FILTERKEEPASPECT:
                        {
                                if (IsDlgButtonChecked (hDlg, IDC_FILTERKEEPASPECT))
@@ -12180,6 +12291,9 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
                        _tcscpy (savestate_fname, file);
                        ret = 1;
                        break;
+               case ZFILE_CDIMAGE:
+                       _tcscpy (workprefs.cdimagefile, file);
+                       break;
                default:
                        if (currentpage < 0 && !full_property_sheet) {
                                do_filesys_insert (file);
index 285d7534072d6e4c314ad3ca8a1834aa449a0b35..9dde7c730af9c775e11c8c3382c09a297a2fd0b6 100644 (file)
@@ -15,7 +15,7 @@ void InitializeListView (HWND hDlg);
 extern void pre_gui_message (const TCHAR*,...);
 extern void gui_message_id (int id);
 int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage);
-UAEREG *read_disk_history (void);
+UAEREG *read_disk_history (int type);
 void write_disk_history (void);
 
 struct newresource
index b18f7e492a7943714626cc7417bf62316ef25d22..306d1788f3c9135daae115a8833a2822dcada028 100644 (file)
@@ -1,4 +1,35 @@
 
+Beta 5:
+
+- save cdimage path to statefile (if set)
+- cdimage on the fly change support (CD32 CD detection may not always
+  notice it without reboot, something wrong with detection)
+- cd images inside archives supported but all tracks will be unpacked
+  before emulation starts = do not use with big images.. (this is
+  something that can be improved someday..)
+- GUI added (quickstart only). "Automatic" and "Image file" does not
+  really do anything, only tries to show that real CDs are still
+  autodetected like in older versions..
+- disk image selection always used DF0: (b4)
+- replaced advanced chipset blitter busy bug checkbox with A1000 Agnus
+  (DIP package 8361/8367) because there are more differences, first
+  vblank strobe is triggered on line 1, not line 0.. (Alcatraz Megademo
+  2) Perhaps someday this gets moved to main chipset panel.. Thanks to
+  yaqube for finding this hardware "feature" accidentally :)
+- more 68000 CE interrupt timing changes
+
+Big DirectDraw/Direct3D change. Anything can be broken..
+
+- Direct3D filter mode is now a checkbox, there is now DirectDraw
+  and Direct3D "render backend" (instead of DirectDraw and D3D
+  filter hack) All software filters are available in both modes
+  (of course pixel shader filters only in D3D mode) This is part of
+  graphics subsystem unification, RTG is still DirectDraw only.
+- point/bilinear setting moved to filter extra menu
+- 16bit/32bit setting removed, uses desktop/fullscreen depth, selects
+  16bit if selected software filter is 16bit only (and lets D3D do
+  the conversion automatically)
+
 Beta 4:
 
 - ADDX and SUBX timing updates
index d15433e049120833c701352f7a75bf74e139c8fe..05bea49cacb81d4678de34534d81012ad85b8608 100644 (file)
@@ -561,6 +561,8 @@ void restore_state (const TCHAR *filename)
                        end = restore_gayle (chunk);
                else if (!_tcscmp (name, L"IDE "))
                        end = restore_ide (chunk);
+               else if (!_tcsncmp (name, L"CDU", 3))
+                       end = restore_cd (name[3] - '0', chunk);
                else if (!_tcscmp (name, L"CONF"))
                        end = restore_configuration (chunk);
                else if (!_tcscmp (name, L"LOG "))
@@ -828,6 +830,14 @@ int save_state (const TCHAR *filename, const TCHAR *description)
                }
        }
 
+       for (i = 0; i < 10; i++) {
+               dst = save_cd (i, &len);
+               if (dst) {
+                       _stprintf (name, L"CDU%d", i);
+                       save_chunk (f, dst, len, name, 0);
+               }
+       }
+
        /* add fake END tag, makes it easy to strip CONF and LOG hunks */
        /* move this if you want to use CONF or LOG hunks when restoring state */
        zfile_fwrite (endhunk, 1, 8, f);
@@ -1478,7 +1488,12 @@ ACTION REPLAY
 Model (1,2,3)          4
 path to rom image
 RAM space              (depends on model)
-ROM CRC                 4
+ROM CRC             4
+
+"CDx "
+
+Flags               4 (bit 0 = scsi, bit 1 = ide, bit 2 = image)
+Path                  (for example image file or drive letter)
 
 END
 hunk "END " ends, remember hunk size 8!
diff --git a/zfile.c b/zfile.c
index ac4d3fd8a0d72204d4d92beadceaa6456f141aef..dc20de92d634684904504a9abf293ddf319857b0 100644 (file)
--- a/zfile.c
+++ b/zfile.c
@@ -268,6 +268,8 @@ int zfile_gettype (struct zfile *z)
                        return ZFILE_NVR;
                if (strcasecmp (ext, L"uae") == 0)
                        return ZFILE_CONFIGURATION;
+               if (strcasecmp (ext, L"cue") == 0)
+                       return ZFILE_CDIMAGE;
        }
        memset (buf, 0, sizeof (buf));
        zfile_fread (buf, 8, 1, z);
@@ -1083,10 +1085,13 @@ const TCHAR *uae_diskimageextensions[] =
 int zfile_is_ignore_ext (const TCHAR *name)
 {
        int i;
+       TCHAR *ext;
 
+       ext = _tcsrchr (name, '.');
+       if (!ext)
+               return 0;
        for (i = 0; uae_ignoreextensions[i]; i++) {
-               if (_tcslen(name) > _tcslen (uae_ignoreextensions[i]) &&
-                       !strcasecmp (uae_ignoreextensions[i], name + _tcslen (name) - _tcslen (uae_ignoreextensions[i])))
+               if (!strcasecmp (uae_ignoreextensions[i], ext))
                        return 1;
        }
        return 0;
@@ -1096,13 +1101,18 @@ int zfile_is_diskimage (const TCHAR *name)
 {
        int i;
 
+       TCHAR *ext = _tcsrchr (name, '.');
+       if (!ext)
+               return 0;
        i = 0;
        while (uae_diskimageextensions[i]) {
-               if (_tcslen (name) > 3 && !strcasecmp (name + _tcslen (name) - 4, uae_diskimageextensions[i]))
-                       return 1;
+               if (!strcasecmp (ext, uae_diskimageextensions[i]))
+                       return HISTORY_FLOPPY;
                i++;
        }
-       return 0;
+       if (!_tcsicmp (ext, L".cue"))
+               return HISTORY_CD;
+       return -1;
 }
 
 
@@ -1821,6 +1831,11 @@ struct zfile *zfile_fopen_data (const TCHAR *name, uae_u64 size, uae_u8 *data)
        return l;
 }
 
+uae_s64 zfile_size (struct zfile *z)
+{
+       return z->size;
+}
+
 uae_s64 zfile_ftell (struct zfile *z)
 {
        uae_s64 v;
index ea201503f86bbf6db30ed58785841b1093c2fb01..2b7cd94d3a6ba82a195cbbfaa8ccb496cde3044f 100644 (file)
@@ -137,6 +137,7 @@ struct zfile *archive_access_select (struct znode *parent, struct zfile *zf, uns
        TCHAR tmphist[MAX_DPATH];
        struct zfile *z = NULL;
        int we_have_file;
+       int diskimg;
        int canhistory = (zf->zfdmask & ZFD_DISKHISTORY) && !(zf->zfdmask & ZFD_CHECKONLY);
 
        if (retcode)
@@ -152,31 +153,31 @@ struct zfile *archive_access_select (struct znode *parent, struct zfile *zf, uns
        first = 1;
        zn = &zv->root;
        while (zn) {
-               int isok = 1, diskimg = 0;
-
+               int isok = 1;
+               
+               diskimg = -1;
                if (zn->type != ZNODE_FILE)
                        isok = 0;
                if (zfile_is_ignore_ext (zn->fullname))
                        isok = 0;
-               if (zfile_is_diskimage (zn->fullname))
-                       diskimg = 1;
+               diskimg = zfile_is_diskimage (zn->fullname);
                if (isok) {
                        if (tmphist[0]) {
 #ifndef _CONSOLE
-                               if (diskimg && canhistory)
-                                       DISK_history_add (tmphist, -1, 1);
+                               if (diskimg >= 0 && canhistory)
+                                       DISK_history_add (tmphist, -1, diskimg, 1);
 #endif
                                tmphist[0] = 0;
                                first = 0;
                        }
                        if (first) {
-                               if (diskimg)
+                               if (diskimg >= 0)
                                        _tcscpy (tmphist, zn->fullname);
                        } else {
                                _tcscpy (tmphist, zn->fullname);
 #ifndef _CONSOLE
-                               if (diskimg && canhistory)
-                                       DISK_history_add (tmphist, -1, 1);
+                               if (diskimg >= 0 && canhistory)
+                                       DISK_history_add (tmphist, -1, diskimg, 1);
 #endif
                                tmphist[0] = 0;
                        }
@@ -203,8 +204,9 @@ struct zfile *archive_access_select (struct znode *parent, struct zfile *zf, uns
                zn = zn->next;
        }
 #ifndef _CONSOLE
-       if (zfile_is_diskimage (zfile_getname (zf)) && first && tmphist[0] && canhistory)
-               DISK_history_add (zfile_getname (zf), -1, 1);
+       diskimg = zfile_is_diskimage (zfile_getname (zf));
+       if (diskimg >= 0 && first && tmphist[0] && canhistory)
+               DISK_history_add (zfile_getname (zf), -1, diskimg, 1);
 #endif
        zfile_fclose_archive (zv);
        if (z) {