]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1620b9.zip
authorToni Wilen <twilen@winuae.net>
Fri, 21 Aug 2009 16:22:08 +0000 (19:22 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:48:03 +0000 (21:48 +0200)
18 files changed:
akiko.c
cfgfile.c
custom.c
gencpu.c
gfxutil.c
include/cpu_prefetch.h
include/xwin.h
main.c
newcpu.c
od-win32/direct3d.c
od-win32/resources/resource
od-win32/resources/winuae.rc
od-win32/win32.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuae_msvc/winuae_msvc.vcproj
od-win32/winuaechangelog.txt

diff --git a/akiko.c b/akiko.c
index ed30efecad02123989c9c7828e84ecc1df2b7ab7..1313ca4a2d1762ab0b42c1f5f3a9bd5becf9adab 100644 (file)
--- a/akiko.c
+++ b/akiko.c
@@ -7,7 +7,7 @@
   * - NVRAM
   * - CDROM
   *
-  * Copyright 2001, 2002 Toni Wilen
+  * Copyright 2001-2009 Toni Wilen
   *
   */
 
@@ -332,9 +332,6 @@ static uae_u32 akiko_c2p_read (int offset)
 /* CD32 CDROM hardware emulation
  * Akiko addresses used:
  * 0xb80004-0xb80028
- *
- * I can't believe cd.device and custom loaders are fooled to think
- * this piece of crap emulates real CD32 CDROM controller and drive :)
  */
 
 #define CDINTERRUPT_SUBCODE        0x80000000
index d0fa9b57db07ea3755f8871f7ece3ce63b7de2cb..db1d5073253d535c19ab16db551549929ca1d831 100644 (file)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -167,6 +167,7 @@ static const TCHAR *autoscale[] = { L"none", L"scale", L"resize", 0 };
 static const TCHAR *joyportmodes[] = { NULL, L"mouse", L"djoy", L"ajoy", L"cdtvjoy", L"cd32joy", L"lightpen", 0 };
 static const TCHAR *epsonprinter[] = { L"none", L"ascii", L"epson_matrix", 0 };
 static const TCHAR *aspects[] = { L"none", L"vga", L"tv", 0 };
+static const TCHAR *vsyncmodes[] = { L"false", L"true", L"autoswitch", 0 };
 
 static const TCHAR *obsolete[] = {
     L"accuracy", L"gfx_opengl", L"gfx_32bit_blits", L"32bit_blits",
@@ -622,7 +623,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
     cfgfile_write (f, L"gfx_height_fullscreen", L"%d", p->gfx_size_fs.height);
     cfgfile_write (f, L"gfx_refreshrate", L"%d", p->gfx_refreshrate);
     cfgfile_write (f, L"gfx_autoresolution", L"%d", p->gfx_autoresolution);
-    cfgfile_write_bool (f, L"gfx_vsync", p->gfx_avsync);
+    cfgfile_write_str (f, L"gfx_vsync", vsyncmodes[p->gfx_avsync]);
     cfgfile_write_bool (f, L"gfx_vsync_picasso", p->gfx_pvsync);
     cfgfile_write_bool (f, L"gfx_lores", p->gfx_resolution == 0);
     cfgfile_write_str (f, L"gfx_resolution", lorestype1[p->gfx_resolution]);
@@ -765,8 +766,17 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
     cfgfile_write_bool (f, L"cpu_compatible", p->cpu_compatible);
     cfgfile_write_bool (f, L"cpu_24bit_addressing", p->address_space_24);
     /* do not reorder end */
+
+    if (p->cpu_frequency)
+       cfgfile_write (f, L"cpu_frequency", L"%d", p->cpu_frequency);
+    if (p->cpu_clock_multiplier) {
+       if (p->cpu_clock_multiplier >= 256)
+           cfgfile_write (f, L"cpu_multiplier", L"%d", p->cpu_clock_multiplier >> 8);
+    }
+
     cfgfile_write_bool (f, L"cpu_cycle_exact", p->cpu_cycle_exact);
     cfgfile_write_bool (f, L"blitter_cycle_exact", p->blitter_cycle_exact);
+    cfgfile_write_bool (f, L"cycle_exact", p->cpu_cycle_exact && p->blitter_cycle_exact ? 1 : 0);
     cfgfile_write_bool (f, L"rtg_nocustom", p->picasso96_nocustom);
     cfgfile_write (f, L"rtg_modes", L"0x%x", p->picasso96_modeflags);
 
@@ -828,7 +838,7 @@ int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name,
     *location = _tcstol (value, &endptr, base) * scale;
 
     if (*endptr != '\0' || *value == '\0') {
-       write_log (L"Option `%s' requires a numeric argument.\n", option);
+       write_log (L"Option '%s' requires a numeric argument but got '%s'\n", option, value);
        return -1;
     }
     return 1;
@@ -844,7 +854,7 @@ int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name,
        if (more)
            return 0;
 
-       write_log (L"Unknown value for option `%s'.\n", option);
+       write_log (L"Unknown value ('%s') for option '%s'.\n", value, option);
        return -1;
     }
     *location = val;
@@ -1042,7 +1052,6 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
        || cfgfile_yesno (option, value, L"avoid_vid", &p->avoid_vid)
        || cfgfile_yesno (option, value, L"log_illegal_mem", &p->illegal_mem)
        || cfgfile_yesno (option, value, L"filesys_no_fsdb", &p->filesys_no_uaefsdb)
-       || cfgfile_yesno (option, value, L"gfx_vsync", &p->gfx_avsync)
        || cfgfile_yesno (option, value, L"gfx_vsync_picasso", &p->gfx_pvsync)
        || cfgfile_yesno (option, value, L"gfx_blacker_than_black", &p->gfx_blackerthanblack)
        || cfgfile_yesno (option, value, L"gfx_flickerfixer", &p->gfx_scandoubler)
@@ -1085,6 +1094,12 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
            return 1;
 
 
+    if (_tcscmp (option, L"gfx_vsync") == 0) {
+       if (cfgfile_strval (option, value, L"gfx_vsync", &p->gfx_avsync, vsyncmodes, 0) >= 0)
+           return 1;
+       return cfgfile_yesno (option, value, L"gfx_vsync", &p->gfx_avsync);
+    }
+
     if (cfgfile_yesno (option, value, L"show_leds", &v)) {
        if (v)
            p->leds_on_screen |= STATUSLINE_CHIPSET;
@@ -1496,6 +1511,18 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, TCHAR *option, TCHAR *va
        /* we don't want cycle-exact in 68020/40+JIT modes */
        return 1;
     }
+    if (cfgfile_yesno (option, value, L"cycle_exact", &tmpval)) {
+       p->cpu_cycle_exact = p->blitter_cycle_exact = tmpval ? 1 : 0;
+       if (p->cpu_model >= 68020 && p->cachesize > 0)
+           p->cpu_cycle_exact = p->blitter_cycle_exact = 0;
+       return 1;
+    }
+
+    if (cfgfile_string (option, value, L"cpu_multiplier", tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) {
+       p->cpu_clock_multiplier = (int)(_tstof (tmpbuf) * 256.0);
+       return 1;
+    }
+
 
     if (cfgfile_yesno (option, value, L"scsi_a3000", &dummyint)) {
        if (dummyint)
@@ -1576,6 +1603,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, TCHAR *option, TCHAR *va
        || cfgfile_intval (option, value, L"maprom", &p->maprom, 1)
        || cfgfile_intval (option, value, L"parallel_autoflush", &p->parallel_autoflush_time, 1)
        || cfgfile_intval (option, value, L"uae_hide", &p->uae_hide, 1)
+       || cfgfile_intval (option, value, L"cpu_frequency", &p->cpu_frequency, 1)
        || cfgfile_intval (option, value, L"catweasel", &p->catweasel, 1))
        return 1;
 
@@ -3427,8 +3455,10 @@ static void set_68020_compa (struct uae_prefs *p, int compa)
     if (compa == 0) {
        p->blitter_cycle_exact = 1;
        p->m68k_speed = 0;
-       if (p->cpu_model == 68020 && p->cachesize == 0)
+       if (p->cpu_model == 68020 && p->cachesize == 0) {
            p->cpu_cycle_exact = 1;
+           p->cpu_clock_multiplier = 4 << 8;
+       }
     }
     if (compa > 0) {
        p->cpu_compatible = 0;
@@ -3449,6 +3479,7 @@ static void set_68020_compa (struct uae_prefs *p, int compa)
 
 static void set_68000_compa (struct uae_prefs *p, int compa)
 {
+    p->cpu_clock_multiplier = 2 << 8;
     switch (compa)
     {
        case 0:
index 7ce9ae74db0ed574d61c67ec732f2a4d504e7304..c1ef1ed4fa766d9c87ffc2d53e27a40e1740a03d 100644 (file)
--- a/custom.c
+++ b/custom.c
@@ -181,7 +181,6 @@ uae_u16 beamcon0, new_beamcon0;
 uae_u16 vtotal = MAXVPOS_PAL, htotal = MAXHPOS_PAL;
 static uae_u16 hsstop, hbstrt, hbstop, vsstop, vbstrt, vbstop, hsstrt, vsstrt, hcenter;
 static int ciavsyncmode;
-static int baseclock, cpucycleunit;
 
 #define HSYNCTIME (maxhpos * CYCLE_UNIT);
 
@@ -2545,6 +2544,11 @@ static void reset_decisions (void)
     last_sprite_point = 0;
     fetch_state = fetch_not_started;
     bplcon1_hpos = -1;
+    if (bpldmasetuphpos >= 0) {
+       // this can happen in "too fast" modes
+       BPLCON0_Denise (0, bplcon0);
+       setup_fmodes (0);
+    }
     bpldmasetuphpos = -1;
     bpldmasetupphase = 0;
 
@@ -2583,7 +2587,9 @@ static void reset_decisions (void)
 
 static int isvsync (void)
 {
-    return currprefs.gfx_avsync && currprefs.gfx_afullscreen && !picasso_on;
+    if (!currprefs.gfx_afullscreen || picasso_on || !currprefs.gfx_avsync)
+       return 0;
+    return currprefs.gfx_avsync;
 }
 
 int vsynctime_orig;
@@ -2595,8 +2601,8 @@ void compute_vsynctime (void)
        vblank_hz = currprefs.chipset_refreshrate;
        if (isvsync ()) {
            vblank_skip = 1;
-           if (!fake_vblank_hz && vblank_hz > 85) {
-               vblank_hz /= 2;
+           if (!fake_vblank_hz && getvsyncrate (vblank_hz) != vblank_hz) {
+               vblank_hz = getvsyncrate (vblank_hz);
                vblank_skip = -1;
            }
        }
@@ -2639,26 +2645,14 @@ void init_hz (void)
     int odbl = doublescan, omaxvpos = maxvpos;
     int hzc = 0;
 
-    if (vsync_switchmode (-1) > 0)
-       currprefs.gfx_avsync = changed_prefs.gfx_avsync = vsync_switchmode (-1);
+    if (vsync_switchmode (-1, 0) > 0)
+       currprefs.gfx_avsync = changed_prefs.gfx_avsync = vsync_switchmode (-1, 0);
 
     if (!isvsync () && ((currprefs.chipset_refreshrate == 50 && !currprefs.ntscmode) ||
        (currprefs.chipset_refreshrate == 60 && currprefs.ntscmode))) {
        currprefs.chipset_refreshrate = changed_prefs.chipset_refreshrate = 0;
     }
 
-    baseclock = currprefs.ntscmode ? 28636360 : 28375160;
-    cpucycleunit = CYCLE_UNIT / 2;
-    if (currprefs.cpu_clock_multiplier) {
-       if (currprefs.cpu_clock_multiplier >= 256) {
-           cpucycleunit = CYCLE_UNIT / (currprefs.cpu_clock_multiplier >> 8);
-       } else {
-           cpucycleunit = CYCLE_UNIT * currprefs.cpu_clock_multiplier;
-       }
-    } else if (currprefs.cpu_frequency) {
-       cpucycleunit = CYCLE_UNIT * baseclock / (currprefs.cpu_frequency * 8);
-    }
-
     doublescan = 0;
     if ((beamcon0 & 0xA0) != (new_beamcon0 & 0xA0))
        hzc = 1;
@@ -2733,6 +2727,14 @@ void init_hz (void)
        interlace_seen = (bplcon0 & 4) ? 1 : 0;
         reset_drawing ();
     }
+    if ((vblank_hz == 50 || vblank_hz == 60) && isvsync () == 2) {
+       if (getvsyncrate (currprefs.gfx_refreshrate) != vblank_hz)
+           vsync_switchmode (vblank_hz, currprefs.gfx_refreshrate);
+    }
+    if (isvsync ()) {
+       changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = abs (currprefs.gfx_refreshrate);
+    }
+
     compute_vsynctime ();
 #ifdef OPENGL
     OGL_refresh ();
@@ -2748,11 +2750,6 @@ void init_hz (void)
        vblank_hz, vblank_hz * maxvpos,
        maxhpos, maxvpos);
 
-    if ((vblank_hz == 50 || vblank_hz == 60) && isvsync ()) {
-       if (currprefs.gfx_refreshrate != vblank_hz)
-           vsync_switchmode (vblank_hz);
-    }
-
 }
 
 static void calcdiw (void)
@@ -4287,8 +4284,8 @@ static void compute_spcflag_copper (int hpos)
            return;
     }
     // do not use past cycles if starting for the first time in this line
-    // (write to DMACON for example)
-    if (!wasenabled && cop_state.hpos < hpos && hpos < maxhpos) {
+    // (write to DMACON for example) hpos+1 for long lines
+    if (!wasenabled && cop_state.hpos < hpos && hpos + 1 < maxhpos) {
        hpos = (hpos + 2) & ~1;
        if (hpos > (maxhpos & ~1))
            hpos = maxhpos & ~1;
@@ -5108,7 +5105,6 @@ static void hsync_handler (void)
            lightpen_triggered = 1;
        }
        vpos = 0;
-       lol = 0;
        vsync_handler ();
 #if 0
        if (input_recording > 0) {
@@ -6702,16 +6698,6 @@ void do_cycles_ce (long cycles)
     }
 }
 
-void do_cycles_ce020 (int clocks)
-{
-    do_cycles_ce (clocks * cpucycleunit);
-}
-
-void do_cycles_ce000 (int clocks)
-{
-    do_cycles_ce (clocks * cpucycleunit);
-}
-
 int is_cycle_ce (void)
 {
     int hpos = current_hpos ();
index 8b3ffae235173a948e346dc4c80eec3224a1d69e..7511daef6a70a22482767917eff718df840bee14 100644 (file)
--- a/gencpu.c
+++ b/gencpu.c
@@ -1342,6 +1342,9 @@ static void gen_opcode (unsigned long int opcode)
     struct instr *curi = table68k + opcode;
     insn_n_cycles = using_prefetch ? 0 : 4;
 
+    if (using_ce020) {
+       addcycles_ce020 (1); // better than nothing...
+    }
     start_brace ();
     m68k_pc_offset = 2;
     switch (curi->plev) {
index 44b50d3b91e37127ae1c83e83c24ba57624e08f4..429ece86a1a45cfbd583763368851399b259df8a 100644 (file)
--- a/gfxutil.c
+++ b/gfxutil.c
 
 #include <math.h>
 
+int getvsyncrate (int hz)
+{
+    if (hz > 85)
+       return hz / 2;
+    return hz;
+}
+
 #define RED    0
 #define GRN    1
 #define BLU    2
index fae528139fa970d70fead1bffd7166ee85be49c5..a7dc91705f665b3afa4ba19437e4d28d8eea12c2 100644 (file)
@@ -274,7 +274,6 @@ STATIC_INLINE uae_u32 mem_access_delay_wordi_read (uaecptr addr)
        case CE_MEMBANK_CHIP:
        return wait_cpu_cycle_read (addr, 1);
        case CE_MEMBANK_FAST:
-       case CE_MEMBANK_FAST16BIT:
        do_cycles_ce000 (4);
        break;
     }
@@ -288,7 +287,6 @@ STATIC_INLINE uae_u32 mem_access_delay_byte_read (uaecptr addr)
        case CE_MEMBANK_CHIP:
        return wait_cpu_cycle_read (addr, 0);
        case CE_MEMBANK_FAST:
-       case CE_MEMBANK_FAST16BIT:
        do_cycles_ce000 (4);
        break;
        
@@ -303,7 +301,6 @@ STATIC_INLINE void mem_access_delay_byte_write (uaecptr addr, uae_u32 v)
        wait_cpu_cycle_write (addr, 0, v);
        return;
        case CE_MEMBANK_FAST:
-       case CE_MEMBANK_FAST16BIT:
        do_cycles_ce000 (4);
        break;
     }
@@ -318,7 +315,6 @@ STATIC_INLINE void mem_access_delay_word_write (uaecptr addr, uae_u32 v)
        return;
        break;
        case CE_MEMBANK_FAST:
-       case CE_MEMBANK_FAST16BIT:
        do_cycles_ce000 (4);
        break;
     }
index 0d2df10264417d1d9aea7e823a32e16dfc9561be..6910adfb35ee6cc971bb323caa4199f7e162f300 100644 (file)
@@ -25,7 +25,7 @@ extern int isfullscreen (void);
 extern void toggle_fullscreen (void);
 extern void toggle_mousegrab (void);
 extern void desktop_coords (int *dw, int *dh, int *x, int *y, int *w, int *h);
-extern int vsync_switchmode (int);
+extern int vsync_switchmode (int, int);
 
 extern void flush_line (int);
 extern void flush_block (int, int);
@@ -53,6 +53,7 @@ extern void setup_greydither (int bits, allocfunc_type allocfunc);
 extern void setup_greydither_maxcol (int maxcol, allocfunc_type allocfunc);
 extern void setup_dither (int bits, allocfunc_type allocfunc);
 extern void DitherLine (uae_u8 *l, uae_u16 *r4g4b4, int x, int y, uae_s16 len, int bits) ASM_SYM_FOR_FUNC("DitherLine");
+extern int getvsyncrate (int hz);
 
 struct vidbuf_description
 {
diff --git a/main.c b/main.c
index 015e39b9fa243c9539155bc3bd6927dbe3086412..4a35ad758a67fa1462634f24c99e2ed8fe1fb7a1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -120,42 +120,28 @@ void fixup_cpu (struct uae_prefs *p)
        p->address_space_24 = 1;
        if (p->cpu_compatible || p->cpu_cycle_exact)
            p->fpu_model = 0;
-       if (!p->cpu_frequency && !p->cpu_clock_multiplier)
-           p->cpu_clock_multiplier = 2 << 8;
        break;
     case 68010:
        p->address_space_24 = 1;
        if (p->cpu_compatible || p->cpu_cycle_exact)
            p->fpu_model = 0;
-       if (!p->cpu_frequency && !p->cpu_clock_multiplier)
-           p->cpu_clock_multiplier = 2 << 8;
        break;
     case 68020:
-       if (!p->cpu_frequency && !p->cpu_clock_multiplier)
-           p->cpu_clock_multiplier = 4 << 8;
        break;
     case 68030:
        p->address_space_24 = 0;
-       if (!p->cpu_frequency && !p->cpu_clock_multiplier)
-           p->cpu_clock_multiplier = 8 << 8;
        break;
     case 68040:
        p->address_space_24 = 0;
        if (p->fpu_model)
            p->fpu_model = 68040;
-       if (!p->cpu_frequency && !p->cpu_clock_multiplier)
-           p->cpu_clock_multiplier = 16 << 8;
        break;
     case 68060:
        p->address_space_24 = 0;
        if (p->fpu_model)
            p->fpu_model = 68060;
-       if (!p->cpu_frequency && !p->cpu_clock_multiplier)
-           p->cpu_clock_multiplier = 16 << 8;
        break;
     }
-    if (!p->cpu_frequency && !p->cpu_clock_multiplier)
-        p->cpu_clock_multiplier = 4 << 8;
 }
 
 
@@ -808,7 +794,6 @@ static int real_main2 (int argc, TCHAR **argv)
     memory_reset ();
 
 #ifdef AUTOCONFIG
-    gfxlib_install ();
 #if defined (BSDSOCKET)
     bsdlib_install ();
 #endif
index a0ae2a1366625f2044e7dff8a5534924c3c6c718..e7993895e714b72af70a9498b3a6bb602831fe1f 100644 (file)
--- a/newcpu.c
+++ b/newcpu.c
@@ -57,6 +57,7 @@ unsigned long irqcycles[15];
 int irqdelay[15];
 int mmu_enabled, mmu_triggered;
 int cpu_cycles;
+static int baseclock, cpucycleunit;
 
 const int areg_byteinc[] = { 1, 1, 1, 1, 1, 1, 1, 2 };
 const int imm8_table[] = { 8, 1, 2, 3, 4, 5, 6, 7 };
@@ -306,6 +307,23 @@ static void update_68k_cycles (void)
        cycles_mask = 0xFFFFFFFF;
        cycles_val = 0;
     }
+    currprefs.cpu_clock_multiplier = changed_prefs.cpu_clock_multiplier;
+    currprefs.cpu_frequency = changed_prefs.cpu_frequency;
+
+    baseclock = currprefs.ntscmode ? 28636360 : 28375160;
+    cpucycleunit = CYCLE_UNIT / 2;
+    if (currprefs.cpu_clock_multiplier) {
+        if (currprefs.cpu_clock_multiplier >= 256) {
+           cpucycleunit = CYCLE_UNIT / (currprefs.cpu_clock_multiplier >> 8);
+       } else {
+           cpucycleunit = CYCLE_UNIT * currprefs.cpu_clock_multiplier;
+       }
+    } else if (currprefs.cpu_frequency) {
+        cpucycleunit = CYCLE_UNIT * baseclock / (currprefs.cpu_frequency * 8);
+    }
+    if (cpucycleunit < 1)
+       cpucycleunit = 1;
+    write_log (L"CPU cycleunit: %d (%.3f)\n", cpucycleunit, (float)cpucycleunit / CYCLE_UNIT);
 }
 
 static void prefs_changed_cpu (void)
@@ -337,11 +355,16 @@ void check_prefs_changed_cpu (void)
        build_cpufunctbl ();
        changed = 1;
     }
-    if (changed || currprefs.m68k_speed != changed_prefs.m68k_speed) {
+    if (changed
+       || currprefs.m68k_speed != changed_prefs.m68k_speed
+       || currprefs.cpu_clock_multiplier != changed_prefs.cpu_clock_multiplier
+       || currprefs.cpu_frequency != changed_prefs.cpu_frequency) {
        currprefs.m68k_speed = changed_prefs.m68k_speed;
        reset_frame_rate_hack ();
        update_68k_cycles ();
+       changed = 1;
     }
+
     if (currprefs.cpu_idle != changed_prefs.cpu_idle) {
        currprefs.cpu_idle = changed_prefs.cpu_idle;
     }
@@ -3568,3 +3591,13 @@ void fill_cache0x0 (uae_u32 addr)
     else
        fill_cache020 (addr);
 }
+
+void do_cycles_ce020 (int clocks)
+{
+    do_cycles_ce (clocks * cpucycleunit);
+}
+
+void do_cycles_ce000 (int clocks)
+{
+    do_cycles_ce (clocks * cpucycleunit);
+}
index 67ace7815e4d5baebc7249210fc2c4a1a4405a25..856b6ac7c579c44901b6fdb640707e04a34064b3 100644 (file)
@@ -1194,7 +1194,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth
        modeex.RefreshRate = dpp.FullScreen_RefreshRateInHz;
        if (currprefs.gfx_avsync > 0) {
            dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
-           if (currprefs.gfx_avsync > 85) {
+           if (getvsyncrate (dpp.FullScreen_RefreshRateInHz) != dpp.FullScreen_RefreshRateInHz) {
                if (d3dCaps.PresentationIntervals & D3DPRESENT_INTERVAL_TWO)
                    dpp.PresentationInterval = D3DPRESENT_INTERVAL_TWO;
                else
index 8c962921d479a8b6b707c7e868a12612cc848a25..061f680a18d70ab40203905917c6c83fa318d46e 100644 (file)
 #define IDS_SCREEN_FULLSCREEN           196
 #define IDS_SCREEN_FULLWINDOW           197
 #define IDS_SCREEN_VSYNC                198
+#define IDS_SCREEN_VSYNC_AUTOSWITCH     199
 #define IDS_SOUND_MONO                  200
 #define IDS_SOUND_MIXED                 201
 #define IDI_QUICKSTART                  201
 #define IDC_CS_HOST                     1209
 #define IDC_CS_68000                    1210
 #define IDC_CS_ADJUSTABLE               1211
-#define IDC_CS_CPU_TEXT                 1212
-#define IDC_CS_CHIPSET_TEXT             1213
 #define IDC_COMPATIBLE                  1214
 #define IDC_TRUST0                      1215
 #define IDC_TRUST1                      1216
 #define IDC_CACHE                       1218
 #define IDC_CYCLEEXACT                  1219
-#define IDC_CS_CPU_TEXT2                1219
 #define IDC_CPUIDLE                     1220
 #define IDC_GENLOCK                     1220
 #define IDC_COMPATIBLE_FPU              1221
 #define IDC_CPUTEXT                     1508
 #define IDC_MAPDRIVES_NET               1508
 #define IDC_RESTARTEMU                  1508
-#define IDC_SWAP                        1509
 #define IDC_CACHETEXT                   1509
+#define IDC_SWAP                        1509
 #define IDC_MAPDRIVES_CD                1509
 #define IDC_SELECTRESTEXT               1510
 #define IDC_FLUSHPRINTER                1510
 #define IDC_NOFLAGS                     1581
 #define IDC_SOUNDDRIVEVOLUME2           1581
 #define IDC_CS_CACHE_TEXT               1582
+#define IDC_CS_CACHE_TEXT2              1583
 #define IDC_COLLISIONS                  1584
 #define IDC_JITENABLE                   1584
 #define IDC_DISASSEMBLY                 1585
 #define IDC_PATHS_CONFIGS               1662
 #define IDC_SOUNDSWAP                   1662
 #define IDC_PATHS_SCREENSHOTS           1663
-#define IDC_SOUNDFREQ2                  1663
 #define IDC_PATHS_SAVESTATES            1664
 #define IDC_SOUNDSTEREOSWAPTXT          1664
 #define IDC_SOUNDSWAPTXT                1664
 #define IDC_RTG_32BIT                   1790
 #define IDC_ASSOCIATE_OFF               1790
 #define IDC_PORT_TABLET_FULL            1790
+#define IDC_CPU_MULTIPLIER              1790
 #define IDC_DD_SURFACETYPE              1791
 #define IDC_RTG_SCALE_ALLOW             1791
+#define IDC_CPU_FREQUENCY               1791
 #define IDC_RTG_SCALE_ASPECTRATIO       1792
 #define IDC_ASSOCIATE_ON                1792
 #define IDC_RTG_VBLANKRATE              1793
 #define _APS_3D_CONTROLS                     1
 #define _APS_NEXT_RESOURCE_VALUE        352
 #define _APS_NEXT_COMMAND_VALUE         40045
-#define _APS_NEXT_CONTROL_VALUE         1790
+#define _APS_NEXT_CONTROL_VALUE         1792
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif
index a45f1075673b2abec990297eebcc68379423d34f..13f92c61084abef33d808a95eda7d827b5d5c77b 100644 (file)
@@ -179,11 +179,11 @@ BEGIN
     EDITTEXT        IDC_MBRAM2,244,122,34,12,ES_CENTER | ES_READONLY\r
 END\r
 \r
-IDD_CPU DIALOGEX 0, 0, 300, 226\r
+IDD_CPU DIALOGEX 0, 0, 300, 241\r
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
 FONT 8, "MS Sans Serif", 0, 0, 0x0\r
 BEGIN\r
-    GROUPBOX        "CPU",IDC_STATIC,5,3,81,139,BS_LEFT\r
+    GROUPBOX        "CPU",IDC_STATIC,5,1,81,142,BS_LEFT\r
     CONTROL         "68000",IDC_CPU0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,16,63,10\r
     CONTROL         "68010",IDC_CPU1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,30,65,10\r
     CONTROL         "68020",IDC_CPU2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,44,63,10\r
@@ -191,38 +191,41 @@ BEGIN
     CONTROL         "68040",IDC_CPU4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,72,66,10\r
     CONTROL         "68060",IDC_CPU5,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,86,66,10\r
     CONTROL         "More compatible [] Emulate 68000's prefetch registers. More compatible but slower.",IDC_COMPATIBLE,\r
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,114,73,8\r
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,117,73,8\r
     CONTROL         "JIT [] Enable just-in-time CPU emulator. Significantly increases the speed of the CPU emulation. Requires 68020 or higher CPU.",IDC_JITENABLE,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,127,73,10\r
-    GROUPBOX        "CPU Emulation Speed",IDC_STATIC,90,3,205,90\r
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,129,73,10\r
+    GROUPBOX        "CPU Emulation Speed",IDC_STATIC,90,3,205,92\r
     CONTROL         "Fastest possible, but maintain chipset timing",IDC_CS_HOST,\r
                     "Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_GROUP | WS_TABSTOP,95,18,195,10\r
     CONTROL         "Match A500 speed",IDC_CS_68000,"Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,95,32,195,10\r
     CONTROL         "Adjustable between CPU and chipset",IDC_CS_ADJUSTABLE,\r
                     "Button",BS_AUTORADIOBUTTON | BS_LEFT | WS_TABSTOP,95,46,195,10\r
-    RTEXT           "CPU",IDC_CS_CPU_TEXT,96,73,15,10,SS_CENTERIMAGE | WS_TABSTOP\r
-    CONTROL         "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,114,68,67,20\r
-    LTEXT           "Chipset",IDC_CS_CHIPSET_TEXT,182,73,25,10,SS_CENTERIMAGE | NOT WS_GROUP | WS_TABSTOP\r
-    RTEXT           "CPU idle",IDC_CS_CPU_TEXT2,236,56,32,10,SS_CENTERIMAGE | WS_TABSTOP\r
-    CONTROL         "",IDC_CPUIDLE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,219,68,69,20\r
-    GROUPBOX        "Advanced JIT Settings",IDC_STATIC,90,94,205,93\r
-    RTEXT           "Cache size:",IDC_CS_CACHE_TEXT,95,113,45,10,SS_CENTERIMAGE | WS_TABSTOP\r
-    CONTROL         "Slider1",IDC_CACHE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,140,108,115,20\r
-    EDITTEXT        IDC_CACHETEXT,255,113,30,12,ES_CENTER | ES_READONLY\r
-    CONTROL         "Hard flush",IDC_HARDFLUSH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,141,63,10\r
-    CONTROL         "Constant jump",IDC_CONSTJUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,155,63,10\r
-    CONTROL         "FPU support",IDC_JITFPU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,169,62,10\r
-    CONTROL         "No flags",IDC_NOFLAGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,168,141,62,10\r
-    CONTROL         "Direct",IDC_TRUST0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,235,141,52,10\r
-    CONTROL         "Indirect",IDC_TRUST1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,235,155,52,10\r
+    CONTROL         "Slider1",IDC_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,114,71,67,20\r
+    CONTROL         "",IDC_CPUIDLE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,219,71,69,20\r
+    GROUPBOX        "Advanced JIT Settings",IDC_STATIC,90,147,205,91\r
+    CONTROL         "Slider1",IDC_CACHE,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,140,161,115,20\r
+    EDITTEXT        IDC_CACHETEXT,255,166,30,12,ES_CENTER | ES_READONLY\r
+    CONTROL         "Hard flush",IDC_HARDFLUSH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,194,63,10\r
+    CONTROL         "Constant jump",IDC_CONSTJUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,208,63,10\r
+    CONTROL         "FPU support",IDC_JITFPU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,222,62,10\r
+    CONTROL         "No flags",IDC_NOFLAGS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,168,194,62,10\r
+    CONTROL         "Direct",IDC_TRUST0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,235,194,52,10\r
+    CONTROL         "Indirect",IDC_TRUST1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,235,208,52,10\r
     CONTROL         "More compatible [] More compatible but slower FPU emulation.",IDC_COMPATIBLE_FPU,\r
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,210,73,10\r
-    GROUPBOX        "FPU",IDC_STATIC,6,146,81,80,BS_LEFT\r
-    CONTROL         "24-bit addressing",IDC_COMPATIBLE24,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,100,73,8\r
-    CONTROL         "None",IDC_FPU0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,157,63,10\r
-    CONTROL         "68881",IDC_FPU1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,171,63,10\r
-    CONTROL         "68882",IDC_FPU2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,185,63,10\r
-    CONTROL         "CPU internal",IDC_FPU3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,199,63,10\r
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,223,73,10\r
+    GROUPBOX        "FPU",IDC_STATIC,6,147,81,91,BS_LEFT\r
+    CONTROL         "24-bit addressing",IDC_COMPATIBLE24,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,10,104,73,8\r
+    CONTROL         "None",IDC_FPU0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,164,63,10\r
+    CONTROL         "68881",IDC_FPU1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,179,63,10\r
+    CONTROL         "68882",IDC_FPU2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,193,63,10\r
+    CONTROL         "CPU internal",IDC_FPU3,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,14,208,63,10\r
+    COMBOBOX        IDC_CPU_FREQUENCY,212,119,73,75,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP\r
+    RTEXT           "CPU Frequency",IDC_STATIC,105,119,87,10,SS_CENTERIMAGE\r
+    GROUPBOX        "Cycle-exact CPU Emulation Speed",IDC_STATIC,90,99,205,44\r
+    RTEXT           "CPU",IDC_STATIC,96,77,17,10,SS_CENTERIMAGE\r
+    RTEXT           "Chipset",IDC_STATIC,182,77,26,9,SS_CENTERIMAGE\r
+    RTEXT           "CPU Idle",IDC_STATIC,231,60,47,9,SS_CENTERIMAGE\r
+    RTEXT           "Cache size:",IDC_STATIC,95,167,42,10,SS_CENTERIMAGE\r
 END\r
 \r
 IDD_FLOPPY DIALOGEX 0, 0, 300, 240\r
@@ -480,7 +483,7 @@ BEGIN
     COMBOBOX        IDC_SCSIMODE,92,51,64,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     COMBOBOX        IDC_LANGUAGE,103,121,179,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     GROUPBOX        "Language",IDC_STATIC,7,113,285,25\r
-    CONTROL         "Disable powersaving features",IDC_POWERSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,120,10\r
+    CONTROL         "Disable screensaver",IDC_POWERSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,120,10\r
     CONTROL         "uaenet.device",IDC_SANA2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,66,94,10\r
     COMBOBOX        IDC_DD_SURFACETYPE,217,93,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
     RTEXT           "Display buffer:",IDC_STATIC,159,94,52,10,SS_CENTERIMAGE\r
@@ -1301,6 +1304,7 @@ BEGIN
     IDS_SCREEN_FULLSCREEN   "Fullscreen"\r
     IDS_SCREEN_FULLWINDOW   "Full-window"\r
     IDS_SCREEN_VSYNC        "VSync"\r
+    IDS_SCREEN_VSYNC_AUTOSWITCH "AutoVSync"\r
     IDS_SOUND_MONO          "Mono"\r
     IDS_SOUND_MIXED         "Mixed"\r
     IDS_SOUND_STEREO        "Stereo"\r
index 1a8df0bfa35f4570289918a1bf1b9e485604d1c5..70f84f986bbd896069b1510f53e7d83acae05c79 100644 (file)
@@ -652,6 +652,7 @@ static void winuae_active (HWND hWnd, int minimized)
        lcd_priority (1);
 #endif
     clipboard_active (hAmigaWnd, 1);
+    SetThreadExecutionState (ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
 #if 0
     if (os_vista && AVTask == NULL) {
        DWORD taskIndex = 0;
@@ -671,6 +672,8 @@ static void winuae_inactive (HWND hWnd, int minimized)
        AvRevertMmThreadCharacteristics (AVTask);
     AVTask = NULL;
 #endif
+    if (!currprefs.win32_powersavedisabled)
+       SetThreadExecutionState (ES_CONTINUOUS);
     if (minimized)
        exit_gui (0);
     focus = 0;
@@ -1142,9 +1145,14 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
        {
            case SC_SCREENSAVE: // Screensaver Trying To Start?
            case SC_MONITORPOWER: // Monitor Trying To Enter Powersave?
+
+           // SetThreadExecutionState (ES_CONTINUOUS | ES_DISPLAY_REQUIRED); handles this now
+#if 0
            if (!manual_painting_needed && focus && currprefs.win32_powersavedisabled)
                return 0; // Prevent From Happening
+#endif
            break;
+
            default:
            {
                LRESULT lr;
index 74d2871915906ca7a64ecf9be7a416420f20cf3f..818cbd0754a150130ed7f7034b1a1bbeb8299b6d 100644 (file)
@@ -17,8 +17,8 @@
 
 #define WINUAEPUBLICBETA 1
 
-#define WINUAEBETA L"8"
-#define WINUAEDATE MAKEBD(2009, 8, 19)
+#define WINUAEBETA L"9"
+#define WINUAEDATE MAKEBD(2009, 8, 21)
 #define WINUAEEXTRA L""
 #define WINUAEREV L""
 
index 3c4df63e02a8e2905bde3f535a59453730016b40..1529fcddbd51e520857f32cc2f5246ce6c7a1827 100644 (file)
@@ -1694,15 +1694,16 @@ static int reopen (int full)
     return 0;
 }
 
-int vsync_switchmode (int hz)
+int vsync_switchmode (int hz, int oldhz)
 {
     static int tempvsync;
     int w = currentmode->native_width;
     int h = currentmode->native_height;
     int d = currentmode->native_depth / 8;
     struct MultiDisplay *md = getdisplay (&currprefs);
-    struct PicassoResolution *found = NULL;
+    struct PicassoResolution *found;
     int newh, i, cnt;
+    int dbl = getvsyncrate (currprefs.chipset_refreshrate) != currprefs.chipset_refreshrate ? 2 : 1;
 
     if (hz < 0)
        return tempvsync;
@@ -1711,7 +1712,27 @@ int vsync_switchmode (int hz)
        newh = h * 312 / 262;
     else
        newh = h * 262 / 312;
+    hz = hz * dbl;
+
+    found = NULL;
+    for (i = 0; md->DisplayModes[i].depth >= 0 && !found; i++) {
+        struct PicassoResolution *r = &md->DisplayModes[i];
+       if (r->res.width == w && r->res.height == h && r->depth == d) {
+           int j;
+           for (j = 0; r->refresh[j] > 0; j++) {
+               if (r->refresh[j] == oldhz) {
+                   found = r;
+                   break;
+               }
+           }
+       }
+    }
+    if (found == NULL) {
+       write_log (L"refresh rate changed to %d but original rate was not found\n", hz);
+       return 0;
+    }
 
+    found = NULL;
     for (cnt = 0; cnt <= abs (newh - h) && !found; cnt++) {
        for (i = 0; md->DisplayModes[i].depth >= 0 && !found; i++) {
            struct PicassoResolution *r = &md->DisplayModes[i];
index 935b24631aaebd1b846df8c94aeb04586c2be611..ae1ab2e43f0160ce19df8920736c0c257b1a7779 100644 (file)
@@ -4759,19 +4759,21 @@ static void init_display_mode (HWND hDlg)
 
 }
 
-static int display_toselect(int fs, int vsync, int p96)
+static int display_toselect (int fs, int vsync, int p96)
 {
     if (p96)
-       return fs *  2 + vsync;
+       return fs * 2 + (vsync ? 1 : 0);
     if (fs == 2)
-       return 3;
+       return 4;
     if (!vsync)
        return fs;
-    if (fs == 1 && vsync)
+    if (fs == 1 && vsync == 1)
        return 2;
+    if (fs == 1 && vsync == 2)
+       return 3;
     return fs;
 }
-static void display_fromselect(int val, int *fs, int *vsync, int p96)
+static void display_fromselect (int val, int *fs, int *vsync, int p96)
 {
     int ofs = *fs;
     if (val == CB_ERR)
@@ -4800,6 +4802,10 @@ static void display_fromselect(int val, int *fs, int *vsync, int p96)
        *vsync = 1;
        break;
        case 3:
+       *fs = 1;
+       *vsync = 2;
+       break;
+       case 4:
        *fs = 2;
        if (workprefs.gfx_filter == 0 && *fs != ofs) {
            if (D3D_goodenough ()) {
@@ -4859,16 +4865,29 @@ static void values_to_displaydlg (HWND hDlg)
     CheckRadioButton (hDlg, IDC_LM_NORMAL, IDC_LM_SCANLINES, IDC_LM_NORMAL + workprefs.gfx_linedbl);
 
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_RESETCONTENT, 0, 0);
+
     WIN32GUI_LoadUIString(IDS_SCREEN_WINDOWED, buffer, sizeof buffer / sizeof (TCHAR));
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_ADDSTRING, 0, (LPARAM)buffer);
+
     WIN32GUI_LoadUIString(IDS_SCREEN_FULLSCREEN, buffer, sizeof buffer / sizeof (TCHAR));
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_ADDSTRING, 0, (LPARAM)buffer);
+
     WIN32GUI_LoadUIString(IDS_SCREEN_VSYNC, buffer2, sizeof buffer2 / sizeof (TCHAR));
     _stprintf (buffer + _tcslen (buffer), L" + %s", buffer2);
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_ADDSTRING, 0, (LPARAM)buffer);
+
+    WIN32GUI_LoadUIString(IDS_SCREEN_FULLSCREEN, buffer, sizeof buffer / sizeof (TCHAR));
+    WIN32GUI_LoadUIString(IDS_SCREEN_VSYNC_AUTOSWITCH, buffer2, sizeof buffer2 / sizeof (TCHAR));
+    _stprintf (buffer + _tcslen (buffer), L" + %s", buffer2);
+    SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_ADDSTRING, 0, (LPARAM)buffer);
+
+
     WIN32GUI_LoadUIString(IDS_SCREEN_FULLWINDOW, buffer, sizeof buffer / sizeof (TCHAR));
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_ADDSTRING, 0, (LPARAM)buffer);
-    SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_SETCURSEL, display_toselect(workprefs.gfx_afullscreen, workprefs.gfx_avsync, 0), 0);
+
+    SendDlgItemMessage(hDlg, IDC_SCREENMODE_NATIVE, CB_SETCURSEL,
+       display_toselect (workprefs.gfx_afullscreen, workprefs.gfx_avsync, 0), 0);
+
 
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG, CB_RESETCONTENT, 0, 0);
     WIN32GUI_LoadUIString(IDS_SCREEN_WINDOWED, buffer, sizeof buffer / sizeof (TCHAR));
@@ -4884,7 +4903,8 @@ static void values_to_displaydlg (HWND hDlg)
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG, CB_ADDSTRING, 0, (LPARAM)buffer);
     _stprintf (buffer + _tcslen (buffer), L" + %s", buffer2);
     SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG, CB_ADDSTRING, 0, (LPARAM)buffer);
-    SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG, CB_SETCURSEL, display_toselect(workprefs.gfx_pfullscreen, workprefs.gfx_pvsync, 1), 0);
+    SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG, CB_SETCURSEL,
+       display_toselect (workprefs.gfx_pfullscreen, workprefs.gfx_pvsync, 1), 0);
 
     SendDlgItemMessage(hDlg, IDC_LORES, CB_RESETCONTENT, 0, 0);
     WIN32GUI_LoadUIString(IDS_RES_LORES, buffer, sizeof buffer / sizeof (TCHAR));
@@ -6729,12 +6749,9 @@ static void enable_for_cpudlg (HWND hDlg)
     /* These four items only get enabled when adjustable CPU style is enabled */
     ew (hDlg, IDC_SPEED, workprefs.m68k_speed > 0);
     ew (hDlg, IDC_COMPATIBLE24, workprefs.cpu_model == 68020);
-    ew (hDlg, IDC_CS_CPU_TEXT, (!workprefs.cpu_cycle_exact || workprefs.cpu_model > 68000) && workprefs.m68k_speed > 0);
-    ew (hDlg, IDC_CS_CHIPSET_TEXT, (!workprefs.cpu_cycle_exact || workprefs.cpu_model > 68000) && workprefs.m68k_speed > 0);
-    ew (hDlg, IDC_CS_HOST, !workprefs.cpu_cycle_exact || workprefs.cpu_model > 68000);
-    ew (hDlg, IDC_CS_68000, !workprefs.cpu_cycle_exact || workprefs.cpu_model > 68000);
-    ew (hDlg, IDC_CS_ADJUSTABLE, !workprefs.cpu_cycle_exact || workprefs.cpu_model > 68000);
-    ew (hDlg, IDC_CPUTEXT, workprefs.m68k_speed > 0 );
+    ew (hDlg, IDC_CS_HOST, !workprefs.cpu_cycle_exact);
+    ew (hDlg, IDC_CS_68000, !workprefs.cpu_cycle_exact);
+    ew (hDlg, IDC_CS_ADJUSTABLE, !workprefs.cpu_cycle_exact);
     ew (hDlg, IDC_CPUIDLE, workprefs.m68k_speed != 0 ? TRUE : FALSE);
 #if !defined(CPUEMU_0) || defined(CPUEMU_68000_ONLY)
     ew (hDlg, IDC_CPU1, FALSE);
@@ -6760,10 +6777,13 @@ static void enable_for_cpudlg (HWND hDlg)
     ew (hDlg, IDC_NOFLAGS, enable);
     ew (hDlg, IDC_CS_CACHE_TEXT, enable);
     ew (hDlg, IDC_CACHE, enable);
-    ew (hDlg, IDC_CACHETEXT, enable);
     ew (hDlg, IDC_JITENABLE, cpu_based_enable);
     ew (hDlg, IDC_COMPATIBLE, !workprefs.cpu_cycle_exact && !workprefs.cachesize);
     ew (hDlg, IDC_COMPATIBLE_FPU, workprefs.fpu_model > 0);
+#if 0
+    ew (hDlg, IDC_CPU_MULTIPLIER, workprefs.cpu_cycle_exact);
+#endif
+    ew (hDlg, IDC_CPU_FREQUENCY, workprefs.cpu_cycle_exact);
 
     fpu = TRUE;
     if (workprefs.cpu_model > 68030 || workprefs.cpu_compatible || workprefs.cpu_cycle_exact)
@@ -6776,7 +6796,7 @@ static void enable_for_cpudlg (HWND hDlg)
 static void values_to_cpudlg (HWND hDlg)
 {
     TCHAR cache[8] = L"";
-    int cpu;
+    int cpu, idx;
 
     SendDlgItemMessage (hDlg, IDC_SPEED, TBM_SETPOS, TRUE, workprefs.m68k_speed <= 0 ? 1 : workprefs.m68k_speed / CYCLE_UNIT );
     SetDlgItemInt( hDlg, IDC_CPUTEXT, workprefs.m68k_speed <= 0 ? 1 : workprefs.m68k_speed / CYCLE_UNIT, FALSE );
@@ -6808,11 +6828,12 @@ static void values_to_cpudlg (HWND hDlg)
     CheckDlgButton (hDlg, IDC_HARDFLUSH, workprefs.comp_hardflush);
     CheckDlgButton (hDlg, IDC_CONSTJUMP, workprefs.comp_constjump);
     CheckDlgButton (hDlg, IDC_JITENABLE, workprefs.cachesize > 0);
+
 }
 
 static void values_from_cpudlg (HWND hDlg)
 {
-    int newcpu, newfpu, newtrust, oldcache, jitena;
+    int newcpu, newfpu, newtrust, oldcache, jitena, idx;
     static int cachesize_prev, trust_prev;
 
     workprefs.cpu_compatible = workprefs.cpu_cycle_exact | (IsDlgButtonChecked (hDlg, IDC_COMPATIBLE) ? 1 : 0);
@@ -6909,11 +6930,36 @@ static void values_from_cpudlg (HWND hDlg)
        SendMessage (pages[DISPLAY_ID], WM_USER, 0, 0);
     if (pages[MEMORY_ID])
        SendMessage (pages[MEMORY_ID], WM_USER, 0, 0);
+
+   
+    idx = SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_GETCURSEL, 0, 0);
+    if (idx >= 0) {
+       workprefs.cpu_frequency = 0;
+       workprefs.cpu_clock_multiplier = 0;
+       if (idx == 0)
+           workprefs.cpu_clock_multiplier = 2 << 8;
+       if (idx == 1)
+           workprefs.cpu_clock_multiplier = 4 << 8;
+       if (idx == 2)
+           workprefs.cpu_clock_multiplier = 8 << 8;
+    } else {
+       TCHAR txt[20];
+       SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, WM_GETTEXT, (WPARAM)sizeof (txt) / sizeof (TCHAR), (LPARAM)txt);
+       workprefs.cpu_clock_multiplier = 0;
+       workprefs.cpu_frequency = _tstof (txt) * 1000000.0;
+       if (workprefs.cpu_frequency < 1 * 1000000)
+           workprefs.cpu_frequency = 1 * 1000000;
+       if (workprefs.cpu_frequency >= 99 * 1000000)
+           workprefs.cpu_frequency = 99 * 1000000;
+    }
+
+
 }
 
 static INT_PTR CALLBACK CPUDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
     static int recursive = 0;
+    int idx;
 
     switch (msg) {
     case WM_INITDIALOG:
@@ -6925,6 +6971,35 @@ static INT_PTR CALLBACK CPUDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
        SendDlgItemMessage (hDlg, IDC_CACHE, TBM_SETPAGESIZE, 0, 1);
        SendDlgItemMessage (hDlg, IDC_CPUIDLE, TBM_SETRANGE, TRUE, MAKELONG (0, 10));
        SendDlgItemMessage (hDlg, IDC_CPUIDLE, TBM_SETPAGESIZE, 0, 1);
+#if 0
+       SendDlgItemMessage (hDlg, IDC_CPU_MULTIPLIER, CB_RESETCONTENT, 0, 0);
+       SendDlgItemMessage (hDlg, IDC_CPU_MULTIPLIER, CB_ADDSTRING, 0, (LPARAM)L"-");
+       SendDlgItemMessage (hDlg, IDC_CPU_MULTIPLIER, CB_ADDSTRING, 0, (LPARAM)L"1 (3.5MHz)");
+       SendDlgItemMessage (hDlg, IDC_CPU_MULTIPLIER, CB_ADDSTRING, 0, (LPARAM)L"2 (7.1MHz)");
+       SendDlgItemMessage (hDlg, IDC_CPU_MULTIPLIER, CB_ADDSTRING, 0, (LPARAM)L"4 (14.2MHz)");
+       SendDlgItemMessage (hDlg, IDC_CPU_MULTIPLIER, CB_ADDSTRING, 0, (LPARAM)L"8 (28.4MHz)");
+#endif
+       SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_RESETCONTENT, 0, 0);
+       SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)L"7MHz");
+       SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)L"14MHz");
+       SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)L"28MHz");
+
+       idx = -1;
+       if (workprefs.cpu_frequency) {
+           TCHAR txt[20];
+           _stprintf (txt, L"%.3f", workprefs.cpu_frequency / 1000000.0);
+           SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, WM_SETTEXT, 0, (LPARAM)txt);
+       } else if (workprefs.cpu_clock_multiplier == 2 << 8) {
+           idx = 0;
+       } else if (workprefs.cpu_clock_multiplier == 4 << 8) {
+           idx = 1;
+       } else if (workprefs.cpu_clock_multiplier == 8 << 8) {
+           idx = 2;
+       }
+       if (idx >= 0)
+           SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_SETCURSEL, idx, 0);
+       
+
 
     case WM_USER:
        recursive++;
index 1572f46265efd3b132433aab320a0a685ddb10d4..4f312655ab570ee9f164e05db475835b31e9e884 100644 (file)
                                        >
                                </File>
                                <File
-                                       RelativePath="..\resources\configfile.ico"
+                                       RelativePath=".\configfile.ico"
                                        >
                                </File>
                                <File
-                                       RelativePath=".\configfile.ico"
+                                       RelativePath="..\resources\configfile.ico"
                                        >
                                </File>
                                <File
                                        >
                                </File>
                                <File
-                                       RelativePath="..\resources\file.ico"
+                                       RelativePath=".\file.ico"
                                        >
                                </File>
                                <File
-                                       RelativePath=".\file.ico"
+                                       RelativePath="..\resources\file.ico"
                                        >
                                </File>
                                <File
                                        >
                                </File>
                                <File
-                                       RelativePath=".\port.ico"
+                                       RelativePath="..\resources\port.ico"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\resources\port.ico"
+                                       RelativePath=".\port.ico"
                                        >
                                </File>
                                <File
                                RelativePath="..\..\gayle.c"
                                >
                        </File>
-                       <File
-                               RelativePath="..\..\gfxlib.c"
-                               >
-                       </File>
                        <File
                                RelativePath="..\..\gfxutil.c"
                                >
index b6a686e285b18e5be44454a6582cf184d97fcd90..5e03deedd2343ed4ed72dde4364a0cc032c13a85 100644 (file)
@@ -1,4 +1,29 @@
 
+Beta 9:
+
+- vsync automatic frequency switching is now optional ("autovsync")
+- 100Hz/120Hz supported in vsync automatic switching mode
+- "Disable powersaving features" is now "Disable screensaver" (when
+  not active) Screensavers are always disabled when active. Programs
+  shouldn't override "real" powersaving features anymore (and Vista
+  and later will ignore these requests anyway)
+- 68020 CE mode all instructions now need at least 1 CPU cycle (1/4
+  bus cycle) to finish (+any slow chip/custom memory fetches),
+  previously all instructions were instant when accessing fast ram
+- CPU frequency configuration added (CE-modes only). Fast RAM (and ROM)
+  is always considered wait-state free, chip ram speed does not change
+  Pre-defined values use main clock as CPU clock source (=includes
+  PAL/NTSC difference), manually typed frequency basically emulate CPU
+  card that has separate CPU clock crystal. For example pre-defined
+  "7MHz" is 7.093790.. if PAL mode) Not very useful in 68020 mode. yet.
+  (see earlier beta change log for explanation)
+- copper woke up 1 line too late (and never woke up if waiting for line
+  255) if wait ended on NTSC long line (this was the real reason for
+  NTSC jumping, b8 hack removed)
+- added "cycle_exact" configuration entry, quick way to switch CE on/off
+  with uae-configuration
+- display parameters were not fully updated if CPU was "too fast" (b5)
+
 Beta 8:
 
 68020 CE mode updates:
@@ -25,6 +50,7 @@ too fast blitter was the most common cause for problems.
 - CD32 drive command communication and interrupt handling rewritten,
   should now match real hardware (I think..) At least Brian the Lion
   CD32 works again..
+- NTSC mode shouldn't jump anymore
 - automatic vsync mode on the fly switching between 50Hz and 60Hz
   screen modes if refresh rate is supported, disable vsync temporarily
   if rate not supported (until switching back to supported rate)