From 30775ce101f647e3c7e9815e0a5f04784d858440 Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Mon, 29 Jul 2024 19:06:33 +0200 Subject: [PATCH] Minor optimizations. --- src/emucore/CartELF.cxx | 5 +++-- src/emucore/elf/VcsLib.cxx | 6 ------ src/emucore/elf/VcsLib.hxx | 5 ++++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/emucore/CartELF.cxx b/src/emucore/CartELF.cxx index 652befaae..de2270230 100644 --- a/src/emucore/CartELF.cxx +++ b/src/emucore/CartELF.cxx @@ -332,7 +332,7 @@ inline uInt8 CartridgeELF::driveBus(uInt16 address, uInt8 value) myVcsLib.updateBus(address, value); - if (!myVcsLib.isSuspended()) runArm(); + runArm(); return value; } @@ -485,7 +485,8 @@ void CartridgeELF::runArm() { if ( (getArmCycles() >= (mySystem->cycles() + ARM_RUNAHED_MIN) * myArmCyclesPer6502Cycle) || - myTransactionQueue.size() >= QUEUE_SIZE_LIMIT + myTransactionQueue.size() >= QUEUE_SIZE_LIMIT || + myVcsLib.isSuspended() ) return; diff --git a/src/emucore/elf/VcsLib.cxx b/src/emucore/elf/VcsLib.cxx index 444d3f11c..6fb34077b 100644 --- a/src/emucore/elf/VcsLib.cxx +++ b/src/emucore/elf/VcsLib.cxx @@ -303,12 +303,6 @@ CortexM0::err_t VcsLib::fetch16(uInt32 address, uInt16& value, uInt8& op, Cortex } } -void VcsLib::updateBus(uInt16 address, uInt8 value) -{ - myCurrentAddress = address; - myCurrentValue = value; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CortexM0::err_t VcsLib::returnFromStub(uInt16& value, uInt8& op) { diff --git a/src/emucore/elf/VcsLib.hxx b/src/emucore/elf/VcsLib.hxx index bcf77e2ac..981f2e75f 100644 --- a/src/emucore/elf/VcsLib.hxx +++ b/src/emucore/elf/VcsLib.hxx @@ -30,7 +30,10 @@ class VcsLib: public CortexM0::BusTransactionDelegate { CortexM0::err_t fetch16(uInt32 address, uInt16& value, uInt8& op, CortexM0& cortex) override; - void updateBus(uInt16 address, uInt8 value); + inline void updateBus(uInt16 address, uInt8 value) { + myCurrentAddress = address; + myCurrentValue = value; + } inline bool isSuspended() const { return