diff --git a/src/emucore/Cart2K.hxx b/src/emucore/Cart2K.hxx index 13aed2608..ddca38048 100644 --- a/src/emucore/Cart2K.hxx +++ b/src/emucore/Cart2K.hxx @@ -118,6 +118,13 @@ class Cartridge2K : public Cartridge } #endif + /** + Get the byte at the specified address. + + @return The byte at the specified address + */ + uInt8 peek(uInt16 address) override { return myImage[address & myMask]; } + private: // Pointer to a dynamically allocated ROM image of the cartridge BytePtr myImage; diff --git a/src/emucore/Cart4K.hxx b/src/emucore/Cart4K.hxx index cc361feba..f8ad3c6fa 100644 --- a/src/emucore/Cart4K.hxx +++ b/src/emucore/Cart4K.hxx @@ -115,6 +115,13 @@ class Cartridge4K : public Cartridge } #endif + /** + Get the byte at the specified address. + + @return The byte at the specified address + */ + uInt8 peek(uInt16 address) override { return myImage[address & 0x0FFF]; } + private: // The 4K ROM image for the cartridge uInt8 myImage[4096]; diff --git a/src/emucore/Device.hxx b/src/emucore/Device.hxx index 73dd90f93..7ab55597e 100644 --- a/src/emucore/Device.hxx +++ b/src/emucore/Device.hxx @@ -85,7 +85,7 @@ class Device : public Serializable @return The byte at the specified address */ - virtual uInt8 peek(uInt16 address) { return 0; } + virtual uInt8 peek(uInt16 address) = 0; /** Change the byte at the specified address to the given value