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

Function DebugFlip

source/Memory.cpp:2496–2520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2494
2495#if defined(_DEBUG) && defined(DEBUG_FLIP_TIMINGS)
2496static void DebugFlip(WORD address, ULONG nExecutedCycles)
2497{
2498 static unsigned __int64 uLastFlipCycle = 0;
2499 static unsigned int uLastPage = -1;
2500
2501 if (address != 0x54 && address != 0x55)
2502 return;
2503
2504 const unsigned int uNewPage = address & 1;
2505 if (uLastPage == uNewPage)
2506 return;
2507 uLastPage = uNewPage;
2508
2509 CpuCalcCycles(nExecutedCycles); // Update g_nCumulativeCycles
2510
2511 const unsigned int uCyclesBetweenFlips = (unsigned int) (uLastFlipCycle ? g_nCumulativeCycles - uLastFlipCycle : 0);
2512 uLastFlipCycle = g_nCumulativeCycles;
2513
2514 if (!uCyclesBetweenFlips)
2515 return; // 1st time in func
2516
2517 const double fFreq = CLK_6502 / (double)uCyclesBetweenFlips;
2518
2519 LogOutput("Cycles between flips = %d (%f Hz)\n", uCyclesBetweenFlips, fFreq);
2520}
2521#endif
2522
2523BYTE __stdcall MemSetPaging(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nExecutedCycles)

Callers 1

MemSetPagingFunction · 0.85

Calls 2

CpuCalcCyclesFunction · 0.85
LogOutputFunction · 0.85

Tested by

no test coverage detected