mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-10-04 17:58:44 +00:00
e688411cb9
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
25 lines
481 B
C++
25 lines
481 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
#include "Rom.h"
|
|
|
|
namespace EightBit {
|
|
// The RAM class is everything the ROM class is, plus
|
|
// it's externally 'reference'able and 'poke'able.
|
|
class Ram : public Rom {
|
|
public:
|
|
Ram(const size_t size = 0) noexcept
|
|
: Rom(size) {
|
|
}
|
|
|
|
virtual uint8_t& reference(const uint16_t address) final {
|
|
return BYTES()[address];
|
|
}
|
|
|
|
virtual void poke(const uint16_t address, const uint8_t value) final {
|
|
Rom::poke(address, value);
|
|
}
|
|
};
|
|
}
|