Debug: Output cycle delta to log file

This commit is contained in:
tomcw 2023-09-03 21:40:09 +01:00
parent f000a3297a
commit 6ca01903b4
1 changed files with 11 additions and 0 deletions

View File

@ -418,6 +418,9 @@ static void UpdateSpkr()
//=============================================================================
static FILE* g_fhSpkr = NULL;
static unsigned __int64 g_nSpkrLastCycle2 = 0;
// Called by emulation code when Speaker I/O reg is accessed
//
@ -441,6 +444,14 @@ BYTE __stdcall SpkrToggle (WORD, WORD, BYTE, BYTE, ULONG nExecutedCycles)
{
CpuCalcCycles(nExecutedCycles);
#if 0
if (!g_fhSpkr)
g_fhSpkr = fopen("spkrDelta.log", "w+");
ULONG nCycleDiff = (ULONG)(g_nCumulativeCycles - g_nSpkrLastCycle2);
g_nSpkrLastCycle2 = g_nCumulativeCycles;
fprintf(g_fhSpkr, "%d\n", nCycleDiff);
#endif
UpdateSpkr();
short speakerDriveLevel = SPKR_DATA_INIT;