The memory bus is the component responsible of mapping addresses to components address and transmitting the data.
More...
#include <MemoryBus.hpp>
|
| std::vector< std::shared_ptr< IMemory > > | _memoryAccessors |
| | The list of components registered inside the bus. Every components that can read/write to a public address should be in this vector. More...
|
| |
| uint8_t | _openBus = 0 |
| | The last value read via the memory bus. More...
|
| |
The memory bus is the component responsible of mapping addresses to components address and transmitting the data.
◆ _mirrorComponents()
| void ComSquare::Memory::MemoryBus::_mirrorComponents |
( |
SNES & |
console, |
|
|
int |
i |
|
) |
| |
|
inlineprivate |
WRam, CPU, PPU & ALU registers are mirrored to all banks of Q1 & Q3. This function is used for the mirroring.
- Parameters
-
| console | All the components. |
| i | Base address for the mirrors. |
◆ getAccessor()
| std::shared_ptr< IMemory > ComSquare::Memory::MemoryBus::getAccessor |
( |
uint24_t |
addr | ) |
|
|
private |
Helper function to get the components that is responsible of read/write at an address.
- Parameters
-
| addr | The address you want to look for. |
- Returns
- The components responsible for the address param or nullptr if none was found.
◆ mapComponents()
| void ComSquare::Memory::MemoryBus::mapComponents |
( |
SNES & |
console | ) |
|
Map components to the address space using the currently loaded cartridge to set the right mapping mode.
- Parameters
-
| console | All the components. |
◆ read()
| uint8_t ComSquare::Memory::MemoryBus::read |
( |
uint24_t |
addr | ) |
|
Read data at a global address.
- Parameters
-
| addr | The address to read from. |
- Returns
- The value that the component returned for this address. If the address was mapped to ram, it simply returned the value. If the address was mapped to a register the component returned the register.
◆ write()
| void ComSquare::Memory::MemoryBus::write |
( |
uint24_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
Write a data to a global address.
- Parameters
-
| addr | The address to write to. |
| data | The data to write. |
◆ _memoryAccessors
| std::vector<std::shared_ptr<IMemory> > ComSquare::Memory::MemoryBus::_memoryAccessors |
|
private |
The list of components registered inside the bus. Every components that can read/write to a public address should be in this vector.
◆ _openBus
| uint8_t ComSquare::Memory::MemoryBus::_openBus = 0 |
|
private |
The last value read via the memory bus.
The documentation for this class was generated from the following files: