all repos — mgba @ 793f552f43df026d498a50886a833d77d57e2dde

mGBA Game Boy Advance Emulator

GBA: Fix DMA in savestates hopefully for good this time
Jeffrey Pfau jeffrey@endrift.com
Fri, 14 Nov 2014 01:19:34 -0800
commit

793f552f43df026d498a50886a833d77d57e2dde

parent

d3a60f655582408f5a3ccb932abdd21c6e2ca16e

1 files changed, 4 insertions(+), 3 deletions(-)

jump to
M src/gba/gba-io.csrc/gba/gba-io.c

@@ -62,9 +62,9 @@ 0, 0, 0, 0, 0, 0, 0, 0,

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // DMA - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Timers

@@ -478,6 +478,7 @@

gba->timersEnabled = 0; memcpy(gba->timers, state->timers, sizeof(gba->timers)); for (i = 0; i < 4; ++i) { + gba->memory.dma[i].reg = state->io[(REG_DMA0CNT_HI + i * 12) >> 1]; gba->memory.dma[i].nextSource = state->dma[i].nextSource; gba->memory.dma[i].nextDest = state->dma[i].nextDest; gba->memory.dma[i].nextCount = state->dma[i].nextCount;