diff options
author | aiju <devnull@localhost> | 2014-03-19 09:04:25 +0100 |
---|---|---|
committer | aiju <devnull@localhost> | 2014-03-19 09:04:25 +0100 |
commit | 5b7ebd7be30cbd89fbfd6fdeb85bd84c1ac61f86 (patch) | |
tree | dbd27ddb2720e67791cc02407f2c291d986bc744 /sys/src | |
parent | da62091c0765ca8994d558f1339dad7c2223a95e (diff) |
games/snes: fixed large sprite scrolling bug
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/games/snes/ppu.c | 13 |
1 files changed, 13 insertions, 0 deletions
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; } |