]> git.lizzy.rs Git - plan9front.git/commitdiff
games/gb: when the LCD is turned off, reset ppuy and ppustate to 0, fixes bug in...
authoraiju <devnull@localhost>
Thu, 11 Oct 2018 16:25:11 +0000 (16:25 +0000)
committeraiju <devnull@localhost>
Thu, 11 Oct 2018 16:25:11 +0000 (16:25 +0000)
sys/src/games/gb/mem.c

index ff8fd7950e74f93ba5ae870b4e9d1910619ffe93..9098dbe18aeb21e515afac280ca4a7fe44d64d5a 100644 (file)
@@ -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;