GB Memory: Write back HDMA addresses when done

This commit is contained in:
Jeffrey Pfau 2016-02-19 22:07:08 -08:00
parent 9d4ffb3e43
commit 0557caad98
1 changed files with 4 additions and 0 deletions

View File

@ -347,6 +347,10 @@ void _GBMemoryHDMAService(struct GB* gb) {
if (gb->memory.hdmaRemaining) {
gb->memory.hdmaNext += 2;
} else {
gb->memory.io[REG_HDMA1] = gb->memory.hdmaSource >> 8;
gb->memory.io[REG_HDMA2] = gb->memory.hdmaSource;
gb->memory.io[REG_HDMA3] = gb->memory.hdmaDest >> 8;
gb->memory.io[REG_HDMA4] = gb->memory.hdmaDest;
if (gb->memory.isHdma) {
--gb->memory.io[REG_HDMA5];
} else {