Release 941017
[wine] / miscemu / int2f.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "registers.h"
4 #include "wine.h"
5 #include "stddebug.h"
6 /* #define DEBUG_INT */
7 /* #undef  DEBUG_INT */
8 #include "debug.h"
9
10 void IntBarf(int i, struct sigcontext_struct *context);
11 int do_int2f_16(struct sigcontext_struct *context);
12
13 int do_int2f(struct sigcontext_struct *context)
14 {
15         switch((context->sc_eax >> 8) & 0xff)
16         {
17         case 0x10: /* share is installed */
18                 EAX = (EAX & 0xffffff00) | 0xff;
19                 break;
20
21         case 0x15: /* mscdex */
22                 /* ignore requests */
23                 return 1;
24
25         case 0x16:
26                 return do_int2f_16(context);
27
28         default:
29                 IntBarf(0x2f, context);
30         };
31         return 1;
32 }
33
34
35 int do_int2f_16(struct sigcontext_struct *context)
36 {
37         switch(context->sc_eax & 0xff) {
38                 case 0x00: 
39                         /* return 'major/minor' for MSWin 3.1 */
40                         dprintf_int(stddeb,"do_int2f_16 // return 'major/minor' for MSWin 3.1 !\n");
41                         context->sc_eax = 0x0310;
42                         return 1;
43                 case 0x86:
44                         /* operating in protected mode under DPMI */
45                         dprintf_int(stddeb,"do_int2f_16 // operating in protected mode under DPMI !\n");
46                         context->sc_eax = 0x0000;
47                         return 1;
48                 case 0x87:
49                         dprintf_int(stddeb,"do_int2f_16 // return DPMI flags !\n");
50                         context->sc_eax = 0x0000;               /* DPMI Installed */
51                         context->sc_ebx = 0x0001;               /* 32bits available */
52                         context->sc_ecx = 0x04;                 /* processor 486 */
53                         context->sc_edx = 0x0100;               /* DPMI major/minor */
54                         context->sc_esi = 0;                    /* # of para. of DOS */
55                                                                                         /* extended private data */
56                         return 1;
57                 default:
58                         IntBarf(0x2f, context);
59                 }
60         return 1;
61 }
62
63