X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=subsystems%2Fntvdm%2Fntvdm.c;h=91bccf7b8498a7dab7ddb15f30619b7f70ee9b3a;hp=004c42e7d90704758bb9ac43c26c757558e7e476;hb=d25d9ea618f7054c1a79423e610159e6a7956ccb;hpb=f2a98176d6f26091b4da0a38ab2b72ef184e4e75 diff --git a/subsystems/ntvdm/ntvdm.c b/subsystems/ntvdm/ntvdm.c index 004c42e7d90..91bccf7b849 100644 --- a/subsystems/ntvdm/ntvdm.c +++ b/subsystems/ntvdm/ntvdm.c @@ -26,7 +26,17 @@ */ #define TESTING -#define IPS_DISPLAY +/* + * Activate IPS_DISPLAY if you want to display the + * number of instructions per second, as well as + * the computed number of ticks for the PIT. + */ +// #define IPS_DISPLAY + +/* + * Activate WORKING_TIMER when the PIT timing problem is fixed. + */ +// #define WORKING_TIMER /* PUBLIC VARIABLES ***********************************************************/ @@ -257,12 +267,15 @@ INT wmain(INT argc, WCHAR *argv[]) /* Main loop */ while (VdmRunning) { +#ifdef WORKING_TIMER DWORD PitResolution = PitGetResolution(); +#endif DWORD RtcFrequency = RtcGetTicksPerSecond(); /* Get the current number of ticks */ CurrentTickCount = GetTickCount(); +#ifdef WORKING_TIMER if ((PitResolution <= 1000) && (RtcFrequency <= 1000)) { /* Calculate the approximate performance counter value instead */ @@ -271,6 +284,7 @@ INT wmain(INT argc, WCHAR *argv[]) * (Frequency.QuadPart / 1000); } else +#endif { /* Get the current performance counter value */ QueryPerformanceCounter(&Counter); @@ -331,7 +345,7 @@ INT wmain(INT argc, WCHAR *argv[]) #ifdef IPS_DISPLAY if ((CurrentTickCount - LastCyclePrintout) >= 1000) { - DPRINT1("NTVDM: %lu Instructions Per Second; TimerTicks = %lu\n", Cycles, TimerTicks); + DPRINT1("NTVDM: %lu Instructions Per Second; TimerTicks = %I64d\n", Cycles, TimerTicks); LastCyclePrintout = CurrentTickCount; Cycles = 0; }