mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-02 18:29:41 +00:00
Make the Rom class a little easier to use by allowing it to be copied around.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
6bf28f1480
commit
6ffd8e5d0a
@ -26,6 +26,8 @@ namespace EightBit {
|
||||
static int load(std::string path, std::vector<uint8_t>& output, int writeOffset = 0, int readOffset = 0, int limit = -1, int maximumSize = -1);
|
||||
|
||||
Rom(size_t size = 0) noexcept;
|
||||
Rom(const Rom& rhs);
|
||||
Rom& operator=(const Rom& rhs);
|
||||
|
||||
[[nodiscard]] size_t size() const noexcept final;
|
||||
|
||||
|
@ -44,6 +44,15 @@ void EightBit::Rom::poke(const uint16_t address, const uint8_t value) noexcept {
|
||||
EightBit::Rom::Rom(const size_t size) noexcept
|
||||
: m_bytes(size) {}
|
||||
|
||||
EightBit::Rom::Rom(const Rom& rhs)
|
||||
: m_bytes(rhs.m_bytes) {}
|
||||
|
||||
EightBit::Rom& EightBit::Rom::operator=(const Rom& rhs) {
|
||||
if (this != &rhs)
|
||||
m_bytes = rhs.m_bytes;
|
||||
return *this;
|
||||
}
|
||||
|
||||
size_t EightBit::Rom::size() const noexcept {
|
||||
return m_bytes.size();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user