From e7ce79fc05c22d4405a0d81d2948b000d10431be Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Sun, 23 Jun 2013 00:20:24 +0000 Subject: [PATCH] [NTVDM] Perform multiple CPU instructions in one emulator cycle. svn path=/branches/ntvdm/; revision=59298 --- subsystems/ntvdm/ntvdm.c | 4 ++-- subsystems/ntvdm/ntvdm.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/subsystems/ntvdm/ntvdm.c b/subsystems/ntvdm/ntvdm.c index 957a9aa4b67..70ae2dc8b4a 100644 --- a/subsystems/ntvdm/ntvdm.c +++ b/subsystems/ntvdm/ntvdm.c @@ -156,9 +156,9 @@ INT wmain(INT argc, WCHAR *argv[]) } /* Continue CPU emulation */ - EmulatorStep(); + for (i = 0; i < STEPS_PER_CYCLE; i++) EmulatorStep(); - Cycles++; + Cycles += STEPS_PER_CYCLE; if ((CurrentTickCount - LastCyclePrintout) >= 1000) { DPRINT1("NTVDM: %d Instructions Per Second\n", Cycles); diff --git a/subsystems/ntvdm/ntvdm.h b/subsystems/ntvdm/ntvdm.h index ddc4ac5bee5..896ce7a4ecf 100644 --- a/subsystems/ntvdm/ntvdm.h +++ b/subsystems/ntvdm/ntvdm.h @@ -32,6 +32,7 @@ #define SPECIAL_INT_NUM 0xFF #define SEGMENT_TO_MCB(seg) ((PDOS_MCB)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), 0))) #define SEGMENT_TO_PSP(seg) ((PDOS_PSP)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), 0))) +#define STEPS_PER_CYCLE 256 /* DOS constants */ #define DOS_VERSION 0x0600