diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index 0386d72d7..337a2904a 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -641,14 +641,17 @@ bool Cartridge::isProbablyEF(const uInt8* image, uInt32 size) // EF cart bankswitching switches banks by accessing addresses 0xFE0 // to 0xFEF, usually with either a NOP or LDA // It's likely that the code will switch to bank 0, so that's what is tested - uInt8 signature[2][3] = { + uInt8 signature[4][3] = { { 0x0C, 0xE0, 0xFF }, // NOP $FFE0 - { 0xAD, 0xE0, 0xFF } // LDA $FFE0 + { 0xAD, 0xE0, 0xFF }, // LDA $FFE0 + { 0x0C, 0xE0, 0x1F }, // NOP $1FE0 + { 0xAD, 0xE0, 0x1F } // LDA $1FE0 }; - if(searchForBytes(image, size, signature[0], 3, 1)) - return true; - else - return searchForBytes(image, size, signature[1], 3, 1); + for(uInt32 i = 0; i < 4; ++i) + if(searchForBytes(image, size, signature[i], 3, 1)) + return true; + + return false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -