mirror of
https://github.com/zoriya/ComSquare.git
synced 2025-12-20 14:15:11 +00:00
Finishing the common bus for all modes
This commit is contained in:
@@ -48,12 +48,14 @@ namespace ComSquare
|
||||
void MemoryBus::_mirrorComponents(SNES &console, int i)
|
||||
{
|
||||
this->_memoryAccessors.push_back(Memory::MemoryShadow::createShadow(console.wram, i, i + 0x2000));
|
||||
this->_memoryAccessors.push_back(Memory::MemoryShadow::createShadow(console.ppu, i + 0x2100, i + 0x2140));
|
||||
this->_memoryAccessors.push_back(Memory::MemoryShadow::createShadow(console.apu, i + 0x2140, i + 0x2144));
|
||||
this->_memoryAccessors.push_back(Memory::MemoryShadow::createShadow(console.cpu, i + 0x4200, i + 0x4220));
|
||||
}
|
||||
|
||||
void MemoryBus::mapComponents(SNES &console)
|
||||
{
|
||||
// The WRam is always mapped in the bank 7E and 7F, no matter the memory mapping mode.
|
||||
// The WRam and PU registers are always mapped at the same address no matter the mapping mode.
|
||||
console.wram->setMemoryRegion(0x7E0000, 0x7FFFFF);
|
||||
this->_memoryAccessors.push_back(console.wram);
|
||||
|
||||
@@ -67,14 +69,15 @@ namespace ComSquare
|
||||
this->_memoryAccessors.push_back(console.cpu);
|
||||
|
||||
// TODO implement DMA & HDMA (4220 to 4300)
|
||||
// TODO implement Joys.
|
||||
|
||||
//Mirror the first $2000 bits of the WRam to all banks of the Q1 & Q3.
|
||||
for (uint24_t i = 0; i < 0x400000; i += 0x10000) {
|
||||
// Map to the quarter 1.
|
||||
for (uint24_t i = 0; i < 0x400000; i += 0x10000)
|
||||
this->_mirrorComponents(console, i);
|
||||
}
|
||||
for (uint24_t i = 0x800000; i < 0xC00000; i += 0x10000) {
|
||||
this->_memoryAccessors.push_back(Memory::MemoryShadow::createShadow(console.wram, i, i + 0x2000));
|
||||
this->_memoryAccessors.push_back(Memory::MemoryShadow::createShadow(console.cpu, i + 0x4200, i + 0x4220));
|
||||
}
|
||||
// Map to the quarter 3.
|
||||
for (uint24_t i = 0x800000; i < 0xC00000; i += 0x10000)
|
||||
this->_mirrorComponents(console, i);
|
||||
|
||||
// TODO should map sram, cartridge etc via the mapping mode of the cartridge.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user