Superset of the IMemory to map non continuous rectangle to the memory. (A rectangle that spam across more than one bank but that does not start at 0000 or end at FFFF).
More...
#include <IRectangleMemory.hpp>
Superset of the IMemory to map non continuous rectangle to the memory. (A rectangle that spam across more than one bank but that does not start at 0000 or end at FFFF).
◆ getStart()
| uint24_t ComSquare::Memory::IRectangleMemory::getStart |
( |
| ) |
|
|
overridevirtual |
◆ hasMemoryAt()
| bool ComSquare::Memory::IRectangleMemory::hasMemoryAt |
( |
uint24_t |
addr | ) |
|
|
overridevirtual |
Return true if this component has mapped the address.
- Parameters
-
| addr | The address to check. |
- Returns
- True if this address is mapped to the component. False otherwise.
Reimplemented from ComSquare::Memory::IMemory.
◆ read()
| uint8_t ComSquare::Memory::IRectangleMemory::read |
( |
uint24_t |
addr | ) |
|
|
overridevirtual |
Read data from the component using the same method as the basic IMemory.
- Parameters
-
| addr | The local address to read from. 0x0 should refer to the first byte of this component on the fist bank. This method is responsible of mapping to the component's read. |
- Exceptions
-
- Returns
- Return the data at the address given as parameter.
Implements ComSquare::Memory::IMemory.
◆ read_internal()
| virtual uint8_t ComSquare::Memory::IRectangleMemory::read_internal |
( |
uint24_t |
addr | ) |
|
|
pure virtual |
Internal component read. Implement this as you would implement a basic IMemory's read.
- Parameters
-
| addr | The local address to read from. 0x0 refer to the first byte of your data and the address is in the component's space. That means that you can consider this address as continuous |
- Exceptions
-
| This | function should thrown an InvalidAddress for address that are not mapped to the component. |
- Returns
- Return the data at the address given as parameter.
Implemented in ComSquare::Cartridge::Cartridge.
◆ setMemoryRegion()
| void ComSquare::Memory::IRectangleMemory::setMemoryRegion |
( |
uint8_t |
startBank, |
|
|
uint8_t |
endBank, |
|
|
uint16_t |
startPage, |
|
|
uint16_t |
endPage |
|
) |
| |
Change starting and ending points of this mapped memory.
- Parameters
-
| startBank | The first bank mapped to this component. |
| endBank | The last bank mapped to this component. |
| startPage | The first page mapped to this component (every mapped banks will have this page mapped) |
| endPage | The end page mapped to this component (every mapped banks will have this pages lower than this mapped) |
- Warning
- The start/end address should be a rectangle. To mirror memory, use the MemoryShadow class and not this one.
◆ write()
| void ComSquare::Memory::IRectangleMemory::write |
( |
uint24_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
|
overridevirtual |
Write data to this component using the same method as the basic IMemory.
- Parameters
-
| addr | The local address to write data 0x0 should refer to the first byte of this component on the fist bank. This method is responsible of mapping to the component's write. |
| data | The new data to write. |
- Exceptions
-
Implements ComSquare::Memory::IMemory.
◆ write_internal()
| virtual void ComSquare::Memory::IRectangleMemory::write_internal |
( |
uint24_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
|
pure virtual |
Internal component write. Implement this as you would implement a basic IMemory's write.
- Parameters
-
| addr | The local address to write to. 0x0 refer to the first byte of your data and the address is in the component's space. That means that you can consider this address as continuous |
| data | The new data to write. |
- Exceptions
-
| This | function should thrown an InvalidAddress for address that are not mapped to the component. |
Implemented in ComSquare::Cartridge::Cartridge.
◆ _endBank
| uint8_t ComSquare::Memory::IRectangleMemory::_endBank = 0 |
|
private |
◆ _endPage
| uint16_t ComSquare::Memory::IRectangleMemory::_endPage = 0 |
|
private |
The last address of each bank to map.
◆ _startBank
| uint8_t ComSquare::Memory::IRectangleMemory::_startBank = 0 |
|
private |
The first bank to map to.
◆ _startPage
| uint16_t ComSquare::Memory::IRectangleMemory::_startPage = 0 |
|
private |
The first address of each bank to map.
The documentation for this class was generated from the following files: