GB Memory: Fix HDMAs running when screen is off

This commit is contained in:
Vicki Pfau 2018-06-25 15:17:06 -07:00
parent 0ae51f47d9
commit 3f05b12bc1
1 changed files with 1 additions and 1 deletions

View File

@ -495,7 +495,7 @@ uint8_t GBMemoryWriteHDMA5(struct GB* gb, uint8_t value) {
gb->memory.hdmaDest |= 0x8000;
bool wasHdma = gb->memory.isHdma;
gb->memory.isHdma = value & 0x80;
if ((!wasHdma && !gb->memory.isHdma) || gb->video.mode == 0) {
if ((!wasHdma && !gb->memory.isHdma) || (GBRegisterLCDCIsEnable(gb->memory.io[REG_LCDC]) && gb->video.mode == 0)) {
if (gb->memory.isHdma) {
gb->memory.hdmaRemaining = 0x10;
} else {