Permalink
Browse files

GB Memory: Fix HDMAs running when screen is off

  • Loading branch information...
endrift committed Jun 25, 2018
1 parent 0ae51f4 commit 3f05b12bc11d152c51516470b763939e05a842cb
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gb/memory.c
View
@@ -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 {

0 comments on commit 3f05b12

Please sign in to comment.