From c03d8488b51b3085be1342780ddba02f61f1f2c2 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sun, 26 Aug 2018 13:06:05 +0100 Subject: [PATCH] Allow memory peek as a const operation. Signed-off-by: Adrian Conlon --- inc/Memory.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/Memory.h b/inc/Memory.h index 0bd2ef1..0512484 100644 --- a/inc/Memory.h +++ b/inc/Memory.h @@ -34,11 +34,12 @@ namespace EightBit { return limit; } - uint8_t peek(const uint16_t address) { + uint8_t peek(const uint16_t address) const { return BYTES()[address]; } protected: + const std::vector& BYTES() const { return m_bytes; } std::vector& BYTES() { return m_bytes; } void poke(const uint16_t address, const uint8_t value) {