]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2500b20
authorToni Wilen <twilen@winuae.net>
Sun, 7 Oct 2012 11:15:50 +0000 (14:15 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 7 Oct 2012 11:15:50 +0000 (14:15 +0300)
23 files changed:
akiko.cpp
cdtv.cpp
cfgfile.cpp
cia.cpp
custom.cpp
drawing.cpp
filesys.cpp
gayle.cpp
include/gui.h
include/options.h
include/uae.h
main.cpp
od-win32/dinput.cpp
od-win32/lcd.cpp
od-win32/resources/resource.h
od-win32/resources/winuae.rc
od-win32/rp.cpp
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt
statusline.cpp

index d220aa98c1ca32c057e2f25bb22780bece10e908..b902f14f27821848ab495b4a7331aa13ced1ee14 100644 (file)
--- a/akiko.cpp
+++ b/akiko.cpp
@@ -1863,6 +1863,7 @@ int akiko_init (void)
                init_comm_pipe (&requests, 100, 1);
                uae_start_thread (_T("akiko"), akiko_thread, 0, NULL);
        }
+       gui_flicker_led (LED_HD, 0, -1);
        akiko_inited = true;
        return 1;
 }
index e6c7755bd0adfd3ca40a51d3d43cef4172e8b108..07840360cc6064ceeef79411c6360732081477d1 100644 (file)
--- a/cdtv.cpp
+++ b/cdtv.cpp
@@ -1761,6 +1761,7 @@ void cdtv_init (void)
 
        cdtv_battram_reset ();
        open_unit ();
+       gui_flicker_led (LED_CD, 0, -1);
 }
 
 void cdtv_check_banks (void)
index 7b534bb1cd329cd5681a529d3e6ea03f230e990c..3e38bb5001a94f51526a0a3898e8a1885f3ae93a 100644 (file)
@@ -640,6 +640,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
                cfgfile_write_str (f, _T("kickstart_ext_rom="), p->romextident);
        cfgfile_write_path (f, &p->path_rom, _T("flash_file"), p->flashfile);
        cfgfile_write_path (f, &p->path_rom, _T("cart_file"), p->cartfile);
+       cfgfile_write_path (f, &p->path_rom, _T("rtc_file"), p->rtcfile);
        if (p->cartident[0])
                cfgfile_write_str (f, _T("cart"), p->cartident);
        if (p->amaxromfile[0])
@@ -847,6 +848,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_write_str (f, _T("gfx_colour_mode"), colormode1[p->color_mode]);
        cfgfile_write_bool (f, _T("gfx_blacker_than_black"), p->gfx_blackerthanblack);
        cfgfile_write_str (f, _T("gfx_api"), filterapi[p->gfx_api]);
+       cfgfile_dwrite (f, _T("gfx_horizontal_tweak"), _T("%d"), p->gfx_extrawidth);
 
 #ifdef GFXFILTER
        if (p->gfx_filtershader[0] && p->gfx_api) {
@@ -1537,6 +1539,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_intval (option, value, _T("gfx_filter_keep_autoscale_aspect"), &p->gfx_filter_keep_autoscale_aspect, 1)
+               || cfgfile_intval (option, value, _T("gfx_horizontal_tweak"), &p->gfx_extrawidth, 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)
 
@@ -1568,7 +1571,6 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_yesno (option, value, _T("filesys_no_fsdb"), &p->filesys_no_uaefsdb)
                || cfgfile_yesno (option, value, _T("gfx_blacker_than_black"), &p->gfx_blackerthanblack)
                || cfgfile_yesno (option, value, _T("gfx_flickerfixer"), &p->gfx_scandoubler)
-               || cfgfile_yesno (option, value, _T("synchronize_clock"), &p->tod_hack)
                || cfgfile_yesno (option, value, _T("magic_mouse"), &p->input_magic_mouse)
                || cfgfile_yesno (option, value, _T("warp"), &p->turbo_emulation)
                || cfgfile_yesno (option, value, _T("headless"), &p->headless)
@@ -2545,6 +2547,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || 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("synchronize_clock"), &p->tod_hack)
 
                || cfgfile_yesno (option, value, _T("kickshifter"), &p->kickshifter)
                || cfgfile_yesno (option, value, _T("ntsc"), &p->ntscmode)
@@ -2610,7 +2613,6 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                return 1;
 
        if (cfgfile_strval (option, value, _T("comp_trustbyte"), &p->comptrustbyte, compmode, 0)
-               || cfgfile_strval (option, value, _T("chipset_compatible"), &p->cs_compatible, cscompa, 0)
                || cfgfile_strval (option, value, _T("rtc"), &p->cs_rtc, rtctype, 0)
                || cfgfile_strval (option, value, _T("ciaatod"), &p->cs_ciaatod, ciaatodmode, 0)
                || cfgfile_strval (option, value, _T("ide"), &p->cs_ide, idemode, 0)
@@ -2633,10 +2635,17 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_path (option, value, _T("amax_rom_file"), p->amaxromfile, sizeof p->amaxromfile / sizeof (TCHAR))
                || cfgfile_path (option, value, _T("flash_file"), p->flashfile, sizeof p->flashfile / sizeof (TCHAR), &p->path_rom)
                || cfgfile_path (option, value, _T("cart_file"), p->cartfile, sizeof p->cartfile / sizeof (TCHAR), &p->path_rom)
+               || cfgfile_path (option, value, _T("rtc_file"), p->rtcfile, sizeof p->rtcfile / sizeof (TCHAR), &p->path_rom)
                || cfgfile_string (option, value, _T("pci_devices"), p->pci_devices, sizeof p->pci_devices / sizeof (TCHAR))
                || cfgfile_string (option, value, _T("ghostscript_parameters"), p->ghostscript_parameters, sizeof p->ghostscript_parameters / sizeof (TCHAR)))
                return 1;
 
+       if (cfgfile_strval (option, value, _T("chipset_compatible"), &p->cs_compatible, cscompa, 0)) {
+               built_in_chipset_prefs (p);
+               return 1;
+       }
+
+
        if (cfgfile_strval (option, value, _T("cart_internal"), &p->cart_internal, cartsmode, 0)) {
                if (p->cart_internal) {
                        struct romdata *rd = getromdatabyid (63);
@@ -4277,6 +4286,7 @@ void default_prefs (struct uae_prefs *p, int type)
        p->romextfile2addr = 0;
        _tcscpy (p->flashfile, _T(""));
        _tcscpy (p->cartfile, _T(""));
+       _tcscpy (p->rtcfile, _T(""));
 
        _tcscpy (p->path_rom.path[0], _T("./"));
        _tcscpy (p->path_floppy.path[0], _T("./"));
@@ -4491,6 +4501,7 @@ static void buildin_default_prefs (struct uae_prefs *p)
        _tcscpy (p->romextfile, _T(""));
        _tcscpy (p->flashfile, _T(""));
        _tcscpy (p->cartfile, _T(""));
+       _tcscpy (p->rtcfile, _T(""));
        _tcscpy (p->amaxromfile, _T(""));
        p->prtname[0] = 0;
        p->sername[0] = 0;
diff --git a/cia.cpp b/cia.cpp
index b664527ee9f3a742b97405cd2b110bb33e8c60b0..64dd8a142c3eb7967f0ff626e8cb682a99501729 100644 (file)
--- a/cia.cpp
+++ b/cia.cpp
@@ -39,6 +39,7 @@
 #include "sampler.h"
 #include "dongle.h"
 #include "inputrecord.h"
+#include "autoconf.h"
 
 #define CIAA_DEBUG_R 0
 #define CIAA_DEBUG_W 0
@@ -46,6 +47,7 @@
 #define CIAB_DEBUG_W 0
 #define DONGLE_DEBUG 0
 #define KB_DEBUG 0
+#define CLOCK_DEBUG 0
 
 #define TOD_HACK
 
@@ -88,6 +90,8 @@ static uae_u8 kbcode;
 
 static uae_u8 serbits;
 static int warned = 10;
+static int rtc_delayed_write;
+
 
 static void setclr (unsigned int *p, unsigned int val)
 {
@@ -467,6 +471,7 @@ STATIC_INLINE void ciaa_checkalarm (int inc)
 #ifdef TOD_HACK
 static uae_u64 tod_hack_tv, tod_hack_tod, tod_hack_tod_last;
 static int tod_hack_enabled;
+#define TOD_HACK_TIME 312 * 50 * 10
 static void tod_hack_reset (void)
 {
        struct timeval tv;
@@ -477,6 +482,12 @@ static void tod_hack_reset (void)
 }
 #endif
 
+static int heartbeat_cnt;
+void cia_heartbeat (void)
+{
+       heartbeat_cnt = 10;
+}
+
 static void do_tod_hack (int dotod)
 {
        struct timeval tv;
@@ -487,6 +498,15 @@ static void do_tod_hack (int dotod)
 
        if (tod_hack_enabled == 0)
                return;
+       if (!heartbeat_cnt) {
+               if (tod_hack_enabled > 0)
+                       tod_hack_enabled = -1;
+               return;
+       }
+       if (tod_hack_enabled < 0) {
+               tod_hack_enabled = TOD_HACK_TIME;
+               return;
+       }
        if (tod_hack_enabled > 1) {
                tod_hack_enabled--;
                if (tod_hack_enabled == 1) {
@@ -692,8 +712,16 @@ static void led_vsync (void)
        led_cycle = get_cycles ();
 }
 
+static void write_battclock (void);
 void CIA_vsync_prehandler (void)
 {
+       if (rtc_delayed_write < 0) {
+               rtc_delayed_write = 50;
+       } else if (rtc_delayed_write > 0) {
+               rtc_delayed_write--;
+               if (rtc_delayed_write == 0)
+                       write_battclock ();
+       }
        led_vsync ();
        CIA_handler ();
        if (kblostsynccnt > 0) {
@@ -710,6 +738,8 @@ void CIA_vsync_prehandler (void)
 
 void CIA_vsync_posthandler (bool dotod)
 {
+       if (heartbeat_cnt > 0)
+               heartbeat_cnt--;
 #ifdef TOD_HACK
        if (currprefs.tod_hack && tod_hack_enabled == 1)
                return;
@@ -1329,7 +1359,7 @@ void CIA_reset (void)
        tod_hack_tod = 0;
        tod_hack_enabled = 0;
        if (currprefs.tod_hack)
-               tod_hack_enabled = 312 * 50 * 10;
+               tod_hack_enabled = TOD_HACK_TIME;
 #endif
 
        kblostsynccnt = 0;
@@ -1337,6 +1367,7 @@ void CIA_reset (void)
        oldcd32mute = 1;
        oldled = true;
        resetwarning_phase = resetwarning_timer = 0;
+       heartbeat_cnt = 0;
 
        if (!savestate_state) {
                oldovl = true;
@@ -1412,10 +1443,14 @@ addrbank cia_bank = {
 // Gayle or Fat Gary does not enable CIA /CS lines if both CIAs are selected
 // Old Gary based Amigas enable both CIAs in this situation
 
-STATIC_INLINE int issinglecia (void)
+STATIC_INLINE bool issinglecia (void)
 {
        return currprefs.cs_ide || currprefs.cs_pcmcia || currprefs.cs_mbdmac;
 }
+STATIC_INLINE bool isgayle (void)
+{
+       return currprefs.cs_ide || currprefs.cs_pcmcia;
+}
 
 static void cia_wait_pre (void)
 {
@@ -1457,17 +1492,29 @@ static void cia_wait_post (uae_u32 value)
        }
 }
 
+static bool isgaylenocia (uaecptr addr)
+{
+       // gayle CIA region is only 4096 bytes at 0xbfd000 and 0xbfe000
+       if (!isgayle ())
+               return true;
+       uaecptr mask = addr & 0xf000;
+       bool cia = mask == 0xe000 || mask == 0xd000;
+       return cia;
+}
+
 static uae_u32 REGPARAM2 cia_bget (uaecptr addr)
 {
        int r = (addr & 0xf00) >> 8;
-       uae_u8 v;
-
+       uae_u8 v = 0xff;
 
 #ifdef JIT
        special_mem |= S_READ;
 #endif
+
+       if (!isgaylenocia (addr))
+               return v;
+
        cia_wait_pre ();
-       v = 0xff;
        switch ((addr >> 12) & 3) {
        case 0:
                if (!issinglecia ())
@@ -1496,13 +1543,16 @@ static uae_u32 REGPARAM2 cia_bget (uaecptr addr)
 static uae_u32 REGPARAM2 cia_wget (uaecptr addr)
 {
        int r = (addr & 0xf00) >> 8;
-       uae_u16 v;
+       uae_u16 v = 0xffff;
 
 #ifdef JIT
        special_mem |= S_READ;
 #endif
+
+       if (!isgaylenocia (addr))
+               return 0xffffffff;
+
        cia_wait_pre ();
-       v = 0xffff;
        switch ((addr >> 12) & 3)
        {
        case 0:
@@ -1556,6 +1606,10 @@ static void REGPARAM2 cia_bput (uaecptr addr, uae_u32 value)
 #ifdef JIT
        special_mem |= S_WRITE;
 #endif
+
+       if (!isgaylenocia (addr))
+               return;
+
        cia_wait_pre ();
        if (!issinglecia () || (addr & 0x3000) != 0) {
                if ((addr & 0x2000) == 0)
@@ -1577,6 +1631,10 @@ static void REGPARAM2 cia_wput (uaecptr addr, uae_u32 value)
 #ifdef JIT
        special_mem |= S_WRITE;
 #endif
+
+       if (!isgaylenocia (addr))
+               return;
+
        cia_wait_pre ();
        if (!issinglecia () || (addr & 0x3000) != 0) {
                if ((addr & 0x2000) == 0)
@@ -1620,29 +1678,113 @@ static unsigned int clock_control_f;
 #define RF5C01A_RAM_SIZE 16
 static uae_u8 rtc_memory[RF5C01A_RAM_SIZE], rtc_alarm[RF5C01A_RAM_SIZE];
 
+static uae_u8 getclockreg (int addr, struct tm *ct)
+{
+       uae_u8 v = 0;
+
+       if (currprefs.cs_rtc == 1) { /* MSM6242B */
+               switch (addr) {
+               case 0x0: v = ct->tm_sec % 10; break;
+               case 0x1: v = ct->tm_sec / 10; break;
+               case 0x2: v = ct->tm_min % 10; break;
+               case 0x3: v = ct->tm_min / 10; break;
+               case 0x4: v = ct->tm_hour % 10; break;
+               case 0x5:
+                       if (clock_control_f & 4) {
+                               v = ct->tm_hour / 10; // 24h
+                       } else {
+                               v = (ct->tm_hour % 12) / 10; // 12h
+                               v |= ct->tm_hour >= 12 ? 4 : 0; // AM/PM bit
+                       }
+                       break;
+               case 0x6: v = ct->tm_mday % 10; break;
+               case 0x7: v = ct->tm_mday / 10; break;
+               case 0x8: v = (ct->tm_mon + 1) % 10; break;
+               case 0x9: v = (ct->tm_mon + 1) / 10; break;
+               case 0xA: v = ct->tm_year % 10; break;
+               case 0xB: v = (ct->tm_year / 10) & 0x0f;  break;
+               case 0xC: v = ct->tm_wday; break;
+               case 0xD: v = clock_control_d; break;
+               case 0xE: v = clock_control_e; break;
+               case 0xF: v = clock_control_f; break;
+               }
+       } else if (currprefs.cs_rtc == 2) { /* RF5C01A */
+               int bank = clock_control_d & 3;
+               /* memory access */
+               if (bank >= 2 && addr < 0x0d)
+                       return (rtc_memory[addr] >> ((bank == 2) ? 0 : 4)) & 0x0f;
+               /* alarm */
+               if (bank == 1 && addr < 0x0d) {
+                       v = rtc_alarm[addr];
+#if CLOCK_DEBUG
+                       write_log (_T("CLOCK ALARM R %X: %X\n"), addr, v);
+#endif
+                       return v;
+               }
+               switch (addr) {
+               case 0x0: v = ct->tm_sec % 10; break;
+               case 0x1: v = ct->tm_sec / 10; break;
+               case 0x2: v = ct->tm_min % 10; break;
+               case 0x3: v = ct->tm_min / 10; break;
+               case 0x4: v = ct->tm_hour % 10; break;
+               case 0x5:
+                       if (rtc_alarm[10] & 1)
+                               v = ct->tm_hour / 10; // 24h
+                       else
+                               v = ((ct->tm_hour % 12) / 10) | (ct->tm_hour >= 12 ? 2 : 0); // 12h
+               break;
+               case 0x6: v = ct->tm_wday; break;
+               case 0x7: v = ct->tm_mday % 10; break;
+               case 0x8: v = ct->tm_mday / 10; break;
+               case 0x9: v = (ct->tm_mon + 1) % 10; break;
+               case 0xA: v = (ct->tm_mon + 1) / 10; break;
+               case 0xB: v = (ct->tm_year % 100) % 10; break;
+               case 0xC: v = (ct->tm_year % 100) / 10; break;
+               case 0xD: v = clock_control_d; break;
+               /* E and F = write-only, reads as zero */
+               case 0xE: v = 0; break;
+               case 0xF: v = 0; break;
+               }
+       }
+#if CLOCK_DEBUG
+       write_log(_T("CLOCK R: %X = %X, PC=%08x\n"), addr, v, M68K_GETPC);
+#endif
+       return v;
+}
+
 static void write_battclock (void)
 {
-       struct zfile *f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL);
-       if (!f) {
-               f = zfile_fopen (currprefs.flashfile, _T("wb"), 0);
-               if (f) {
-                       zfile_fwrite (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
+       if (!currprefs.rtcfile[0] || currprefs.cs_rtc == 0)
+               return;
+       struct zfile *f = zfile_fopen (currprefs.rtcfile, _T("wb"));
+       if (f) {
+               uae_u8 zero[13] = { 0 };
+               struct tm *ct;
+               time_t t = time (0);
+               t += currprefs.cs_rtc_adjust;
+               ct = localtime (&t);
+               uae_u8 od = clock_control_d;
+               if (currprefs.cs_rtc == 2)
+                       clock_control_d &= ~3;
+               for (int i = 0; i < 13; i++) {
+                       uae_u8 v = getclockreg (i, ct);
+                       zfile_fwrite (&v, 1, 1, f);
+               }
+               clock_control_d = od;
+               zfile_fwrite (&clock_control_d, 1, 1, f);
+               zfile_fwrite (&clock_control_e, 1, 1, f);
+               zfile_fwrite (&clock_control_f, 1, 1, f);
+               if (currprefs.cs_rtc == 2) {
                        zfile_fwrite (rtc_alarm, RF5C01A_RAM_SIZE, 1, f);
-                       zfile_fclose (f);
+                       zfile_fwrite (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
                }
-               return;
-       }
-       zfile_fseek (f, 0, SEEK_END);
-       if (zfile_ftell (f) <= 2 * RF5C01A_RAM_SIZE) {
-               zfile_fseek (f, 0, SEEK_SET);
-               zfile_fwrite (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
-               zfile_fwrite (rtc_alarm, RF5C01A_RAM_SIZE, 1, f);
+               zfile_fclose (f);
        }
-       zfile_fclose (f);
 }
 
 void rtc_hardreset (void)
 {
+       rtc_delayed_write = 0;
        if (currprefs.cs_rtc == 1) { /* MSM6242B */
                clock_bank.name = _T("Battery backed up clock (MSM6242B)");
                clock_control_d = 0x1;
@@ -1650,28 +1792,28 @@ void rtc_hardreset (void)
                clock_control_f = 0x4; /* 24/12 */
        } else if (currprefs.cs_rtc == 2) { /* RF5C01A */
                clock_bank.name = _T("Battery backed up clock (RF5C01A)");
-               clock_control_d = 0x4; /* Timer EN */
+               clock_control_d = 0x8; /* Timer EN */
                clock_control_e = 0;
                clock_control_f = 0;
                memset (rtc_memory, 0, RF5C01A_RAM_SIZE);
                memset (rtc_alarm, 0, RF5C01A_RAM_SIZE);
-#if 0
-               struct zfile *f;
-               f = zfile_fopen (currprefs.flashfile, "rb", ZFD_NORMAL);
+               rtc_alarm[10] = 1; /* 24H mode */
+       }
+       if (currprefs.rtcfile[0]) {
+               struct zfile *f = zfile_fopen (currprefs.rtcfile, _T("rb"));
                if (f) {
-                       zfile_fread (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
+                       uae_u8 empty[13];
+                       zfile_fread (empty, 13, 1, f);
+                       zfile_fread (&clock_control_d, 1, 1, f);
+                       zfile_fread (&clock_control_e, 1, 1, f);
+                       zfile_fread (&clock_control_f, 1, 1, f);
                        zfile_fread (rtc_alarm, RF5C01A_RAM_SIZE, 1, f);
+                       zfile_fread (rtc_memory, RF5C01A_RAM_SIZE, 1, f);
                        zfile_fclose (f);
                }
-#endif
        }
 }
 
-static uae_u8 tobcd (int val)
-{
-       return (val / 10) * 16 + (val % 10);
-}
-
 static uae_u32 REGPARAM2 clock_lget (uaecptr addr)
 {
        return (clock_wget (addr) << 16) | clock_wget (addr + 2);
@@ -1686,18 +1828,17 @@ static uae_u32 REGPARAM2 clock_bget (uaecptr addr)
 {
        time_t t;
        struct tm *ct;
+       uae_u8 v = 0;
 
 #ifdef JIT
        special_mem |= S_READ;
 #endif
-//     write_log(_T("R: %x (%x), PC=%08x\n"), addr, (addr & 0xff) >> 2, M68K_GETPC);
 #ifdef CDTV
        if (currprefs.cs_cdtvram && addr >= 0xdc8000)
                return cdtv_battram_read (addr);
 #endif
        addr &= 0x3f;
        if ((addr & 3) == 2 || (addr & 3) == 0 || currprefs.cs_rtc == 0) {
-               int v = 0;
                if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible)
                        v = regs.irc >> 8;
                return v;
@@ -1706,52 +1847,7 @@ static uae_u32 REGPARAM2 clock_bget (uaecptr addr)
        t += currprefs.cs_rtc_adjust;
        ct = localtime (&t);
        addr >>= 2;
-       if (currprefs.cs_rtc == 1) { /* MSM6242B */
-               switch (addr) {
-               case 0x0: return ct->tm_sec % 10;
-               case 0x1: return ct->tm_sec / 10;
-               case 0x2: return ct->tm_min % 10;
-               case 0x3: return ct->tm_min / 10;
-               case 0x4: return ct->tm_hour % 10;
-               case 0x5: return ct->tm_hour / 10;
-               case 0x6: return ct->tm_mday % 10;
-               case 0x7: return ct->tm_mday / 10;
-               case 0x8: return (ct->tm_mon + 1) % 10;
-               case 0x9: return (ct->tm_mon + 1) / 10;
-               case 0xA: return ct->tm_year % 10;
-               case 0xB: return tobcd (ct->tm_year / 10);
-               case 0xC: return ct->tm_wday;
-               case 0xD: return clock_control_d;
-               case 0xE: return clock_control_e;
-               case 0xF: return clock_control_f;
-               }
-       } else if (currprefs.cs_rtc == 2) { /* RF5C01A */
-               int bank = clock_control_d & 3;
-               /* memory access */
-               if (bank >= 2 && addr < 0x0d)
-                       return (rtc_memory[addr] >> ((bank == 2) ? 0 : 4)) & 0x0f;
-               /* alarm */
-               if (bank == 1 && addr < 0x0d)
-                       return rtc_alarm[addr];
-               switch (addr) {
-               case 0x0: return ct->tm_sec % 10;
-               case 0x1: return ct->tm_sec / 10;
-               case 0x2: return ct->tm_min % 10;
-               case 0x3: return ct->tm_min / 10;
-               case 0x4: return ct->tm_hour % 10;
-               case 0x5: return ct->tm_hour / 10;
-               case 0x6: return ct->tm_wday;
-               case 0x7: return ct->tm_mday % 10;
-               case 0x8: return ct->tm_mday / 10;
-               case 0x9: return (ct->tm_mon + 1) % 10;
-               case 0xA: return (ct->tm_mon + 1) / 10;
-               case 0xB: return ct->tm_year % 10;
-               case 0xC: return tobcd (ct->tm_year / 10);
-               case 0xD: return clock_control_d;
-                       /* E and F = write-only */
-               }
-       }
-       return 0;
+       return getclockreg (addr, ct);
 }
 
 static void REGPARAM2 clock_lput (uaecptr addr, uae_u32 value)
@@ -1784,6 +1880,9 @@ static void REGPARAM2 clock_bput (uaecptr addr, uae_u32 value)
        addr >>= 2;
        value &= 0x0f;
        if (currprefs.cs_rtc == 1) { /* MSM6242B */
+#if CLOCK_DEBUG
+               write_log (_T("CLOCK W %X: %X\n"), addr, value);
+#endif
                switch (addr)
                {
                case 0xD: clock_control_d = value & (1|8); break;
@@ -1794,17 +1893,19 @@ static void REGPARAM2 clock_bput (uaecptr addr, uae_u32 value)
                int bank = clock_control_d & 3;
                /* memory access */
                if (bank >= 2 && addr < 0x0d) {
+                       uae_u8 ov = rtc_memory[addr];
                        rtc_memory[addr] &= ((bank == 2) ? 0xf0 : 0x0f);
                        rtc_memory[addr] |= value << ((bank == 2) ? 0 : 4);
-#if 0
-                       uae_u8 ov = rtc_memory[addr];
                        if (rtc_memory[addr] != ov)
-                               write_battclock ();
-#endif
+                               rtc_delayed_write = -1;
                        return;
                }
                /* alarm */
                if (bank == 1 && addr < 0x0d) {
+#if CLOCK_DEBUG
+                       write_log (_T("CLOCK ALARM W %X: %X\n"), addr, value);
+#endif
+                       uae_u8 ov = rtc_alarm[addr];
                        rtc_alarm[addr] = value;
                        rtc_alarm[0] = rtc_alarm[1] = rtc_alarm[9] = rtc_alarm[12] = 0;
                        rtc_alarm[3] &= ~0x8;
@@ -1813,13 +1914,13 @@ static void REGPARAM2 clock_bput (uaecptr addr, uae_u32 value)
                        rtc_alarm[8] &= ~0xc;
                        rtc_alarm[10] &= ~0xe;
                        rtc_alarm[11] &= ~0xc;
-#if 0
-                       uae_u8 ov = rtc_alarm[addr];
-                       if (rtc_alarm[addr] != value)
-                               write_battclock ();
-#endif
+                       if (rtc_alarm[addr] != ov)
+                               rtc_delayed_write = -1;
                        return;
                }
+#if CLOCK_DEBUG
+               write_log (_T("CLOCK W %X: %X\n"), addr, value);
+#endif
                switch (addr)
                {
                case 0xD: clock_control_d = value; break;
@@ -1827,7 +1928,7 @@ static void REGPARAM2 clock_bput (uaecptr addr, uae_u32 value)
                case 0xF: clock_control_f = value; break;
                }
        }
-
+       rtc_delayed_write = -1;
 }
 
 #ifdef SAVESTATE
index 4f75cf61c16a95615d4f47b885fde288c3e85526..c4cde54ee6ebcf43cff2d6b26d3e366ee59c0be6 100644 (file)
@@ -2997,7 +2997,7 @@ void compute_framesync (void)
        } else {
 
                gfxvidinfo.drawbuffer.inwidth = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
-               gfxvidinfo.drawbuffer.extrawidth = 8;
+               gfxvidinfo.drawbuffer.extrawidth = currprefs.gfx_extrawidth ? currprefs.gfx_extrawidth : -1;
                gfxvidinfo.drawbuffer.inwidth2 = gfxvidinfo.drawbuffer.inwidth;
                gfxvidinfo.drawbuffer.inheight = (maxvpos_nom - minfirstline + 1) << currprefs.gfx_vresolution;
                gfxvidinfo.drawbuffer.inheight2 = gfxvidinfo.drawbuffer.inheight;
index 5c96254c9eb7f1a1c5ce0d8032b884f7d65f6c7a..19aae919557d92423feb910f061fe27ac0cfb447 100644 (file)
@@ -2340,7 +2340,8 @@ static void center_image (void)
                }
        } else if (gfxvidinfo.drawbuffer.extrawidth) {
                visible_left_border = max_diwlastword - w;
-               visible_left_border += gfxvidinfo.drawbuffer.extrawidth << currprefs.gfx_resolution;
+               if (gfxvidinfo.drawbuffer.extrawidth > 0)
+                       visible_left_border += gfxvidinfo.drawbuffer.extrawidth << currprefs.gfx_resolution;
        } else {
                if (gfxvidinfo.drawbuffer.inxoffset < 0) {
                        visible_left_border = 0;
@@ -2349,7 +2350,6 @@ static void center_image (void)
                }
        }
 
-
        if (visible_left_border > max_diwlastword - 32)
                visible_left_border = max_diwlastword - 32;
        if (visible_left_border < 0)
index 7dfcdf52ec4a35d4541e58d835ba1c331ed0eac6..d8f1b1ca6ee853ff9e378fbb2e2cebfa6b520b19 100644 (file)
@@ -6580,6 +6580,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context)
                } else {
                        get_new_device (type, parmpacket, &cdname, &cdname_amiga, cd_unit_no);
                }
+               gui_flicker_led (LED_CD, cd_unit_no, -1);
 
                write_log (_T("Mounting uaescsi.device %d: (%d)\n"), cd_unit_no, unit_no);
                put_long (parmpacket + 0, cdname_amiga);
@@ -6632,6 +6633,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context)
 
        } else {
 
+               gui_flicker_led (LED_HD, unit_no, -1);
                type = is_hardfile (unit_no);
                if (type == FILESYS_HARDFILE_RDB || type == FILESYS_HARDDRIVE) {
                        /* RDB hardfile */
@@ -6728,16 +6730,20 @@ static uae_u32 REGPARAM2 mousehack_done (TrapContext *context)
        return 1;
 }
 
+extern void cia_heartbeat (void);
 void filesys_vsync (void)
 {
        Unit *u;
 
+       if (!uae_boot_rom)
+               return;
        if (heartbeat == get_long (rtarea_base + RTAREA_HEARTBEAT)) {
                if (heartbeat_count > 0)
                        heartbeat_count--;
                return;
        }
        heartbeat = get_long (rtarea_base + RTAREA_HEARTBEAT);
+       cia_heartbeat ();
 
        for (u = units; u; u = u->next) {
                if (u->reinsertdelay > 0) {
index fac017d388bfa651dc522c5f2f4b7fc3aa831e0b..536af365988b09bec719817be478575c4e423272 100644 (file)
--- a/gayle.cpp
+++ b/gayle.cpp
@@ -1555,6 +1555,7 @@ static struct ide_hdf *add_ide_unit (int ch, const TCHAR *path, int blocksize, i
        ide->status = 0;
        ide->data_offset = 0;
        ide->data_size = 0;
+       gui_flicker_led (LED_HD, ch, -1);
        return ide;
 }
 
index 403c3c5f87896e7dcdc81f8acfeffecffe725274..544c9403e53c4f875bfedbd9dc177b06e7ebbd0e 100644 (file)
@@ -50,11 +50,11 @@ struct gui_info
     bool drive_writing[4];             /* drive is writing */
     bool drive_disabled[4];            /* drive is disabled */
     bool powerled;                             /* state of power led */
-    uae_u8 powerled_brightness;        /* 0 to 255 */
-    uae_u8 drive_side;                 /* floppy side */
-    uae_u8 hd;                                 /* harddrive */
-    uae_u8 cd;                                 /* CD */
-       uae_u8 md;                                      /* CD32 or CDTV internal storage */
+    uae_s8 powerled_brightness;        /* 0 to 255 */
+    uae_s8 drive_side;                 /* floppy side */
+    uae_s8 hd;                                 /* harddrive */
+    uae_s8 cd;                                 /* CD */
+       uae_s8 md;                                      /* CD32 or CDTV internal storage */
     int fps, idle;
        int fps_color;
     int sndbuf, sndbuf_status;
index 80086c82fc39a7d77a2fabb74503dcc839d94a73..696f465a2d1825aad16a8ff51dfac2646615e141 100644 (file)
@@ -279,6 +279,7 @@ struct uae_prefs {
        bool gfx_blackerthanblack;
        int gfx_api;
        int color_mode;
+       int gfx_extrawidth;
 
        int gfx_filter;
        TCHAR gfx_filtershader[MAX_DPATH];
@@ -372,6 +373,7 @@ struct uae_prefs {
        TCHAR romextfile2[MAX_DPATH];
        TCHAR romextident[256];
        TCHAR flashfile[MAX_DPATH];
+       TCHAR rtcfile[MAX_DPATH];
        TCHAR cartfile[MAX_DPATH];
        TCHAR cartident[256];
        int cart_internal;
@@ -488,6 +490,7 @@ struct uae_prefs {
        TCHAR win32_parjoyport0[MAX_DPATH];
        TCHAR win32_parjoyport1[MAX_DPATH];
        TCHAR win32_guipage[32];
+       TCHAR win32_guiactivepage[32];
        bool win32_filesystem_mangle_reserved_names;
 
        int statecapturerate, statecapturebuffersize;
index 30164184c6a0ccd6de8c173141c942a9b14c900d..653c6d467efc3f3488bc866fa623fbe4dbbe205e 100644 (file)
@@ -26,6 +26,7 @@ extern void target_reset (void);
 extern void target_addtorecent (const TCHAR*, int);
 extern void target_run (void);
 extern void target_quit (void);
+extern void target_restart (void);
 extern bool get_plugin_path (TCHAR *out, int size, const TCHAR *path);
 extern void stripslashes (TCHAR *p);
 extern void fixtrailing (TCHAR *p);
index c4a8e4ee5bdb53e23b98044ffcadb39972692feb..1a31634c5c3e1c5919011549cd17e7ffbd8823a8 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -503,8 +503,8 @@ void fixup_prefs (struct uae_prefs *p)
        if (p->tod_hack && p->cs_ciaatod == 0)
                p->cs_ciaatod = p->ntscmode ? 2 : 1;
 
+       built_in_chipset_prefs (p);
        blkdev_fix_prefs (p);
-
        target_fixup_options (p);
 }
 
@@ -546,6 +546,7 @@ void uae_restart (int opengui, TCHAR *cfgfile)
        default_config = 0;
        if (cfgfile)
                _tcscpy (restart_config, cfgfile);
+       target_restart ();
 }
 
 #ifndef DONT_PARSE_CMDLINE
@@ -967,6 +968,9 @@ static int real_main2 (int argc, TCHAR **argv)
                }
        }
 
+       memset (&gui_data, 0, sizeof gui_data);
+       gui_data.cd = -1;
+       gui_data.hd = -1;
        logging_init (); /* Yes, we call this twice - the first case handles when the user has loaded
                                                 a config using the cmd-line.  This case handles loads through the GUI. */
 
index 66c3a64b126e4e19e37458bb5fc552ffabce501f..4e4090961c7f59eb74de499a6721341d78d7099b 100644 (file)
@@ -300,12 +300,14 @@ void indicator_leds (int num, int state)
                return;
        disabledleds = 0;
        for (i = 0; i < 3; i++) {
-               if (currprefs.keyboard_leds[i] == num + 1) {
-                       newleds &= ~(1 << i);
-                       if (state)
-                               newleds |= 1 << i;
-               } else if (currprefs.keyboard_leds[i] <= 0) {
-                       disabledleds |= 1 << i;
+               if (state >= 0) {
+                       if (currprefs.keyboard_leds[i] == num + 1) {
+                               newleds &= ~(1 << i);
+                               if (state)
+                                       newleds |= 1 << i;
+                       } else if (currprefs.keyboard_leds[i] <= 0) {
+                               disabledleds |= 1 << i;
+                       }
                }
        }
 }
index 379bb211597c0be3304d5589c5c1b689b5ce01ec..36a82ac6d7d1d198834586ece1d9f3bb0d571f49 100644 (file)
@@ -168,6 +168,8 @@ void lcd_update (int led, int on)
                lgLcdUpdateBitmap (device, lbh, LGLCD_PRIORITY_IDLE_NO_SHOW);
                return;
        }
+       if (on < 0)
+               return;
 
        if (led >= 1 && led <= 4) {
                x = 23 + (led - 1) * 40;
index 148ea3c25fd8fb43e2d59889f961c2d242e71b59..0a989cf8e15862c03972fadd6bb15119ead57b2a 100644 (file)
 #define IDC_CARTCHOOSER                 1399
 #define IDC_SAVE                        1400
 #define IDC_LOAD                        1401
+#define IDC_FLASHCHOOSER2               1401
+#define IDC_RTCCHOOSER                  1401
 #define IDC_DELETE                      1403
 #define IDC_CONFIGLIST                  1404
 #define IDC_EDITNAME                    1405
 #define IDC_QUICKLOAD                   1409
 #define IDC_EXIT                        1410
 #define IDC_EDITPATH                    1410
+#define IDC_RTCFILE                     1411
 #define IDC_HDF_RDB                     1500
 #define IDC_HFSIZE                      1501
 #define IDC_HF_SIZE                     1501
 #define IDC_NOFLAGS                     1581
 #define IDC_SOUNDDRIVEVOLUME2           1581
 #define IDC_CS_CACHE_TEXT               1582
-#define IDC_SOUNDVOLUME3                1582
 #define IDC_SOUNDVOLUMECD2              1582
 #define IDC_CS_CACHE_TEXT2              1583
 #define IDC_COLLISIONS                  1584
index 939d231466f3875f02e7276ab2bc1e8562e4dad7..35961772e89b50d8337a543a389774642bfe1849 100644 (file)
@@ -85,12 +85,12 @@ END
 // Dialog\r
 //\r
 \r
-IDD_KICKSTART DIALOGEX 0, 0, 396, 195\r
+IDD_KICKSTART DIALOGEX 0, 0, 396, 217\r
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
 EXSTYLE WS_EX_CONTEXTHELP\r
 FONT 8, "MS Sans Serif", 0, 0, 0x1\r
 BEGIN\r
-    GROUPBOX        "System ROM Settings",-1,1,0,394,93\r
+    GROUPBOX        "System ROM Settings",IDC_STATIC,1,0,394,93\r
     LTEXT           "Main ROM file:",IDC_ROMTEXT,14,13,263,10\r
     COMBOBOX        IDC_ROMFILE,12,26,361,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "...",IDC_KICKCHOOSER,376,25,10,15\r
@@ -101,13 +101,16 @@ BEGIN
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,87,77,104,12\r
     CONTROL         "ShapeShifter support [] Patches the system ROM for ShapeShifter compatibility.",IDC_KICKSHIFTER,\r
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,195,77,106,13\r
-    GROUPBOX        "Miscellaneous",-1,1,98,394,90\r
+    GROUPBOX        "Miscellaneous",IDC_STATIC,1,98,394,116\r
     LTEXT           "Cartridge ROM file:",IDC_FLASHTEXT2,12,112,265,10\r
     COMBOBOX        IDC_CARTFILE,12,125,361,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "...",IDC_CARTCHOOSER,376,124,10,15\r
     LTEXT           "Flash RAM file:",IDC_FLASHTEXT,12,144,265,10\r
     EDITTEXT        IDC_FLASHFILE,12,157,361,12,ES_AUTOHSCROLL\r
     PUSHBUTTON      "...",IDC_FLASHCHOOSER,376,156,10,15\r
+    LTEXT           "Real Time Clock file",IDC_STATIC,12,174,313,15,SS_CENTERIMAGE\r
+    EDITTEXT        IDC_RTCFILE,12,191,361,12,ES_AUTOHSCROLL\r
+    PUSHBUTTON      "...",IDC_RTCCHOOSER,376,189,10,15\r
 END\r
 \r
 IDD_DISPLAY DIALOGEX 0, 0, 396, 272\r
@@ -1253,6 +1256,7 @@ GUIDELINES DESIGNINFO
 BEGIN\r
     IDD_KICKSTART, DIALOG\r
     BEGIN\r
+        BOTTOMMARGIN, 214\r
     END\r
 \r
     IDD_DISPLAY, DIALOG\r
index c4f9e170916d817031e93ae79ed2de6c16fe0d58..82e174ffd1bc671e07996741d7c4d8cc7e20c642 100644 (file)
@@ -1369,6 +1369,8 @@ void rp_update_leds (int led, int onoff, int write)
                return;
        if (led < 0 || led > 4)
                return;
+       if (onoff < 0)
+               return;
        switch (led)
        {
        case 0:
index 3730452e119342abad02c1ea48f1fa943a325575..b3087e6d3ca22679c9a404bfb39c577d7e678005 100644 (file)
@@ -3072,9 +3072,15 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
        cfgfile_target_dwrite_str (f, _T("parjoyport0"), p->win32_parjoyport0);
        cfgfile_target_dwrite_str (f, _T("parjoyport1"), p->win32_parjoyport1);
        cfgfile_target_dwrite_str (f, _T("gui_page"), p->win32_guipage);
+       cfgfile_target_dwrite_str (f, _T("gui_active_page"), p->win32_guiactivepage);
        cfgfile_target_dwrite_bool (f, _T("filesystem_mangle_reserved_names"), p->win32_filesystem_mangle_reserved_names);
 }
 
+void target_restart (void)
+{
+       gui_restart ();
+}
+
 static int fetchpri (int pri, int defpri)
 {
        int i = 0;
@@ -3144,6 +3150,7 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *
                || cfgfile_string (option, value, _T("parjoyport0"), p->win32_parjoyport0, sizeof p->win32_parjoyport0 / sizeof (TCHAR))
                || cfgfile_string (option, value, _T("parjoyport1"), p->win32_parjoyport1, sizeof p->win32_parjoyport1 / sizeof (TCHAR))
                || cfgfile_string (option, value, _T("gui_page"), p->win32_guipage, sizeof p->win32_guipage / sizeof (TCHAR))
+               || cfgfile_string (option, value, _T("gui_active_page"), p->win32_guiactivepage, sizeof p->win32_guiactivepage / sizeof (TCHAR))
                || cfgfile_intval (option, value, _T("guikey"), &p->win32_guikey, 1)
                || cfgfile_intval (option, value, _T("kbledmode"), &p->win32_kbledmode, 1)
                || cfgfile_yesno (option, value, _T("filesystem_mangle_reserved_names"), &p->win32_filesystem_mangle_reserved_names)
index 670ad19b33dded287fc6a8e2603b6719551e1515..f1dc8af5796155a9f4a909c819ff130b9bbdfd8a 100644 (file)
@@ -19,8 +19,8 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA _T("")
-#define WINUAEBETA _T("19")
-#define WINUAEDATE MAKEBD(2012, 10, 1)
+#define WINUAEBETA _T("20")
+#define WINUAEDATE MAKEBD(2012, 10, 7)
 #define WINUAEEXTRA _T("")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 #define WINUAEREV _T("")
@@ -58,6 +58,7 @@ extern void remove_brkhandler (void);
 extern void disablecapture (void);
 extern void fullscreentoggle (void);
 extern int isfocus (void);
+extern void gui_restart (void);
 
 extern void setmouseactive (int active);
 extern void minimizewindow (void);
index f3402525a3bd60fbb95a5231815ae1bcba2cfa59..f0183e4094ee16954d45b6fd6a01811d97fe2f42 100644 (file)
@@ -1547,7 +1547,7 @@ static int open_windows (int full)
        if (startactive) {
                setpriority (&priorities[currprefs.win32_active_capture_priority]);
                for (i = 0; i < NUM_LEDS; i++)
-                       gui_led (i, 0);
+                       gui_led (i, -1);
                gui_fps (0, 0, 0);
                inputdevice_acquire (TRUE);
        } else if (startminimized) {
index d1fc139b7e74848f15820b19291ebef6c16e3eb6..6b64c6426f9c62441e0b1f27162e9bcd773b75a2 100644 (file)
@@ -2397,6 +2397,10 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
                        _tcscpy (workprefs.flashfile, full_path);
                        fullpath (workprefs.flashfile, MAX_DPATH);
                        break;
+               case IDC_RTCFILE:
+                       _tcscpy (workprefs.rtcfile, full_path);
+                       fullpath (workprefs.rtcfile, MAX_DPATH);
+                       break;
                case IDC_CARTFILE:
                        _tcscpy (workprefs.cartfile, full_path);
                        fullpath (workprefs.cartfile, MAX_DPATH);
@@ -7620,6 +7624,7 @@ static void values_to_kickstartdlg (HWND hDlg)
        regclosetree (fkey);
 
        SetDlgItemText(hDlg, IDC_FLASHFILE, workprefs.flashfile);
+       SetDlgItemText(hDlg, IDC_RTCFILE, workprefs.rtcfile);
        CheckDlgButton(hDlg, IDC_KICKSHIFTER, workprefs.kickshifter);
        CheckDlgButton(hDlg, IDC_MAPROM, workprefs.maprom);
 }
@@ -7662,6 +7667,10 @@ static void kickstartfilebuttons (HWND hDlg, WPARAM wParam, TCHAR *path)
                DiskSelection(hDlg, IDC_FLASHFILE, 11, &workprefs, path);
                values_to_kickstartdlg (hDlg);
                break;
+       case IDC_RTCCHOOSER:
+               DiskSelection(hDlg, IDC_RTCFILE, 6, &workprefs, path);
+               values_to_kickstartdlg (hDlg);
+               break;
        case IDC_CARTCHOOSER:
                DiskSelection(hDlg, IDC_CARTFILE, 6, &workprefs, path);
                values_to_kickstartdlg (hDlg);
@@ -7685,6 +7694,7 @@ static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP
                        values_to_kickstartdlg (hDlg);
                        setmultiautocomplete (hDlg, ids);
                        setac (hDlg, IDC_FLASHFILE);
+                       setac (hDlg, IDC_RTCFILE);
                        return TRUE;
                }
 
@@ -7692,7 +7702,7 @@ static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP
                {
                        int id = GetDlgCtrlID((HWND)wParam);
                        if (id == IDC_KICKCHOOSER || id == IDC_ROMCHOOSER2
-                               || id == IDC_FLASHCHOOSER || id == IDC_CARTCHOOSER) {
+                               || id == IDC_FLASHCHOOSER || id == IDC_CARTCHOOSER || id == IDC_RTCCHOOSER) {
                                        TCHAR *s = favoritepopup (hDlg);
                                        if (s) {
                                                TCHAR newfile[MAX_DPATH];
@@ -7725,6 +7735,10 @@ static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP
                        GetWindowText (GetDlgItem (hDlg, IDC_FLASHFILE), tmp, sizeof (tmp) / sizeof (TCHAR));
                        _tcscpy (workprefs.flashfile, tmp);
                        break;
+               case IDC_RTCFILE:
+                       GetWindowText (GetDlgItem (hDlg, IDC_RTCFILE), tmp, sizeof (tmp) / sizeof (TCHAR));
+                       _tcscpy (workprefs.rtcfile, tmp);
+                       break;
 
                case IDC_KICKSHIFTER:
                        workprefs.kickshifter = ischecked (hDlg, IDC_KICKSHIFTER);
@@ -14302,7 +14316,7 @@ static int ignorewindows[] = {
        -1,
        IDD_INPUT, IDC_INPUTDEVICE, IDC_INPUTLIST, IDC_INPUTAMIGA,
        -1,
-       IDD_KICKSTART, IDC_ROMFILE, IDC_ROMFILE2, IDC_CARTFILE, IDC_FLASHFILE,
+       IDD_KICKSTART, IDC_ROMFILE, IDC_ROMFILE2, IDC_CARTFILE, IDC_FLASHFILE, IDC_RTCFILE,
        -1,
        IDD_LOADSAVE, IDC_CONFIGTREE, IDC_EDITNAME, IDC_EDITDESCRIPTION, IDC_CONFIGLINK, IDC_EDITPATH,
        -1,
@@ -14555,14 +14569,33 @@ static HWND updatePanel (int id)
        return panelDlg;
 }
 
+static bool panel_done, panel_active_done;
+
 static void checkpagelabel (int id, int sub, const TCHAR *label)
 {
-       if (!label || _tcsicmp (label, currprefs.win32_guipage))
-               return;
+       if (full_property_sheet) {
+               if (panel_done)
+                       return;
+               if (!label || _tcsicmp (label, currprefs.win32_guipage) != 0)
+                       return;
+               panel_done = true;
+       } else {
+               if (panel_active_done)
+                       return;
+               if (!label || _tcsicmp (label, currprefs.win32_guiactivepage) != 0)
+                       return;
+               panel_active_done = true;
+       }
        currentpage = id;
        configtypepanel = configtype = sub;
 }
 
+void gui_restart (void)
+{
+       panel_done = panel_active_done = false;
+}
+
+
 static HTREEITEM CreateFolderNode (HWND TVhDlg, int nameid, HTREEITEM parent, int nodeid, int sub, const TCHAR *label)
 {
        TVINSERTSTRUCT is;
@@ -15623,8 +15656,8 @@ void gui_disk_image_change (int unitnum, const TCHAR *name, bool writeprotected)
 static void gui_flicker_led2 (int led, int unitnum, int status)
 {
        static int resetcounter[LED_MAX];
-       uae_u8 old;
-       uae_u8 *p;
+       uae_s8 old;
+       uae_s8 *p;
 
        if (led == LED_HD)
                p = &gui_data.hd;
@@ -15635,6 +15668,17 @@ static void gui_flicker_led2 (int led, int unitnum, int status)
        else
                return;
        old = *p;
+       if (status < 0) {
+               if (old < 0) {
+                       *p = 0;
+                       gui_led (led, 0);
+               }
+               return;
+       }
+       if (status == 0 && old < 0) {
+               resetcounter[led] = 0;
+               return;
+       }
        if (status == 0) {
                resetcounter[led]--;
                if (resetcounter[led] > 0)
@@ -15734,11 +15778,13 @@ void gui_led (int led, int on)
                pos = 5;
                ptr = _tcscpy (drive_text + pos * 16, _T("CD"));
                center = 1;
-               if (on & LED_CD_AUDIO)
-                       playing = 1;
-               else if (on & LED_CD_ACTIVE2)
-                       active2 = 1;
-               on &= 1;
+               if (on >= 0) {
+                       if (on & LED_CD_AUDIO)
+                               playing = 1;
+                       else if (on & LED_CD_ACTIVE2)
+                               active2 = 1;
+                       on &= 1;
+               }
        } else if (led == LED_FPS) {
                double fps = (double)gui_data.fps / 10.0;
                extern double p96vblank;
@@ -15778,6 +15824,9 @@ void gui_led (int led, int on)
                ptr = _tcscpy (drive_text + pos * 16, _T("NV"));
        }
 
+       if (on < 0)
+               return;
+
        type = SBT_OWNERDRAW;
        if (pos >= 0) {
                ptr[_tcslen (ptr) + 1] = 0;
index db8baac9797d98e6e67016b6f3fc1cfad14f0ac0..cc8e586e5de045e0fa0fcff245a60ed534b3a0b9 100644 (file)
@@ -1,12 +1,26 @@
 
-- Merged SVN updates.
-- Check dos.library's version, not exec's, to detect KS version. Exec version is v37 on CDTV with KS 1.3 + 2.x extended ROM.
-- Enabled removable media support.
-- Fixed ACTION_DIE (unmount) crash.
-- 1.x C:Info does not anymore report no disk state.
-
 - restore only single input target to default.
 
+Beta 20:
+
+- Reduced Gayle based configuration CIA memory bank size to 4096 bytes, only accesses to bfdxxx and bfexxx goes to CIA chips if Gayle.
+- Reverted b19 horizontal change, I forgot that it was made to fit max overscan modes better..
+  (Manually adding "gfx_horizontal_tweak=8" to config file can be used as a workaround, if needed for some reason) 
+- RTC update in b11 was not compatible with KS 1.x.
+- improved RF5C01A RTC emulation, previously KS2.0+ detected stopped clock and attempted to reset it (which is no-op because
+  emulated clock's time is currently read-only) and after reset it finally read the time.
+- RTC year value is saved differently depending on OS version, Pre-2.0: RTC year value = current year - 1900,
+  2.0+: year value = last 2 digits. Both methods supported when reading. WinUAE now uses pre-2.0 method if
+  MSM clock chip (because this is the only type that KS1.x supports), 2.0+ if RF clock chip, previously always used -1900 method.
+- RTC 12/24h bit emulated, this is not used by AOS.
+- RTC time/date, alarm and memory data save/load to file supported (alarm time/date, note that alarm interrupt pin is not connected in Amigas,
+  and 104 bits of memory, used mainly for A3000 SCSI settings, included with RF clock chip type). Date/time ignored when loading.
+- added win32.gui_active_page=name, sets default GUI panel after emulation has been started (Old win32.gui_page = before emulation starts)
+- In some situations adv. chipset may have used incompatible data stored in config file even if compatible settings was ticked.
+- Syncronize clock on the fly CIA TOD adjustment is now only active if heartbeat signal (b11) is detected.
+- b11 heartbeat system was not fully disabled when UAE boot rom was unavailable.
+- On screen led HD/CD/NVRAM indicator is blank if device is not available (like floppies already did).
+
 Beta 19:
 
 - GamePorts panel Test function now shows all currently mapped input target(s). Can be used to test any kind of input event mapping.
index a0037c244c4180f33c147e2c5c0b5b35a73eee2c..62a18dce4d1464cdbb2b3d37696f51ea789540e2 100644 (file)
@@ -124,24 +124,28 @@ void draw_status_line_single (uae_u8 *buf, int bpp, int y, int totalwidth, uae_u
                        off_rgb = 0x330000;
                } else if (led == LED_CD) {
                        pos = 5;
-                       on = gui_data.cd & (LED_CD_AUDIO | LED_CD_ACTIVE);
-                       on_rgb = (on & LED_CD_AUDIO) ? 0x00cc00 : 0x0000cc;
-                       if ((gui_data.cd & LED_CD_ACTIVE2) && !(gui_data.cd & LED_CD_AUDIO)) {
-                               on_rgb &= 0xfefefe;
-                               on_rgb >>= 1;
+                       if (gui_data.cd >= 0) {
+                               on = gui_data.cd & (LED_CD_AUDIO | LED_CD_ACTIVE);
+                               on_rgb = (on & LED_CD_AUDIO) ? 0x00cc00 : 0x0000cc;
+                               if ((gui_data.cd & LED_CD_ACTIVE2) && !(gui_data.cd & LED_CD_AUDIO)) {
+                                       on_rgb &= 0xfefefe;
+                                       on_rgb >>= 1;
+                               }
+                               off_rgb = 0x000033;
+                               num1 = -1;
+                               num2 = 10;
+                               num3 = 12;
                        }
-                       off_rgb = 0x000033;
-                       num1 = -1;
-                       num2 = 10;
-                       num3 = 12;
                } else if (led == LED_HD) {
                        pos = 4;
-                       on = gui_data.hd;
-                       on_rgb = on == 2 ? 0xcc0000 : 0x0000cc;
-                       off_rgb = 0x000033;
-                       num1 = -1;
-                       num2 = 11;
-                       num3 = 12;
+                       if (gui_data.hd >= 0) {
+                               on = gui_data.hd;
+                               on_rgb = on == 2 ? 0xcc0000 : 0x0000cc;
+                               off_rgb = 0x000033;
+                               num1 = -1;
+                               num2 = 11;
+                               num3 = 12;
+                       }
                } else if (led == LED_FPS) {
                        int fps = (gui_data.fps + 5) / 10;
                        pos = 2;