From 921b75a9095a20bbc44d97b251e659c3334df18b Mon Sep 17 00:00:00 2001 From: aiju Date: Thu, 11 Oct 2018 16:25:11 +0000 Subject: games/gb: when the LCD is turned off, reset ppuy and ppustate to 0, fixes bug in dragon warriors iii reported by mischief --- sys/src/games/gb/mem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/src/games/gb/mem.c b/sys/src/games/gb/mem.c index ff8fd7950..9098dbe18 100644 --- a/sys/src/games/gb/mem.c +++ b/sys/src/games/gb/mem.c @@ -107,8 +107,11 @@ regwrite(u8int a, u8int v) break; case LCDC: ppusync(); - if((~v & reg[a] & LCDEN) != 0) + if((~v & reg[a] & LCDEN) != 0){ + ppuy = 0; + ppustate = 0; delevent(&evhblank); + } if((v & ~reg[a] & LCDEN) != 0) addevent(&evhblank, 456*2); break; -- cgit v1.2.3