Step cycles in VBlank
authorAlyssa Rosenzweig <alyssa@backtick.town>
Thu, 30 Jun 2016 17:18:44 +0000 (10:18 -0700)
committerAlyssa Rosenzweig <alyssa@backtick.town>
Thu, 30 Jun 2016 17:18:44 +0000 (10:18 -0700)
src/PPU/PPU.tosh

index 419e849..a3ac12c 100644 (file)
@@ -50,7 +50,7 @@ repeat 224
        evaluate sprites scanline:  (Y)
        set x to -128
        set X to 1
-       repeat until X > 240
+       repeat until X > 255
                 step CPU
                 repeat cycles
                     emulate 3 PPU cycles
@@ -60,6 +60,10 @@ repeat 224
        set PPU vblank? to 1
        if PPU generate NMI = 1 then
                interrupt: vector "0xFFFA"
+                repeat until cycles > 2380
+                    step CPU
+                end
+                set cycles to 0
        end
        change y by -1
 end
This page took 0.028125 seconds and 4 git commands to generate.