mirror of https://github.com/mgba-emu/mgba.git
GB Memory: Clearing the HDMA bit disabled HDMA
This commit is contained in:
parent
b8ed859c21
commit
a260b4cf91
|
@ -322,8 +322,9 @@ void GBMemoryWriteHDMA5(struct GB* gb, uint8_t value) {
|
|||
}
|
||||
gb->memory.hdmaDest &= 0x1FF0;
|
||||
gb->memory.hdmaDest |= 0x8000;
|
||||
bool wasHdma = gb->memory.isHdma;
|
||||
gb->memory.isHdma = value & 0x80;
|
||||
if (!gb->memory.isHdma) {
|
||||
if (!wasHdma && !gb->memory.isHdma) {
|
||||
gb->memory.hdmaRemaining = ((value & 0x7F) + 1) * 0x10;
|
||||
gb->memory.hdmaNext = gb->cpu->cycles;
|
||||
gb->cpu->nextEvent = gb->cpu->cycles;
|
||||
|
|
Loading…
Reference in New Issue