From f5d197e549b90d4422e1e98959a0dafa0ed2c277 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 7 Feb 2016 15:38:48 +0200 Subject: [PATCH] Use WRITE_WATCH_FLAG_RESET, PPC thread may update framebuffer while frame is being converted to host format. --- od-win32/mman.cpp | 2 +- od-win32/picasso96_win.cpp | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/od-win32/mman.cpp b/od-win32/mman.cpp index a6b43751..d5a8c46b 100644 --- a/od-win32/mman.cpp +++ b/od-win32/mman.cpp @@ -87,7 +87,7 @@ static uae_u32 lowmem (void) int mman_GetWriteWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize, PVOID *lpAddresses, PULONG_PTR lpdwCount, PULONG lpdwGranularity) { - return GetWriteWatch (0, lpBaseAddress, dwRegionSize, lpAddresses, lpdwCount, lpdwGranularity); + return GetWriteWatch (WRITE_WATCH_FLAG_RESET, lpBaseAddress, dwRegionSize, lpAddresses, lpdwCount, lpdwGranularity); } void mman_ResetWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize) { diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index 4b7dff4c..c6b189d6 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -4254,7 +4254,6 @@ void picasso_invalidate (int x, int y, int w, int h) bool picasso_flushpixels (uae_u8 *src, int off) { - int i; uae_u8 *src_start; uae_u8 *src_end; int lock = 0; @@ -4296,7 +4295,7 @@ bool picasso_flushpixels (uae_u8 *src, int off) if (full_refresh < 0) { gwwcnt = (src_end - src_start) / gwwpagesize + 1; full_refresh = 1; - for (i = 0; i < gwwcnt; i++) + for (int i = 0; i < gwwcnt; i++) gwwbuf[i] = src_start + i * gwwpagesize; } else { ULONG ps; @@ -4342,7 +4341,7 @@ bool picasso_flushpixels (uae_u8 *src, int off) break; } - for (i = 0; i < gwwcnt; i++) { + for (int i = 0; i < gwwcnt; i++) { uae_u8 *p = (uae_u8*)gwwbuf[i]; if (p >= src_start && p < src_end) { @@ -4358,12 +4357,13 @@ bool picasso_flushpixels (uae_u8 *src, int off) if (y < pheight) { int w = gwwpagesize / picasso96_state.BytesPerPixel; x = (realoffset % picasso96_state.BytesPerRow) / picasso96_state.BytesPerPixel; - if (x < pwidth) + if (x < pwidth) { copyrow (src + off, dst, x, y, pwidth - x, picasso96_state.BytesPerRow, picasso96_state.BytesPerPixel, picasso_vidinfo.rowbytes, picasso_vidinfo.pixbytes, picasso96_state.RGBFormat == host_mode, picasso_convert); flushlines++; + } w = (gwwpagesize - (picasso96_state.BytesPerRow - x * picasso96_state.BytesPerPixel)) / picasso96_state.BytesPerPixel; if (y < miny) miny = y; @@ -4418,11 +4418,6 @@ bool picasso_flushpixels (uae_u8 *src, int off) if (lock) gfx_unlock_picasso (true); if (dst && gwwcnt) { - if (doskip () && p96skipmode == 3) { - ; - } else { - mman_ResetWatch (src_start, src_end - src_start); - } full_refresh = 0; } return lock != 0; -- 2.47.3