Author: aandrejevic
Date: Sun Oct 27 16:34:27 2013
New Revision: 60772
URL:
http://svn.reactos.org/svn/reactos?rev=60772&view=rev
Log:
[NTVDM]
Simplify BiosPeekCharacter.
Implement DOS direct console I/O functions.
Modified:
branches/ntvdm/subsystems/ntvdm/bios.c
branches/ntvdm/subsystems/ntvdm/dos.c
Modified: branches/ntvdm/subsystems/ntvdm/bios.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sun Oct 27 16:34:27 2013
@@ -596,13 +596,9 @@
{
WORD CharacterData;
- /* Check if there is a key available */
- if (Bda->KeybdBufferHead == Bda->KeybdBufferTail) return 0xFFFF;
-
/* Get the key from the queue, but don't remove it */
- BiosKbdBufferTop(&CharacterData);
-
- return CharacterData;
+ if (BiosKbdBufferTop(&CharacterData)) return CharacterData;
+ else return 0xFFFF;
}
WORD BiosGetCharacter(VOID)
@@ -1169,8 +1165,7 @@
}
/* Push it onto the BIOS keyboard queue */
- BiosKbdBufferPush((ScanCode << 8) | (Character & 0xFF));
-
+ BiosKbdBufferPush(MAKEWORD(Character, ScanCode));
}
else
{
Modified: branches/ntvdm/subsystems/ntvdm/dos.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Sun Oct 27 16:34:27 2013
@@ -1411,6 +1411,36 @@
break;
}
+ /* Direct Console I/O */
+ case 0x06:
+ {
+ BYTE Character = LOBYTE(Edx);
+
+ if (Character != 0xFF)
+ {
+ /* Output */
+ DosPrintCharacter(Character);
+ }
+ else
+ {
+ /* Input */
+ Eax &= 0xFFFFFF00;
+
+ if (DosCheckInput())
+ {
+ Eax |= DosReadCharacter();
+ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_ZF;
+ }
+ else
+ {
+ /* No character available */
+ Stack[STACK_FLAGS] |= EMULATOR_FLAG_ZF;
+ }
+ }
+
+ break;
+ }
+
/* Read Character Without Echo */
case 0x07:
case 0x08: