bugfix: Fix bad write impl of DISPSTAT again.

I should really pay more attention to the docs..
The previous fix (bb843ea5) was not enough as it caused vblank,hblank
and vcount-match flags to be overwritten when they really should have
just been ignored.

This caused Dragon Ball - Advance Adevnture to fail booting


Former-commit-id: 1810e32692a0abd79f2df385c7c822debf186c79
This commit is contained in:
Michel Heily 2020-02-28 15:01:51 +02:00
parent d938767430
commit c68b9502fe

View file

@ -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 | (io.gpu.dispstat.0 & 5),
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,