mirror of
https://github.com/reactos/reactos.git
synced 2024-09-10 21:04:26 +00:00
[NTVDM]
Implement all the missing INT 16h functions but 03h. Also, for simplification purposes (should be fixed later on) act exactly the same for INT 00h and 10h, and for INT 01h and 11h. Finally, one has to implement setting the BIOS KeybdShiftFlags flag. svn path=/branches/ntvdm/; revision=60770
This commit is contained in:
parent
4d28af9bb5
commit
d9c072aba2
|
@ -17,6 +17,8 @@
|
||||||
#include "ps2.h"
|
#include "ps2.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
|
#include "registers.h"
|
||||||
|
|
||||||
/* PRIVATE VARIABLES **********************************************************/
|
/* PRIVATE VARIABLES **********************************************************/
|
||||||
|
|
||||||
PBIOS_DATA_AREA Bda;
|
PBIOS_DATA_AREA Bda;
|
||||||
|
@ -982,15 +984,20 @@ VOID BiosKeyboardService(LPWORD Stack)
|
||||||
|
|
||||||
switch (HIBYTE(Eax))
|
switch (HIBYTE(Eax))
|
||||||
{
|
{
|
||||||
|
/* Wait for keystroke and read */
|
||||||
case 0x00:
|
case 0x00:
|
||||||
|
/* Wait for extended keystroke and read */
|
||||||
|
case 0x10: // FIXME: Temporarily do the same as INT 16h, 00h
|
||||||
{
|
{
|
||||||
/* Read the character (and wait if necessary) */
|
/* Read the character (and wait if necessary) */
|
||||||
EmulatorSetRegister(EMULATOR_REG_AX, BiosGetCharacter());
|
EmulatorSetRegister(EMULATOR_REG_AX, BiosGetCharacter());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get keystroke status */
|
||||||
case 0x01:
|
case 0x01:
|
||||||
|
/* Get extended keystroke status */
|
||||||
|
case 0x11: // FIXME: Temporarily do the same as INT 16h, 01h
|
||||||
{
|
{
|
||||||
WORD Data = BiosPeekCharacter();
|
WORD Data = BiosPeekCharacter();
|
||||||
|
|
||||||
|
@ -1009,6 +1016,44 @@ VOID BiosKeyboardService(LPWORD Stack)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get shift status */
|
||||||
|
case 0x02:
|
||||||
|
{
|
||||||
|
/* Return the lower byte of the keyboard shift status word */
|
||||||
|
setAL(LOBYTE(Bda->KeybdShiftFlags));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reserved */
|
||||||
|
case 0x04:
|
||||||
|
{
|
||||||
|
DPRINT1("BIOS Function INT 16h, AH = 0x04 is RESERVED\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Push keystroke */
|
||||||
|
case 0x05:
|
||||||
|
{
|
||||||
|
/* Return 0 if success, 1 if failure */
|
||||||
|
setAL(BiosKbdBufferPush(getCX()) == FALSE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get extended shift status */
|
||||||
|
case 0x12:
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Be careful! The returned word is similar to Bda->KeybdShiftFlags
|
||||||
|
* but the high byte is organized differently:
|
||||||
|
* the bytes 2 and 3 of the high byte are not the same...
|
||||||
|
*/
|
||||||
|
WORD KeybdShiftFlags = (Bda->KeybdShiftFlags & 0xF3FF);
|
||||||
|
|
||||||
|
/* Return the extended keyboard shift status word */
|
||||||
|
setAX(KeybdShiftFlags);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DPRINT1("BIOS Function INT 16h, AH = 0x%02X NOT IMPLEMENTED\n",
|
DPRINT1("BIOS Function INT 16h, AH = 0x%02X NOT IMPLEMENTED\n",
|
||||||
|
@ -1115,6 +1160,7 @@ VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack)
|
||||||
BiosKeyboardMap[VirtualKey] |= (1 << 7);
|
BiosKeyboardMap[VirtualKey] |= (1 << 7);
|
||||||
|
|
||||||
/* Find out which character this is */
|
/* Find out which character this is */
|
||||||
|
Character = 0;
|
||||||
if (ToAscii(VirtualKey, ScanCode, BiosKeyboardMap, &Character, 0) == 0)
|
if (ToAscii(VirtualKey, ScanCode, BiosKeyboardMap, &Character, 0) == 0)
|
||||||
{
|
{
|
||||||
/* Not ASCII */
|
/* Not ASCII */
|
||||||
|
|
|
@ -21,11 +21,13 @@
|
||||||
#define BIOS_PIC_MASTER_INT 0x08
|
#define BIOS_PIC_MASTER_INT 0x08
|
||||||
#define BIOS_PIC_SLAVE_INT 0x70
|
#define BIOS_PIC_SLAVE_INT 0x70
|
||||||
#define BIOS_SEGMENT 0xF000
|
#define BIOS_SEGMENT 0xF000
|
||||||
|
|
||||||
#define BIOS_VIDEO_INTERRUPT 0x10
|
#define BIOS_VIDEO_INTERRUPT 0x10
|
||||||
#define BIOS_EQUIPMENT_INTERRUPT 0x11
|
#define BIOS_EQUIPMENT_INTERRUPT 0x11
|
||||||
#define BIOS_KBD_INTERRUPT 0x16
|
#define BIOS_KBD_INTERRUPT 0x16
|
||||||
#define BIOS_TIME_INTERRUPT 0x1A
|
#define BIOS_TIME_INTERRUPT 0x1A
|
||||||
#define BIOS_SYS_TIMER_INTERRUPT 0x1C
|
#define BIOS_SYS_TIMER_INTERRUPT 0x1C
|
||||||
|
|
||||||
#define CONSOLE_FONT_HEIGHT 8
|
#define CONSOLE_FONT_HEIGHT 8
|
||||||
#define BIOS_KBD_BUFFER_SIZE 16
|
#define BIOS_KBD_BUFFER_SIZE 16
|
||||||
#define BIOS_EQUIPMENT_LIST 0x2C // HACK: Disable FPU for now
|
#define BIOS_EQUIPMENT_LIST 0x2C // HACK: Disable FPU for now
|
||||||
|
@ -51,12 +53,12 @@ typedef struct
|
||||||
{
|
{
|
||||||
WORD SerialPorts[4];
|
WORD SerialPorts[4];
|
||||||
WORD ParallelPorts[3];
|
WORD ParallelPorts[3];
|
||||||
WORD EbdaSegment;
|
WORD EbdaSegment; // Sometimes, ParallelPort
|
||||||
WORD EquipmentList;
|
WORD EquipmentList;
|
||||||
BYTE Reserved0;
|
BYTE Reserved0; // Errors in PCjr infrared keyboard link
|
||||||
WORD MemorySize;
|
WORD MemorySize;
|
||||||
WORD Reserved1;
|
WORD Reserved1; // Scratch pad for manufacturing error tests
|
||||||
WORD KeyboardFlags;
|
WORD KeybdShiftFlags;
|
||||||
BYTE AlternateKeypad;
|
BYTE AlternateKeypad;
|
||||||
WORD KeybdBufferHead;
|
WORD KeybdBufferHead;
|
||||||
WORD KeybdBufferTail;
|
WORD KeybdBufferTail;
|
||||||
|
|
|
@ -11,12 +11,13 @@
|
||||||
|
|
||||||
/* INCLUDES *******************************************************************/
|
/* INCLUDES *******************************************************************/
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <conio.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
/* DEFINES ********************************************************************/
|
/* DEFINES ********************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -300,6 +300,8 @@ DWORD WINAPI InputThreadProc(LPVOID Parameter)
|
||||||
KeyboardQueuePush(ScanCode);
|
KeyboardQueuePush(ScanCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: Update the keyboard shift status flags */
|
||||||
|
|
||||||
/* Keyboard IRQ */
|
/* Keyboard IRQ */
|
||||||
PicInterruptRequest(1);
|
PicInterruptRequest(1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue