From c96fa38a2ddf932e585078fd7697b0a0a9fa7520 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Sun, 16 Feb 2020 01:46:51 +0200 Subject: [PATCH] bugfix: Fix improper write to DISPSTAT register For some reason, probably typing mistkae, I `or`ed the value being written to DISPSTAT, causing bits to never actually turn off, affectivly making HBLANK/VBLANK interrupts linger forever. This probably has caused some nasty glitches that I don't even know of, but two confirm issues solved by this are Mariokart and Pacman. This commit fixes #14 and #13 Former-commit-id: 72ad6efcb9e8f6b582d9279c5daab2603d5a408e --- src/core/iodev.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/iodev.rs b/src/core/iodev.rs index 613cea7..986c4fc 100644 --- a/src/core/iodev.rs +++ b/src/core/iodev.rs @@ -121,7 +121,7 @@ impl Bus for IoDevices { let io_addr = addr + IO_BASE; match io_addr { REG_DISPCNT => io.gpu.dispcnt.0 = value, - REG_DISPSTAT => io.gpu.dispstat.0 |= value & !3, + REG_DISPSTAT => io.gpu.dispstat.0 = value & !3, REG_BG0CNT => io.gpu.backgrounds[0].bgcnt.0 = value, REG_BG1CNT => io.gpu.backgrounds[1].bgcnt.0 = value, REG_BG2CNT => io.gpu.backgrounds[2].bgcnt.0 = value,