]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2700b14
authorToni Wilen <twilen@winuae.net>
Wed, 20 Nov 2013 18:36:35 +0000 (20:36 +0200)
committerToni Wilen <twilen@winuae.net>
Wed, 20 Nov 2013 18:36:35 +0000 (20:36 +0200)
22 files changed:
blitter.cpp
cfgfile.cpp
custom.cpp
drawing.cpp
filesys.cpp
fpp.cpp
gencpu.cpp
include/audio.h
include/custom.h
include/newcpu.h
include/options.h
inputdevice.cpp
newcpu.cpp
od-win32/dinput.cpp
od-win32/sounddep/sound.cpp
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32_scaler.cpp
od-win32/win32gui.cpp
od-win32/win32gui_extra.cpp
od-win32/winuae_msvc11/winuae_msvc.vcxproj
od-win32/winuaechangelog.txt

index 02f53e71c0d290bcc5e0b3a89bb85aa2f9af8241..4b48870078e1c4be919ddc3fc600f1fdd0e23184 100644 (file)
@@ -336,14 +336,15 @@ STATIC_INLINE int canblit (int hpos)
        return 1;
 }
 
-// blitter interrupt is set when last "main" cycle
-// has been finished, any non-linedraw D-channel blit
-// still needs 2 more cycles before final D is written
+// blitter interrupt is set (and busy bit cleared) when
+// last "main" cycle has been finished, any non-linedraw
+// D-channel blit still needs 2 more cycles before final
+// D is written
 static void blitter_interrupt (int hpos, int done)
 {
        if (blit_interrupt)
                return;
-       if (!done && (!currprefs.blitter_cycle_exact || currprefs.cpu_model >= 68020))
+       if (!done && (!currprefs.blitter_cycle_exact || currprefs.cpu_model >= 68030))
                return;
        blit_interrupt = 1;
        send_interrupt (6, 3 * CYCLE_UNIT);
index 7ab3a40618479a0c0c6bed2765fad04f108dc156..9697bdc51c6e546659c85fd08a7b5d223659c8d3 100644 (file)
@@ -1392,6 +1392,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        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);
+       cfgfile_dwrite (f, _T("filesys_max_name_length"), _T("%d"), p->filesys_max_name);
+       cfgfile_dwrite (f, _T("filesys_max_file_size"), _T("%d"), p->filesys_max_file_size);
 #endif
        write_inputdevice_config (p, f);
 }
@@ -1850,6 +1852,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, _T("gfx_horizontal_tweak"), &p->gfx_extrawidth, 1)
                || cfgfile_string (option, value, _T("gfx_filter_mask"), p->gfx_filtermask[2 * MAX_FILTERSHADERS], sizeof p->gfx_filtermask[2 * MAX_FILTERSHADERS] / sizeof (TCHAR))
                || cfgfile_intval (option, value, _T("filesys_max_size"), &p->filesys_limit, 1)
+               || cfgfile_intval (option, value, _T("filesys_max_name_length"), &p->filesys_max_name, 1)
+               || cfgfile_intval (option, value, _T("filesys_max_file_size"), &p->filesys_max_file_size, 1)
 
                || cfgfile_floatval (option, value, _T("rtg_vert_zoom_multf"), &p->rtg_vert_zoom_mult)
                || cfgfile_floatval (option, value, _T("rtg_horiz_zoom_multf"), &p->rtg_horiz_zoom_mult)
@@ -5034,6 +5038,8 @@ void default_prefs (struct uae_prefs *p, int type)
        p->genlock = 0;
        p->ntscmode = 0;
        p->filesys_limit = 0;
+       p->filesys_max_name = 107;
+       p->filesys_max_file_size = 0x7fffffff;
 
        p->fastmem_size = 0x00000000;
        p->fastmem2_size = 0x00000000;
index 483c2419019fd3d5f074d4e1406f6e136edc1dfb..4ee14c2ec160e2c4408aae3c224ba75d145b85b5 100644 (file)
@@ -166,7 +166,7 @@ static int lof_togglecnt_lace, lof_togglecnt_nlace; //, nlace_cnt;
 */
 static int vpos_previous, hpos_previous;
 static int vpos_lpen, hpos_lpen, lightpen_triggered;
-int lightpen_x = -1, lightpen_y = -1, lightpen_cx, lightpen_cy, lightpen_active;
+int lightpen_x = -1, lightpen_y = -1, lightpen_cx, lightpen_cy, lightpen_active, lightpen_enabled;
 
 static uae_u32 sprtaba[256],sprtabb[256];
 static uae_u32 sprite_ab_merge[256];
@@ -200,7 +200,7 @@ static int maxvpos_total = 511;
 int minfirstline = VBLANK_ENDLINE_PAL;
 static int equ_vblank_endline = EQU_ENDLINE_PAL;
 static bool equ_vblank_toggle = true;
-double vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz, vblank_hz_stored;
+double vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz, vblank_hz_stored, vblank_hz_nom;
 static float vblank_hz_lof, vblank_hz_shf, vblank_hz_lace;
 static int vblank_hz_mult, vblank_hz_state;
 static struct chipset_refresh *stored_chipset_refresh;
@@ -1023,7 +1023,7 @@ static void compute_toscr_delay (int hpos, int bplcon1)
 
 static int bpldmasetuphpos;
 static int bpldmasetupphase;
-static void update_toscr_planes (void);
+static void update_toscr_planes (int fm);
 /* set currently active Agnus bitplane DMA sequence */
 static void setup_fmodes (int hpos)
 {
@@ -1136,22 +1136,26 @@ STATIC_INLINE void clear_fetchbuffer (uae_u32 *ptr, int nwords)
        memset (ptr, 0, nwords * 4);
 }
 
-static void update_toscr_planes (void)
+static void update_toscr_planes (int fm)
 {
        // This must be called just before new bitplane block starts,
        // not when depth value changes. Depth can change early and can leave
        // 16+ pixel horizontal line of old data visible.
        if (toscr_nr_planes_agnus > thisline_decision.nr_planes) {
-               int j;
-               for (j = thisline_decision.nr_planes; j < toscr_nr_planes_agnus; j++) {
-                       clear_fetchbuffer ((uae_u32 *)(line_data[next_lineno] + 2 * MAX_WORDS_PER_LINE * j), out_offs);
-                       if (thisline_decision.plfleft >= 0) {
-                               todisplay[j][0] = 0;
+               if (out_offs) {
+                       int j;
+                       for (j = thisline_decision.nr_planes; j < toscr_nr_planes_agnus; j++) {
+                               clear_fetchbuffer ((uae_u32 *)(line_data[next_lineno] + 2 * MAX_WORDS_PER_LINE * j), out_offs);
+                               if (thisline_decision.plfleft >= 0) {
+                                       todisplay[j][0] = 0;
 #ifdef AGA
-                               todisplay[j][1] = 0;
-                               todisplay[j][2] = 0;
-                               todisplay[j][3] = 0;
+                                       if (fm) {
+                                               todisplay[j][1] = 0;
+                                               todisplay[j][2] = 0;
+                                               todisplay[j][3] = 0;
+                                       }
 #endif
+                               }
                        }
                }
                thisline_decision.nr_planes = toscr_nr_planes_agnus;
@@ -1486,7 +1490,7 @@ STATIC_INLINE void beginning_of_plane_block (int hpos, int fm)
 #endif
 
        update_denise (hpos);
-       update_toscr_planes ();
+       update_toscr_planes (fm);
        maybe_first_bpl1dat (hpos);
 
        bplcon1t2 = bplcon1t;
@@ -1908,7 +1912,7 @@ static void update_fetch_x (int until, int fm)
                return;
 
        pos = last_fetch_hpos;
-       update_toscr_planes ();
+       update_toscr_planes (fm);
 
        // not optimized, update_fetch_x() is extremely rarely used.
        for (; pos < until; pos++) {
@@ -3059,7 +3063,7 @@ void compute_vsynctime (void)
                vblank_hz = currprefs.chipset_refreshrate;
                if (isvsync_chipset ()) {
                        int mult = 0;
-                       if (!fake_vblank_hz && getvsyncrate (vblank_hz, &mult) != vblank_hz) {
+                       if (getvsyncrate (vblank_hz, &mult) != vblank_hz) {
                                vblank_hz = getvsyncrate (vblank_hz, &vblank_hz_mult);
                                if (vblank_hz_mult > 0)
                                        vblank_hz_state = 0;
@@ -3077,8 +3081,21 @@ void compute_vsynctime (void)
                updatedisplayarea ();
        }
 #endif
-       if (currprefs.produce_sound > 1)
-               update_sound (fake_vblank_hz);
+       if (currprefs.produce_sound > 1) {
+               double svpos = maxvpos;
+               double shpos = maxhpos_short;
+               if (islinetoggle ()) {
+                       shpos += 0.5;
+               }
+               if (interlace_seen) {
+                       svpos += 0.5;
+               } else if (lof_current) {
+                       svpos += 1.0;
+               }
+               double clk = svpos * shpos * fake_vblank_hz;
+               write_log (_T("SNDRATE %.1f*%.1f*%.6f=%.6f\n"), svpos, shpos, fake_vblank_hz, clk);
+               update_sound (clk);
+       }
 }
 
 
@@ -3351,7 +3368,7 @@ void init_hz (bool fullinit)
                maxvpos = MAXVPOS_PAL;
                maxhpos = MAXHPOS_PAL;
                minfirstline = VBLANK_ENDLINE_PAL;
-               vblank_hz = VBLANK_HZ_PAL;
+               vblank_hz_nom = vblank_hz = VBLANK_HZ_PAL;
                sprite_vblank_endline = VBLANK_SPRITE_PAL;
                equ_vblank_endline = EQU_ENDLINE_PAL;
                equ_vblank_toggle = true;
@@ -3362,13 +3379,13 @@ void init_hz (bool fullinit)
                maxvpos = MAXVPOS_NTSC;
                maxhpos = MAXHPOS_NTSC;
                minfirstline = VBLANK_ENDLINE_NTSC;
-               vblank_hz = VBLANK_HZ_NTSC;
+               vblank_hz_nom = vblank_hz = VBLANK_HZ_NTSC;
                sprite_vblank_endline = VBLANK_SPRITE_NTSC;
                equ_vblank_endline = EQU_ENDLINE_NTSC;
                equ_vblank_toggle = false;
-               vblank_hz_shf = (double)clk / ((maxvpos + 0) * maxhpos);
-               vblank_hz_lof = (double)clk / ((maxvpos + 1) * maxhpos);
-               vblank_hz_lace = (double)clk / ((maxvpos + 0.5) * maxhpos);
+               vblank_hz_shf = (double)clk / ((maxvpos + 0) * (maxhpos + 0.5));
+               vblank_hz_lof = (double)clk / ((maxvpos + 1) * (maxhpos + 0.5));
+               vblank_hz_lace = (double)clk / ((maxvpos + 0.5) * (maxhpos + 0.5));
        }
 
        maxvpos_nom = maxvpos;
@@ -3379,7 +3396,7 @@ void init_hz (bool fullinit)
                if (vpos_count < 10)
                        vpos_count = 10;
                vblank_hz = (isntsc ? 15734 : 15625.0) / vpos_count;
-               vblank_hz_shf = vblank_hz_lof = vblank_hz_lace = vblank_hz;
+               vblank_hz_nom = vblank_hz_shf = vblank_hz_lof = vblank_hz_lace = vblank_hz;
                maxvpos_nom = vpos_count - (lof_current ? 1 : 0);
                if ((maxvpos_nom >= 256 && maxvpos_nom <= 313) || (beamcon0 & 0x80)) {
                        maxvpos_display = maxvpos_nom;
@@ -3398,7 +3415,7 @@ void init_hz (bool fullinit)
                if (htotal >= MAXHPOS)
                        htotal = MAXHPOS - 1;
                maxhpos = htotal + 1;
-               vblank_hz = 227.0 * 312.0 * 50.0 / (maxvpos * maxhpos);
+               vblank_hz_nom = vblank_hz = 227.0 * 312.0 * 50.0 / (maxvpos * maxhpos);
                vblank_hz_shf = vblank_hz;
                vblank_hz_lof = 227.0 * 313.0 * 50.0 / (maxvpos * maxhpos);;
                vblank_hz_lace = 227.0 * 312.5 * 50.0 / (maxvpos * maxhpos);;
@@ -3684,7 +3701,7 @@ static uae_u16 VPOSR (void)
 
        if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
                vp &= 1;
-       vp = vp | (lof_store ? 0x8000 : 0) | csbit;
+       vp |= (lof_store ? 0x8000 : 0) | csbit;
        if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
                vp |= lol ? 0x80 : 0;
        hsyncdelay ();
@@ -6262,6 +6279,11 @@ static void vsync_handler_post (void)
                if (lof_togglecnt_lace >= LOF_TOGGLES_NEEDED)
                        lof_togglecnt_nlace = 0;
        } else {
+               // only 1-2 vblanks with bplcon0 lace bit set?
+               // lets check if lof has changed
+               if (!(bplcon0 & 4) && lof_togglecnt_lace > 0 && lof_togglecnt_lace < LOF_TOGGLES_NEEDED && !interlace_seen) {
+                       lof_changed = 1;
+               }
                lof_togglecnt_nlace = LOF_TOGGLES_NEEDED;
                lof_togglecnt_lace = 0;
 #if 0
@@ -6579,7 +6601,7 @@ static void hsync_handler_pre (bool onvsync)
                        lightpen_triggered = 0;
                        sprite_0 = 0;
                }
-               if (lightpen_cx > 0 && (bplcon0 & 8) && !lightpen_triggered && lightpen_cy == vpos) {
+               if (lightpen_enabled && lightpen_cx > 0 && (bplcon0 & 8) && !lightpen_triggered && lightpen_cy == vpos) {
                        vpos_lpen = vpos;
                        hpos_lpen = lightpen_cx;
                        lightpen_triggered = 1;
index aa1859c556be6d4151b5ccbef1fd8264d90a6570..ae3c8442f265b498191cb03be3d7897aa60a849f 100644 (file)
@@ -2357,18 +2357,12 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in
                        memcpy (row_map[gfx_ypos], xlinebuffer + linetoscr_x_adjust_bytes, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth);
 
                do_flush_line (vb, gfx_ypos);
-               if (do_double > 0) {
+               if (do_double) {
                        if (dh == dh_emerg)
                                memcpy (row_map[follow_ypos], xlinebuffer + linetoscr_x_adjust_bytes, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth);
                        else if (dh == dh_buf)
                                memcpy (row_map[follow_ypos], row_map[gfx_ypos], gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth);
                        do_flush_line (vb, follow_ypos);
-               } else if (do_double < 0) {
-                       if (dh == dh_emerg)
-                               memset (row_map[follow_ypos], 0, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth);
-                       else if (dh == dh_buf)
-                               memset (row_map[follow_ypos], 0, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth);
-                       do_flush_line (vb, follow_ypos);
                }
 
                if (dip_for_drawing->nr_sprites)
@@ -3141,12 +3135,24 @@ void hsync_record_line_state (int lineno, enum nln_how how, int changed)
                        state[1] = LINE_DECIDED; //LINE_BLACK;
                break;
        case nln_lower_black:
-               state[1] = currprefs.gfx_scanlines >= 4 ? LINE_BLACK : LINE_DONE;
-               *state = LINE_DECIDED;
+               if (currprefs.gfx_scanlines >= 4) {
+                       state[1] = LINE_BLACK;
+                       *state = LINE_DECIDED;
+               } else {
+                       changed += state[0] != LINE_DONE;
+                       state[1] = LINE_DONE;
+                       *state = changed ? LINE_DECIDED : LINE_DONE;
+               }
                break;
        case nln_upper_black:
-               *state = LINE_DECIDED;
-               state[-1] = currprefs.gfx_scanlines >= 4 ? LINE_BLACK : LINE_DONE;
+               if (currprefs.gfx_scanlines >= 4) {
+                       *state = LINE_DECIDED;
+                       state[1] = LINE_BLACK;
+               } else {
+                       changed += state[0] != LINE_DONE;
+                       *state = changed ? LINE_DECIDED : LINE_DONE;
+                       state[-1] = LINE_DONE;
+               }
                break;
        }
 }
index 5f06a41199715813d184d3d4c393ae508990a7c1..6d5a529d47d3fefb06114bcb4f3374dfa3f2a751 100644 (file)
@@ -3669,8 +3669,10 @@ static void
        TRACE((_T("name=\"%s\"\n"), xs));
        x2 = x = ua_fs (xs, -1);
        n = strlen (x);
-       if (n > 106)
-               n = 106;
+       if (n > 107)
+               n = 107;
+       if (n > abs (currprefs.filesys_max_name))
+               n = abs (currprefs.filesys_max_name);
        i = 8;
        put_byte (info + i, n); i++;
        while (n--)
@@ -4057,6 +4059,11 @@ end:
        return ret;
 }
 
+static bool filesys_name_invalid (const TCHAR *fn)
+{
+       return _tcslen (fn) > currprefs.filesys_max_name;
+}
+
 static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaecptr control)
 {
        a_inode *aino, *base = NULL;
@@ -4082,7 +4089,7 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp
                                        ok = isofs_readdir (d->isod, fn, &uniq);
                                else
                                        ok = 0;
-                       } while (ok && d->fstype == FS_DIRECTORY && fsdb_name_invalid_dir (fn));
+                       } while (ok && d->fstype == FS_DIRECTORY && (filesys_name_invalid (fn) || fsdb_name_invalid_dir (fn)));
                        if (!ok)
                                return 0;
                } else {
@@ -4355,7 +4362,7 @@ static void populate_directory (Unit *unit, a_inode *base)
                                ok = isofs_readdir (d->isod, fn, &uniq);
                        else
                                ok = 0;
-               } while (ok && d->fstype == FS_DIRECTORY && fsdb_name_invalid_dir (fn));
+               } while (ok && d->fstype == FS_DIRECTORY && (filesys_name_invalid (fn) || fsdb_name_invalid_dir (fn)));
                if (!ok)
                        break;
                /* This calls init_child_aino, which will notice that the parent is
diff --git a/fpp.cpp b/fpp.cpp
index a8e6c392f2e6efa1542b658e4697e8a152138d1b..911d41bd5ae199d4713d7e9598a5d92992402b70 100644 (file)
--- a/fpp.cpp
+++ b/fpp.cpp
@@ -233,7 +233,7 @@ static void fpu_op_unimp (uae_u16 opcode, uae_u32 ea, uaecptr oldpc, int type)
                }
        } else if (currprefs.cpu_model == 68040) {
                regs.fpiar = oldpc;
-               if (type == FPU_EXP_UNIMP_INS) {
+               if (type == FPU_EXP_UNIMP_INS || type == FPU_EXP_DISABLED) {
                        // PC = next instruction
                        oldpc = newpc;
                        m68k_areg (regs, 7) -= 4;
index a81e38c39443818427d1981dca080d611d008ff9..7bedc5dd8676f2bdada89e492f3415253e24d756 100644 (file)
@@ -4620,13 +4620,15 @@ static void gen_opcode (unsigned long int opcode)
                genamode (curi, curi->smode, "srcreg", curi->size, "extra", 1, 0, 0);
                genamode (curi, curi->dmode, "dstreg", curi->size, "dst", 1, 0, 0);
                sync_m68k_pc ();
-               printf ("\tm68k_divl(opcode, dst, extra);\n");
+               printf ("\tif (!m68k_divl(opcode, dst, extra)) goto %s;\n", endlabelstr);
+               need_endlabel = 1;
                break;
        case i_MULL:
                genamode (curi, curi->smode, "srcreg", curi->size, "extra", 1, 0, 0);
                genamode (curi, curi->dmode, "dstreg", curi->size, "dst", 1, 0, 0);
                sync_m68k_pc ();
-               printf ("\tm68k_mull(opcode, dst, extra);\n");
+               printf ("\tif (!m68k_mull(opcode, dst, extra)) goto %s;\n", endlabelstr);
+               need_endlabel = 1;
                break;
        case i_BFTST:
        case i_BFEXTU:
index 0429b29041844237bb73880353874125189c047f..5ce063b78a9a1c4c7c06c9c0f9774185a76ac99d 100644 (file)
@@ -32,7 +32,7 @@ extern void update_audio (void);
 extern void audio_evhandler (void);
 extern void audio_hsync (void);
 extern void audio_update_adkmasks (void);
-extern void update_sound (double freq);
+extern void update_sound (double clk);
 extern void led_filter_audio (void);
 extern void set_audio (void);
 extern int audio_activate (void);
index 21dd8c24dbdf7a856d5fa88906c9c797f3e70e16..b6ee501c6af2ea5db50b8d3b89a995f1665ab58e 100644 (file)
@@ -216,7 +216,7 @@ STATIC_INLINE int GET_PLANES(uae_u16 bplcon0)
 
 extern void fpscounter_reset (void);
 extern unsigned long idletime;
-extern int lightpen_x, lightpen_y, lightpen_cx, lightpen_cy, lightpen_active;
+extern int lightpen_x, lightpen_y, lightpen_cx, lightpen_cy, lightpen_active, lightpen_enabled;
 
 struct customhack {
        uae_u16 v;
index f410e5025deecfbb8026ebd0ad25c45e3fb5654b..b0ff11369414106df6ccbcf13e5e7a48ffdf854f 100644 (file)
@@ -411,8 +411,8 @@ extern void doint (void);
 extern void dump_counts (void);
 extern int m68k_move2c (int, uae_u32 *);
 extern int m68k_movec2 (int, uae_u32 *);
-extern void m68k_divl (uae_u32, uae_u32, uae_u16);
-extern void m68k_mull (uae_u32, uae_u32, uae_u16);
+extern bool m68k_divl (uae_u32, uae_u32, uae_u16);
+extern bool m68k_mull (uae_u32, uae_u32, uae_u16);
 extern void init_m68k (void);
 extern void init_m68k_full (void);
 extern void m68k_go (int);
index c6f37466a84604056c809d34d75f2c2eadadadc2..d9a681389001b5336747c4c2bdc1465dbd47cfd8 100644 (file)
@@ -383,6 +383,8 @@ struct uae_prefs {
        int turbo_emulation;
        bool headless;
        int filesys_limit;
+       int filesys_max_name;
+       int filesys_max_file_size;
 
        int cs_compatible;
        int cs_ciaatod;
index 77202a3cb0da88b72181ee004ec7c15af83cb8dd..2bcab149647208b6975debcec63203dcf68d8337 100644 (file)
@@ -228,7 +228,6 @@ static uae_u8 pot_dat[NORMAL_JPORTS][2];
 static int pot_dat_act[NORMAL_JPORTS][2];
 static int analog_port[NORMAL_JPORTS][2];
 static int digital_port[NORMAL_JPORTS][2];
-static int lightpen;
 #define POTDAT_DELAY_PAL 8
 #define POTDAT_DELAY_NTSC 7
 
@@ -288,15 +287,16 @@ static void copyjport (const struct uae_prefs *src, struct uae_prefs *dst, int n
        dst->jports[num].autofire = src->jports[num].autofire;
 }
 
-static void out_config (struct zfile *f, int id, int num, TCHAR *s1, TCHAR *s2)
+static void out_config (struct zfile *f, int id, int num, const TCHAR *s1, const TCHAR *s2)
 {
        TCHAR tmp[MAX_DPATH];
        _stprintf (tmp, _T("input.%d.%s%d"), id, s1, num);
        cfgfile_write_str (f, tmp, s2);
 }
 
-static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *name, struct uae_input_device *id,  struct inputdevice_functions *idf)
+static bool write_config_head (struct zfile *f, int idnum, int devnum, const TCHAR *name, struct uae_input_device *id,  struct inputdevice_functions *idf)
 {
+       TCHAR *s = NULL;
        TCHAR tmp2[CONFIG_BLEN];
 
        if (idnum == GAMEPORT_INPUT_SETTINGS) {
@@ -306,7 +306,6 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *na
                        return false;
        }
 
-       TCHAR *s = NULL;
        if (id->name)
                s = id->name;
        else if (devnum < idf->get_num ())
@@ -331,7 +330,7 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *na
                cfgfile_write_bool (f, tmp2, true);
                if (id->enabled) {
                        _stprintf (tmp2, _T("input.%d.%s.%d.disabled"), idnum + 1, name, devnum);
-                       cfgfile_write (f, tmp2, _T("%d"), id->enabled ? 0 : 1);
+                       cfgfile_write_bool (f, tmp2, id->enabled ? false : true);
                }
                return false;
        }
@@ -541,7 +540,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae
        }
 }
 
-static void write_config (struct zfile *f, int idnum, int devnum, TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf)
+static void write_config (struct zfile *f, int idnum, int devnum, const TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf)
 {
        TCHAR tmp1[MAX_DPATH];
        int i;
@@ -624,7 +623,7 @@ static int getnum (const TCHAR **pp)
 
        if (!_tcsnicmp (p, _T("false"), 5))
                v = 0;
-       if (!_tcsnicmp (p, _T("true"), 4))
+       else if (!_tcsnicmp (p, _T("true"), 4))
                v = 1;
        else
                v = _tstol (p);
@@ -671,8 +670,10 @@ static void reset_inputdevice_settings (struct uae_input_device *uid)
                for (int i = 0; i < MAX_INPUT_SUB_EVENT_ALL; i++) {
                        uid->eventid[l][i] = 0;
                        uid->flags[l][i] = 0;
-                       xfree (uid->custom[l][i]);
-                       uid->custom[l][i] = NULL;
+                       if (uid->custom[l][i]) {
+                               xfree (uid->custom[l][i]);
+                               uid->custom[l][i] = NULL;
+                       }
                }
        }
 }
@@ -686,7 +687,7 @@ static void reset_inputdevice_slot (struct uae_prefs *prefs, int slot)
 }
 void reset_inputdevice_config (struct uae_prefs *prefs)
 {
-       for (int i = 0; i< MAX_INPUT_SETTINGS; i++)
+       for (int i = 0; i < MAX_INPUT_SETTINGS; i++)
                reset_inputdevice_slot (prefs, i);
 }
 
@@ -3055,6 +3056,7 @@ static int handle_input_event (int nr, int state, int max, int autofire, bool ca
                                lightpen_y = gfxvidinfo.outbuffer->outheight / 2;
                        }
                        lightpen_active = true;
+                       lightpen_enabled = true;
                        if (ie->type == 0) {
                                int delta = 0;
                                if (max == 0)
@@ -3973,7 +3975,7 @@ static int isdigitalbutton (int ei)
 static int islightpen (int ei)
 {
        if (ei >= INPUTEVENT_LIGHTPEN_FIRST && ei < INPUTEVENT_LIGHTPEN_LAST) {
-               lightpen = 1;
+               lightpen_enabled = true;
                return 1;
        }
        return 0;
@@ -4002,7 +4004,7 @@ static void scanevents (struct uae_prefs *p)
                        joydirpot[i][j] = 128 / (312 * 100 / currprefs.input_analog_joystick_mult) + (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset;
                }
        }
-       lightpen = 0;
+       lightpen_enabled = false;
        if (lightpen_active > 0)
                lightpen_active = -1;
 
index e2683954285ad321716dba68ba80c7c36c30d2ef..f941fb284cc0e18352af0a773b94d8457aed93e5 100644 (file)
@@ -3134,15 +3134,15 @@ STATIC_INLINE int div_unsigned (uae_u32 src_hi, uae_u32 src_lo, uae_u32 div, uae
        return 0;
 }
 
-void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra)
+bool m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra)
 {
        if ((extra & 0x400) && currprefs.int_no_unimplemented && currprefs.cpu_model == 68060) {
                op_unimpl (opcode);
-               return;
+               return false;
        }
        if (src == 0) {
                Exception (5);
-               return;
+               return false;
        }
 #if defined (uae_s64)
        if (extra & 0x800) {
@@ -3260,6 +3260,7 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra)
                }
        }
 #endif
+       return true;
 }
 
 STATIC_INLINE void mul_unsigned (uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, uae_u32 *dst_lo)
@@ -3280,11 +3281,11 @@ STATIC_INLINE void mul_unsigned (uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, ua
        *dst_hi = r3;
 }
 
-void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra)
+bool m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra)
 {
        if ((extra & 0x400) && currprefs.int_no_unimplemented && currprefs.cpu_model == 68060) {
                op_unimpl (opcode);
-               return;
+               return false;
        }
 #if defined (uae_s64)
        if (extra & 0x800) {
@@ -3369,6 +3370,7 @@ void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra)
                m68k_dreg (regs, (extra >> 12) & 7) = dst_lo;
        }
 #endif
+       return true;
 }
 
 #endif
index d4b78416c97165c9b7a808f0f651fb10d5857c3f..05b33b2c026119cc98b8d64d2638905cd0d93745 100644 (file)
@@ -3048,10 +3048,15 @@ static int get_kb_widget_first (int kb, int type)
 
 static int get_kb_widget_type (int kb, int num, TCHAR *name, uae_u32 *code)
 {
-       if (name)
-               _tcscpy (name, di_keyboard[kb].buttonname[num]);
-       if (code)
+       if (name) {
+               if (di_keyboard[kb].buttonname[num])
+                       _tcscpy (name, di_keyboard[kb].buttonname[num]);
+               else
+                       name[0] = 0;
+       }
+       if (code) {
                *code = di_keyboard[kb].buttonmappings[num];
+       }
        return IDEV_WIDGET_KEY;
 }
 
index 2278da9b86aa2e3924bc3191f60877ebf3afcdb9..8931b6ccaa00a026fd45aff1d4f0725f5be444cd 100644 (file)
@@ -163,17 +163,18 @@ int setup_sound (void)
        return 1;
 }
 
+float sound_sync_multiplier = 1.0;
 float scaled_sample_evtime_orig;
 extern float sampler_evtime;
-void update_sound (double freq)
+
+void update_sound (double clk)
 
 {
        if (!have_sound)
                return;
-       int clk = currprefs.ntscmode ? CHIPSET_CLOCK_NTSC : CHIPSET_CLOCK_PAL;
-       scaled_sample_evtime_orig = clk * CYCLE_UNIT / (double)sdp->obtainedfreq;
+       scaled_sample_evtime_orig = clk * CYCLE_UNIT * sound_sync_multiplier / sdp->obtainedfreq;
        scaled_sample_evtime = scaled_sample_evtime_orig;
-       sampler_evtime = clk * CYCLE_UNIT;
+       sampler_evtime = clk * CYCLE_UNIT * sound_sync_multiplier;
 }
 
 extern int vsynctimebase_orig;
@@ -1576,7 +1577,6 @@ static int open_sound (void)
 
        have_sound = 1;
        sound_available = 1;
-       update_sound (fake_vblank_hz);
        paula_sndbufsize = sdp->sndbufsize;
        paula_sndbufpt = paula_sndbuffer;
        driveclick_init ();
index 8c38792ebdedb8b4ff1e819a2cd23e26a410ef65..f1e90e437ae0b983cf1370a9591be18c5064e5e7 100644 (file)
@@ -4777,6 +4777,7 @@ extern int tablet_log;
 extern int log_blitter;
 extern int slirp_debug;
 extern int fakemodewaitms;
+extern float sound_sync_multiplier;
 
 extern DWORD_PTR cpu_affinity, cpu_paffinity;
 static DWORD_PTR original_affinity = -1;
@@ -4794,6 +4795,18 @@ static int getval (const TCHAR *s)
                return 0;
        return v;
 }
+#if 0
+static float getvalf (const TCHAR *s)
+{
+       TCHAR *endptr;
+       double v;
+
+       v = _tcstof (s, &endptr);
+       if (*endptr != '\0' || *s == '\0')
+               return 0;
+       return v;
+}
+#endif
 
 static void makeverstr (TCHAR *s)
 {
@@ -5067,6 +5080,12 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2)
        if (!np)
                return 0;
 
+#if 0
+       if (!_tcscmp (arg, _T("sound_adjust"))) {
+               sound_sync_multiplier = getvalf (np);
+               return 2;
+       }
+#endif
        if (!_tcscmp (arg, _T("vsync_modechangetimeout"))) {
                vsync_modechangetimeout = getval (np);
                return 2;
index 0bf4907e69fa1803e434dcb3c50fcdc48d378b13..fe454f80d1f3c2cc233f83cf11c9413e2c91ea8a 100644 (file)
 #define LANG_DLL 1
 
 #if WINUAEPUBLICBETA
-#define WINUAEBETA _T("13")
+#define WINUAEBETA _T("14")
 #else
 #define WINUAEBETA _T("")
 #endif
-#define WINUAEDATE MAKEBD(2013, 11, 15)
+#define WINUAEDATE MAKEBD(2013, 11, 20)
 #define WINUAEEXTRA _T("")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 //#define WINUAEEXTRA _T("Amiga Forever Edition")
index fdbf9cbdba73f85ac7d809989a6e406e019505bb..727f0fd5b4b360c3d96cf9967037afcc0576a909 100644 (file)
@@ -441,7 +441,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
                                if (currprefs.gfx_ycenter_size >= 0)
                                        hh = currprefs.gfx_ycenter_size;
                                int oldwinw = currprefs.gfx_size_win.width;
-                               int oldwinh = currprefs.gfx_size_win.width;
+                               int oldwinh = currprefs.gfx_size_win.height;
                                changed_prefs.gfx_size_win.width = ww;
                                changed_prefs.gfx_size_win.height = hh;
                                fixup_prefs_dimensions (&changed_prefs);
index 39bd6106d316f4accdbbd68fbbba28918e8b27c9..88677a788b025dce92b5f932aa66c1983d72b964 100644 (file)
@@ -12335,7 +12335,6 @@ static void processport (HWND hDlg, bool reset, int port)
        updatejoyport (hDlg, port);
        inputdevice_updateconfig (NULL, &workprefs);
        inputdevice_config_change ();
-       reset_inputdevice_config (&workprefs);
 }
 
 /* Handle messages for the Joystick Settings page of our property-sheet */
@@ -12496,8 +12495,6 @@ static INT_PTR CALLBACK IOPortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR
                pages[IOPORTS_ID] = hDlg;
                currentpage = IOPORTS_ID;
                init_portsdlg (hDlg);
-               inputdevice_updateconfig (NULL, &workprefs);
-               reset_inputdevice_config (&workprefs);
                enable_for_portsdlg (hDlg);
                values_to_portsdlg (hDlg);
                recursive--;
@@ -16530,7 +16527,7 @@ static int GetSettings (int all_options, HWND hwnd)
                }
 
                tres = scaleresource (panelresource, hwnd, gui_resize_enabled);
-               dhwnd = CreateDialogIndirect (tres->inst, tres->resource, NULL, DialogProc);
+               dhwnd = CreateDialogIndirect (tres->inst, tres->resource, isfullscreen () > 0 ? hwnd : NULL, DialogProc);
                dialog_rect.top = dialog_rect.left = 0;
                dialog_rect.right = tres->width;
                dialog_rect.bottom = tres->height;
index b17bcfb9acddc0237c9555879395f599690ad1b5..a4c1469626eaf2d3dc965054cd73b47518356305 100644 (file)
@@ -24,6 +24,7 @@
 #include "registry.h"
 #include "win32.h"
 #include "win32gui.h"
+#include "xwin.h"
 
 #define MAX_GUI_FONTS 2
 #define DEFAULT_FONTSIZE  8
@@ -243,7 +244,8 @@ struct newresource *scaleresource (struct newresource *res, HWND parent, int res
                d->style |= DS_MODALFRAME;
                d->style &= ~WS_THICKFRAME;
        }
-       d->style |= WS_MINIMIZEBOX;
+       if (isfullscreen () <= 0)
+               d->style |= WS_MINIMIZEBOX;
 
        d2 = (DLGTEMPLATEEX_END*)ns->resource;
        p = (BYTE*)d + sizeof (DLGTEMPLATEEX);
index 90b67ad544cf0a6c7d652ff54ea88de2c90dcc24..1c5c6fa44ced92debbb3a3ff6c399496464d2c3b 100644 (file)
@@ -70,7 +70,7 @@
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>Unicode</CharacterSet>
     <WholeProgramOptimization>true</WholeProgramOptimization>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v120</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <OmitFramePointers>true</OmitFramePointers>
       <WholeProgramOptimization>true</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;..\..\slirp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Sync</ExceptionHandling>
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;wntab32x.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;wntab32x.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;Iphlpapi.lib;luastatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <ShowProgress>NotSet</ShowProgress>
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
index 9b9d5b3c9875f86ba55484fb1468823b67b86306..a2ca7f29f8d44955c63829c3d129d162429c2c47 100644 (file)
@@ -2,6 +2,17 @@
 
 - restore only single input target to default.
 
+Beta 13:
+
+- Standard partition hardfile OFS filesystem check was broken (2.6.1)
+- Adjusted sprite xpos == hpos check. (Shed Tears / Ozone scroller)
+- 64-bit build didn't load portaudio dll.
+- GUI window minimize button worked strangely when emulation window was open.
+- Added new interlace emulation modes, first new is same as old one but display is updated every field
+  (Old doubling updated every frame) and another that does same and also blanks every other line.
+- Added separate non-laced and lace doubling modes to GUI. (Better labels needed, but there is no space)
+- Sound timing calculation wasn't updated to match new long/short field/interlace display emulation timing (b1).
+
 Beta 12:
 
 - AROS rom memory mapping fixed (b1).