all repos — mgba @ 39c754bdab6fd56c373e0f0864e4f60a6c9b55cb

mGBA Game Boy Advance Emulator

GB Video: Changing LYC while LCDC off doesn't affect STAT (fixes #1224)
Vicki Pfau vi@endrift.com
Fri, 23 Nov 2018 16:29:52 -0500
commit

39c754bdab6fd56c373e0f0864e4f60a6c9b55cb

parent

77d6bda52401fa508d9d4a7f78149938a039f921

2 files changed, 7 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -129,6 +129,7 @@ - Qt: Grab focus when game starts (fixes mgba.io/i/804)

- Core: Remember to deinit proxy ring FIFO - GBA Savedata: Fix EEPROM writing codepath when savetype is not EEPROM - Core: Reroot timing list when (de)scheduling + - GB Video: Changing LYC while LCDC off doesn't affect STAT (fixes mgba.io/i/1224) Misc: - mGUI: Add SGB border configuration option - mGUI: Add support for different settings types
M src/gb/video.csrc/gb/video.c

@@ -449,10 +449,12 @@ }

void GBVideoWriteLYC(struct GBVideo* video, uint8_t value) { GBRegisterSTAT oldStat = video->stat; - video->stat = GBRegisterSTATSetLYC(video->stat, value == video->ly); - if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) { - video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT); - GBUpdateIRQs(video->p); + if (GBRegisterLCDCIsEnable(video->p->memory.io[REG_LCDC])) { + video->stat = GBRegisterSTATSetLYC(video->stat, value == video->ly); + if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) { + video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT); + GBUpdateIRQs(video->p); + } } video->p->memory.io[REG_STAT] = video->stat; }