Go to the documentation of this file.
5 #ifndef COMSQUARE_IRECTANGLEMEMORY_HPP
6 #define COMSQUARE_IRECTANGLEMEMORY_HPP
58 void setMemoryRegion(uint8_t startBank, uint8_t endBank, uint16_t startPage, uint16_t endPage);
62 #endif //COMSQUARE_IRECTANGLEMEMORY_HPP
Superset of the IMemory to map non continuous rectangle to the memory. (A rectangle that spam across ...
Definition: IRectangleMemory.hpp:14
uint8_t _startBank
The first bank to map to.
Definition: IRectangleMemory.hpp:17
uint8_t read(uint24_t addr) override
Read data from the component using the same method as the basic IMemory.
Definition: IRectangleMemory.cpp:10
unsigned uint24_t
Definition: Ints.hpp:8
Common interface implemented by all components mapping memory.
Definition: IMemory.hpp:16
uint24_t getStart() override
Get the first address mapped to this component.
Definition: IRectangleMemory.cpp:53
void write(uint24_t addr, uint8_t data) override
Write data to this component using the same method as the basic IMemory.
Definition: IRectangleMemory.cpp:26
virtual uint8_t read_internal(uint24_t addr)=0
Internal component read. Implement this as you would implement a basic IMemory's read.
void setMemoryRegion(uint8_t startBank, uint8_t endBank, uint16_t startPage, uint16_t endPage)
Change starting and ending points of this mapped memory.
Definition: IRectangleMemory.cpp:58
uint16_t _startPage
The first address of each bank to map.
Definition: IRectangleMemory.hpp:21
uint16_t _endPage
The last address of each bank to map.
Definition: IRectangleMemory.hpp:23
Definition: IMemory.cpp:8
virtual void write_internal(uint24_t addr, uint8_t data)=0
Internal component write. Implement this as you would implement a basic IMemory's write.
bool hasMemoryAt(uint24_t addr) override
Return true if this component has mapped the address.
Definition: IRectangleMemory.cpp:42
uint8_t _endBank
The last bank to map to.
Definition: IRectangleMemory.hpp:19