mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-27 07:44:09 +02:00
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:
parent
77af35928e
commit
5fa8f24fb7
@ -749,16 +749,20 @@ UWORD GetBiosKey(int timeout)
|
||||
|
||||
ULONG startTime = GetBiosTime();
|
||||
|
||||
if (timeout >= 0) do
|
||||
if (timeout >= 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
r.a.x = 0x0100; /* are there keys available ? */
|
||||
init_call_intr(0x16, &r);
|
||||
if ((unsigned)(GetBiosTime() - startTime) >= timeout * 18u)
|
||||
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;
|
||||
init_call_intr(0x16, &r);
|
||||
return r.a.x;
|
||||
|
Loading…
x
Reference in New Issue
Block a user