GB Video: Fix read mode when enabling LCD

This commit is contained in:
Vicki Pfau 2017-09-26 16:24:58 -07:00
parent a949fdfced
commit 431ee76c1a
2 changed files with 2 additions and 2 deletions

View File

@ -45,6 +45,7 @@ Bugfixes:
- GBA I/O: Fix reading from a few invalid I/O registers (fixes mgba.io/i/876)
- GBA Savedata: Fix size of SRAM saves (fixes mgba.io/i/883)
- GB: Revamp IRQ handling based on new information
- GB Video: Fix read mode when enabling LCD
Misc:
- GBA Timer: Use global cycles for timers
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)

View File

@ -418,9 +418,8 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) {
video->ly = 0;
video->p->memory.io[REG_LY] = 0;
// TODO: Does this read as 0 for 4 T-cycles?
GBRegisterSTAT oldStat = video->stat;
video->stat = GBRegisterSTATSetMode(video->stat, 2);
video->stat = GBRegisterSTATSetMode(video->stat, 0);
video->stat = GBRegisterSTATSetLYC(video->stat, video->ly == video->p->memory.io[REG_LYC]);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);