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

Method UpdateCycles

source/Mockingboard.cpp:959–976  ·  view source on GitHub ↗

Called by: . CpuExecute() every ~1000 cycles @ 1MHz (or ~3 cycles when MODE_STEPPING) . MB_SyncEventCallback() on a TIMER1/2 underflow . IORead() / IOWrite() (for both normal & full-speed)

Source from the content-addressed store, hash-verified

957// . MB_SyncEventCallback() on a TIMER1/2 underflow
958// . IORead() / IOWrite() (for both normal & full-speed)
959void MockingboardCard::UpdateCycles(ULONG executedCycles)
960{
961 CpuCalcCycles(executedCycles);
962 UINT64 uCycles = g_nCumulativeCycles - m_lastCumulativeCycle;
963 _ASSERT(uCycles >= 0);
964 if (uCycles == 0)
965 return;
966
967 m_lastCumulativeCycle = g_nCumulativeCycles;
968 _ASSERT(uCycles < 0x10000 || g_nAppMode == MODE_BENCHMARK);
969 USHORT nClocks = (USHORT)uCycles;
970
971 for (UINT i = 0; i < NUM_SUBUNITS_PER_MB; i++)
972 {
973 m_MBSubUnit[i].sy6522.UpdateTimer1(nClocks);
974 m_MBSubUnit[i].sy6522.UpdateTimer2(nClocks);
975 }
976}
977
978//-----------------------------------------------------------------------------
979

Callers 4

CpuExecuteFunction · 0.45
IOReadInternalMethod · 0.45
IOWriteInternalMethod · 0.45

Calls 3

CpuCalcCyclesFunction · 0.85
UpdateTimer1Method · 0.80
UpdateTimer2Method · 0.80

Tested by

no test coverage detected