From: kub Date: Mon, 9 May 2022 19:45:59 +0000 (+0200) Subject: core vdp, fix out-of-bounds vram access for save/load X-Git-Tag: v2.00~303 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56e0b865591c81cd748100e5f384fe68199e5357;p=picodrive.git core vdp, fix out-of-bounds vram access for save/load --- diff --git a/pico/videoport.c b/pico/videoport.c index 07b16b51..7f567f17 100644 --- a/pico/videoport.c +++ b/pico/videoport.c @@ -1105,8 +1105,9 @@ void PicoVideoCacheSAT(int load) // rebuild SAT cache XXX wrong since cache and memory can differ for (l = 0; load && l < 80; l++) { - ((u16 *)VdpSATCache)[l*2 ] = PicoMem.vram[(SATaddr>>1) + l*4 ]; - ((u16 *)VdpSATCache)[l*2 + 1] = PicoMem.vram[(SATaddr>>1) + l*4 + 1]; + u16 addr = SATaddr + l*8; + ((u16 *)VdpSATCache)[l*2 ] = PicoMem.vram[(addr>>1) ]; + ((u16 *)VdpSATCache)[l*2 + 1] = PicoMem.vram[(addr>>1) + 1]; } Pico.est.rendstatus |= PDRAW_SPRITES_MOVED;