mirror of https://github.com/mgba-emu/mgba.git
GB Memory: Support running from blocked memory
This commit is contained in:
parent
42f65db396
commit
0332db8961
1
CHANGES
1
CHANGES
|
@ -6,6 +6,7 @@ Bugfixes:
|
||||||
Misc:
|
Misc:
|
||||||
- GBA Savedata: EEPROM performance fixes
|
- GBA Savedata: EEPROM performance fixes
|
||||||
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
|
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
|
||||||
|
- GB Memory: Support running from blocked memory
|
||||||
|
|
||||||
0.7.0: (Future)
|
0.7.0: (Future)
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -45,6 +45,8 @@ static const enum GBBus _oamBlockCGB[] = {
|
||||||
GB_BUS_CPU // 0xE000
|
GB_BUS_CPU // 0xE000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const uint8_t _blockedRegion[1] = { 0xFF };
|
||||||
|
|
||||||
static void _pristineCow(struct GB* gba);
|
static void _pristineCow(struct GB* gba);
|
||||||
|
|
||||||
static uint8_t GBFastLoad8(struct LR35902Core* cpu, uint16_t address) {
|
static uint8_t GBFastLoad8(struct LR35902Core* cpu, uint16_t address) {
|
||||||
|
@ -92,6 +94,15 @@ static void GBSetActiveRegion(struct LR35902Core* cpu, uint16_t address) {
|
||||||
cpu->memory.cpuLoad8 = GBLoad8;
|
cpu->memory.cpuLoad8 = GBLoad8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (gb->memory.dmaRemaining) {
|
||||||
|
const enum GBBus* block = gb->model < GB_MODEL_CGB ? _oamBlockDMG : _oamBlockCGB;
|
||||||
|
enum GBBus dmaBus = block[memory->dmaSource >> 13];
|
||||||
|
enum GBBus accessBus = block[address >> 13];
|
||||||
|
if ((dmaBus != GB_BUS_CPU && dmaBus == accessBus) || (address >= GB_BASE_OAM && address < GB_BASE_UNUSABLE)) {
|
||||||
|
cpu->memory.activeRegion = _blockedRegion;
|
||||||
|
cpu->memory.activeMask = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _GBMemoryDMAService(struct mTiming* timing, void* context, uint32_t cyclesLate);
|
static void _GBMemoryDMAService(struct mTiming* timing, void* context, uint32_t cyclesLate);
|
||||||
|
|
Loading…
Reference in New Issue