GBA Memory: Fix timing of DMAs
Jeffrey Pfau jeffrey@endrift.com
Wed, 18 Nov 2015 20:44:18 -0800
2 files changed,
5 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -32,6 +32,7 @@ - OpenGL: Fix fast-forward on some OpenGL drivers where it may block early
- GBA BIOS: Fix Sqrt sign - GBA BIOS: Fix misaligned RLUnCompReadNormalWrite* - Qt: Fix race condition with setting sample rate + - GBA Memory: Fix timing of DMAs Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper
M
src/gba/memory.c
→
src/gba/memory.c
@@ -1611,9 +1611,10 @@ uint32_t sourceRegion = source >> BASE_OFFSET;
uint32_t destRegion = dest >> BASE_OFFSET; int32_t cycles = 2; - if (source == info->source) { - // TODO: support 4 cycles for ROM access - cycles += 2; + if (source == info->source && dest == info->dest && wordsRemaining == info->count) { + if (sourceRegion < REGION_CART0 || destRegion < REGION_CART0) { + cycles += 2; + } if (width == 4) { cycles += memory->waitstatesNonseq32[sourceRegion] + memory->waitstatesNonseq32[destRegion]; source &= 0xFFFFFFFC;