Author: aandrejevic
Date: Sat Nov 30 03:59:26 2013
New Revision: 61151
URL:
http://svn.reactos.org/svn/reactos?rev=61151&view=rev
Log:
[NTVDM]
Fix the PIT square wave generator.
Modified:
branches/ntvdm/subsystems/ntvdm/timer.c
Modified: branches/ntvdm/subsystems/ntvdm/timer.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/timer.c?…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/timer.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/timer.c [iso-8859-1] Sat Nov 30 03:59:26 2013
@@ -277,11 +277,11 @@
}
else
{
+ /* Decrease the value */
+ PitChannels[i].CurrentValue -= Count * 2;
+
/* Clear the count */
Count = 0;
-
- /* Decrease the value */
- PitChannels[i].CurrentValue -= Count * 2;
/* Did it fall to zero? */
if (PitChannels[i].CurrentValue == 0)
@@ -304,7 +304,9 @@
}
/* Was there any rising edge on channel 0 ? */
- if ((PitChannels[i].OutputFlipFlop || ReloadCount) && (i == 0))
+ if (((PitChannels[i].OutputFlipFlop && (ReloadCount == 1))
+ || (ReloadCount > 1))
+ && (i == 0))
{
/* Yes, IRQ 0 */
PicInterruptRequest(0);