mirror of https://github.com/stella-emu/stella.git
Add call to resetCycles.
This commit is contained in:
parent
a35f378d87
commit
b28dfaa31f
|
@ -78,6 +78,7 @@ TIA::TIA(Console& console, Sound& sound, Settings& settings)
|
||||||
},
|
},
|
||||||
[this] () {
|
[this] () {
|
||||||
mySystem->m6502().stop();
|
mySystem->m6502().stop();
|
||||||
|
mySystem->resetCycles();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -146,6 +147,7 @@ void TIA::systemCyclesReset()
|
||||||
const uInt32 cycles = mySystem->cycles();
|
const uInt32 cycles = mySystem->cycles();
|
||||||
|
|
||||||
myLastCycle -= cycles;
|
myLastCycle -= cycles;
|
||||||
|
|
||||||
mySound.adjustCycleCounter(-1 * cycles);
|
mySound.adjustCycleCounter(-1 * cycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -897,15 +899,17 @@ void TIA::updateScanlineByTrace(int target)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void TIA::updateEmulation()
|
void TIA::updateEmulation()
|
||||||
{
|
{
|
||||||
const uInt32 cycles = mySystem->cycles();
|
const uInt32 systemCycles = mySystem->cycles();
|
||||||
|
|
||||||
if (mySubClock > 2)
|
if (mySubClock > 2)
|
||||||
throw runtime_error("subclock exceeds range");
|
throw runtime_error("subclock exceeds range");
|
||||||
|
|
||||||
cycle(3 * (cycles - myLastCycle) + mySubClock);
|
const uInt32 cyclesToRun = 3 * (systemCycles - myLastCycle) + mySubClock;
|
||||||
|
|
||||||
mySubClock = 0;
|
mySubClock = 0;
|
||||||
myLastCycle = cycles;
|
myLastCycle = systemCycles;
|
||||||
|
|
||||||
|
cycle(cyclesToRun);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -383,10 +383,6 @@ class TIA : public Device
|
||||||
|
|
||||||
void nextLine();
|
void nextLine();
|
||||||
|
|
||||||
void onFrameComplete();
|
|
||||||
|
|
||||||
void onFrameStart();
|
|
||||||
|
|
||||||
void delayedWrite(uInt8 address, uInt8 value);
|
void delayedWrite(uInt8 address, uInt8 value);
|
||||||
|
|
||||||
void updatePaddle(uInt8 idx);
|
void updatePaddle(uInt8 idx);
|
||||||
|
@ -421,7 +417,7 @@ class TIA : public Device
|
||||||
uInt8 myCtrlPF; // needed for the debugger
|
uInt8 myCtrlPF; // needed for the debugger
|
||||||
|
|
||||||
uInt8 mySubClock;
|
uInt8 mySubClock;
|
||||||
uInt32 myLastCycle;
|
Int32 myLastCycle;
|
||||||
|
|
||||||
uInt8 mySpriteEnabledBits;
|
uInt8 mySpriteEnabledBits;
|
||||||
uInt8 myCollisionsEnabledBits;
|
uInt8 myCollisionsEnabledBits;
|
||||||
|
|
Loading…
Reference in New Issue