Author: hbelusca
Date: Fri Feb 21 19:27:27 2014
New Revision: 62282
URL:
http://svn.reactos.org/svn/reactos?rev=62282&view=rev
Log:
[NTVDM]
Start to implement EmulatorSimulate / EmulatorUnsimulate (used by VDDSimulate16 and
VDDUnsimualte16). This piece of code can be better written, but it works for what I'm
going to commit next.
Modified:
branches/ntvdm/subsystems/ntvdm/clock.c
branches/ntvdm/subsystems/ntvdm/emulator.c
branches/ntvdm/subsystems/ntvdm/emulator.h
branches/ntvdm/subsystems/ntvdm/ntvdm.c
Modified: branches/ntvdm/subsystems/ntvdm/clock.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/clock.c?…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/clock.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/clock.c [iso-8859-1] Fri Feb 21 19:27:27 2014
@@ -127,7 +127,6 @@
VgaHorizontalRetrace();
/* Continue CPU emulation */
- // EmulatorSimulate();
for (i = 0; (i < STEPS_PER_CYCLE) && VdmRunning; i++)
{
EmulatorStep();
Modified: branches/ntvdm/subsystems/ntvdm/emulator.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Fri Feb 21 19:27:27 2014
@@ -177,12 +177,18 @@
VOID EmulatorSimulate(VOID)
{
- UNIMPLEMENTED;
+ // FIXME: Do not mix VdmRunning (i.e. ntvdm running) and CpuSimulate!!
+ while (VdmRunning) ClockUpdate();
+
+ /* This takes into account for reentrance */
+ VdmRunning = TRUE;
}
VOID EmulatorUnsimulate(VOID)
{
- UNIMPLEMENTED;
+ /* Stop simulation */
+ // FIXME: Do not mix VdmRunning (i.e. ntvdm running) and CpuSimulate!!
+ VdmRunning = FALSE;
}
VOID EmulatorInterrupt(BYTE Number)
Modified: branches/ntvdm/subsystems/ntvdm/emulator.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] Fri Feb 21 19:27:27 2014
@@ -118,6 +118,8 @@
VOID EmulatorInterrupt(BYTE Number);
VOID EmulatorInterruptSignal(VOID);
VOID EmulatorStep(VOID);
+VOID EmulatorSimulate(VOID);
+VOID EmulatorUnsimulate(VOID);
VOID EmulatorCleanup(VOID);
VOID EmulatorSetA20(BOOLEAN Enabled);
Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Fri Feb 21 19:27:27 2014
@@ -420,8 +420,8 @@
goto Cleanup;
}
- /* Main loop */
- while (VdmRunning) ClockUpdate();
+ /* Start simulation */
+ EmulatorSimulate();
/* Perform another screen refresh */
VgaRefreshDisplay();