summaryrefslogtreecommitdiff
path: root/sys/src/games
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2018-10-11 16:25:11 +0000
committeraiju <devnull@localhost>2018-10-11 16:25:11 +0000
commit921b75a9095a20bbc44d97b251e659c3334df18b (patch)
tree04c26cbc183800292054b7d4d17e1dc4af9e6b13 /sys/src/games
parent8eecdc96643cf0d90f850212e6e2bd351bdc00e7 (diff)
games/gb: when the LCD is turned off, reset ppuy and ppustate to 0, fixes bug in dragon warriors iii reported by mischief
Diffstat (limited to 'sys/src/games')
-rw-r--r--sys/src/games/gb/mem.c5
1 files changed, 4 insertions, 1 deletions
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;