Ram.hpp
Go to the documentation of this file.
//
// Created by anonymus-raccoon on 1/28/20.
//
#ifndef COMSQUARE_RAM_HPP
#define COMSQUARE_RAM_HPP
#include "../Memory/IMemory.hpp"
namespace ComSquare::Ram
{
class Ram : public Memory::IMemory {
private:
uint8_t *_data;
size_t _size;
public:
explicit Ram(size_t size);
~Ram();
uint8_t read(uint24_t addr) override;
void write(uint24_t addr, uint8_t data) override;
};
}
#endif //COMSQUARE_RAM_HPP
ComSquare::Ram::Ram
Definition: Ram.hpp:12
ComSquare::Ram
Definition: Ram.cpp:8
ComSquare::Ram::Ram::Ram
Ram(size_t size)
Load a rom from it's path.
Definition: Ram.cpp:10
uint24_t
unsigned uint24_t
Definition: Ints.hpp:8
ComSquare::Memory::IMemory
Common interface implemented by all components mapping memory.
Definition: IMemory.hpp:16
ComSquare::Ram::Ram::_data
uint8_t * _data
The ram. (Can be used for WRam, SRam, VRam etc)
Definition: Ram.hpp:15
ComSquare::Ram::Ram::_size
size_t _size
The size of the ram.
Definition: Ram.hpp:17
ComSquare::Ram::Ram::write
void write(uint24_t addr, uint8_t data) override
Write data to the ram.
Definition: Ram.cpp:28
ComSquare::Ram::Ram::read
uint8_t read(uint24_t addr) override
Read from the ram.
Definition: Ram.cpp:21
ComSquare::Ram::Ram::~Ram
~Ram()
Destructor that free the ram.
Definition: Ram.cpp:16