mirror of https://github.com/mgba-emu/mgba.git
GB Video: Setting LYC=LY during mode 2 should trigger an IRQ
This commit is contained in:
parent
b4e0ab93fe
commit
4d75576229
1
CHANGES
1
CHANGES
|
@ -1,6 +1,7 @@
|
|||
0.5.1: (Future)
|
||||
Bugfixes:
|
||||
- GB MBC: Fix MBC7 when size is incorrectly specified
|
||||
- GB Video: Setting LYC=LY during mode 2 should trigger an IRQ
|
||||
Misc:
|
||||
- All: Only update version info if needed
|
||||
|
||||
|
|
10
src/gb/io.c
10
src/gb/io.c
|
@ -341,7 +341,6 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
|
|||
case REG_SB:
|
||||
case REG_TIMA:
|
||||
case REG_TMA:
|
||||
case REG_LYC:
|
||||
// Handled transparently by the registers
|
||||
break;
|
||||
case REG_TAC:
|
||||
|
@ -357,6 +356,15 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
|
|||
value = gb->video.renderer->writeVideoRegister(gb->video.renderer, address, value);
|
||||
GBVideoWriteLCDC(&gb->video, value);
|
||||
break;
|
||||
case REG_LYC:
|
||||
if (gb->video.mode == 2) {
|
||||
gb->video.stat = GBRegisterSTATSetLYC(gb->video.stat, value == gb->video.ly);
|
||||
if (GBRegisterSTATIsLYCIRQ(gb->video.stat) && value == gb->video.ly) {
|
||||
gb->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
|
||||
GBUpdateIRQs(gb->video.p);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case REG_DMA:
|
||||
GBMemoryDMA(gb, value << 8);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue