ref: 921b75a9095a20bbc44d97b251e659c3334df18b
parent: 8eecdc96643cf0d90f850212e6e2bd351bdc00e7
author: aiju <devnull@localhost>
date: Thu Oct 11 12:25:11 EDT 2018
games/gb: when the LCD is turned off, reset ppuy and ppustate to 0, fixes bug in dragon warriors iii reported by mischief
--- a/sys/src/games/gb/mem.c
+++ b/sys/src/games/gb/mem.c
@@ -107,8 +107,11 @@
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;