]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2420b12
authorToni Wilen <twilen@winuae.net>
Tue, 14 Aug 2012 15:11:20 +0000 (18:11 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 14 Aug 2012 15:11:20 +0000 (18:11 +0300)
20 files changed:
cfgfile.cpp
custom.cpp
disk.cpp
drawing.cpp
filesys.cpp
include/disk.h
include/drawing.h
include/options.h
newcpu.cpp
od-win32/direct3d.cpp
od-win32/picasso96_win.cpp
od-win32/resources/resource
od-win32/resources/winuae.rc
od-win32/sounddep/sound.cpp
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt
sampler.cpp

index a3ab055134e0040790e7c4af710012cd5a703bc7..3664984b0851ea32f63c97f0936c1edb78e58104 100644 (file)
@@ -724,6 +724,9 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_write_bool (f, _T("sound_auto"), p->sound_auto);
        cfgfile_write_bool (f, _T("sound_stereo_swap_paula"), p->sound_stereo_swap_paula);
        cfgfile_write_bool (f, _T("sound_stereo_swap_ahi"), p->sound_stereo_swap_ahi);
+       cfgfile_dwrite (f, _T("sampler_frequency"), _T("%d"), p->sampler_freq);
+       cfgfile_dwrite (f, _T("sampler_buffer"), _T("%d"), p->sampler_buffer);
+       cfgfile_dwrite_bool (f, _T("sampler_stereo"), p->sampler_stereo);
 
        cfgfile_write_str (f, _T("comp_trustbyte"), compmode[p->comptrustbyte]);
        cfgfile_write_str (f, _T("comp_trustword"), compmode[p->comptrustword]);
@@ -1033,6 +1036,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_write (f, _T("gfxcard_size"), _T("%d"), p->rtgmem_size / 0x100000);
        cfgfile_write_str (f, _T("gfxcard_type"), rtgtype[p->rtgmem_type]);
        cfgfile_write_bool (f, _T("gfxcard_hardware_vblank"), p->rtg_hardwareinterrupt);
+       cfgfile_write_bool (f, _T("gfxcard_hardware_sprite"), p->rtg_hardwaresprite);
        cfgfile_write (f, _T("chipmem_size"), _T("%d"), p->chipmem_size == 0x20000 ? -1 : (p->chipmem_size == 0x40000 ? 0 : p->chipmem_size / 0x80000));
        cfgfile_dwrite (f, _T("megachipmem_size"), _T("%d"), p->z3chipmem_size / 0x100000);
 
@@ -1041,7 +1045,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        } else {
                cfgfile_write_str (f, _T("cpu_speed"), p->m68k_speed < 0 ? _T("max") : _T("real"));
        }
-       cfgfile_write (f, _T("cpu_throttle"), _T("%d"), p->m68k_speed_throttle);
+       cfgfile_write (f, _T("cpu_throttle"), _T("%.1f"), p->m68k_speed_throttle);
 
        /* do not reorder start */
        write_compatibility_cpu(f, p);
@@ -1093,6 +1097,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        write_filesys_config (p, f);
        if (p->filesys_no_uaefsdb)
                cfgfile_write_bool (f, _T("filesys_no_fsdb"), p->filesys_no_uaefsdb);
+       cfgfile_dwrite (f, _T("filesys_max_size"), _T("%d"), p->filesys_limit);
 #endif
        write_inputdevice_config (p, f);
 }
@@ -1487,6 +1492,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, _T("sound_volume_cd"), &p->sound_volume_cd, 1)
                || cfgfile_intval (option, value, _T("sound_stereo_separation"), &p->sound_stereo_separation, 1)
                || cfgfile_intval (option, value, _T("sound_stereo_mixing_delay"), &p->sound_mixed_stereo_delay, 1)
+               || cfgfile_intval (option, value, _T("sampler_frequency"), &p->sampler_freq, 1)
+               || cfgfile_intval (option, value, _T("sampler_buffer"), &p->sampler_buffer, 1)
 
                || cfgfile_intval (option, value, _T("gfx_framerate"), &p->gfx_framerate, 1)
                || cfgfile_intval (option, value, _T("gfx_width_windowed"), &p->gfx_size_win.width, 1)
@@ -1529,6 +1536,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, _T("gfx_contrast"), &p->gfx_contrast, 1)
                || cfgfile_intval (option, value, _T("gfx_gamma"), &p->gfx_gamma, 1)
                || cfgfile_string (option, value, _T("gfx_filter_mask"), p->gfx_filtermask, sizeof p->gfx_filtermask / sizeof (TCHAR))
+               || cfgfile_intval (option, value, _T("filesys_max_size"), &p->filesys_limit, 1)
 
 #endif
                || cfgfile_intval (option, value, _T("floppy0sound"), &p->floppyslots[0].dfxclick, 1)
@@ -1549,6 +1557,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                return 1;
 
        if (cfgfile_yesno (option, value, _T("use_debugger"), &p->start_debugger)
+               || cfgfile_yesno (option, value, _T("sampler_stereo"), &p->sampler_stereo)
                || cfgfile_yesno (option, value, _T("sound_auto"), &p->sound_auto)
                || cfgfile_yesno (option, value, _T("sound_stereo_swap_paula"), &p->sound_stereo_swap_paula)
                || cfgfile_yesno (option, value, _T("sound_stereo_swap_ahi"), &p->sound_stereo_swap_ahi)
@@ -1680,14 +1689,14 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                while (s) {
                        if (!_tcschr (s, ':'))
                                break;
-                       p->osd_pos.x = _tstof (s) * 10.0;
+                       p->osd_pos.x =  (int)(_tstof (s) * 10.0);
                        s = _tcschr (s, ':');
                        if (!s)
                                break;
                        if (s[-1] == '%')
                                p->osd_pos.x += 30000;
                        s++;
-                       p->osd_pos.y = _tstof (s) * 10.0;
+                       p->osd_pos.y = (int)(_tstof (s) * 10.0);
                        s += _tcslen (s);
                        if (s[-1] == '%')
                                p->osd_pos.y += 30000;
@@ -2533,6 +2542,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_yesno (option, value, _T("agnus_bltbusybug"), &p->cs_agnusbltbusybug)
                || cfgfile_yesno (option, value, _T("fastmem_autoconfig"), &p->fastmem_autoconfig)
                || cfgfile_yesno (option, value, _T("gfxcard_hardware_vblank"), &p->rtg_hardwareinterrupt)
+               || cfgfile_yesno (option, value, _T("gfxcard_hardware_sprite"), &p->rtg_hardwaresprite)
 
                || cfgfile_yesno (option, value, _T("kickshifter"), &p->kickshifter)
                || cfgfile_yesno (option, value, _T("ntsc"), &p->ntscmode)
@@ -2556,6 +2566,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_yesno (option, value, _T("comp_lowopt"), &p->comp_lowopt)
                || cfgfile_yesno (option, value, _T("rtg_nocustom"), &p->picasso96_nocustom)
                || cfgfile_yesno (option, value, _T("floppy_write_protected"), &p->floppy_read_only)
+               || cfgfile_yesno (option, value, _T("floppy_auto_extended_adf"), &p->floppy_auto_ext2)
                || cfgfile_yesno (option, value, _T("uaeserial"), &p->uaeserial))
                return 1;
 
@@ -2736,7 +2747,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                p->m68k_speed *= CYCLE_UNIT;
                return 1;
        }
-       if (cfgfile_intval (option, value, _T("cpu_throttle"), &p->m68k_speed_throttle, 1)) {
+       if (cfgfile_doubleval (option, value, _T("cpu_throttle"), &p->m68k_speed_throttle)) {
                return 1;
        }
        if (cfgfile_intval (option, value, _T("finegrain_cpu_speed"), &p->m68k_speed, 1)) {
@@ -4131,6 +4142,9 @@ void default_prefs (struct uae_prefs *p, int type)
        p->sound_filter = FILTER_SOUND_EMUL;
        p->sound_filter_type = 0;
        p->sound_auto = 1;
+       p->sampler_stereo = false;
+       p->sampler_buffer = 0;
+       p->sampler_freq = 0;
 
        p->comptrustbyte = 0;
        p->comptrustword = 0;
@@ -4278,6 +4292,7 @@ void default_prefs (struct uae_prefs *p, int type)
        p->chipset_mask = CSMASK_ECS_AGNUS;
        p->genlock = 0;
        p->ntscmode = 0;
+       p->filesys_limit = 0;
 
        p->fastmem_size = 0x00000000;
        p->fastmem2_size = 0x00000000;
@@ -4508,7 +4523,7 @@ static void set_68020_compa (struct uae_prefs *p, int compa, int cd32)
 /* 0: cycle-exact
 * 1: more compatible
 * 2: no more compatible, no 100% sound
-* 3: no more compatible, immediate blits, no 100% sound
+* 3: no more compatible, waiting blits, no 100% sound
 */
 
 static void set_68000_compa (struct uae_prefs *p, int compa)
@@ -4525,7 +4540,6 @@ static void set_68000_compa (struct uae_prefs *p, int compa)
                p->cpu_compatible = 0;
                break;
        case 3:
-               p->immediate_blits = 1;
                p->produce_sound = 2;
                p->cpu_compatible = 0;
                break;
@@ -4543,7 +4557,6 @@ static int bip_a3000 (struct uae_prefs *p, int config, int compa, int romcheck)
        else
                roms[0] = 59;
        roms[1] = -1;
-       p->immediate_blits = 1;
        p->bogomem_size = 0;
        p->chipmem_size = 0x200000;
        p->cpu_model = 68030;
@@ -4572,7 +4585,7 @@ static int bip_a4000 (struct uae_prefs *p, int config, int compa, int romcheck)
        roms[2] = 13;
        roms[3] = 12;
        roms[4] = -1;
-       p->immediate_blits = 1;
+
        p->bogomem_size = 0;
        p->chipmem_size = 0x200000;
        p->mbresmem_low_size = 8 * 1024 * 1024;
@@ -4604,7 +4617,7 @@ static int bip_a4000t (struct uae_prefs *p, int config, int compa, int romcheck)
        roms[1] = 31;
        roms[2] = 13;
        roms[3] = -1;
-       p->immediate_blits = 1;
+
        p->bogomem_size = 0;
        p->chipmem_size = 0x200000;
        p->mbresmem_low_size = 8 * 1024 * 1024;
@@ -4959,7 +4972,7 @@ int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int r
                v = bip_super (p, config, compa, romcheck);
                break;
        }
-       if (p->cpu_model >= 68020 || !p->cpu_cycle_exact)
+       if ((p->cpu_model >= 68020 || !p->cpu_cycle_exact) && !p->immediate_blits)
                p->waiting_blits = 1;
        return v;
 }
index be3004132a2cd1622373020780410824f5bc1f7a..8192df5e5774e1e795bdf331cdb5cb81306f2ab4 100644 (file)
@@ -250,6 +250,7 @@ static bool bpl1dat_written, bpl1dat_early, bpl1dat_written_at_least_once;
 static uae_s16 bpl1mod, bpl2mod;
 static uaecptr prevbpl[2][MAXVPOS][8];
 static uaecptr bplpt[8], bplptx[8];
+static bool brdblank_prevframe[MAXVPOS];
 
 /*static int blitcount[256];  blitter debug */
 
@@ -891,6 +892,15 @@ static bool isehb (uae_u16 bplcon0, uae_u16 bplcon2)
        return bplehb;
 }
 
+static bool isbrdblank (uae_u16 bplcon0, uae_u16 bplcon3)
+{
+#ifdef ECS_DENISE
+       return (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (bplcon0 & 1) && (bplcon3 & 0x20);
+#else
+       return false;
+#endif
+}
+
 // OCS/ECS, lores, 7 planes = 4 "real" planes + BPL5DAT and BPL6DAT as static 5th and 6th plane
 STATIC_INLINE int isocs7planes (void)
 {
@@ -2041,8 +2051,11 @@ static void record_register_change (int hpos, int regno, uae_u16 value)
                if (value & 0x800)
                        thisline_decision.ham_seen = 1;
                thisline_decision.ehb_seen = isehb (value, bplcon2);
+               thisline_decision.brdblank_seen = isbrdblank (value, bplcon3);
        } else if (regno == 0x104) { // BPLCON2
-               thisline_decision.ehb_seen = isehb (value, bplcon2);
+               thisline_decision.ehb_seen = isehb (bplcon0, value);
+       } else if (regno == 0x106) { // BPLCON3
+               thisline_decision.brdblank_seen = isbrdblank (bplcon0, value);
        }
        record_color_change (hpos, regno + 0x1000, value);
 }
@@ -2644,6 +2657,12 @@ static void finish_decisions (void)
                changed = 1;
        }
 
+       /* if last frame's brdblank was different = mark line changed */
+       if (brdblank_prevframe[vpos] != thisline_decision.brdblank_seen) {
+               changed = 1;
+               brdblank_prevframe[vpos] = thisline_decision.brdblank_seen;
+       }
+
        if (changed) {
                thisline_changed = 1;
                *dp = thisline_decision;
@@ -2689,6 +2708,7 @@ static void reset_decisions (void)
        thisline_decision.plflinelen = -1;
        thisline_decision.ham_seen = !! (bplcon0 & 0x800);
        thisline_decision.ehb_seen = !! isehb (bplcon0, bplcon2);
+       thisline_decision.brdblank_seen = !! isbrdblank (bplcon0, bplcon3);
        thisline_decision.ham_at_start = !! (bplcon0 & 0x800);
 
        /* decided_res shouldn't be touched before it's initialized by decide_line(). */
@@ -2783,7 +2803,7 @@ void compute_vsynctime (void)
        if (currprefs.turbo_emulation)
                vsynctimebase = vsynctimebase_orig = 1;
        else
-               vsynctimebase = vsynctimebase_orig = syncbase / fake_vblank_hz;
+               vsynctimebase = vsynctimebase_orig = (int)(syncbase / fake_vblank_hz);
 #if 0
        if (!picasso_on) {
                updatedisplayarea ();
@@ -2881,7 +2901,7 @@ void compute_framesync (void)
                        if (isvsync_chipset ()) {
                                if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
                                        if ((fabs (vblank_hz - 50) < 1 || fabs (vblank_hz - 60) < 1 || fabs (vblank_hz - 100) < 1 || fabs (vblank_hz - 120) < 1) && currprefs.gfx_apmode[0].gfx_vsync == 2 && currprefs.gfx_apmode[0].gfx_fullscreen > 0) {
-                                               vsync_switchmode (vblank_hz);
+                                               vsync_switchmode ((int)vblank_hz);
                                        }
                                }
                                if (isvsync_chipset () < 0) {
@@ -3791,7 +3811,7 @@ void set_picasso_hack_rate (int hz)
        if (!picasso_on)
                return;
        vpos_count = 0;
-       p96refresh_active = maxvpos_stored * vblank_hz_stored / hz;
+       p96refresh_active = (int)(maxvpos_stored * vblank_hz_stored / hz);
        if (!currprefs.cs_ciaatod)
                changed_prefs.cs_ciaatod = currprefs.cs_ciaatod = currprefs.ntscmode ? 2 : 1;
        if (p96refresh_active > 0) {
@@ -4392,6 +4412,8 @@ static void checkautoscalecol0 (void)
                return;
        if (vpos < 20)
                return;
+       if (isbrdblank (bplcon0, bplcon3))
+               return;
        // autoscale if copper changes COLOR00 on top or bottom of screen
        if (vpos >= minfirstline) {
                int vpos2 = autoscale_bordercolors ? minfirstline : vpos;
@@ -5480,7 +5502,7 @@ static bool framewait (void)
                        if (val > vsynctimebase * 2 / 3)
                                val = vsynctimebase * 2 / 3;
 
-                       max = (vsynctimebase - val) * (1000 + currprefs.m68k_speed_throttle) / 1000;
+                       max = (int)((vsynctimebase - val) * (1000.0 + currprefs.m68k_speed_throttle) / 1000.0);
                        if (max < 1)
                                max = 1;
 
@@ -5618,7 +5640,7 @@ static bool framewait (void)
                if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vstb / 2)
                        adjust += curr_time - vsyncwaittime;
                adjust += clockadjust;
-               max = vstb * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
+               max = (int)(vstb * (1000.0 + currprefs.m68k_speed_throttle) / 1000.0 - adjust);
                vsyncwaittime = curr_time + vstb - adjust;
                vsyncmintime = curr_time;
 
index eb47c134c19a2042de1716de03bfc76c50723e7e..eca83f16aed5b84ae36063a9ca0418e3c9c57197 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -2036,6 +2036,8 @@ static int drive_write_ext2 (uae_u16 *bigmfmbuf, struct zfile *diskfile, trackid
        return 1;
 }
 
+static void drive_write_data (drive * drv);
+
 static bool convert_adf_to_ext2 (drive *drv)
 {
        TCHAR name[MAX_DPATH];
@@ -2047,16 +2049,26 @@ static bool convert_adf_to_ext2 (drive *drv)
        _tcscpy (name, currprefs.floppyslots[drv - floppy].df);
        if (!name[0])
                return false;
-       _tcscat (name, _T(".extended.adf"));
-       if (!disk_creatediskfile (name, 1, hd ? DRV_35_HD : DRV_35_DD, NULL, false, false, currprefs.floppyslots[drv - floppy].df))
+       TCHAR *p = _tcsrchr (name, '.');
+       if (!p)
+               p = name + _tcslen (name);
+       _tcscpy (p, _T(".extended.adf"));
+       if (!disk_creatediskfile (name, 1, hd ? DRV_35_HD : DRV_35_DD, NULL, false, false, drv->diskfile))
                return false;
        f = zfile_fopen (name, _T("rb"), 0);
        if (!f)
                return false;
+       _tcscpy (currprefs.floppyslots[drv - floppy].df, name);
+       _tcscpy (changed_prefs.floppyslots[drv - floppy].df, name);
        zfile_fclose (drv->diskfile);
        drv->diskfile = f;
-       read_header_ext2 (drv->diskfile, drv->trackdata, &drv->num_tracks, &drv->ddhd);
        drv->filetype = ADF_EXT2;
+       read_header_ext2 (drv->diskfile, drv->trackdata, &drv->num_tracks, &drv->ddhd);
+
+       drive_write_data (drv);
+#ifdef RETROPLATFORM
+       rp_disk_image_change (drv - &floppy[0], name, false);
+#endif
        drive_fill_bigbuf (drv, 1);
 
        return true;
@@ -2080,10 +2092,7 @@ static void drive_write_data (drive * drv)
        case ADF_NORMAL:
                if (drive_write_adf_amigados (drv)) {
                        if (currprefs.floppy_auto_ext2) {
-                               if (convert_adf_to_ext2 (drv)) {
-                                       drive_write_data (drv);
-                                       return;
-                               }
+                               convert_adf_to_ext2 (drv);
                        } else {
                                static int warned;
                                if (!warned)
@@ -2176,14 +2185,15 @@ static void floppy_get_rootblock (uae_u8 *dst, int block, const TCHAR *disk_name
 
 /* type: 0=regular, 1=ext2adf */
 /* adftype: 0=DD,1=HD,2=DD PC,3=HD PC,4=525SD */
-bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, const TCHAR *copyfrom)
+bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, struct zfile *copyfrom)
 {
        int size = 32768;
-       struct zfile *f, *sf;
+       struct zfile *f;
        int i, l, file_size, tracks, track_len, sectors;
        uae_u8 *chunk = NULL;
        int ddhd = 1;
        bool ok = false;
+       uae_u64 pos;
 
        if (type == 1)
                tracks = 2 * 83;
@@ -2206,9 +2216,8 @@ bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const
        }
 
        if (copyfrom) {
-               sf = zfile_fopen (copyfrom, _T("rb"), 0);
-               if (!sf)
-                       return false;
+               pos = zfile_ftell (copyfrom);
+               zfile_fseek (copyfrom, 0, SEEK_SET);
        }
 
        f = zfile_fopen (name, _T("wb"), 0);
@@ -2250,14 +2259,14 @@ bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const
                        for (i = 0; i < tracks; i++) {
                                uae_u8 tmp[3 * 4];
                                memcpy (tmp, rawtrack, sizeof rawtrack);
-                               if (dodos || sf)
+                               if (dodos || copyfrom)
                                        memcpy (tmp, dostrack, sizeof dostrack);
                                zfile_fwrite (tmp, sizeof tmp, 1, f);
                        }
                        for (i = 0; i < tracks; i++) {
                                memset (chunk, 0, size);
-                               if (sf) {
-                                       zfile_fread (chunk, 11 * ddhd, 512, sf);
+                               if (copyfrom) {
+                                       zfile_fread (chunk, 11 * ddhd, 512, copyfrom);
                                } else {
                                        if (dodos) {
                                                if (i == 0)
@@ -2273,7 +2282,8 @@ bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const
        }
        xfree (chunk);
        zfile_fclose (f);
-       zfile_fclose (sf);
+       if (copyfrom)
+               zfile_fseek (copyfrom, pos, SEEK_SET);
        if (f)
                DISK_history_add (name, -1, HISTORY_FLOPPY, TRUE);
        return ok;
index bd7d656a35cad0a4c96303bee82c45c304b3709f..49e96f784d22fdc93dac6849abcabe22a0b19b5a 100644 (file)
@@ -85,7 +85,6 @@ static int linedbl, linedbld;
 int interlace_seen = 0;
 #define AUTO_LORES_FRAMES 10
 static int can_use_lores = 0, frame_res, frame_res_lace, last_max_ypos;
-static uae_u16 bplcon0_store, bplcon3_store;
 
 /* Lookup tables for dual playfields.  The dblpf_*1 versions are for the case
 that playfield 1 has the priority, dbplpf_*2 are used if playfield 2 has
@@ -220,7 +219,7 @@ static int bplres;
 static int plf1pri, plf2pri, bplxor;
 static uae_u32 plf_sprite_mask;
 static int sbasecol[2] = { 16, 16 };
-static bool brdsprt, brdblank, brdblank_changed;
+static bool brdsprt, brdblank;
 static int hposblank;
 
 bool picasso_requested_on;
@@ -765,6 +764,7 @@ STATIC_INLINE xcolnr getbgc (bool blank)
                return xcolors[0x00f];
        else if (brdblank)
                return xcolors[0x880];
+       //return colors_for_drawing.acolors[0];
        return xcolors[0xf0f];
 #endif
        return (blank || brdblank || hposblank) ? 0 : colors_for_drawing.acolors[0];
@@ -1928,6 +1928,15 @@ STATIC_INLINE void do_flush_screen (struct vidbuffer *vb, int start, int stop)
                flush_screen (vb, 0, 0); /* vsync mode */
 }
 
+STATIC_INLINE void getbrdblank (void)
+{
+#ifdef ECS_DENISE
+       brdblank = dp_for_drawing->brdblank_seen;
+#else
+       brdblank = false;
+#endif
+}
+
 /* We only save hardware registers during the hardware frame. Now, when
 * drawing the frame, we expand the data into a slightly more useful
 * form. */
@@ -1944,6 +1953,7 @@ static void pfield_expand_dp_bplcon (void)
        issprites = dip_for_drawing->nr_sprites;
 #ifdef ECS_DENISE
        ecsshres = bplres == RES_SUPERHIRES && (currprefs.chipset_mask & CSMASK_ECS_DENISE) && !(currprefs.chipset_mask & CSMASK_AGA);
+       getbrdblank ();
 #endif
 
        plf1pri = dp_for_drawing->bplcon2 & 7;
@@ -1981,16 +1991,6 @@ static bool isham (uae_u16 bplcon0)
        return 0;
 }
 
-static void isbrdblank (void)
-{
-#ifdef ECS_DENISE
-       bool brdblank_2 = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (bplcon0_store & 1) && (bplcon3_store & 0x20);
-       if (brdblank_2 != brdblank)
-               brdblank_changed = true;
-       brdblank = brdblank_2;
-#endif
-}
-
 static void pfield_expand_dp_bplconx (int regno, int v)
 {
        if (regno == 0xffff) {
@@ -2005,8 +2005,6 @@ static void pfield_expand_dp_bplconx (int regno, int v)
                dp_for_drawing->bplres = GET_RES_DENISE (v);
                dp_for_drawing->nr_planes = GET_PLANES (v);
                dp_for_drawing->ham_seen = isham (v);
-               bplcon0_store = v;
-               isbrdblank ();
                break;
        case 0x104:
                dp_for_drawing->bplcon2 = v;
@@ -2014,8 +2012,6 @@ static void pfield_expand_dp_bplconx (int regno, int v)
 #ifdef ECS_DENISE
        case 0x106:
                dp_for_drawing->bplcon3 = v;
-               bplcon3_store = v;
-               isbrdblank ();
                break;
 #endif
 #ifdef AGA
@@ -2179,6 +2175,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
        if (xlinebuffer == 0)
                xlinebuffer = row_map[gfx_ypos], dh = dh_buf;
        xlinebuffer -= linetoscr_x_adjust_bytes;
+       getbrdblank ();
 
        if (border == 0) {
 
@@ -2771,17 +2768,6 @@ void finish_drawing_frame (void)
 
        if (!didflush)
                do_flush_screen (vb, first_drawn_line, last_drawn_line);
-
-
-#ifdef ECS_DENISE
-       if (brdblank_changed) {
-               last_max_ypos = max_ypos_thisframe;
-               for (i = 0; i < sizeof linestate / sizeof *linestate; i++)
-                       linestate[i] = LINE_UNDECIDED;
-               notice_screen_contents_lost ();
-               brdblank_changed = false;
-       }
-#endif
 }
 
 void hardware_line_completed (int lineno)
@@ -2901,11 +2887,6 @@ void vsync_handle_redraw (int long_frame, int lof_changed, uae_u16 bplcon0p, uae
                        flush_screen (gfxvidinfo.inbuffer, 0, 0); /* vsync mode */
        }
 
-       /* check borderblank here because bplcon0 or especially bplcon3 may only be written once outside of displayable area */
-       bplcon0_store = bplcon0p;
-       bplcon3_store = bplcon3p;
-       isbrdblank ();
-
        gui_flicker_led (-1, 0, 0);
 #ifdef AVIOUTPUT
        if (!picasso_on)
index 74dea908e684090d1d027793a870b988235e1958..85a057a707eca13c9381696ac3b76ca8d21400fb 100644 (file)
@@ -2598,13 +2598,15 @@ static void
        int ret, err = ERROR_NO_FREE_STORE;
        int blocksize, nr;
        uae_u32 dostype;
+       bool fs = false;
 
-       blocksize = 1204;
+       blocksize = 512;
        /* not FFS because it is not understood by WB1.x C:Info */
        dostype = DISK_TYPE_DOS;
        nr = unit->unit;
        if (unit->volflags & MYVOLUMEINFO_ARCHIVE) {
                ret = zfile_fs_usage_archive (unit->ui.rootdir, 0, &fsu);
+               fs = true;
        } else if (unit->volflags & MYVOLUMEINFO_CDFS) {
                struct isofs_info ii;
                ret = isofs_mediainfo (unit->ui.cdfs_superblock, &ii) ? 0 : 1;
@@ -2616,6 +2618,7 @@ static void
                ret = get_fs_usage (unit->ui.rootdir, 0, &fsu);
                if (ret)
                        err = dos_errno ();
+               fs = true;
        }
        if (ret != 0) {
                PUT_PCK_RES1 (packet, DOS_FALSE);
@@ -2637,7 +2640,14 @@ static void
                put_long (info + 24, -1); /* ID_NO_DISK_PRESENT */
                put_long (info + 28, 0);
        } else {
-               put_long (info + 12, fsu.fsu_blocks ); /* numblocks */
+               if (fs && currprefs.filesys_limit) {
+                       if (fsu.fsu_blocks > (uae_u64)currprefs.filesys_limit * 1024 / blocksize) {
+                               uae_u32 oldblocks = fsu.fsu_blocks;
+                               fsu.fsu_blocks = (uae_u32)((uae_u64)currprefs.filesys_limit * 1024 / blocksize);
+                               fsu.fsu_bavail = (uae_u32)((uae_u64)fsu.fsu_bavail * fsu.fsu_blocks / oldblocks);
+                       }
+               }
+               put_long (info + 12, fsu.fsu_blocks); /* numblocks */
                put_long (info + 16, fsu.fsu_blocks - fsu.fsu_bavail); /* inuse */
                put_long (info + 24, dostype); /* disk type */
                put_long (info + 28, unit->volume >> 2); /* volume node */
@@ -6620,7 +6630,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context)
                put_long (parmpacket + 80, DISK_TYPE_DOS); /* DOS\0 */
                if (type == FILESYS_VIRTUAL) {
                        put_long (parmpacket + 4, fsdevname);
-                       put_long (parmpacket + 20, 1024 >> 2); /* longwords per block */
+                       put_long (parmpacket + 20, 512 >> 2); /* longwords per block */
                        put_long (parmpacket + 28, 15); /* heads */
                        put_long (parmpacket + 32, 1); /* sectors per block */
                        put_long (parmpacket + 36, 127); /* sectors per track */
index 14586f207d2c7a4c93666bf52d44699f00b8302d..0f06b70368b624c4ad77aa34ecc5fc524613f8d9 100644 (file)
@@ -29,7 +29,7 @@ extern void DISK_hsync (void);
 extern void DISK_reset (void);
 extern int disk_getwriteprotect (struct uae_prefs *p, const TCHAR *name);
 extern int disk_setwriteprotect (struct uae_prefs *p, int num, const TCHAR *name, bool writeprotected);
-extern bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, const TCHAR *copyfrom);
+extern bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, struct zfile *copyfrom);
 extern void dumpdisk (void);
 extern int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck);
 extern TCHAR *DISK_history_get (int idx, int type);
index 7af4073e86494fbd3e4f359ebcc5892af3f01e3c..2f4ab3b7e10c794c628a7e8359649549d8229a14 100644 (file)
@@ -224,6 +224,7 @@ struct decision {
        uae_u8 nr_planes;
        uae_u8 bplres;
        bool ehb_seen;
+       bool brdblank_seen;
        bool ham_seen;
        bool ham_at_start;
 };
index f221aa1ac4ee516fdd616b92d3c0ac2444aba3b4..02ad4e697cf9c3215e5c1205fe29997a66e3f66b 100644 (file)
@@ -234,6 +234,10 @@ struct uae_prefs {
        bool sound_stereo_swap_ahi;
        bool sound_auto;
 
+       int sampler_freq;
+       int sampler_buffer;
+       bool sampler_stereo;
+
        int comptrustbyte;
        int comptrustword;
        int comptrustlong;
@@ -327,6 +331,7 @@ struct uae_prefs {
        uae_u32 maprom;
        int turbo_emulation;
        bool headless;
+       int filesys_limit;
 
        int cs_compatible;
        int cs_ciaatod;
@@ -386,7 +391,7 @@ struct uae_prefs {
        struct multipath path_cd;
 
        int m68k_speed;
-       int m68k_speed_throttle;
+       double m68k_speed_throttle;
        int cpu_model;
        int mmu_model;
        int cpu060_revision;
@@ -409,6 +414,7 @@ struct uae_prefs {
        uae_u32 mbresmem_high_size;
        uae_u32 rtgmem_size;
        bool rtg_hardwareinterrupt;
+       bool rtg_hardwaresprite;
        int rtgmem_type;
        uae_u32 custom_memory_addrs[MAX_CUSTOM_MEMORY_ADDRS];
        uae_u32 custom_memory_sizes[MAX_CUSTOM_MEMORY_ADDRS];
@@ -441,6 +447,8 @@ struct uae_prefs {
        bool win32_powersavedisabled;
        bool win32_minimize_inactive;
        int win32_statusbar;
+       bool win32_start_minimized;
+       bool win32_start_uncaptured;
 
        int win32_active_capture_priority;
        bool win32_active_nocapture_pause;
index dea56512b095b61dc5294f83bb36df88f736d1fd..786b82174a92848f760c1e0a340ad610c3c470c5 100644 (file)
@@ -1129,9 +1129,9 @@ static void update_68k_cycles (void)
        cycles_mult = 0;
        if (currprefs.m68k_speed >= 0 && !currprefs.cpu_cycle_exact) {
                if (currprefs.m68k_speed_throttle < 0) {
-                       cycles_mult = CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle);
+                       cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
                } else if (currprefs.m68k_speed_throttle > 0) {
-                       cycles_mult = CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle);
+                       cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
                }
        }
        if (currprefs.m68k_speed == 0 && currprefs.cpu_model >= 68020) {
index 824a7c58b6cce1e717d928904632b9054e6524ab..ed91ce7ae63b1f070125a2a1f7cbe86a01dc3fa0 100644 (file)
@@ -2443,14 +2443,14 @@ static void D3D_showframe2 (bool dowait)
                        sleep_millis (1);
                        continue;
                } else if (hr == S_PRESENT_OCCLUDED) {
-                       ;
+                       ; //write_log (_T("S_PRESENT_OCCLUDED\n"));
                } else if (hr == S_PRESENT_MODE_CHANGED) {
                        // In most cases mode actually didn't change but
                        // D3D is just being stupid and not accepting
                        // all modes that DirectDraw does accept,
                        // for example interlaced or EDS_RAWMODE modes!
                        //devicelost = 1;
-                       ;
+                       ; //write_log (_T("S_PRESENT_MODE_CHANGED\n"));
                } else if (FAILED (hr)) {
                        write_log (_T("%s: Present() %s\n"), D3DHEAD, D3D_ErrorString (hr));
                        if (hr == D3DERR_DEVICELOST || hr == S_PRESENT_MODE_CHANGED) {
index 1a1f9593bad84712f6be7514cb2f6252dc225919..823ce78de082870c76ca11c8e3136e3e2098fbf2 100644 (file)
@@ -2205,7 +2205,7 @@ static void inituaegfx (uaecptr ABI)
                write_log (_T("P96: Blitter disabled in devs:monitors/uaegfx!\n"));
        flags |= BIF_BLITTER | BIF_NOMEMORYMODEMIX;
        flags &= ~BIF_HARDWARESPRITE;
-       if (currprefs.gfx_api && D3D_goodenough () > 0 && USE_HARDWARESPRITE) {
+       if (currprefs.gfx_api && D3D_goodenough () > 0 && USE_HARDWARESPRITE && currprefs.rtg_hardwaresprite) {
                hwsprite = 1;
                flags |= BIF_HARDWARESPRITE;
                write_log (_T("P96: Hardware sprite support enabled\n"));
index 54d07991e89d03cd38c25a1d4a7c429cffc8989b..0f34f69175739c8f44d5e6f8e0860fc8c13d6336 100644 (file)
 #define IDC_CONTRIBUTORS                1124
 #define IDC_BLACKER_THAN_BLACK          1170
 #define IDC_BLITIMM                     1174
-#define IDC_BLITIMM2                    1175
 #define IDC_BLITWAIT                    1175
 #define IDC_LORES                       1176
 #define IDC_RATE2BOX                    1177
 #define IDC_WIDTHTEXT                   1512
 #define IDC_WINDOWEDTEXT                1512
 #define IDC_PORT2_TEST                  1512
+#define IDC_MAPDRIVES_LIMIT             1512
 #define IDC_HEIGHTTEXT                  1513
 #define IDC_PORT3_TEST                  1513
 #define IDC_SETTINGSTEXT                1514
 #define IDC_RTG_BUFFERCNT               1795
 #define IDC_RTG_VBINTERRUPT             1796
 #define IDC_INPUTMAPLIST                1797
+#define IDC_RTG_HWSPRITE                1797
 #define IDC_PORT1_REMAP                 1798
 #define IDC_PORT0_REMAP                 1799
 #define IDC_PORT2_REMAP                 1800
 #define IDC_RTG_DISPLAYSELECT           1809
 #define IDC_MISCLIST                    1810
 #define IDC_STATENAME                   1811
+#define IDC_SAMPLER_STEREO              1812
 #define ID__FLOPPYDRIVES                40004
 #define ID_FLOPPYDRIVES_DF0             40005
 #define ID_ST_CONFIGURATION             40010
index 47e0246e65569b9fa1493cd6f3bc63378fbf2f66..900d5f945bce82a9ddc53704f8781106e949ef72 100644 (file)
@@ -293,25 +293,28 @@ STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD
 EXSTYLE WS_EX_CONTEXTHELP\r
 FONT 8, "MS Sans Serif", 0, 0, 0x1\r
 BEGIN\r
-    CONTROL         "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,0,290,130\r
-    PUSHBUTTON      "Add &Directory or Archive...",IDC_NEW_FS,10,135,103,15\r
-    PUSHBUTTON      "Add &Hardfile...",IDC_NEW_HF,130,135,74,15\r
-    PUSHBUTTON      "Add Ha&rd Drive...",IDC_NEW_HD,220,135,75,15\r
-    PUSHBUTTON      "Remove",IDC_REMOVE,235,155,60,15\r
-    PUSHBUTTON      "&Properties",IDC_EDIT,235,172,60,15\r
-    CONTROL         "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,154,100,10\r
-    CONTROL         "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,154,119,10\r
-    CONTROL         "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,166,121,10\r
-    CONTROL         "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,178,101,10\r
-    CONTROL         "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,190,160,10\r
-    CONTROL         "Automount removable drives",IDC_MAPDRIVES_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,178,115,10\r
+    CONTROL         "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,0,290,116\r
+    PUSHBUTTON      "Add &Directory or Archive...",IDC_NEW_FS,10,121,103,15\r
+    PUSHBUTTON      "Add &Hardfile...",IDC_NEW_HF,130,121,74,15\r
+    PUSHBUTTON      "Add Ha&rd Drive...",IDC_NEW_HD,220,121,75,15\r
+    PUSHBUTTON      "Remove",IDC_REMOVE,235,141,60,15\r
+    PUSHBUTTON      "&Properties",IDC_EDIT,235,158,60,15\r
+    CONTROL         "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,140,100,10\r
+    CONTROL         "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,140,119,10\r
+    CONTROL         "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,152,121,10\r
+    CONTROL         "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,164,101,10\r
+    CONTROL         "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,176,136,10\r
+    CONTROL         "Automount removable drives [] Windows side insert or removal will immediately mount/remove it on Amiga side.",IDC_MAPDRIVES_AUTO,\r
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,164,115,10\r
     CONTROL         "Include removable drives..",IDC_MAPDRIVES_REMOVABLE,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,166,100,10\r
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,152,100,10\r
     COMBOBOX        IDC_CD_TEXT,5,224,289,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "Eject",IDC_CD_EJECT,265,204,30,15\r
     PUSHBUTTON      "Select image file",IDC_CD_SELECT,90,204,98,15\r
     COMBOBOX        IDC_CD_TYPE,194,205,63,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     LTEXT           "CD drive/image",IDC_STATIC,5,206,70,10,SS_CENTERIMAGE\r
+    CONTROL         "Limit size of directory drives to 1G [] Workaround for example old installers that calculate free space incorrectly if drive is large.",IDC_MAPDRIVES_LIMIT,\r
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,188,136,10\r
 END\r
 \r
 IDD_SOUND DIALOGEX 0, 0, 300, 237\r
@@ -381,11 +384,11 @@ BEGIN
     PUSHBUTTON      "Save As...",IDC_SAVE,175,225,44,15\r
 END\r
 \r
-IDD_IOPORTS DIALOGEX 0, 0, 300, 228\r
+IDD_IOPORTS DIALOGEX 0, 0, 305, 245\r
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
 FONT 8, "MS Sans Serif", 0, 0, 0x1\r
 BEGIN\r
-    GROUPBOX        "Parallel Port",IDC_STATIC,5,2,291,105\r
+    GROUPBOX        "Parallel Port",IDC_STATIC,5,2,291,120\r
     RTEXT           "Printer:",IDC_STATIC,12,15,25,15,SS_CENTERIMAGE\r
     COMBOBOX        IDC_PRINTERLIST,49,15,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "Flush print job",IDC_FLUSHPRINTER,114,51,58,12\r
@@ -393,24 +396,25 @@ BEGIN
     EDITTEXT        IDC_PRINTERAUTOFLUSH,255,50,25,12,ES_NUMBER\r
     RTEXT           "Type:",IDC_STATIC,15,33,21,15,SS_CENTERIMAGE\r
     EDITTEXT        IDC_PS_PARAMS,114,67,167,12,ES_AUTOHSCROLL\r
-    GROUPBOX        "Serial Port",IDC_STATIC,4,110,292,48\r
-    COMBOBOX        IDC_SERIAL,49,122,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,15,141,48,12\r
-    CONTROL         "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,75,141,55,12\r
-    RTEXT           "Out:",IDC_MIDI,10,172,19,15,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_MIDIOUTLIST,36,173,108,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    RTEXT           "In:",IDC_MIDI2,150,171,22,15,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_MIDIINLIST,181,173,108,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    GROUPBOX        "Serial Port",IDC_STATIC,4,124,292,48\r
+    COMBOBOX        IDC_SERIAL,49,136,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    CONTROL         "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,15,155,48,12\r
+    CONTROL         "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,75,155,55,12\r
+    RTEXT           "Out:",IDC_MIDI,10,186,19,15,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_MIDIOUTLIST,36,187,108,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    RTEXT           "In:",IDC_MIDI2,150,185,22,15,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_MIDIINLIST,181,187,108,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     CONTROL         "Direct []Use when emulating serial-link games on two PCs running WinUAE",IDC_SER_DIRECT,\r
-                    "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,135,141,65,12\r
-    CONTROL         "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,200,141,78,12\r
+                    "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,135,155,65,12\r
+    CONTROL         "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,200,155,78,12\r
     COMBOBOX        IDC_PRINTERTYPELIST,49,33,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     RTEXT           "Ghostscript extra parameters:",IDC_STATIC,10,66,102,15,SS_CENTERIMAGE\r
-    GROUPBOX        "MIDI",IDC_STATIC,5,161,291,34,BS_LEFT\r
-    GROUPBOX        "Protection Dongle",IDC_STATIC,5,197,292,30,BS_LEFT\r
-    COMBOBOX        IDC_DONGLELIST,50,208,232,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    RTEXT           "Sampler:",IDC_STATIC,12,84,31,15,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_SAMPLERLIST,49,85,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    GROUPBOX        "MIDI",IDC_STATIC,5,175,291,34,BS_LEFT\r
+    GROUPBOX        "Protection Dongle",IDC_STATIC,5,212,292,31,BS_LEFT\r
+    COMBOBOX        IDC_DONGLELIST,50,223,232,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    RTEXT           "Sampler:",IDC_STATIC,12,85,31,15,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_SAMPLERLIST,49,86,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    CONTROL         "Stereo sampler",IDC_SAMPLER_STEREO,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,205,104,75,12\r
 END\r
 \r
 IDD_GAMEPORTS DIALOGEX 0, 0, 300, 246\r
@@ -606,25 +610,25 @@ BEGIN
     GROUPBOX        "Options",IDC_STATIC,168,11,114,111\r
     CONTROL         "Immediate Blitter [] Faster but less compatible blitter emulation.",IDC_BLITIMM,\r
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,27,96,10\r
-    CONTROL         "Cycle-exact [] The most compatible A500 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT,\r
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,53,100,10\r
     GROUPBOX        "Collision Level",IDC_STATIC,14,128,267,48\r
     CONTROL         "None [] Collision hardware emulation disabled.",IDC_COLLISION0,\r
                     "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,144,59,10\r
     CONTROL         "Sprites only [] Emulate only sprite vs. sprite collisions.",IDC_COLLISION1,\r
-                    "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,160,62,10\r
+                    "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,159,62,10\r
     CONTROL         "Sprites and Sprites vs. Playfield [] Recommended collision emulation level.",IDC_COLLISION2,\r
                     "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,144,161,10\r
     CONTROL         "Full [] 100% collision hardware emulation. Only very few games need this option. Slowest.",IDC_COLLISION3,\r
-                    "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,160,119,10\r
+                    "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,159,119,10\r
     CONTROL         "Genlock connected [] Allow boot sequence to detect genlock. Genlock is not emulated.",IDC_GENLOCK,\r
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,66,100,10\r
-    COMBOBOX        IDC_CS_EXT,100,80,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    RTEXT           "Chipset Extra",IDC_STATIC,25,79,52,15,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_MONITOREMU,178,102,98,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
-    RTEXT           "External display hardware:",IDC_STATIC,174,82,100,15,SS_CENTERIMAGE\r
-    CONTROL         "Wait for Blitter [] Pauses the CPU if blitter is active and CPU attempted to modify blitter registers.",IDC_BLITWAIT,\r
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,53,100,10\r
+    COMBOBOX        IDC_CS_EXT,100,101,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    RTEXT           "Chipset Extra",IDC_STATIC,25,100,52,15,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_MONITOREMU,178,87,98,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+    RTEXT           "External display hardware:",IDC_STATIC,174,67,100,15,SS_CENTERIMAGE\r
+    CONTROL         "Wait for Blitter [] Compatibility hack for programs that don't wait for the blitter correctly, causing graphics corruption if CPU is too fast.",IDC_BLITWAIT,\r
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,40,96,10\r
+    CONTROL         "Cycle-exact [] The most compatible A500/A1200 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT,\r
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,35,80,100,10\r
 END\r
 \r
 IDD_CHIPSET2 DIALOGEX 0, 65490, 300, 247\r
@@ -1033,7 +1037,8 @@ BEGIN
     CTEXT           "Color modes:",IDC_STATIC,215,9,62,10,SS_CENTERIMAGE\r
     COMBOBOX        IDC_RTG_DISPLAYSELECT,11,106,279,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
     CONTROL         "Hardware vertical blank interrupt",IDC_RTG_VBINTERRUPT,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,89,162,10\r
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,89,142,10\r
+    CONTROL         "Hardware sprite emulation",IDC_RTG_HWSPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,185,89,102,10\r
 END\r
 \r
 IDD_INPUTMAP DIALOGEX 0, 0, 300, 240\r
@@ -1239,6 +1244,8 @@ BEGIN
 \r
     IDD_IOPORTS, DIALOG\r
     BEGIN\r
+        RIGHTMARGIN, 300\r
+        BOTTOMMARGIN, 240\r
     END\r
 \r
     IDD_GAMEPORTS, DIALOG\r
@@ -1263,7 +1270,6 @@ BEGIN
 \r
     IDD_CHIPSET, DIALOG\r
     BEGIN\r
-        BOTTOMMARGIN, 165\r
     END\r
 \r
     IDD_CHIPSET2, DIALOG\r
index d8aa9a4016b7e33f07cfa555693fb4c371186210..6275bef384b28c670bc9fb97379f0fe44f89c5eb 100644 (file)
@@ -1617,25 +1617,6 @@ void close_sound (void)
        have_sound = 0;
 }
 
-int init_sound (void)
-{
-       gui_data.sndbuf_status = 3;
-       gui_data.sndbuf = 0;
-       if (!sound_available)
-               return 0;
-       if (currprefs.produce_sound <= 1)
-               return 0;
-       if (have_sound)
-               return 1;
-       if (!open_sound ())
-               return 0;
-       sdp->paused = 1;
-       driveclick_reset ();
-       reset_sound ();
-       resume_sound ();
-       return 1;
-}
-
 void pause_sound (void)
 {
        if (sdp->paused)
@@ -1661,6 +1642,31 @@ void reset_sound (void)
        clearbuffer (sdp);
 }
 
+int init_sound (void)
+{
+       bool started = false;
+       gui_data.sndbuf_status = 3;
+       gui_data.sndbuf = 0;
+       if (!sound_available)
+               return 0;
+       if (currprefs.produce_sound <= 1)
+               return 0;
+       if (have_sound)
+               return 1;
+       if (!open_sound ())
+               return 0;
+       sdp->paused = 1;
+       driveclick_reset ();
+       reset_sound ();
+       resume_sound ();
+       if (!started &&
+               (currprefs.win32_start_minimized && currprefs.win32_iconified_nosound ||
+               currprefs.win32_start_uncaptured && currprefs.win32_inactive_nosound))
+               pause_sound ();
+       started = true;
+       return 1;
+}
+
 static void disable_sound (void)
 {
        close_sound ();
index 229c8054fcaee71eaefc3ce0c1800dd4203bf9f4..012fcdc0d60fc1870bb516ec4a273d72d12636fb 100644 (file)
@@ -157,6 +157,7 @@ static int sound_closed;
 static int recapture;
 static int focus;
 int mouseactive;
+int minimized;
 
 static int mm_timerres;
 static int timermode, timeon;
@@ -482,6 +483,17 @@ void setpaused (int priority)
 #endif
 }
 
+void setminimized (void)
+{
+       minimized = 1;
+       set_inhibit_frame (IHF_WINDOWHIDDEN);
+}
+void unsetminimized (void)
+{
+       minimized = 0;
+       clear_inhibit_frame (IHF_WINDOWHIDDEN);
+}
+
 static int showcursor;
 
 extern TCHAR config_filename[256];
@@ -693,9 +705,6 @@ static void winuae_active (HWND hWnd, int minimized)
                pri = &priorities[currprefs.win32_active_capture_priority];
        setpriority (pri);
 
-       if (!avioutput_video) {
-               clear_inhibit_frame (IHF_WINDOWHIDDEN);
-       }
        if (sound_closed) {
                if (sound_closed < 0) {
                        resumesoundpaused ();
@@ -770,9 +779,6 @@ static void winuae_inactive (HWND hWnd, int minimized)
                                setsoundpaused ();
                                sound_closed = -1;
                        }
-                       if (!avioutput_video) {
-                               set_inhibit_frame (IHF_WINDOWHIDDEN);
-                       }
                } else if (mouseactive) {
                        if (currprefs.win32_active_nocapture_pause) {
                                setpaused (2);
@@ -951,7 +957,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
        HDC hDC;
        int mx, my;
        int istablet = (GetMessageExtraInfo () & 0xFFFFFF00) == 0xFF515700;
-       static int mm, minimized, recursive, ignoremousemove;
+       static int mm, recursive, ignoremousemove;
        static bool ignorelbutton;
 
 #if MSGDEBUG > 1
@@ -974,13 +980,16 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
 
        case WM_SETFOCUS:
                winuae_active (hWnd, minimized);
-               minimized = 0;
+               unsetminimized ();
                dx_check ();
                break;
        case WM_ACTIVATE:
                //write_log (_T("active %d\n"), LOWORD(wParam));
                if (LOWORD (wParam) == WA_INACTIVE) {
-                       minimized = HIWORD (wParam) ? 1 : 0;
+                       if (HIWORD (wParam))
+                               setminimized ();
+                       else
+                               unsetminimized ();
                        winuae_inactive (hWnd, minimized);
                }
                dx_check ();
@@ -2856,6 +2865,8 @@ void target_fixup_options (struct uae_prefs *p)
        if (depth) {
                p->color_mode = p->color_mode == 5 ? 2 : 5;
        }
+       if (p->rtg_hardwaresprite && !p->gfx_api)
+               p->rtg_hardwaresprite = false;
 }
 
 void target_default_options (struct uae_prefs *p, int type)
@@ -2874,6 +2885,8 @@ void target_default_options (struct uae_prefs *p, int type)
                p->win32_soundcard = 0;
                p->win32_samplersoundcard = -1;
                p->win32_minimize_inactive = 0;
+               p->win32_start_minimized = false;
+               p->win32_start_uncaptured = false;
                p->win32_active_capture_priority = 1;
                //p->win32_active_nocapture_priority = 1;
                p->win32_inactive_priority = 2;
@@ -2898,6 +2911,7 @@ void target_default_options (struct uae_prefs *p, int type)
                p->win32_rtgallowscaling = 0;
                p->win32_rtgscaleaspectratio = -1;
                p->win32_rtgvblankrate = 0;
+               p->rtg_hardwaresprite = true;
                p->win32_commandpathstart[0] = 0;
                p->win32_commandpathend[0] = 0;
                p->win32_statusbar = 1;
@@ -2962,6 +2976,8 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
        cfgfile_target_dwrite_bool (f, _T("iconified_nosound"), p->win32_iconified_nosound);
        cfgfile_target_dwrite_bool (f, _T("iconified_pause"), p->win32_iconified_pause);
        cfgfile_target_dwrite_bool (f, _T("inactive_iconify"), p->win32_minimize_inactive);
+       cfgfile_target_dwrite_bool (f, _T("start_iconified"), p->win32_start_minimized);
+       cfgfile_target_dwrite_bool (f, _T("start_not_captured"), p->win32_start_uncaptured);
 
        cfgfile_target_dwrite_bool (f, _T("ctrl_f11_is_quit"), p->win32_ctrl_F11_is_quit);
 
@@ -3225,6 +3241,12 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *
        if (cfgfile_yesno (option, value, _T("inactive_iconify"), &p->win32_minimize_inactive))
                return 1;
 
+       if (cfgfile_yesno (option, value, _T("start_iconified"), &p->win32_start_minimized))
+               return 1;
+
+       if (cfgfile_yesno (option, value, _T("start_not_captured"), &p->win32_start_uncaptured))
+               return 1;
+
        if (cfgfile_string (option, value, _T("serial_port"), &p->sername[0], 256)) {
                sernametodev (p->sername);
                if (p->sername[0])
index 2c4af9db925ca194a7118f74e8debefe561089d0..8ec6dc967152ad150fbef075e13d895e04b9f46a 100644 (file)
@@ -19,8 +19,8 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA _T("")
-#define WINUAEBETA _T("11")
-#define WINUAEDATE MAKEBD(2012, 8, 10)
+#define WINUAEBETA _T("12")
+#define WINUAEDATE MAKEBD(2012, 8, 14)
 #define WINUAEEXTRA _T("")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 #define WINUAEREV _T("")
@@ -36,6 +36,7 @@ extern int in_sizemove;
 extern int manual_painting_needed;
 extern int manual_palette_refresh_needed;
 extern int mouseactive;
+extern int minimized;
 extern int ignore_messages_all;
 extern void *globalipc, *serialipc;
 
@@ -66,6 +67,8 @@ extern uae_u32 OSDEP_minimize_uae (void);
 
 extern void resumepaused (int priority);
 extern void setpaused (int priority);
+extern void unsetminimized (void);
+extern void setminimized (void);
 
 void finishjob (void);
 void init_colors (void);
index 6f9df93b1c76436e0395f28c619dbf81b7cd6da3..0aeb1cb8cb491f410dead11487cdc927c5d748e8 100644 (file)
@@ -930,7 +930,7 @@ bool render_screen (bool immediate)
        bool v = false;
 
        render_ok = false;
-       if (picasso_on || dx_islost ())
+       if (minimized || picasso_on || dx_islost ())
                return render_ok;
        flushymin = 0;
        flushymax = currentmode->amiga_height;
@@ -1454,6 +1454,7 @@ static void update_gfxparams (void)
 
 static int open_windows (int full)
 {
+       static bool started = false;
        int ret, i;
 
        changevblankthreadmode (VBLANKTH_IDLE);
@@ -1494,14 +1495,29 @@ static int open_windows (int full)
                return ret;
        }
 
-       setpriority (&priorities[currprefs.win32_active_capture_priority]);
-       if (!rp_isactive () && full)
+       bool startactive = started || (!started && !currprefs.win32_start_uncaptured && !currprefs.win32_start_minimized);
+       bool startpaused = !started && ((currprefs.win32_start_minimized && currprefs.win32_iconified_pause) || (currprefs.win32_start_uncaptured && currprefs.win32_inactive_pause));
+       bool startminimized = !started && currprefs.win32_start_minimized;
+
+       if (!rp_isactive () && full && startactive)
                setmouseactive (-1);
-       for (i = 0; i < NUM_LEDS; i++)
-               gui_led (i, 0);
-       gui_fps (0, 0, 0);
-       inputdevice_acquire (TRUE);
 
+       if (startactive) {
+               setpriority (&priorities[currprefs.win32_active_capture_priority]);
+               for (i = 0; i < NUM_LEDS; i++)
+                       gui_led (i, 0);
+               gui_fps (0, 0, 0);
+               inputdevice_acquire (TRUE);
+       } else if (startminimized) {
+               setpriority (&priorities[currprefs.win32_iconified_priority]);
+               setminimized ();
+       } else {
+               setpriority (&priorities[currprefs.win32_inactive_priority]);
+       }
+       if (startpaused)
+               setpaused (1);
+
+       started = true;
        return ret;
 }
 
@@ -1734,9 +1750,8 @@ int check_prefs_changed_gfx (void)
                return 1;
        }
 
-       if (currprefs.win32_norecyclebin != changed_prefs.win32_norecyclebin) {
-               currprefs.win32_norecyclebin = changed_prefs.win32_norecyclebin;
-       }
+       currprefs.win32_norecyclebin = changed_prefs.win32_norecyclebin;
+       currprefs.filesys_limit = changed_prefs.filesys_limit;
 
        if (currprefs.win32_logfile != changed_prefs.win32_logfile) {
                currprefs.win32_logfile = changed_prefs.win32_logfile;
@@ -1790,8 +1805,10 @@ int check_prefs_changed_gfx (void)
                return 1;
        }
 
-       if (currprefs.win32_samplersoundcard != changed_prefs.win32_samplersoundcard) {
+       if (currprefs.win32_samplersoundcard != changed_prefs.win32_samplersoundcard ||
+               currprefs.sampler_stereo != changed_prefs.sampler_stereo) {
                currprefs.win32_samplersoundcard = changed_prefs.win32_samplersoundcard;
+               currprefs.sampler_stereo = changed_prefs.sampler_stereo;
                sampler_free ();
        }
 
@@ -3358,7 +3375,7 @@ fail:
 
 static int create_windows_2 (void)
 {
-       static int firstwindow = 1;
+       static bool firstwindow = true;
        int dxfs = currentmode->flags & (DM_DX_FULLSCREEN);
        int d3dfs = currentmode->flags & (DM_D3D_FULLSCREEN);
        int fsw = currentmode->flags & (DM_W_FULLSCREEN);
@@ -3587,13 +3604,13 @@ static int create_windows_2 (void)
        createblankwindows ();
        if (hMainWnd != hAmigaWnd) {
                if (!currprefs.headless && !rp_isactive ())
-                       ShowWindow (hMainWnd, firstwindow ? SW_SHOWDEFAULT : SW_SHOWNORMAL);
+                       ShowWindow (hMainWnd, firstwindow ? (currprefs.win32_start_minimized ? SW_SHOWMINIMIZED : SW_SHOWDEFAULT) : SW_SHOWNORMAL);
                UpdateWindow (hMainWnd);
        }
        if (!currprefs.headless && !rp_isactive ())
-               ShowWindow (hAmigaWnd, firstwindow ? SW_SHOWDEFAULT : SW_SHOWNORMAL);
+               ShowWindow (hAmigaWnd, SW_SHOWNORMAL);
        UpdateWindow (hAmigaWnd);
-       firstwindow = 0;
+       firstwindow = false;
 
        return 1;
 }
index c0aaef78a6be3cdbc42a78588e70c675c8f44a94..8aeac11750506b01092a38ee86edef19e7f6f6af 100644 (file)
@@ -3580,7 +3580,6 @@ struct miscentry
 
 static struct miscentry misclist[] = { 
        { 0, 1, _T("Untrap = middle button"),  &workprefs.win32_middle_mouse },
-       { 0, 1, _T("Minimize when focus is lost"), &workprefs.win32_minimize_inactive },
        { 0, 0, _T("Show GUI on startup"), &workprefs.start_gui },
        { 0, 1, _T("Use CTRL-F11 to quit"), &workprefs.win32_ctrl_F11_is_quit },
        { 0, 1, _T("Don't show taskbar button"), &workprefs.win32_notaskbarbutton },
@@ -3596,6 +3595,10 @@ static struct miscentry misclist[] = {
        { 0, 0, _T("Create winuaelog.txt log"), &workprefs.win32_logfile },
        { 0, 0, _T("Log illegal memory accesses"), &workprefs.illegal_mem },
        { 0, 0, _T("Blank unused displays"), &workprefs.win32_blankmonitors },
+       { 0, 0, _T("Start mouse uncaptured"), &workprefs.win32_start_uncaptured  },
+       { 0, 0, _T("Start minimized"), &workprefs.win32_start_minimized  },
+       { 0, 1, _T("Minimize when focus is lost"), &workprefs.win32_minimize_inactive },
+
        { 0, NULL }
 };
 
@@ -6680,19 +6683,26 @@ static void enable_for_memorydlg (HWND hDlg)
        ew (hDlg, IDC_RTG_VBLANKRATE, rtg2);
        ew (hDlg, IDC_RTG_BUFFERCNT, rtg2);
        ew (hDlg, IDC_RTG_DISPLAYSELECT, rtg2);
+       ew (hDlg, IDC_RTG_VBINTERRUPT, rtg2);
+       if (!workprefs.gfx_api) {
+               workprefs.rtg_hardwaresprite = false;
+               CheckDlgButton (hDlg, IDC_RTG_HWSPRITE, FALSE);
+       }
+       ew (hDlg, IDC_RTG_HWSPRITE, rtg2 && workprefs.gfx_api);
 }
 
 extern uae_u32 natmem_size;
 static void setmax32bitram (HWND hDlg)
 {
        TCHAR tmp[100];
-       uae_u32 size;
+       uae_u32 size, rtgz3size;
 
+       rtgz3size = workprefs.rtgmem_type ? workprefs.rtgmem_size : 0;
        size = workprefs.z3fastmem_size + workprefs.z3fastmem2_size +
-               workprefs.z3chipmem_size + workprefs.rtgmem_size;
+               workprefs.z3chipmem_size + rtgz3size;
        if (workprefs.z3chipmem_size && workprefs.z3fastmem_size)
                size += 16 * 1024 * 1024;
-       if ((workprefs.z3fastmem_size || workprefs.z3chipmem_size) && workprefs.rtgmem_size)
+       if ((workprefs.z3fastmem_size || workprefs.z3chipmem_size) && rtgz3size)
                size += 16 * 1024 * 1024;
 
        _stprintf (tmp, L"Total configured 32-bit RAM: %dM, reserved: %dM",
@@ -6895,6 +6905,7 @@ static void values_to_memorydlg (HWND hDlg)
        CheckDlgButton (hDlg, IDC_RTG_SCALE_ALLOW, workprefs.win32_rtgallowscaling);
        CheckDlgButton (hDlg, IDC_RTG_MATCH_DEPTH, workprefs.win32_rtgmatchdepth);
        CheckDlgButton (hDlg, IDC_RTG_VBINTERRUPT, workprefs.rtg_hardwareinterrupt);
+       CheckDlgButton (hDlg, IDC_RTG_HWSPRITE, workprefs.rtg_hardwaresprite);
 
        SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_SETCURSEL,
                (workprefs.win32_rtgscaleaspectratio == 0) ? 0 :
@@ -7151,6 +7162,9 @@ static INT_PTR CALLBACK ExpansionDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP
                        case IDC_RTG_VBINTERRUPT:
                                workprefs.rtg_hardwareinterrupt = ischecked (hDlg, IDC_RTG_VBINTERRUPT);
                                break;
+                       case IDC_RTG_HWSPRITE:
+                               workprefs.rtg_hardwaresprite = ischecked (hDlg, IDC_RTG_HWSPRITE);
+                               break;
                        case IDC_SOCKETS:
                                workprefs.socket_emu = ischecked (hDlg, IDC_SOCKETS);
                                break;
@@ -8119,8 +8133,8 @@ static void values_to_cpudlg (HWND hDlg)
        TCHAR buffer[8] = _T("");
        int cpu;
 
-       SendDlgItemMessage (hDlg, IDC_SPEED, TBM_SETPOS, TRUE, workprefs.m68k_speed_throttle / 100);
-       _stprintf (buffer, _T("%+d%%"), workprefs.m68k_speed_throttle / 10);
+       SendDlgItemMessage (hDlg, IDC_SPEED, TBM_SETPOS, TRUE, (int)(workprefs.m68k_speed_throttle / 100));
+       _stprintf (buffer, _T("%+d%%"), (int)(workprefs.m68k_speed_throttle / 10));
        SetDlgItemText (hDlg, IDC_CPUTEXT, buffer);
        CheckDlgButton (hDlg, IDC_COMPATIBLE, workprefs.cpu_compatible);
        CheckDlgButton (hDlg, IDC_COMPATIBLE24, workprefs.address_space_24);
@@ -9665,6 +9679,10 @@ static int harddiskdlg_button (HWND hDlg, WPARAM wParam)
                workprefs.win32_automount_cddrives = ischecked (hDlg, IDC_MAPDRIVES_CD);
                break;
 
+       case IDC_MAPDRIVES_LIMIT:
+               workprefs.filesys_limit = ischecked (hDlg, IDC_MAPDRIVES_LIMIT) ? 950 * 1024 : 0;
+               break;
+
        case IDC_MAPDRIVES_NET:
                workprefs.win32_automount_netdrives = ischecked (hDlg, IDC_MAPDRIVES_NET);
                break;
@@ -9738,6 +9756,7 @@ static INT_PTR CALLBACK HarddiskDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA
                CheckDlgButton (hDlg, IDC_MAPDRIVES_REMOVABLE, workprefs.win32_automount_removabledrives);
                CheckDlgButton (hDlg, IDC_NOUAEFSDB, workprefs.filesys_no_uaefsdb);
                CheckDlgButton (hDlg, IDC_NORECYCLEBIN, workprefs.win32_norecyclebin);
+               CheckDlgButton (hDlg, IDC_MAPDRIVES_LIMIT, workprefs.filesys_limit != 0);
                addfloppyhistory_2 (hDlg, 0, IDC_CD_TEXT, HISTORY_CD);
                addcdtype (hDlg, IDC_CD_TYPE);
                InitializeListView (hDlg);
@@ -10852,6 +10871,7 @@ static void enable_for_portsdlg (HWND hDlg)
        }
        ew (hDlg, IDC_PRINTERLIST, isprinter);
        ew (hDlg, IDC_SAMPLERLIST, issampler);
+       ew (hDlg, IDC_SAMPLER_STEREO, issampler && workprefs.win32_samplersoundcard >= 0);
        ew (hDlg, IDC_PRINTERAUTOFLUSH, isprinter);
        ew (hDlg, IDC_PRINTERTYPELIST, isprinter);
        ew (hDlg, IDC_FLUSHPRINTER, isprinteropen () && isprinter ? TRUE : FALSE);
@@ -11067,6 +11087,9 @@ static void values_from_portsdlg (HWND hDlg)
                if (item > 0)
                        workprefs.prtname[0] = 0;
        }
+       workprefs.sampler_stereo = false;
+       if (ischecked (hDlg, IDC_SAMPLER_STEREO))
+               workprefs.sampler_stereo = true;
 
        item = SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_GETCURSEL, 0, 0L);
        if(item != CB_ERR) {
@@ -11146,6 +11169,7 @@ static void values_to_portsdlg (HWND hDlg)
        int idx;
 
        SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_SETCURSEL, workprefs.win32_samplersoundcard + 1, 0);
+       CheckDlgButton (hDlg, IDC_SAMPLER_STEREO, workprefs.sampler_stereo);
 
        result = 0;
        if(workprefs.prtname[0]) {
@@ -11530,7 +11554,7 @@ static INT_PTR CALLBACK IOPortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR
                        if (isprinter ()) {
                                closeprinter ();
                        }
-               } else if (wParam == IDC_UAESERIAL || wParam == IDC_SER_SHARED || wParam == IDC_SER_DIRECT || wParam == IDC_SER_CTSRTS || wParam == IDC_PRINTERAUTOFLUSH) {
+               } else if (wParam == IDC_UAESERIAL || wParam == IDC_SER_SHARED || wParam == IDC_SER_DIRECT || wParam == IDC_SER_CTSRTS || wParam == IDC_PRINTERAUTOFLUSH || wParam == IDC_SAMPLER_STEREO) {
                        values_from_portsdlg (hDlg);
                } else {
                        if (HIWORD (wParam) == CBN_SELCHANGE) {
@@ -12671,7 +12695,7 @@ static struct filterxtra filter_pal_extra[] =
 static struct filterxtra filter_3d_extra[] =
 {
        _T("Point/Bilinear"), &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1,
-       _T("Scanline transparency"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
+       _T("Scanline opacity"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
        _T("Scanline level"), &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10,
        NULL
 };
index 59461d1886a747fc8d643124b5a1b7029209de2e..80810f7513d5dcc2aa3af0366fb38a1ad1a02912 100644 (file)
@@ -1,6 +1,25 @@
 
 - restore only single input target to default.
 
+- Moved cycle-exact option to Chipset group in GUI. Other options are minor options/hacks, CE is not.
+- Do not enable wait for blit if immediate blitter is enabled in quickstart mode.
+- Added RTG hardware sprite (mouse cursor) enable/disable option. Enabled by default if D3D mode. Was always enabled
+  previously if D3D mode.
+- GUI Memory panel 32-bit RAM size information text incorrectly included Z2 mode RTG memory.
+- Added directory harddrive limit option to Harddrives panel. When enabled, all directory harddrives size is faked
+  to ~950M with free space relative to original size (for example 500G HD with 100G free = 950M HD with 950*100/500=190M free)
+  This hack is workaround for installers that think drive is full or have negative free space if drive is larger than 2G (32-bit overflow).
+  Can be changed on the fly. Edit configuration file manually if you want custom limit size. Also virtual fake block size changed
+  from 1024 to 512. More compatible with KS1.x dos commands that seem to use hardcoded 512 block sizes when calculating disk size.
+- cpu_throttle configuration entry also accepts decimal values.
+- Added Start minimized and Start mouse uncaptured Misc panel options.
+- In minimized mode D3D/DirectDraw display updates are also now completely stopped.
+- ECS Denise/AGA border blanking handling rewritten again. (Brian the Lion borders are black again)
+- Ignore color 0 (background) writes if borderblank is currently enabled when deciding autoscale start vertical
+  coordinate. (Brian the Lion)
+- Parallel port audio sampler emulation partially rewritten, it actually sounds correct now, mono/stereo option added.
+  AudioMaster IV confirmed working. Very pointless feature.
+  
 Beta 11:
 
 - END special qualifier didn't work when combined with other qualifiers, some END + shortcuts leaked key presses to emulated
index 868ec9ed6d3b1c6c39cbb4eaf729ca5f2ce8bb7a..c08e9c30afad4a6d300a17e8868acc3af197625d 100644 (file)
 #include "win32.h"
 
 #define SAMPLESIZE 4
-#define RECORDBUFFER 10000
-#define SAMPLEBUFFER 2000
 
 static LPDIRECTSOUNDCAPTURE lpDS2r = NULL;
 static LPDIRECTSOUNDCAPTUREBUFFER lpDSBprimary2r = NULL;
 static LPDIRECTSOUNDCAPTUREBUFFER lpDSB2r = NULL;
 static int inited;
 static uae_u8 *samplebuffer;
-static int samplerate = 44100;
+static int sampleframes;
+static int recordbufferframes;
 static float clockspersample;
 static int vsynccnt;
 static int safepos;
@@ -40,6 +39,13 @@ static int capture_init (void)
        HRESULT hr;
        DSCBUFFERDESC sound_buffer_rec;
        WAVEFORMATEX wavfmt;
+       TCHAR *name;
+       int samplerate = 44100;
+
+       if (currprefs.sampler_freq)
+               samplerate = currprefs.sampler_freq;
+
+       name = record_devices[currprefs.win32_samplersoundcard]->name;
 
        wavfmt.wFormatTag = WAVE_FORMAT_PCM;
        wavfmt.nChannels = 2;
@@ -49,30 +55,36 @@ static int capture_init (void)
        wavfmt.nAvgBytesPerSec = wavfmt.nBlockAlign * wavfmt.nSamplesPerSec;
        wavfmt.cbSize = 0;
 
+       clockspersample = sampler_evtime / samplerate;
+       sampleframes = (samplerate + 49) / 50;
+       recordbufferframes = 16384;
+       if (currprefs.sampler_buffer)
+               recordbufferframes = currprefs.sampler_buffer;
+
        hr = DirectSoundCaptureCreate (&record_devices[currprefs.win32_samplersoundcard]->guid, &lpDS2r, NULL);
        if (FAILED (hr)) {
-               write_log (_T("SAMPLER: DirectSoundCaptureCreate() failure: %s\n"), DXError (hr));
+               write_log (_T("SAMPLER: DirectSoundCaptureCreate('%s') failure: %s\n"), name, DXError (hr));
                return 0;
        }
        memset (&sound_buffer_rec, 0, sizeof (DSCBUFFERDESC));
        sound_buffer_rec.dwSize = sizeof (DSCBUFFERDESC);
-       sound_buffer_rec.dwBufferBytes = RECORDBUFFER * SAMPLESIZE;
+       sound_buffer_rec.dwBufferBytes = recordbufferframes * SAMPLESIZE;
        sound_buffer_rec.lpwfxFormat = &wavfmt;
        sound_buffer_rec.dwFlags = 0 ;
 
        hr = lpDS2r->CreateCaptureBuffer (&sound_buffer_rec, &lpDSB2r, NULL);
        if (FAILED (hr)) {
-               write_log (_T("SAMPLER: CreateCaptureSoundBuffer() failure: %s\n"), DXError(hr));
+               write_log (_T("SAMPLER: CreateCaptureSoundBuffer('%s') failure: %s\n"), name, DXError(hr));
                return 0;
        }
 
        hr = lpDSB2r->Start (DSCBSTART_LOOPING);
        if (FAILED (hr)) {
-               write_log (_T("SAMPLER: DirectSoundCaptureBuffer_Start failed: %s\n"), DXError (hr));
+               write_log (_T("SAMPLER: DirectSoundCaptureBuffer_Start('%s') failed: %s\n"), name, DXError (hr));
                return 0;
        }
-       samplebuffer = xcalloc (uae_u8, SAMPLEBUFFER * SAMPLESIZE);
-       write_log (_T("SAMPLER: Parallel port sampler initialized\n"));
+       samplebuffer = xcalloc (uae_u8, sampleframes * SAMPLESIZE);
+       write_log (_T("SAMPLER: Parallel port sampler initialized, CPS=%f, '%s'\n"), clockspersample, name);
        return 1;
 }
 
@@ -96,19 +108,24 @@ static int oldoffset;
 
 uae_u8 sampler_getsample (int channel)
 {
-       HRESULT hr;
-       static DWORD cap_pos;
+#if 0
+       int cur_pos;
+       static int cap_pos;
        static float diffsample;
-       DWORD t, cur_pos;
+#endif
+       static double doffset_offset;
+       HRESULT hr;
+       DWORD pos;
+       DWORD t;
        void *p1, *p2;
        DWORD len1, len2;
        evt cycles;
+       int sample, samplecnt;
+       double doffset;
        int offset;
-       int sample, samplecnt, diff;
 
-//     if (channel)
-//             return 0;
-       channel = 0;
+       if (!currprefs.sampler_stereo)
+               channel = 0;
 
        if (!inited) {
                if (!capture_init ()) {
@@ -118,19 +135,22 @@ uae_u8 sampler_getsample (int channel)
                inited = 1;
                oldcycles = get_cycles ();
                oldoffset = -1;
+               doffset_offset = 0;
+#if 0
                diffsample = 0;
-               safepos = -RECORDBUFFER / 10 * SAMPLESIZE;
-               hr = lpDSB2r->GetCurrentPosition (&t, &cap_pos);
+               safepos = -recordbufferframes / 10 * SAMPLESIZE;
+               hr = lpDSB2r->GetCurrentPosition (&t, &pos);
+               cap_pos = pos;
                cap_pos += safepos;
-               if (cap_pos >= 10 * RECORDBUFFER * SAMPLESIZE)
-                       cap_pos += RECORDBUFFER * SAMPLESIZE;
-               if (cap_pos >= RECORDBUFFER * SAMPLESIZE)
-                       cap_pos -= RECORDBUFFER * SAMPLESIZE;
+               if (cap_pos < 0)
+                       cap_pos += recordbufferframes * SAMPLESIZE;
+               if (cap_pos >= recordbufferframes * SAMPLESIZE)
+                       cap_pos -= recordbufferframes * SAMPLESIZE;
                if (FAILED (hr)) {
                        sampler_free ();
                        return 0;
                }
-               clockspersample = sampler_evtime / samplerate;
+#endif
        }
        if (clockspersample < 1)
                return 0;
@@ -139,34 +159,52 @@ uae_u8 sampler_getsample (int channel)
        vsynccnt = 0;
        sample = 0;
        samplecnt = 0;
-       cycles = get_cycles () - oldcycles;
-       float cps = clockspersample + diffsample;
-       offset = (cycles + cps - 1) / cps;
-       if (oldoffset < 0 || offset >= SAMPLEBUFFER || offset < 0) {
-               if (oldoffset >= 0 && offset >= SAMPLEBUFFER) {
-                       while (oldoffset < SAMPLEBUFFER) {
+       cycles = (int)get_cycles () - (int)oldcycles;
+       doffset = doffset_offset + cycles / clockspersample;
+       offset = (int)doffset;
+       if (oldoffset < 0 || offset >= sampleframes || offset < 0) {
+               if (offset >= sampleframes) {
+                       doffset -= offset;
+                       doffset_offset = doffset;
+               }
+               if (oldoffset >= 0 && offset >= sampleframes) {
+                       while (oldoffset < sampleframes) {
                                sample += sbuf[oldoffset * SAMPLESIZE / 2 + channel];
                                oldoffset++;
                                samplecnt++;
                        }
                }
-               hr = lpDSB2r->Lock (cap_pos, SAMPLEBUFFER * SAMPLESIZE, &p1, &len1, &p2, &len2, 0);
-               if (FAILED (hr))
+               hr = lpDSB2r->GetCurrentPosition (&t, &pos);
+               hr = lpDSB2r->Lock (t, sampleframes * SAMPLESIZE, &p1, &len1, &p2, &len2, 0);
+               if (FAILED (hr)) {
+                       write_log (_T("SAMPLER: Lock() failed %x\n"), hr);
                        return 0;
+               }
                memcpy (samplebuffer, p1, len1);
                if (p2)
                        memcpy (samplebuffer + len1, p2, len2);
                lpDSB2r->Unlock (p1, len1, p2, len2);
-               cap_pos += SAMPLEBUFFER * SAMPLESIZE;
 
-               hr = lpDSB2r->GetCurrentPosition (&t, &cur_pos);
+#if 0
+               cap_pos = t;
+               cap_pos += sampleframes * SAMPLESIZE;
+               if (cap_pos < 0)
+                       cap_pos += RECORDBUFFER * SAMPLESIZE;
+               if (cap_pos >= RECORDBUFFER * SAMPLESIZE)
+                       cap_pos -= RECORDBUFFER * SAMPLESIZE;
+
+               hr = lpDSB2r->GetCurrentPosition (&t, &pos);
+               cur_pos = pos;
                if (FAILED (hr))
                        return 0;
+
                cur_pos += safepos;
-               if (cur_pos >= 10 * RECORDBUFFER * SAMPLESIZE)
+               if (cur_pos < 0)
                        cur_pos += RECORDBUFFER * SAMPLESIZE;
                if (cur_pos >= RECORDBUFFER * SAMPLESIZE)
                        cur_pos -= RECORDBUFFER * SAMPLESIZE;
+
+               int diff;
                if (cur_pos >= cap_pos)
                        diff = cur_pos - cap_pos;
                else
@@ -176,35 +214,44 @@ uae_u8 sampler_getsample (int channel)
                diff /= SAMPLESIZE;
 
                int diff2 = 100 * diff / (RECORDBUFFER / 2);
-#if 0
                diffsample = -pow (diff2 < 0 ? -diff2 : diff2, 3.1);
                if (diff2 < 0)
                        diffsample = -diffsample;
-#endif 
-//             write_log (_T("%d:%.1f\n"), diff, diffsample);
+               write_log (_T("%d\n"), diff);
 
-               cap_pos += SAMPLEBUFFER * SAMPLESIZE;
-               if (cap_pos < 0)
-                       cap_pos += RECORDBUFFER * SAMPLESIZE;
-               if (cap_pos >= RECORDBUFFER * SAMPLESIZE)
-                       cap_pos -= RECORDBUFFER * SAMPLESIZE;
+               write_log (_T("CAP=%05d CUR=%05d (%-05d) OFF=%05d %f\n"),
+                       cap_pos / SAMPLESIZE, cur_pos / SAMPLESIZE, (cap_pos - cur_pos) / SAMPLESIZE, offset, doffset_offset);
+#endif
 
                if (offset < 0)
                        offset = 0;
-               if (offset >= SAMPLEBUFFER)
-                       offset -= SAMPLEBUFFER;
+               if (offset >= sampleframes)
+                       offset -= sampleframes;
+
                oldoffset = 0;
                oldcycles = get_cycles ();
        }
+
        while (oldoffset <= offset) {
                sample += sbuf[oldoffset * SAMPLESIZE / 2 + channel];
                samplecnt++;
                oldoffset++;
        }
        oldoffset = offset;
+
        if (samplecnt > 0)
                sample /= samplecnt;
-       return (sample / 256) - 128;
+#if 1
+        /* yes, not 256, without this max recording volume would still be too quiet on my sound cards */
+       sample /= 128;
+       if (sample < -128)
+               sample = 0;
+       else if (sample > 127)
+               sample = 127;
+       return (uae_u8)(sample - 128);
+#else
+       return (Uae_u8)((sample / 256) - 128);
+#endif
 }
 
 int sampler_init (void)
@@ -225,6 +272,7 @@ void sampler_vsync (void)
 {
        if (!inited)
                return;
+
        vsynccnt++;
        if (vsynccnt > 1) {
                oldcycles = get_cycles ();