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

Function CpuExecute

source/CPU.cpp:721–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719//===========================================================================
720
721uint32_t CpuExecute(const uint32_t uCycles, const bool bVideoUpdate)
722{
723#ifdef LOG_PERF_TIMINGS
724 extern UINT64 g_timeCpu;
725 PerfMarker perfMarker(g_timeCpu);
726#endif
727
728 g_nCyclesExecuted = 0;
729 g_interruptInLastExecutionBatch = false;
730
731#ifdef _DEBUG
732 GetCardMgr().GetMockingboardCardMgr().CheckCumulativeCycles();
733#endif
734
735 // uCycles:
736 // =0 : Do single step
737 // >0 : Do multi-opcode emulation
738 const uint32_t uExecutedCycles = InternalCpuExecute(uCycles, bVideoUpdate);
739
740 // Update 6522s (NB. Do this before updating g_nCumulativeCycles below)
741 // . Ensures that 6522 regs are up-to-date for any potential save-state
742 // . SyncEvent will trigger the 6522 TIMER1/2 underflow on the correct cycle
743 GetCardMgr().GetMockingboardCardMgr().UpdateCycles(uExecutedCycles);
744
745 const UINT nRemainingCycles = uExecutedCycles - g_nCyclesExecuted;
746 g_nCumulativeCycles += nRemainingCycles;
747
748 return uExecutedCycles;
749}
750
751//===========================================================================
752

Callers 2

BenchmarkMethod · 0.85
ContinueExecutionFunction · 0.85

Calls 3

InternalCpuExecuteFunction · 0.85
CheckCumulativeCyclesMethod · 0.45
UpdateCyclesMethod · 0.45

Tested by

no test coverage detected