mirror of https://github.com/stella-emu/stella.git
Timing improvements.
This commit is contained in:
parent
7085cea510
commit
49b1b9f258
|
@ -340,10 +340,11 @@ inline uInt64 CartridgeELF::getArmCycles() const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
inline uInt8 CartridgeELF::driveBus(uInt16 address, uInt8 value)
|
||||
{
|
||||
auto* nextTransaction = myTransactionQueue.getNextTransaction(address, getArmCycles());
|
||||
auto* nextTransaction = myTransactionQueue.getNextTransaction(address,
|
||||
mySystem->cycles() * myArmCyclesPer6502Cycle - myArmCyclesOffset);
|
||||
if (nextTransaction) {
|
||||
nextTransaction->setBusState(myIsBusDriven, myDriveBusValue);
|
||||
syncClock(*nextTransaction);
|
||||
myArmCyclesOffset = mySystem->cycles() * myArmCyclesPer6502Cycle - nextTransaction->timestamp;
|
||||
}
|
||||
|
||||
if (myIsBusDriven) value |= myDriveBusValue;
|
||||
|
@ -355,14 +356,6 @@ inline uInt8 CartridgeELF::driveBus(uInt16 address, uInt8 value)
|
|||
return value;
|
||||
}
|
||||
|
||||
inline void CartridgeELF::syncClock(const BusTransactionQueue::Transaction& transaction)
|
||||
{
|
||||
const Int64 currentSystemArmCycles = mySystem->cycles() * myArmCyclesPer6502Cycle;
|
||||
const Int64 transactionArmCycles = transaction.timestamp + myArmCyclesOffset;
|
||||
|
||||
myArmCyclesOffset += currentSystemArmCycles - transactionArmCycles;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeELF::parseAndLinkElf()
|
||||
{
|
||||
|
|
|
@ -79,7 +79,6 @@ class CartridgeELF: public Cartridge {
|
|||
uInt64 getArmCycles() const;
|
||||
|
||||
uInt8 driveBus(uInt16 address, uInt8 value);
|
||||
void syncClock(const BusTransactionQueue::Transaction& transaction);
|
||||
|
||||
void parseAndLinkElf();
|
||||
void setupMemoryMap();
|
||||
|
|
Loading…
Reference in New Issue