mirror of https://github.com/mgba-emu/mgba.git
GB Video: Delay LYC STAT check (fixes #1331)
This commit is contained in:
parent
eafb1ca06b
commit
f9ff88302f
1
CHANGES
1
CHANGES
|
@ -9,6 +9,7 @@ Bugfixes:
|
|||
- GBA BIOS: Fix multiboot entry point (fixes Magic Floor)
|
||||
- Qt: More app metadata fixes
|
||||
- Qt: Fix load recent from archive (fixes mgba.io/i/1325)
|
||||
- GB Video: Delay LYC STAT check (fixes mgba.io/i/1331)
|
||||
Misc:
|
||||
- GBA Savedata: EEPROM performance fixes
|
||||
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
|
||||
|
|
|
@ -224,7 +224,6 @@ void _endMode0(struct mTiming* timing, void* context, uint32_t cyclesLate) {
|
|||
++video->ly;
|
||||
video->p->memory.io[REG_LY] = video->ly;
|
||||
GBRegisterSTAT oldStat = video->stat;
|
||||
video->stat = GBRegisterSTATSetLYC(video->stat, lyc == video->ly);
|
||||
if (video->ly < GB_VIDEO_VERTICAL_PIXELS) {
|
||||
next = GB_VIDEO_MODE_2_LENGTH;
|
||||
video->mode = 2;
|
||||
|
@ -246,6 +245,14 @@ void _endMode0(struct mTiming* timing, void* context, uint32_t cyclesLate) {
|
|||
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
|
||||
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
|
||||
}
|
||||
|
||||
// LYC stat is delayed 1 T-cycle
|
||||
oldStat = video->stat;
|
||||
video->stat = GBRegisterSTATSetLYC(video->stat, lyc == 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;
|
||||
mTimingSchedule(timing, &video->modeEvent, (next << video->p->doubleSpeed) - cyclesLate);
|
||||
|
|
Loading…
Reference in New Issue