mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-11-15 06:05:22 +00:00
9de0f597f6
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
26 lines
418 B
C++
26 lines
418 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include "Memory.h"
|
|
|
|
namespace EightBit {
|
|
class Ram : public Memory {
|
|
public:
|
|
Ram(const size_t size = 0)
|
|
: Memory(size) {
|
|
}
|
|
|
|
uint8_t peek(const uint16_t address) const {
|
|
return read(address);
|
|
}
|
|
|
|
void poke(const uint16_t address, const uint8_t value) {
|
|
write(address, value);
|
|
}
|
|
|
|
uint8_t& reference(const uint16_t address) {
|
|
return BYTES()[address];
|
|
}
|
|
};
|
|
}
|