all repos — mgba @ 3d321bc0b94959d21b6063039d67057c05890c33

mGBA Game Boy Advance Emulator

GBA Memory: Fix timing of DMAs
Jeffrey Pfau jeffrey@endrift.com
Wed, 18 Nov 2015 20:44:18 -0800
commit

3d321bc0b94959d21b6063039d67057c05890c33

parent

21d51964e8be28f2b5e294510c55bee4eb267862

2 files changed, 5 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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;