Release 950727
[wine] / miscemu / int2f.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "registers.h"
4 #include "wine.h"
5 #include "msdos.h"
6 #include "miscemu.h"
7 #include "options.h"
8 #include "stddebug.h"
9 /* #define DEBUG_INT */
10 #include "debug.h"
11
12 static void do_int2f_16(struct sigcontext_struct *context);
13
14 /**********************************************************************
15  *          INT_Int2fHandler
16  *
17  * Handler for int 2fh (multiplex).
18  */
19 void INT_Int2fHandler( struct sigcontext_struct sigcontext )
20 {
21 #define context (&sigcontext)
22     switch(AH)
23     {
24         case 0x10:
25                 AL = 0xff; /* share is installed */
26                 break;
27
28         case 0x15: /* mscdex */
29                 /* ignore requests */
30                 break;
31
32         case 0x16:
33                 do_int2f_16( context );
34                 break;
35         default:
36                 INT_BARF( 0x2f );
37             }
38 #undef context
39 }
40
41
42 static void do_int2f_16(struct sigcontext_struct *context)
43 {
44     switch(AL)
45     {
46     case 0x00:  /* Windows enhanced mode installation check */
47         AX = Options.enhanced ? WINVERSION : 0;
48         break;
49
50     case 0x0a:  /* Get Windows version and type */
51         AX = 0;
52         BX = (WINVERSION >> 8) | ((WINVERSION << 8) & 0xff00);
53         CX = Options.enhanced ? 3 : 2;
54         break;
55
56     case 0x80:  /* Release time-slice */
57         break;  /* nothing to do */
58
59     case 0x86:  /* DPMI detect mode */
60         AX = 0;  /* Running under DPMI */
61         break;
62
63     case 0x87:  /* DPMI installation check */
64         AX = 0x0000;  /* DPMI Installed */
65         BX = 0x0001;  /* 32bits available */
66         CL = 0x03;    /* processor 386 */
67         DX = 0x005a;  /* DPMI major/minor 0.90 */
68         SI = 0;       /* # of para. of DOS extended private data */
69         ES = 0;       /* ES:DI is DPMI switch entry point */
70         DI = 0;
71         break;
72
73     default:
74         INT_BARF( 0x2f );
75     }
76 }
77
78