Finishing the LoRom mapping

This commit is contained in:
AnonymusRaccoon
2020-02-05 15:18:22 +01:00
parent a0e6119841
commit 5fd85abaa7
4 changed files with 13 additions and 8 deletions
+2 -2
View File
@@ -18,14 +18,14 @@ namespace ComSquare::Ram
delete[] this->_data;
}
uint8_t Ram::read(uint24_t addr)
uint8_t Ram::read_internal(uint24_t addr)
{
if (addr >= this->_size)
throw InvalidAddress("Ram read", addr);
return this->_data[addr];
}
void Ram::write(uint24_t addr, uint8_t data)
void Ram::write_internal(uint24_t addr, uint8_t data)
{
if (addr >= this->_size)
throw InvalidAddress("Ram write", addr);
+4 -4
View File
@@ -5,11 +5,11 @@
#ifndef COMSQUARE_RAM_HPP
#define COMSQUARE_RAM_HPP
#include "../Memory/IMemory.hpp"
#include "../Memory/IRectangleMemory.hpp"
namespace ComSquare::Ram
{
class Ram : public Memory::IMemory {
class Ram : public Memory::IRectangleMemory {
private:
//! @brief The ram. (Can be used for WRam, SRam, VRam etc)
uint8_t *_data;
@@ -24,12 +24,12 @@ namespace ComSquare::Ram
//! @param addr The address to read from. The address 0x0 should refer to the first byte of this ram.
//! @throw InvalidAddress will be thrown if the address is more than the size of the ram.
//! @return Return the data at the address.
uint8_t read(uint24_t addr) override;
uint8_t read_internal(uint24_t addr) override;
//! @brief Write data to the ram.
//! @param addr The address to write to. The address 0x0 should refer to the first byte of this ram.
//! @param data The data to write.
//! @throw InvalidAddress will be thrown if the address is more than the size of the ram.
void write(uint24_t addr, uint8_t data) override;
void write_internal(uint24_t addr, uint8_t data) override;
};
}