mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-05 02:49:50 +00:00
Finishing the LoRom mapping
This commit is contained in:
+2
-2
@@ -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
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user