mirror of https://github.com/mgba-emu/mgba.git
GBA DMA: Fix case where DMAs could get misaligned (fixes #1092)
This commit is contained in:
parent
7ef0c5074c
commit
f35136f881
2
CHANGES
2
CHANGES
|
@ -86,6 +86,8 @@ Misc:
|
||||||
- Switch: Support file associations
|
- Switch: Support file associations
|
||||||
- Vita: L2/R2 and L3/R3 can now be mapped on PSTV (fixes mgba.io/i/1292)
|
- Vita: L2/R2 and L3/R3 can now be mapped on PSTV (fixes mgba.io/i/1292)
|
||||||
Changes from beta 1:
|
Changes from beta 1:
|
||||||
|
Emulation fixes:
|
||||||
|
- GBA DMA: Fix case where DMAs could get misaligned (fixes mgba.io/i/1092)
|
||||||
Other fixes:
|
Other fixes:
|
||||||
- 3DS: Fix screen darkening (fixes mgba.io/i/1562)
|
- 3DS: Fix screen darkening (fixes mgba.io/i/1562)
|
||||||
- Vita: Fix analog controls (fixes mgba.io/i/1554)
|
- Vita: Fix analog controls (fixes mgba.io/i/1554)
|
||||||
|
|
|
@ -95,6 +95,8 @@ uint16_t GBADMAWriteCNT_HI(struct GBA* gba, int dma, uint16_t control) {
|
||||||
if (currentDma->nextDest & (width - 1)) {
|
if (currentDma->nextDest & (width - 1)) {
|
||||||
mLOG(GBA_MEM, GAME_ERROR, "Misaligned DMA destination address: 0x%08X", currentDma->nextDest);
|
mLOG(GBA_MEM, GAME_ERROR, "Misaligned DMA destination address: 0x%08X", currentDma->nextDest);
|
||||||
}
|
}
|
||||||
|
currentDma->nextSource &= -width;
|
||||||
|
currentDma->nextDest &= -width;
|
||||||
|
|
||||||
GBADMASchedule(gba, dma, currentDma);
|
GBADMASchedule(gba, dma, currentDma);
|
||||||
}
|
}
|
||||||
|
@ -242,8 +244,6 @@ void GBADMAService(struct GBA* gba, int number, struct GBADMA* info) {
|
||||||
} else {
|
} else {
|
||||||
cycles += memory->waitstatesNonseq16[sourceRegion] + memory->waitstatesNonseq16[destRegion];
|
cycles += memory->waitstatesNonseq16[sourceRegion] + memory->waitstatesNonseq16[destRegion];
|
||||||
}
|
}
|
||||||
source &= -width;
|
|
||||||
dest &= -width;
|
|
||||||
} else {
|
} else {
|
||||||
if (width == 4) {
|
if (width == 4) {
|
||||||
cycles += memory->waitstatesSeq32[sourceRegion] + memory->waitstatesSeq32[destRegion];
|
cycles += memory->waitstatesSeq32[sourceRegion] + memory->waitstatesSeq32[destRegion];
|
||||||
|
|
Loading…
Reference in New Issue