From 192bdffd646571aad437fcf3e33fd3910d3bd7c0 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Mon, 12 Jul 2021 21:32:50 -0500 Subject: [PATCH] fix(ppu): PPU cycle count increases even if LCDC bit 7 says otherwise --- src/ppu.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ppu.rs b/src/ppu.rs index b5d51f9..0d5de6b 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -67,12 +67,12 @@ impl BusIo for Ppu { impl Ppu { pub(crate) fn clock(&mut self) { + self.cycle += 1; + if !self.ctrl.lcd_enabled() { return; } - self.cycle += 1; - match self.stat.mode() { PpuMode::OamScan => { if self.cycle >= 80.into() {