From 3618d636d2d7a76c03bb0a92c9d83f7b7348ff0e Mon Sep 17 00:00:00 2001 From: kub Date: Wed, 7 Oct 2020 20:12:23 +0200 Subject: [PATCH] vdp rendering, fix SAT caching for high addresses >64KB --- pico/pico_int.h | 2 +- pico/videoport.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pico/pico_int.h b/pico/pico_int.h index 86cfb778..1a2e408d 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -857,7 +857,7 @@ static __inline void VideoWriteVRAM(u32 a, u16 d) { PicoMem.vram [(u16)a >> 1] = d; - if (!((u16)(a^SATaddr) & SATmask)) + if (((a^SATaddr) & SATmask) == 0) UpdateSAT(a, d); } diff --git a/pico/videoport.c b/pico/videoport.c index fec862f7..c9221493 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -334,7 +334,7 @@ static NOINLINE void VideoWriteVRAM128(u32 a, u16 d) if (!((u16)(b^SATaddr) & SATmask)) Pico.est.rendstatus |= PDRAW_DIRTY_SPRITES; - if (!((u16)(a^SATaddr) & SATmask)) + if (((a^SATaddr) & SATmask) == 0) UpdateSAT(a, d); } @@ -539,7 +539,7 @@ static void DmaCopy(int len) for (; len; len--) { vr[(u16)a] = vr[(u16)(source++)]; - if (!((u16)(a^SATaddr) & SATmask)) + if (((a^SATaddr) & SATmask) == 0) UpdateSAT(a, ((u16 *)vr)[(u16)a >> 1]); // AutoIncrement a = (a+inc) & ~0x20000; @@ -579,7 +579,7 @@ static NOINLINE void DmaFill(int data) // Write upper byte to adjacent address // (here we are byteswapped, so address is already 'adjacent') vr[(u16)a] = high; - if (!((u16)(a^SATaddr) & SATmask)) + if (((a^SATaddr) & SATmask) == 0) UpdateSAT(a, ((u16 *)vr)[(u16)a >> 1]); // Increment address register -- 2.39.2