mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 00:03:00 +00:00
[NTVDM]
The PS/2 should latch the last value that was read in the case of multiple reads. Modify the BIOS keyboard IRQ handler to support hooks. svn path=/branches/ntvdm/; revision=60773
This commit is contained in:
parent
37430c188b
commit
7e0285b710
2 changed files with 11 additions and 10 deletions
|
@ -1132,9 +1132,9 @@ VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack)
|
||||||
{
|
{
|
||||||
BYTE ScanCode, VirtualKey;
|
BYTE ScanCode, VirtualKey;
|
||||||
WORD Character;
|
WORD Character;
|
||||||
|
|
||||||
/* Loop while there is a scancode available */
|
/* Loop while there is a scancode available */
|
||||||
while (KeyboardReadStatus() & 1)
|
do
|
||||||
{
|
{
|
||||||
/* Get the scan code and virtual key code */
|
/* Get the scan code and virtual key code */
|
||||||
ScanCode = KeyboardReadData();
|
ScanCode = KeyboardReadData();
|
||||||
|
@ -1173,6 +1173,7 @@ VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack)
|
||||||
BiosKeyboardMap[VirtualKey] &= ~(1 << 7);
|
BiosKeyboardMap[VirtualKey] &= ~(1 << 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
while (KeyboardReadStatus() & 1);
|
||||||
|
|
||||||
/* Clear the keyboard flags */
|
/* Clear the keyboard flags */
|
||||||
Bda->KeybdShiftFlags = 0;
|
Bda->KeybdShiftFlags = 0;
|
||||||
|
|
|
@ -20,7 +20,7 @@ static BYTE KeyboardQueue[KEYBOARD_BUFFER_SIZE];
|
||||||
static BOOLEAN KeyboardQueueEmpty = TRUE;
|
static BOOLEAN KeyboardQueueEmpty = TRUE;
|
||||||
static UINT KeyboardQueueStart = 0;
|
static UINT KeyboardQueueStart = 0;
|
||||||
static UINT KeyboardQueueEnd = 0;
|
static UINT KeyboardQueueEnd = 0;
|
||||||
static BYTE KeyboardResponse = 0;
|
static BYTE KeyboardData = 0, KeyboardResponse = 0;
|
||||||
static BOOLEAN KeyboardReadResponse = FALSE, KeyboardWriteResponse = FALSE;
|
static BOOLEAN KeyboardReadResponse = FALSE, KeyboardWriteResponse = FALSE;
|
||||||
static BYTE KeyboardConfig = PS2_DEFAULT_CONFIG;
|
static BYTE KeyboardConfig = PS2_DEFAULT_CONFIG;
|
||||||
|
|
||||||
|
@ -190,19 +190,19 @@ VOID KeyboardWriteCommand(BYTE Command)
|
||||||
|
|
||||||
BYTE KeyboardReadData()
|
BYTE KeyboardReadData()
|
||||||
{
|
{
|
||||||
BYTE Value = 0;
|
|
||||||
|
|
||||||
/* If there was a response byte from the controller, return it */
|
/* If there was a response byte from the controller, return it */
|
||||||
if (KeyboardReadResponse)
|
if (KeyboardReadResponse)
|
||||||
{
|
{
|
||||||
KeyboardReadResponse = FALSE;
|
KeyboardReadResponse = FALSE;
|
||||||
return KeyboardResponse;
|
KeyboardData = KeyboardResponse;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Otherwise, read the data from the queue */
|
||||||
|
KeyboardQueuePop(&KeyboardData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, read the data from the queue */
|
|
||||||
KeyboardQueuePop(&Value);
|
|
||||||
|
|
||||||
return Value;
|
return KeyboardData;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID KeyboardWriteData(BYTE Data)
|
VOID KeyboardWriteData(BYTE Data)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue