mirror of https://github.com/stella-emu/stella.git
Fix cycle counting in CPU.
This commit is contained in:
parent
ed6eae6a67
commit
ae0faaabfc
|
@ -240,12 +240,13 @@ inline bool M6502::_execute(uInt32 cycles)
|
|||
M6532& riot = mySystem->m6532();
|
||||
#endif
|
||||
|
||||
uInt32 currentCycles = 0;
|
||||
uInt64 previousCycles = mySystem->cycles();
|
||||
uInt64 currentCycles = 0;
|
||||
|
||||
// Loop until execution is stopped or a fatal error occurs
|
||||
for(;;)
|
||||
{
|
||||
for(; !myExecutionStatus && (currentCycles < cycles * SYSTEM_CYCLES_PER_CPU); currentCycles += SYSTEM_CYCLES_PER_CPU)
|
||||
while (!myExecutionStatus && currentCycles < cycles * SYSTEM_CYCLES_PER_CPU)
|
||||
{
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
if(myJustHitReadTrapFlag || myJustHitWriteTrapFlag)
|
||||
|
@ -297,6 +298,8 @@ inline bool M6502::_execute(uInt32 cycles)
|
|||
myExecutionStatus |= FatalErrorBit;
|
||||
}
|
||||
|
||||
currentCycles = (mySystem->cycles() - previousCycles);
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
if(myStepStateByInstruction)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue