2017-09-06 12:22:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include "Memory.h"
|
|
|
|
|
|
|
|
namespace EightBit {
|
|
|
|
class Ram : public Memory {
|
|
|
|
public:
|
2018-08-07 22:06:15 +00:00
|
|
|
Ram(const size_t size = 0) noexcept
|
2017-09-06 12:22:23 +00:00
|
|
|
: Memory(size) {
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:15:17 +00:00
|
|
|
virtual uint8_t& reference(const uint16_t address) final {
|
2018-06-09 23:40:56 +00:00
|
|
|
return BYTES()[address];
|
2017-09-06 12:22:23 +00:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:15:17 +00:00
|
|
|
virtual void poke(const uint16_t address, const uint8_t value) final {
|
2018-06-09 23:40:56 +00:00
|
|
|
Memory::poke(address, value);
|
2017-09-06 12:22:23 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|