|
ComSquare
|
#include <RectangleShadow.hpp>
Public Member Functions | |
| RectangleShadow (IMemory &initial, uint8_t startBank, uint8_t endBank, uint16_t startPage, uint16_t endPage) | |
| Create a shadow for the memory given as parameter. More... | |
| RectangleShadow (const RectangleShadow &)=default | |
| A rectangle shadow is copy constructable. More... | |
| RectangleShadow & | operator= (const RectangleShadow &)=delete |
| @brrief A rectangle shadow is not assignable More... | |
| ~RectangleShadow () override=default | |
| A default destructor. More... | |
| uint8_t | read (uint24_t addr) override |
| Read from the initial AMemory given. More... | |
| void | write (uint24_t addr, uint8_t data) override |
| Write data to the ram. More... | |
| uint24_t | getRelativeAddress (uint24_t addr) const override |
| Translate an absolute address to a relative address. More... | |
| uint24_t | getSize () const override |
| Get the size of the data. This size can be lower than the mapped data. More... | |
| std::string | getName () const override |
| Get the name of this accessor (used for debug purpose) More... | |
| Component | getComponent () const override |
| Get the component of this accessor (used for debug purpose) More... | |
| IMemory & | getMirrored () const |
| Return the memory accessor this accessor mirror if any. More... | |
| void | setBankOffset (int bankOffset) |
| Set the number of bank this component do not shadow. Referring to the first byte of this component will refer to the first byte of the bank at (bankOffset + start of initial memory). More... | |
Public Member Functions inherited from ComSquare::Memory::ARectangleMemory | |
| bool | hasMemoryAt (uint24_t addr) const override |
| Return true if this component has mapped the address. More... | |
| void | setMemoryRegion (uint8_t startBank, uint8_t endBank, uint16_t startPage, uint16_t endPage) |
| Change starting and ending points of this mapped memory. More... | |
| std::string | getValueName (uint24_t addr) const override |
| Get the name of the data at the address. More... | |
| ~ARectangleMemory () override=default | |
| A default destructor. More... | |
Public Member Functions inherited from ComSquare::Memory::IMemory | |
| virtual | ~IMemory ()=default |
| A virtual default destructor. More... | |
Private Attributes | |
| IMemory & | _initial |
| Memory to shadow from. More... | |
| int | _bankOffset = 0 |
| The number of banks to add to the memory before accessing it from the initial data. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ComSquare::Memory::ARectangleMemory | |
| uint8_t | _startBank = 0 |
| The first bank to map to. More... | |
| uint8_t | _endBank = 0 |
| The last bank to map to. More... | |
| uint16_t | _startPage = 0 |
| The first address of each bank to map. More... | |
| uint16_t | _endPage = 0 |
| The last address of each bank to map. More... | |
| ComSquare::Memory::RectangleShadow::RectangleShadow | ( | IMemory & | initial, |
| uint8_t | startBank, | ||
| uint8_t | endBank, | ||
| uint16_t | startPage, | ||
| uint16_t | endPage | ||
| ) |
Create a shadow for the memory given as parameter.
| startBank | The starting bank of the memory to shadow. |
| endBank | The ending bank of the memory to shadow |
| startPage | The starting page of the memory to shadow |
| endPage | The ending page of the memory to shadow |
|
default |
A rectangle shadow is copy constructable.
|
overridedefault |
A default destructor.
|
overridevirtual |
Get the component of this accessor (used for debug purpose)
Implements ComSquare::Memory::IMemory.
| IMemory & ComSquare::Memory::RectangleShadow::getMirrored | ( | ) | const |
Return the memory accessor this accessor mirror if any.
|
overridevirtual |
Get the name of this accessor (used for debug purpose)
Implements ComSquare::Memory::IMemory.
|
overridevirtual |
Translate an absolute address to a relative address.
| addr | The absolute address (in the 24 bit bus) |
| InvalidAddress | is thrown if the address is not mapped by this component. |
Reimplemented from ComSquare::Memory::ARectangleMemory.
|
overridevirtual |
Get the size of the data. This size can be lower than the mapped data.
Implements ComSquare::Memory::IMemory.
|
delete |
@brrief A rectangle shadow is not assignable
|
overridevirtual |
Read from the initial AMemory given.
| addr | The address to read from. The address 0x0 should refer to the first byte of the initial AMemory. |
| InvalidAddress | will be thrown if the address is more than the size of the initial AMemory. |
Implements ComSquare::Memory::IMemory.
| void ComSquare::Memory::RectangleShadow::setBankOffset | ( | int | bankOffset | ) |
Set the number of bank this component do not shadow. Referring to the first byte of this component will refer to the first byte of the bank at (bankOffset + start of initial memory).
|
overridevirtual |
Write data to the ram.
| addr | The address to write to. The address 0x0 should refer to the first byte of the initial AMemory. |
| data | The data to write. |
| InvalidAddress | will be thrown if the address is more than the size of the initial AMemory. |
Implements ComSquare::Memory::IMemory.
|
private |
The number of banks to add to the memory before accessing it from the initial data.
1.8.17