all repos — mgba @ 3f682034d62eb1b8f8b3fe6f87d9ed51d1248ae1

mGBA Game Boy Advance Emulator

GB Video: Only trigger STAT write IRQs when screen is on (fixes #912)
Vicki Pfau vi@endrift.com
Wed, 18 Oct 2017 09:19:10 -0700
commit

3f682034d62eb1b8f8b3fe6f87d9ed51d1248ae1

parent

dbc48fd401a9d96fea1568fcbae2f7a7fddc95dc

2 files changed, 5 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -2,6 +2,7 @@ 0.6.2: (Future)

Bugfixes: - GBA Video: Force align 256-color tiles - GBA DMA: ROM reads are forced to increment + - GB Video: Only trigger STAT write IRQs when screen is on (fixes mgba.io/i/912) 0.6.1: (2017-10-01) Bugfixes:
M src/gb/video.csrc/gb/video.c

@@ -373,7 +373,10 @@

void GBVideoWriteSTAT(struct GBVideo* video, GBRegisterSTAT value) { GBRegisterSTAT oldStat = video->stat; video->stat = (video->stat & 0x7) | (value & 0x78); - if (video->p->model == GB_MODEL_DMG && !_statIRQAsserted(video, oldStat) && video->mode < 3) { + if (!GBRegisterLCDCIsEnable(video->p->memory.io[REG_LCDC]) || video->p->model >= GB_MODEL_CGB) { + return; + } + if (!_statIRQAsserted(video, oldStat) && video->mode < 3) { // TODO: variable for the IRQ line value? video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT); GBUpdateIRQs(video->p);