From 5fa12cb8ebec260064efde0d69b2f07e5a8dcbc1 Mon Sep 17 00:00:00 2001 From: EliseZeroTwo Date: Wed, 24 Nov 2021 17:12:59 +0100 Subject: [PATCH] fix: ly!=lyc clears stat --- src/gameboy/ppu.rs | 2 ++ src/window.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gameboy/ppu.rs b/src/gameboy/ppu.rs index e89851a..2363c14 100644 --- a/src/gameboy/ppu.rs +++ b/src/gameboy/ppu.rs @@ -164,6 +164,8 @@ impl Ppu { if (self.stat >> 6) & 0b1 == 1 { interrupts.write_if_lcd_stat(true); } + } else { + self.stat &= !(1 << 2); } } diff --git a/src/window.rs b/src/window.rs index 4b3d8b4..8ef423f 100644 --- a/src/window.rs +++ b/src/window.rs @@ -51,7 +51,7 @@ pub const FB_HEIGHT: u32 = 144; pub const FB_WIDTH: u32 = 160; #[derive(Debug, Default)] -pub struct Keymap { +struct Keymap { pub down: bool, pub up: bool, pub left: bool,