From 5b7ebd7be30cbd89fbfd6fdeb85bd84c1ac61f86 Mon Sep 17 00:00:00 2001 From: aiju Date: Wed, 19 Mar 2014 09:04:25 +0100 Subject: games/snes: fixed large sprite scrolling bug --- sys/src/games/snes/ppu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/src/games/snes/ppu.c b/sys/src/games/snes/ppu.c index d88cc2044..3d17e4930 100644 --- a/sys/src/games/snes/ppu.c +++ b/sys/src/games/snes/ppu.c @@ -616,6 +616,14 @@ nope: a = sp->t0 | (dy & 7) << 1; if(dy >= 8) a += (dy & ~7) << 6; + if(sp->x < 0 && (i = (-sp->x >> 3)) != 0){ + if((sp->c & 0x40) != 0) + a -= i << 5; + else + a += i << 5; + nt -= i; + tp->sx += i << 3; + } if((sp->c & 0x40) != 0){ a += sp->sx * 4; for(i = 0; i < nt; i++){ @@ -642,6 +650,11 @@ nope: }else over |= 0x80; } + if(sp->x < 0 && (i = (-sp->x) & 7) != 0) + if((sp->c & 0x40) != 0) + *tp->ch >>= i; + else + *tp->ch <<= i; } reg[0x213e] = over; } -- cgit v1.2.3