Hack around buggy ARM code that accesses low memory.

This commit is contained in:
Christian Speckner 2024-07-29 23:39:39 +02:00
parent ead6675e6d
commit a3899278a5
2 changed files with 9 additions and 1 deletions

View File

@ -325,6 +325,13 @@ CortexM0::err_t CartridgeELF::BusFallbackDelegate::fetch16(
: CortexM0::errIntrinsic(CortexM0::ERR_UNMAPPED_FETCH16, address); : CortexM0::errIntrinsic(CortexM0::ERR_UNMAPPED_FETCH16, address);
} }
CortexM0::err_t CartridgeELF::BusFallbackDelegate::read8(uInt32 address, uInt8& value, CortexM0& cortex)
{
// TODO: remove this hack and replace it with a setting.
value = 0;
return 0;
}
inline uInt64 CartridgeELF::getArmCycles() const inline uInt64 CartridgeELF::getArmCycles() const
{ {
return myCortexEmu.getCycles() + myArmCyclesOffset; return myCortexEmu.getCycles() + myArmCyclesOffset;

View File

@ -68,6 +68,7 @@ class CartridgeELF: public Cartridge {
private: private:
class BusFallbackDelegate: public CortexM0::BusTransactionDelegate { class BusFallbackDelegate: public CortexM0::BusTransactionDelegate {
CortexM0::err_t fetch16(uInt32 address, uInt16& value, uInt8& op, CortexM0& cortex); CortexM0::err_t fetch16(uInt32 address, uInt16& value, uInt8& op, CortexM0& cortex);
CortexM0::err_t read8(uInt32 address, uInt8& value, CortexM0& cortex);
}; };
enum class ExecutionStage { enum class ExecutionStage {
@ -119,7 +120,7 @@ class CartridgeELF: public Cartridge {
BusFallbackDelegate myFallbackDelegate; BusFallbackDelegate myFallbackDelegate;
ConsoleTiming myConsoleTiming{ConsoleTiming::ntsc}; ConsoleTiming myConsoleTiming{ConsoleTiming::ntsc};
uInt32 myArmCyclesPer6502Cycle{80}; uInt32 myArmCyclesPer6502Cycle{140};
Int64 myArmCyclesOffset{0}; Int64 myArmCyclesOffset{0};