diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index b7bc92533..dd01f9d18 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -81,7 +81,9 @@ void M6502::reset() icycles = 0; // Load PC from the reset vector - PC = static_cast(mySystem->peek(0xfffc)) | (static_cast(mySystem->peek(0xfffd)) << 8); + // Note: ELF needs the correct order here! + PC = static_cast(mySystem->peek(0xfffc)); + PC |= (static_cast(mySystem->peek(0xfffd)) << 8); myLastAddress = myLastPeekAddress = myLastPokeAddress = myLastPeekBaseAddress = myLastPokeBaseAddress = 0; @@ -415,6 +417,7 @@ inline void M6502::_execute(uInt64 cycles, DispatchResult& result) #endif } + // JTZ, TODO: This code seems to be superfluous for a 6507: // See if we need to handle an interrupt if((myExecutionStatus & MaskableInterruptBit) || (myExecutionStatus & NonmaskableInterruptBit)) diff --git a/test/roms/bankswitching/ELF/MattressMonkeys20240530rc4.bin b/test/roms/bankswitching/ELF/MattressMonkeys20240530rc4.bin new file mode 100644 index 000000000..2cdc15401 Binary files /dev/null and b/test/roms/bankswitching/ELF/MattressMonkeys20240530rc4.bin differ diff --git a/test/roms/bankswitching/ELF/raycaster.bin b/test/roms/bankswitching/ELF/raycaster.bin new file mode 100644 index 000000000..bfe285258 Binary files /dev/null and b/test/roms/bankswitching/ELF/raycaster.bin differ