Remove old debug timing code (#540)

This commit is contained in:
tomcw 2018-02-26 21:34:01 +00:00
parent 6c031e7930
commit 552d8fcc7b
3 changed files with 0 additions and 52 deletions

View File

@ -502,29 +502,6 @@ ULONG CpuGetCyclesThisVideoFrame(const ULONG nExecutedCycles)
}
#endif
//---------------------------------------------------------------------------
static DWORD g_dwEmulationTime_ms = 0;
static void UpdateEmulationTime(const DWORD dwExecutedCycles)
{
static DWORD dwEmulationTimeFrac_clks = 0;
const DWORD CLKS_PER_MS = (DWORD)g_fCurrentCLK6502 / 1000;
dwEmulationTimeFrac_clks += dwExecutedCycles;
if (dwEmulationTimeFrac_clks > CLKS_PER_MS)
{
g_dwEmulationTime_ms += dwEmulationTimeFrac_clks / CLKS_PER_MS;
dwEmulationTimeFrac_clks %= CLKS_PER_MS;
}
}
DWORD CpuGetEmulationTime_ms(void)
{
return g_dwEmulationTime_ms;
}
//===========================================================================
DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
@ -540,7 +517,6 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
MB_UpdateCycles(uExecutedCycles); // Update 6522s (NB. Do this before updating g_nCumulativeCycles below)
// NB. Ensures that 6522 regs are up-to-date for any potential save-state
UpdateEmulationTime(uExecutedCycles);
//

View File

@ -34,8 +34,6 @@ void CpuLoadSnapshot(class YamlLoadHelper& yamlLoadHelper);
BYTE CpuRead(USHORT addr, ULONG uExecutedCycles);
void CpuWrite(USHORT addr, BYTE a, ULONG uExecutedCycles);
DWORD CpuGetEmulationTime_ms(void);
enum eCpuType {CPU_UNKNOWN=0, CPU_6502=1, CPU_65C02, CPU_Z80}; // Don't change! Persisted to Registry
eCpuType GetMainCpu(void);

View File

@ -592,28 +592,6 @@ void VideoRedrawScreen (void)
//===========================================================================
// NB. Can get "big" 1000+ms times: these occur during disk loading when the emulator is at full-speed.
//#define DEBUG_REFRESH_TIMINGS
#if defined(_DEBUG) && defined(DEBUG_REFRESH_TIMINGS)
static void DebugRefresh(char uDebugFlag)
{
static DWORD uLastRefreshTime = 0;
const DWORD dwEmuTime_ms = CpuGetEmulationTime_ms();
const DWORD uTimeBetweenRefreshes = uLastRefreshTime ? dwEmuTime_ms - uLastRefreshTime : 0;
uLastRefreshTime = dwEmuTime_ms;
if (!uTimeBetweenRefreshes)
return; // 1st time in func
char szStr[100];
sprintf(szStr, "Time between refreshes = %d ms %c\n", uTimeBetweenRefreshes, (uDebugFlag==0)?' ':uDebugFlag);
OutputDebugString(szStr);
}
#endif
// TC: Hacky-fix for GH#341 - better to draw to the correct position in the framebuffer to start with! (in NTSC.cpp)
static void VideoFrameBufferAdjust(int& xSrc, int& ySrc, bool bInvertY=false)
{
@ -641,10 +619,6 @@ static void VideoFrameBufferAdjust(int& xSrc, int& ySrc, bool bInvertY=false)
void VideoRefreshScreen ( uint32_t uRedrawWholeScreenVideoMode /* =0*/, bool bRedrawWholeScreen /* =false*/ )
{
#if defined(_DEBUG) && defined(DEBUG_REFRESH_TIMINGS)
DebugRefresh(0);
#endif
if (bRedrawWholeScreen || g_nAppMode == MODE_PAUSED)
{
// uVideoModeForWholeScreen set if: