mirror of https://github.com/mgba-emu/mgba.git
GB Video: Add HDMA
This commit is contained in:
parent
371f6913e7
commit
526a9ce446
|
@ -340,7 +340,11 @@ void _GBMemoryHDMAService(struct GB* gb) {
|
|||
if (gb->memory.hdmaRemaining) {
|
||||
gb->memory.hdmaNext += 2;
|
||||
} else {
|
||||
gb->memory.io[REG_HDMA5] |= 0x80;
|
||||
if (gb->memory.isHdma) {
|
||||
--gb->memory.io[REG_HDMA5];
|
||||
} else {
|
||||
gb->memory.io[REG_HDMA5] |= 0x80;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -178,6 +178,10 @@ int32_t GBVideoProcessEvents(struct GBVideo* video, int32_t cycles) {
|
|||
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
|
||||
GBUpdateIRQs(video->p);
|
||||
}
|
||||
if (video->ly < GB_VIDEO_VERTICAL_PIXELS && video->p->memory.isHdma && video->p->memory.io[REG_HDMA5] != 0xFF) {
|
||||
video->p->memory.hdmaRemaining = 0x10;
|
||||
video->p->memory.hdmaNext = video->p->cpu->cycles;
|
||||
}
|
||||
break;
|
||||
}
|
||||
video->stat = GBRegisterSTATSetMode(video->stat, video->mode);
|
||||
|
|
Loading…
Reference in New Issue