Author: aandrejevic Date: Sun Aug 28 02:00:10 2016 New Revision: 72481
URL: http://svn.reactos.org/svn/reactos?rev=72481&view=rev Log: [NTVDM:BIOS] Properly implement INT 15h, AH = 86h.
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios/... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] Sun Aug 28 02:00:10 2016 @@ -327,14 +327,31 @@ * See Ralf Brown: http://www.ctyme.com/intr/rb-1525.htm * for more information. */ - LARGE_INTEGER TimeOut; - TimeOut.QuadPart = MAKELONG(getDX(), getCX()) * -10LL; - - // HACK: For now, use the NT API (time in hundreds of nanoseconds). - NtDelayExecution(FALSE, &TimeOut); - - /* Clear CF */ - Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + + static ULONG CompletionTime = 0; + + /* Check if we're already looping */ + if (getCF()) + { + if (GetTickCount() >= CompletionTime) + { + /* Stop looping */ + setCF(0); + + /* Clear the CF on the stack too */ + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + } + } + else + { + /* Set the CF on the stack */ + Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + + /* Set the completion time and start looping */ + CompletionTime = GetTickCount() + (MAKELONG(getDX(), getCX()) / 1000); + setCF(1); + } + break; }