mirror of https://github.com/stella-emu/stella.git
Fixed bug in peek handling for 2K and 4K ROMs.
This fixes cheatcode handling for those schemes.
This commit is contained in:
parent
c3671ac095
commit
a1342afe34
|
@ -118,6 +118,13 @@ class Cartridge2K : public Cartridge
|
||||||
}
|
}
|
||||||
#endif
|
#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:
|
private:
|
||||||
// Pointer to a dynamically allocated ROM image of the cartridge
|
// Pointer to a dynamically allocated ROM image of the cartridge
|
||||||
BytePtr myImage;
|
BytePtr myImage;
|
||||||
|
|
|
@ -115,6 +115,13 @@ class Cartridge4K : public Cartridge
|
||||||
}
|
}
|
||||||
#endif
|
#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:
|
private:
|
||||||
// The 4K ROM image for the cartridge
|
// The 4K ROM image for the cartridge
|
||||||
uInt8 myImage[4096];
|
uInt8 myImage[4096];
|
||||||
|
|
|
@ -85,7 +85,7 @@ class Device : public Serializable
|
||||||
|
|
||||||
@return The byte at the specified address
|
@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
|
Change the byte at the specified address to the given value
|
||||||
|
|
Loading…
Reference in New Issue