[NTVDM]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Sun, 23 Jun 2013 00:20:24 +0000 (00:20 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Sun, 23 Jun 2013 00:20:24 +0000 (00:20 +0000)
Perform multiple CPU instructions in one emulator cycle.

svn path=/branches/ntvdm/; revision=59298

subsystems/ntvdm/ntvdm.c
subsystems/ntvdm/ntvdm.h

index 957a9aa..70ae2dc 100644 (file)
@@ -156,9 +156,9 @@ INT wmain(INT argc, WCHAR *argv[])
         }
         
         /* Continue CPU emulation */
         }
         
         /* 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);
         if ((CurrentTickCount - LastCyclePrintout) >= 1000)
         {
             DPRINT1("NTVDM: %d Instructions Per Second\n", Cycles);
index ddc4ac5..896ce7a 100644 (file)
@@ -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 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
 
 /* DOS constants */
 #define DOS_VERSION 0x0600