GBA DMA: Fix case where DMAs could get misaligned (fixes #1092)
Vicki Pfau vi@endrift.com
Tue, 29 Oct 2019 20:13:58 -0700
2 files changed,
4 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -86,6 +86,8 @@ - Switch: Dynamic display resizing
- Switch: Support file associations - Vita: L2/R2 and L3/R3 can now be mapped on PSTV (fixes mgba.io/i/1292) Changes from beta 1: +Emulation fixes: + - GBA DMA: Fix case where DMAs could get misaligned (fixes mgba.io/i/1092) Other fixes: - 3DS: Fix screen darkening (fixes mgba.io/i/1562) - Vita: Fix analog controls (fixes mgba.io/i/1554)
M
src/gba/dma.c
→
src/gba/dma.c
@@ -95,6 +95,8 @@ }
if (currentDma->nextDest & (width - 1)) { mLOG(GBA_MEM, GAME_ERROR, "Misaligned DMA destination address: 0x%08X", currentDma->nextDest); } + currentDma->nextSource &= -width; + currentDma->nextDest &= -width; GBADMASchedule(gba, dma, currentDma); }@@ -242,8 +244,6 @@ cycles += memory->waitstatesNonseq32[sourceRegion] + memory->waitstatesNonseq32[destRegion];
} else { cycles += memory->waitstatesNonseq16[sourceRegion] + memory->waitstatesNonseq16[destRegion]; } - source &= -width; - dest &= -width; } else { if (width == 4) { cycles += memory->waitstatesSeq32[sourceRegion] + memory->waitstatesSeq32[destRegion];