From e7a58554e41682a0a3d88fcd4dea11d1e274f21e Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 9 Nov 2008 11:19:33 +0200 Subject: [PATCH] imported winuaesrc1530b8.zip --- archivers/dms/pfile.c | 2 +- cia.c | 26 ++++++++++++++++++++++---- gayle.c | 4 ++-- gfxutil.c | 3 +-- od-win32/hardfile_win32.c | 6 +++--- od-win32/picasso96_win.c | 25 ++++++++++++++++--------- od-win32/win32.h | 4 ++-- od-win32/winuaechangelog.txt | 13 +++++++++++-- 8 files changed, 58 insertions(+), 25 deletions(-) diff --git a/archivers/dms/pfile.c b/archivers/dms/pfile.c index 7677714b..d1bf43b3 100755 --- a/archivers/dms/pfile.c +++ b/archivers/dms/pfile.c @@ -420,7 +420,7 @@ static USHORT Unpack_Track(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen, if (usum1 == Calc_CheckSum(b2,(ULONG)unpklen)) { passfound = maybeencrypted; if (passfound) - write_log ("DMS: decryption key = 0x%04.4X\n", pass); + write_log ("DMS: decryption key = 0x%04X\n", prevpass); err = NO_PROBLEM; pass = prevpass; break; diff --git a/cia.c b/cia.c index bb8d5100..1704a68b 100755 --- a/cia.c +++ b/cia.c @@ -335,6 +335,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; static void tod_hack_reset (void) { struct timeval tv; @@ -349,20 +350,36 @@ static void do_tod_hack (int dotod) { struct timeval tv; static int oldrate; - uae_u64 t, rate; + uae_u64 t; + int rate; int docount = 0; + if (tod_hack_enabled == 0) + return; + if (tod_hack_enabled > 1) { + tod_hack_enabled--; + if (tod_hack_enabled == 1) { + write_log ("TOD HACK enabled\n"); + tod_hack_reset (); + } + return; + } + if (currprefs.cs_ciaatod == 0) rate = vblank_hz; else if (currprefs.cs_ciaatod == 1) rate = 50; else rate = 60; + if (rate <= 0) + return; if (rate != oldrate || ciaatod != tod_hack_tod_last) { + if (ciaatod != 0) + write_log ("TOD HACK reset %d,%d %d,%d\n", + rate, oldrate, ciaatod, tod_hack_tod_last); tod_hack_reset (); oldrate = rate; docount = 1; - write_log ("TOD HACK reset %d\n", rate); } if (!dotod && currprefs.cs_ciaatod == 0) return; @@ -547,7 +564,7 @@ void CIA_vsync_handler (int dotod) { led_vsync (); #ifdef TOD_HACK - if (currprefs.tod_hack) + if (currprefs.tod_hack && tod_hack_enabled == 1) return; #endif if (ciaatodon && dotod) { @@ -1102,8 +1119,9 @@ void CIA_reset (void) #ifdef TOD_HACK tod_hack_tv = 0; tod_hack_tod = 0; + tod_hack_enabled = 0; if (currprefs.tod_hack) - tod_hack_reset (); + tod_hack_enabled = 312 * 50 * 10; #endif kback = 1; kbstate = 3; diff --git a/gayle.c b/gayle.c index 24b91b74..1fdc64f3 100755 --- a/gayle.c +++ b/gayle.c @@ -1820,9 +1820,9 @@ int gayle_add_pcmcia_sram_unit (const char *path, int readonly) int gayle_modify_pcmcia_sram_unit (const char *path, int readonly, int insert) { if (insert) - return initpcmcia (path, readonly, 1); + return initpcmcia (path, readonly, pcmcia_sram ? 0 : 1); else - return freepcmcia (1); + return freepcmcia (0); } static void initide (void) diff --git a/gfxutil.c b/gfxutil.c index 3cbaf5de..3ff46c07 100755 --- a/gfxutil.c +++ b/gfxutil.c @@ -200,7 +200,6 @@ void alloc_colors_picasso (int rw, int gw, int bw, int rs, int gs, int bs, int r int i; int red_bits = 0, green_bits, blue_bits; int red_shift, green_shift, blue_shift; - int bpp = rw + gw + bw; switch (rgbfmt) @@ -278,7 +277,7 @@ void alloc_colors_picasso (int rw, int gw, int bw, int rs, int gs, int bs, int r b = (((j >> blue_shift) & lbmask) << lbbits) | lowbits (j, blue_shift, lbbits); c = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs); if (bpp <= 16) - c |= c * 0x00010001; + c *= 0x00010001; p96_rgbx16[i] = c; } } diff --git a/od-win32/hardfile_win32.c b/od-win32/hardfile_win32.c index ba0ca6f2..1dd7f086 100755 --- a/od-win32/hardfile_win32.c +++ b/od-win32/hardfile_win32.c @@ -206,7 +206,7 @@ int hdf_open (struct hardfiledata *hfd, const char *pname) if (h == INVALID_HANDLE_VALUE) goto end; if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL)) - write_log ("FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", GetLastError()); + write_log ("WARNING: '%s' FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", name, GetLastError()); strncpy (hfd->vendor_id, udi->vendor_id, 8); strncpy (hfd->product_id, udi->product_id, 16); strncpy (hfd->product_rev, udi->product_rev, 4); @@ -295,8 +295,8 @@ int hdf_open (struct hardfiledata *hfd, const char *pname) } hfd->handle = h; if (hfd->handle_valid || hfd->drive_empty) { - hfd_log ("HDF '%s' opened succesfully, mode=%d empty=%d\n", - name, hfd->handle_valid, hfd->drive_empty); + hfd_log ("HDF '%s' opened, size=%dK mode=%d empty=%d\n", + name, hfd->size / 1024, hfd->handle_valid, hfd->drive_empty); return 1; } end: diff --git a/od-win32/picasso96_win.c b/od-win32/picasso96_win.c index 040ea4b0..17c4342c 100755 --- a/od-win32/picasso96_win.c +++ b/od-win32/picasso96_win.c @@ -661,30 +661,36 @@ static int doskip (void) static void picasso_trigger_vblank (void) { - if (!boardinfo || !uaegfx_base || !interrupt_enabled) + if (!boardinfo || !uaegfx_base || !interrupt_enabled) { return; + } put_long (uaegfx_base + CARD_VBLANKCODE + 6 + 2, boardinfo + PSSO_BoardInfo_SoftInterrupt); put_byte (uaegfx_base + CARD_VBLANKFLAG, 1); INTREQ_f (0x8000 | 0x2000); } +static int isvsync (void) +{ + return currprefs.gfx_pfullscreen && currprefs.gfx_pvsync; +} + void picasso_handle_vsync (void) { static int vsynccnt; - int isvsync = 1; + int thisisvsync = 1; #ifdef RETROPLATFORM rp_vsync (); #endif if (currprefs.chipset_refreshrate >= 100) { - vsynccnt++; + thisisvsync++; if (vsynccnt < 2) - isvsync = 0; + thisisvsync = 0; vsynccnt = 0; } - if (isvsync && currprefs.win32_rtgvblankrate == 0 && !(currprefs.gfx_pfullscreen && currprefs.gfx_pvsync)) + if (thisisvsync && currprefs.win32_rtgvblankrate == 0 && !isvsync ()) picasso_trigger_vblank (); if (!picasso_on) @@ -695,7 +701,7 @@ void picasso_handle_vsync (void) framecnt++; mouseupdate (); - if (isvsync) { + if (thisisvsync) { if (doskip () && p96skipmode == 0) { ; } else { @@ -850,6 +856,7 @@ static void setconvert (void) } picasso_convert = v; host_mode = DirectDraw_GetSurfacePixelFormat (NULL); + gfx_set_picasso_colors (picasso96_state.RGBFormat); if (d == 4) alloc_colors_rgb (8, 8, 8, 16, 8, 0, 0, 0, 0, 0, p96rc, p96gc, p96bc); else @@ -3250,7 +3257,7 @@ void picasso_handle_hsync (void) if (currprefs.gfxmem_size == 0) return; - if (currprefs.win32_rtgvblankrate == 0) + if (currprefs.win32_rtgvblankrate == 0 && !isvsync ()) return; if (p96hsync < 0) { p96hsync++; @@ -3258,7 +3265,7 @@ void picasso_handle_hsync (void) p96hsync = p96syncrate; return; } - if (WIN32GFX_IsPicassoScreen () && currprefs.gfx_pfullscreen && currprefs.gfx_pvsync) { + if (WIN32GFX_IsPicassoScreen () && isvsync ()) { if (DirectDraw_GetVerticalBlankStatus ()) p96hsync = -maxvpos / 3; } else { @@ -3274,7 +3281,7 @@ void picasso_handle_hsync (void) void init_hz_p96 (void) { p96syncrate = maxvpos * vblank_hz; - if (currprefs.win32_rtgvblankrate < 0) + if (currprefs.win32_rtgvblankrate < 0 || isvsync ()) p96vblank = DirectDraw_CurrentRefreshRate (); else if (currprefs.win32_rtgvblankrate == 0) p96vblank = vblank_hz; diff --git a/od-win32/win32.h b/od-win32/win32.h index 49abe4be..5347ffd9 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -17,8 +17,8 @@ #define WINUAEPUBLICBETA 1 -#define WINUAEBETA "7" -#define WINUAEDATE MAKEBD(2008, 11, 2) +#define WINUAEBETA "8" +#define WINUAEDATE MAKEBD(2008, 11, 9) #define WINUAEEXTRA "" #define WINUAEREV "" diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index f44a0bb3..673bb9f0 100755 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,13 @@ +1.5.3 + +- delay sync clock enable until 10s from reset +- real PCMCIA SRAM re-insert detection really really does work now + (Thanks to Eclipse for donating PCMCIA SRAM card) + Vista note: Vista does not come with generic PCMCIA SRAM drivers + anymore but XP built-in drivers work after force-installing them.. + (only need memcard.sys and memcard.inf) 32-bit tested only. + Beta 7: - fixed D3D scanline missing right edge @@ -11,7 +20,8 @@ Beta 7: configured chipset refresh rate was different than current refresh rate. Bug since the beginning of time but genlock option made this worse because old "genlock always connected" feature hide this bug.. - (CIA-A TOD configured to PS tick didn't have this problem) + (CIA-A TOD configured to PS tick didn't have this problem) Thanks + to Ed Cruse for real NTSC A3000 testing. - Syncronize clock improved. Automatically enables PS supply tick mode (CIA-A TOD = sysclock only if it uses PS supply tick) and also counts "lost" ticks when emulation is stopped (for example GUI is open) @@ -36,7 +46,6 @@ Beta 6: apparently only gets reset when disk read is started. Kick Off 2 save, most likely many other programs too.. - Beta 5: - moved file extension stuff to half-empty priority panel, replaced -- 2.47.3