mirror of https://github.com/mgba-emu/mgba.git
GB Video: Only trigger STAT write IRQs when screen is on (fixes #912)
This commit is contained in:
parent
c94aff135f
commit
523aaf1497
1
CHANGES
1
CHANGES
|
@ -20,6 +20,7 @@ Bugfixes:
|
||||||
- GBA Video: Force align 256-color tiles
|
- GBA Video: Force align 256-color tiles
|
||||||
- GBA DMA: ROM reads are forced to increment
|
- GBA DMA: ROM reads are forced to increment
|
||||||
- GB Video: Fix loading states while in mode 3
|
- GB Video: Fix loading states while in mode 3
|
||||||
|
- GB Video: Only trigger STAT write IRQs when screen is on (fixes mgba.io/i/912)
|
||||||
Misc:
|
Misc:
|
||||||
- GBA Timer: Use global cycles for timers
|
- GBA Timer: Use global cycles for timers
|
||||||
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
||||||
|
|
|
@ -455,7 +455,10 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) {
|
||||||
void GBVideoWriteSTAT(struct GBVideo* video, GBRegisterSTAT value) {
|
void GBVideoWriteSTAT(struct GBVideo* video, GBRegisterSTAT value) {
|
||||||
GBRegisterSTAT oldStat = video->stat;
|
GBRegisterSTAT oldStat = video->stat;
|
||||||
video->stat = (video->stat & 0x7) | (value & 0x78);
|
video->stat = (video->stat & 0x7) | (value & 0x78);
|
||||||
if (video->p->model < GB_MODEL_CGB && !_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?
|
// TODO: variable for the IRQ line value?
|
||||||
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
|
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
|
||||||
GBUpdateIRQs(video->p);
|
GBUpdateIRQs(video->p);
|
||||||
|
|
Loading…
Reference in New Issue