From a1ded47af3cf842c2271d534394f4fb1e3bcf5aa Mon Sep 17 00:00:00 2001 From: thrust26 Date: Wed, 8 Apr 2020 22:02:01 +0200 Subject: [PATCH] fix carts >= 64K --- src/emucore/CartEnhanced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emucore/CartEnhanced.cxx b/src/emucore/CartEnhanced.cxx index 8efab740a..6752d3153 100644 --- a/src/emucore/CartEnhanced.cxx +++ b/src/emucore/CartEnhanced.cxx @@ -25,7 +25,7 @@ CartridgeEnhanced::CartridgeEnhanced(const ByteBuffer& image, size_t size, mySize(size) { // Allocate array for the ROM image (at least 64 bytzes) - myImage = make_unique(std::max(uInt16(mySize), System::PAGE_SIZE)); + myImage = make_unique(std::max(uInt32(mySize), uInt32(System::PAGE_SIZE))); // Copy the ROM image into my buffer std::copy_n(image.get(), mySize, myImage.get()); @@ -251,7 +251,7 @@ bool CartridgeEnhanced::load(Serializer& in) cerr << "ERROR: " << name() << "::load" << endl; return false; } - // Restore bank sewgments + // Restore bank segments for(uInt16 i = 0; i < myBankSegs; ++i) bank(getSegmentBank(i), i);