ref: 2fb68b633845ad67fbf03d6f0cf8faa6d7005a45
parent: 74778941ed75b0a548d6f00e825d6d56bb5722d8
author: aiju <devnull@localhost>
date: Sun Mar 16 05:52:38 EDT 2014
games/snes: bug fixes
--- a/sys/src/games/snes/mem.c
+++ b/sys/src/games/snes/mem.c
@@ -342,7 +342,7 @@
vtime = vtime & 0xff | (v & 1) << 8;
break;
case 0x420b:
- dma |= v & ~reg[0x420c];
+ dma |= v & ~(reg[0x420c] & ~hdma >> 24);
break;
case 0x4210:
return;
--- a/sys/src/games/snes/ppu.c
+++ b/sys/src/games/snes/ppu.c
@@ -280,8 +280,8 @@
p->t = tile(n, p->tx, p->ty);
chr(n, nb, p->sz, p->t, p->tnx, p->tny, p->c);
p->pal = palette(n, p->t >> 10 & 7);
- if(p->tnx != 0)
- shift(p->c, nb, p->tnx, p->t & 0x4000);
+ if((p->tnx & 7) != 0)
+ shift(p->c, nb, p->tnx & 7, p->t & 0x4000);
if(p->msz != 1 && p->mx != 0 && sx % p->msz == 0){
p->mv = bgpixel(p->c, nb, p->t & 0x4000);
if(p->tnx + p->mx >= 8){