GBA DMA: Fix case where DMAs could get misaligned (fixes #1092)

This commit is contained in:
Vicki Pfau 2019-10-29 20:13:58 -07:00
parent 7ef0c5074c
commit f35136f881
2 changed files with 4 additions and 2 deletions

View File

@ -86,6 +86,8 @@ Misc:
- 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)

View File

@ -95,6 +95,8 @@ uint16_t GBADMAWriteCNT_HI(struct GBA* gba, int dma, uint16_t control) {
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 @@ void GBADMAService(struct GBA* gba, int number, struct GBADMA* info) {
} else {
cycles += memory->waitstatesNonseq16[sourceRegion] + memory->waitstatesNonseq16[destRegion];
}
source &= -width;
dest &= -width;
} else {
if (width == 4) {
cycles += memory->waitstatesSeq32[sourceRegion] + memory->waitstatesSeq32[destRegion];