From 26777f4cefb1dc5a19da585cb38e08a7db9f143a Mon Sep 17 00:00:00 2001 From: aiju Date: Fri, 21 Mar 2014 14:25:08 +0100 Subject: [PATCH] games/snes: minor oam bugs --- sys/src/games/snes/mem.c | 2 +- sys/src/games/snes/ppu.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/src/games/snes/mem.c b/sys/src/games/snes/mem.c index 1c8728e99..a9156bc25 100644 --- a/sys/src/games/snes/mem.c +++ b/sys/src/games/snes/mem.c @@ -231,7 +231,7 @@ regwrite(u16int p, u8int v) oamaddr = (reg[0x2103] & 1) << 9 | v << 1; break; case 0x2103: - oamaddr = (v & 1) << 9 | reg[0x2102]; + oamaddr = (v & 1) << 9 | reg[0x2102] << 1; break; case 0x2104: if((oamaddr & 1) == 0) diff --git a/sys/src/games/snes/ppu.c b/sys/src/games/snes/ppu.c index b905fc34a..9d3fab477 100644 --- a/sys/src/games/snes/ppu.c +++ b/sys/src/games/snes/ppu.c @@ -877,7 +877,8 @@ ppustep(void) reg[RDNMI] |= VBLANK; if((reg[NMITIMEN] & VBLANK) != 0) nmi = 2; - oamaddr = reg[0x2102] << 1 | (reg[0x2103] & 1) << 9; + if((reg[INIDISP] & 0x80) == 0) + oamaddr = reg[0x2102] << 1 | (reg[0x2103] & 1) << 9; if((reg[NMITIMEN] & AUTOJOY) != 0){ memwrite(0x4016, 1); memwrite(0x4016, 0);