Author: aandrejevic
Date: Mon Apr 27 14:14:14 2015
New Revision: 67459
URL: http://svn.reactos.org/svn/reactos?rev=67459&view=rev
Log:
[NTVDM]
Remove the useless wrappers BiosPeekCharacter and BiosGetCharacter. They're also
a source of bugs since 0xFFFF could legitimately appear in the buffer.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] Mon Apr 27 14:14:14 2015
@@ -80,26 +80,6 @@
return TRUE;
}
-static WORD BiosPeekCharacter(VOID)
-{
- WORD CharacterData = 0;
-
- /* Get the key from the queue, but don't remove it */
- if (BiosKbdBufferTop(&CharacterData)) return CharacterData;
- else return 0xFFFF;
-}
-
-static WORD BiosGetCharacter(VOID)
-{
- WORD CharacterData = 0;
-
- /* Check if there is a key available, and if so, remove it from the queue */
- if (BiosKbdBufferTop(&CharacterData)) BiosKbdBufferPop();
- else CharacterData = 0xFFFF;
-
- return CharacterData;
-}
-
static VOID WINAPI BiosKeyboardService(LPWORD Stack)
{
switch (getAH())
@@ -109,16 +89,17 @@
/* Wait for extended keystroke and read */
case 0x10: // FIXME: Temporarily do the same as INT 16h, 00h
{
+ WORD Character;
+
/* Read the character (and wait if necessary) */
- WORD Character = BiosGetCharacter();
-
- if (Character == 0xFFFF)
+ if (!BiosKbdBufferTop(&Character))
{
/* No key available. Set the handler CF to repeat the BOP */
setCF(1);
break;
}
+ BiosKbdBufferPop();
setAX(Character);
break;
@@ -129,9 +110,9 @@
/* Get extended keystroke status */
case 0x11: // FIXME: Temporarily do the same as INT 16h, 01h
{
- WORD Character = BiosPeekCharacter();
-
- if (Character != 0xFFFF)
+ WORD Character;
+
+ if (BiosKbdBufferTop(&Character))
{
/* There is a character, clear ZF and return it */
Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_ZF;