Fix zero timeouts for GetBiosKey (F5/F8 handling).

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1332 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2007-05-28 18:01:59 +00:00
parent 77af35928e
commit 5fa8f24fb7

View File

@ -749,16 +749,20 @@ UWORD GetBiosKey(int timeout)
ULONG startTime = GetBiosTime(); ULONG startTime = GetBiosTime();
if (timeout >= 0) do if (timeout >= 0)
{ {
r.a.x = 0x0100; /* are there keys available ? */ do
init_call_intr(0x16, &r); {
if ((unsigned)(GetBiosTime() - startTime) >= timeout * 18u) r.a.x = 0x0100; /* are there keys available ? */
return 0xffff; init_call_intr(0x16, &r);
if (!(r.flags & FLG_ZERO))
return r.a.x;
}
while ((unsigned)(GetBiosTime() - startTime) < timeout * 18u);
return 0xffff;
} }
while (r.flags & FLG_ZERO);
/* key available or blocking wait (timeout < 0): fetch it */ /* blocking wait (timeout < 0): fetch it */
r.a.x = 0x0000; r.a.x = 0x0000;
init_call_intr(0x16, &r); init_call_intr(0x16, &r);
return r.a.x; return r.a.x;