MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CpuCalcCycles

Function CpuCalcCycles

source/CPU.cpp:686–694  ·  view source on GitHub ↗

Description: Call this when an IO-reg is accessed & accurate cycle info is needed NB. Safe to call multiple times from the same IO function handler (as 'nExecutedCycles - g_nCyclesExecuted' will be zero the 2nd time) Pre: nExecutedCycles = # of cycles executed by Cpu6502() or Cpu65C02() for this iteration of ContinueExecution() Post: g_nCyclesExecuted g_nCumulativeCycles

Source from the content-addressed store, hash-verified

684// g_nCumulativeCycles
685//
686void CpuCalcCycles(const ULONG nExecutedCycles)
687{
688 // Calc # of cycles executed since this func was last called
689 const ULONG nCycles = nExecutedCycles - g_nCyclesExecuted;
690 _ASSERT( (LONG)nCycles >= 0 );
691 g_nCumulativeCycles += nCycles;
692
693 g_nCyclesExecuted = nExecutedCycles;
694}
695
696//===========================================================================
697

Callers 9

DebugFlipFunction · 0.85
IOReadMethod · 0.85
IOWriteMethod · 0.85
UpdateCyclesMethod · 0.85
SpkrToggleFunction · 0.85
JoyReadPositionFunction · 0.85
JoyResetPositionFunction · 0.85
IOReadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected