Fixed/implemented various interrupt functions.
[wine/dcerpc.git] / msdos / int16.c
blob1de9f1962f15e0da6f3f6b458f47c38c7c1fe26e
1 /*
2 * DOS interrupt 16h handler
3 */
5 #include <stdlib.h>
6 #include <string.h>
7 #include <unistd.h>
9 #include "config.h"
10 #include "module.h"
11 #include "console.h"
12 #include "wincon.h"
13 #include "debug.h"
15 /**********************************************************************
16 * INT_Int16Handler
18 * Handler for int 16h (keyboard)
20 * NOTE:
22 * KEYB.COM (DOS >3.2) adds functions to this interrupt, they are
23 * not currently listed here.
26 void WINAPI INT_Int16Handler( CONTEXT *context )
28 switch AH_reg(context) {
30 case 0x00: /* Get Keystroke */
31 /* Returns: AH = Scan code
32 AL = ASCII character */
33 TRACE(int16, "Get Keystroke\n");
34 CONSOLE_GetKeystroke(&AH_reg(context), &AL_reg(context));
35 break;
37 case 0x01: /* Check for Keystroke */
38 /* Returns: ZF set if no keystroke */
39 /* AH = Scan code */
40 /* AL = ASCII character */
41 TRACE(int16, "Check for Keystroke\n");
42 if (!CONSOLE_CheckForKeystroke(&AH_reg(context), &AL_reg(context)))
44 SET_ZFLAG(context);
46 else
48 RESET_ZFLAG(context);
50 break;
52 case 0x02: /* Get Shift Flags */
53 FIXME(int16, "Get Shift Flags - Not Supported\n");
54 break;
56 case 0x03: /* Set Typematic Rate and Delay */
57 FIXME(int16, "Set Typematic Rate and Delay - Not Supported\n");
58 break;
60 case 0x09: /* Get Keyboard Functionality */
61 FIXME(int16, "Get Keyboard Functionality - Not Supported\n");
62 /* As a temporary measure, say that "nothing" is supported... */
63 AL_reg(context) = 0;
64 break;
66 case 0x0a: /* Get Keyboard ID */
67 FIXME(int16, "Get Keyboard ID - Not Supported\n");
68 break;
70 case 0x10: /* Get Enhanced Keystroke */
71 TRACE(int16, "Get Enhanced Keystroke - Partially supported\n");
72 /* Returns: AH = Scan code
73 AL = ASCII character */
74 CONSOLE_GetKeystroke(&AH_reg(context), &AL_reg(context));
75 break;
78 case 0x11: /* Check for Enhanced Keystroke */
79 /* Returns: ZF set if no keystroke */
80 /* AH = Scan code */
81 /* AL = ASCII character */
82 TRACE(int16, "Check for Enhanced Keystroke - Partially supported\n");
83 if (!CONSOLE_CheckForKeystroke(&AH_reg(context), &AL_reg(context)))
85 SET_ZFLAG(context);
87 else
89 RESET_ZFLAG(context);
91 break;
93 case 0x12: /* Get Extended Shift States */
94 FIXME(int16, "Get Extended Shift States - Not Supported\n");
95 break;
97 default:
98 FIXME(int16, "Unknown INT 16 function - 0x%x\n", AH_reg(context));
99 break;