mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-09-07 08:54:24 +00:00
26 lines
388 B
C++
26 lines
388 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include "Memory.h"
|
|
|
|
namespace EightBit {
|
|
class Ram : public Memory {
|
|
public:
|
|
Ram(size_t size = 0)
|
|
: Memory(size) {
|
|
}
|
|
|
|
uint8_t peek(uint16_t address) const {
|
|
return read(address);
|
|
}
|
|
|
|
void poke(uint16_t address, uint8_t value) {
|
|
write(address, value);
|
|
}
|
|
|
|
uint8_t& reference(uint16_t address) {
|
|
return BYTES()[address];
|
|
}
|
|
};
|
|
}
|