Go to the documentation of this file.
25 explicit Ram(
size_t size,
Component, std::string ramName);
31 ~Ram()
override =
default;
54 [[nodiscard]] std::string
getName()
const override;
68 [[nodiscard]] std::span<uint8_t>
getData();
72 [[nodiscard]] std::span<const uint8_t>
getData()
const;
Component
Definition: Components.hpp:9
~Ram() override=default
Destructor that free the ram.
Base memory class to map non continuous rectangle to the memory. (A rectangle that spam across more t...
Definition: ARectangleMemory.hpp:13
std::span< uint8_t > getData()
Get the raw data of the RAM.
Definition: Ram.cpp:63
unsigned uint24_t
Definition: Ints.hpp:10
std::vector< uint8_t > _data
The ram. (Can be used for WRam, SRam, VRam etc)
Definition: Ram.hpp:18
std::string getName() const override
Get the name of this accessor (used for debug purpose)
Definition: Ram.cpp:53
Component _ramType
An id identifying the type of memory this is (for the debugger)
Definition: Ram.hpp:20
Component getComponent() const override
Get the component of this accessor (used for debug purpose)
Definition: Ram.cpp:58
void setSize(uint24_t size)
Change the size of this ram.
Definition: Ram.cpp:48
uint24_t getSize() const override
Get the size of the ram in bytes.
Definition: Ram.cpp:43
uint8_t & operator[](uint24_t addr)
Retrieve the data at the address given. This can be used instead of read or write.
Definition: Ram.cpp:18
Ram & operator=(Ram &)=delete
The ram can't be assigned.
std::string _ramName
The name of this ram.
Definition: Ram.hpp:22
void write(uint24_t addr, uint8_t data) override
Write data to this component.
Definition: Ram.cpp:36
Ram(size_t size, Component, std::string ramName)
Create a ram of a given size in bytes.
Definition: Ram.cpp:12
uint8_t read(uint24_t addr) override
Read data from the component.
Definition: Ram.cpp:28