mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[NTVDM]
Simplify BiosPeekCharacter. Implement DOS direct console I/O functions. svn path=/branches/ntvdm/; revision=60772
This commit is contained in:
parent
161fc791e4
commit
37430c188b
2 changed files with 33 additions and 8 deletions
|
@ -596,13 +596,9 @@ WORD BiosPeekCharacter(VOID)
|
|||
{
|
||||
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 @@ VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack)
|
|||
}
|
||||
|
||||
/* Push it onto the BIOS keyboard queue */
|
||||
BiosKbdBufferPush((ScanCode << 8) | (Character & 0xFF));
|
||||
|
||||
BiosKbdBufferPush(MAKEWORD(Character, ScanCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1411,6 +1411,36 @@ VOID DosInt21h(LPWORD Stack)
|
|||
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:
|
||||
|
|
Loading…
Reference in a new issue