- New implementation of SendMessage, ReceiveMessage, ReplyMessage functions
[wine] / msdos / int16.c
1 /*
2  * DOS interrupt 16h handler
3  */
4
5 #include <stdlib.h>
6 #include <string.h>
7 #include <unistd.h>
8
9 #include "config.h"
10 #include "debug.h"
11
12 #include "ldt.h"
13 #include "drive.h"
14 #include "msdos.h"
15 #include "miscemu.h"
16 #include "module.h"
17 #include "console.h"
18
19 /**********************************************************************
20  *          INT_Int16Handler
21  *
22  * Handler for int 16h (keyboard)
23  *
24  * NOTE:
25  * 
26  *    KEYB.COM (DOS >3.2) adds functions to this interrupt, they are
27  *    not currently listed here.
28  */
29
30 void WINAPI INT_Int16Handler( CONTEXT *context )
31 {
32    switch AH_reg(context) {
33
34    case 0x00: /* Get Keystroke */
35       /* Returns: AH = Scan code
36                   AL = ASCII character */   
37       TRACE(int16, "Get Keystroke\n");
38       CONSOLE_GetKeystroke(&AH_reg(context), &AL_reg(context));
39       break;
40
41    case 0x01: /* Check for Keystroke */
42       /* Returns: ZF set if no keystroke */
43       /*          AH = Scan code */
44       /*          AL = ASCII character */
45       TRACE(int16, "Check for Keystroke\n");
46       if (!CONSOLE_CheckForKeystroke(&AH_reg(context), &AL_reg(context)))
47       {
48           SET_ZFLAG(context);
49       }
50       else
51       {
52           RESET_ZFLAG(context);
53       }
54       break;
55
56    case 0x02: /* Get Shift Flags */      
57       FIXME(int16, "Get Shift Flags - Not Supported\n");
58       break;
59
60    case 0x03: /* Set Typematic Rate and Delay */
61       FIXME(int16, "Set Typematic Rate and Delay - Not Supported\n");
62       break;
63
64    case 0x09: /* Get Keyboard Functionality */
65       FIXME(int16, "Get Keyboard Functionality - Not Supported\n");
66       /* As a temporary measure, say that "nothing" is supported... */
67       AL_reg(context) = 0;
68       break;
69
70    case 0x0a: /* Get Keyboard ID */
71       FIXME(int16, "Get Keyboard ID - Not Supported\n");
72       break;
73
74    case 0x10: /* Get Enhanced Keystroke */
75       FIXME(int16, "Get Enhanced Keystroke - Not Supported\n");
76       break;
77
78    case 0x11: /* Check for Enhanced Keystroke */
79       FIXME(int16, "Check for Enhanced Keystroke - Not Supported\n");
80       break;
81
82    case 0x12: /* Get Extended Shift States */
83       FIXME(int16, "Get Extended Shift States - Not Supported\n");
84       break;
85  
86    default:
87       FIXME(int16, "Unknown INT 16 function - 0x%x\n", AH_reg(context));   
88       break;
89
90    }
91 }
92