mirror of https://github.com/mgba-emu/mgba.git
GBA Memory: Fix DMA behavior for SRAM accesses
This commit is contained in:
parent
c6f4f23332
commit
4c1977d351
1
CHANGES
1
CHANGES
|
@ -19,6 +19,7 @@ Bugfixes:
|
||||||
- Libretro: Fix problems with rumble not turning off
|
- Libretro: Fix problems with rumble not turning off
|
||||||
- ARM7: Fix sign of unaligned LDRSH
|
- ARM7: Fix sign of unaligned LDRSH
|
||||||
- GBA BIOS: Fix CpuSet on 0x01XXXXXX addresses
|
- GBA BIOS: Fix CpuSet on 0x01XXXXXX addresses
|
||||||
|
- GBA Memory: Fix DMA behavior for SRAM accesses
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Window size command line options are now supported
|
- Qt: Window size command line options are now supported
|
||||||
- Qt: Increase usability of key mapper
|
- Qt: Increase usability of key mapper
|
||||||
|
|
|
@ -88,7 +88,7 @@ struct GBA {
|
||||||
struct ARMDebugger* debugger;
|
struct ARMDebugger* debugger;
|
||||||
|
|
||||||
uint32_t bus;
|
uint32_t bus;
|
||||||
bool performingDMA;
|
int performingDMA;
|
||||||
|
|
||||||
int timersEnabled;
|
int timersEnabled;
|
||||||
struct GBATimer timers[4];
|
struct GBATimer timers[4];
|
||||||
|
|
|
@ -591,6 +591,9 @@ uint32_t GBALoad8(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
|
||||||
GBALog(gba, GBA_LOG_INFO, "Detected SRAM savegame");
|
GBALog(gba, GBA_LOG_INFO, "Detected SRAM savegame");
|
||||||
GBASavedataInitSRAM(&memory->savedata);
|
GBASavedataInitSRAM(&memory->savedata);
|
||||||
}
|
}
|
||||||
|
if (gba->performingDMA == 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (memory->savedata.type == SAVEDATA_SRAM) {
|
if (memory->savedata.type == SAVEDATA_SRAM) {
|
||||||
value = memory->savedata.data[address & (SIZE_CART_SRAM - 1)];
|
value = memory->savedata.data[address & (SIZE_CART_SRAM - 1)];
|
||||||
} else if (memory->savedata.type == SAVEDATA_FLASH512 || memory->savedata.type == SAVEDATA_FLASH1M) {
|
} else if (memory->savedata.type == SAVEDATA_FLASH512 || memory->savedata.type == SAVEDATA_FLASH1M) {
|
||||||
|
@ -1480,7 +1483,7 @@ void GBAMemoryServiceDMA(struct GBA* gba, int number, struct GBADMA* info) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gba->performingDMA = true;
|
gba->performingDMA = 1 | (number << 1);
|
||||||
int32_t word;
|
int32_t word;
|
||||||
if (width == 4) {
|
if (width == 4) {
|
||||||
word = cpu->memory.load32(cpu, source, 0);
|
word = cpu->memory.load32(cpu, source, 0);
|
||||||
|
@ -1517,7 +1520,7 @@ void GBAMemoryServiceDMA(struct GBA* gba, int number, struct GBADMA* info) {
|
||||||
--wordsRemaining;
|
--wordsRemaining;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gba->performingDMA = false;
|
gba->performingDMA = 0;
|
||||||
|
|
||||||
if (!wordsRemaining) {
|
if (!wordsRemaining) {
|
||||||
if (!GBADMARegisterIsRepeat(info->reg) || GBADMARegisterGetTiming(info->reg) == DMA_TIMING_NOW) {
|
if (!GBADMARegisterIsRepeat(info->reg) || GBADMARegisterGetTiming(info->reg) == DMA_TIMING_NOW) {
|
||||||
|
|
Loading…
Reference in New Issue