From b93a07dcfa97e4bc0ccdfde6b19211de864a98f5 Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Thu, 2 Apr 2020 21:14:49 +0200 Subject: [PATCH] 3E: fix invalid access on write to ROM. --- src/emucore/Cart3E.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/emucore/Cart3E.cxx b/src/emucore/Cart3E.cxx index 15084b53e..3f2b1263f 100644 --- a/src/emucore/Cart3E.cxx +++ b/src/emucore/Cart3E.cxx @@ -115,6 +115,9 @@ bool Cartridge3E::poke(uInt16 address, uInt8 value) } else { + if (myCurrentBank < 256) + return false; + if(address & 0x0400) { pokeRAM(myRAM[(address & 0x03FF) + ((myCurrentBank - 256) << 10)], pokeAddress, value);