Release 0.2.0
[wine/multimedia.git] / kernel.c
blob13f30c77610ead23a50d3707df6e95a73e6ce28d
1 static char RCSId[] = "$Id: kernel.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
2 static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include "prototypes.h"
8 extern unsigned short *Stack16Frame;
10 /**********************************************************************
11 * KERNEL_LockSegment
13 int
14 KERNEL_LockSegment(int segment)
16 if (segment == -1)
17 segment = *(Stack16Frame + 6);
19 #ifdef RELAY_DEBUG
20 printf("LockSegment: segment %x\n", segment);
21 #endif
23 return segment;
26 /**********************************************************************
27 * KERNEL_UnlockSegment
29 int
30 KERNEL_UnlockSegment(int segment)
32 if (segment == -1)
33 segment = *(Stack16Frame + 6);
35 #ifdef RELAY_DEBUG
36 printf("UnlockSegment: segment %x\n", segment);
37 #endif
39 return segment;
42 /**********************************************************************
43 * KERNEL_WaitEvent
45 int
46 KERNEL_WaitEvent(int task)
48 #ifdef RELAY_DEBUG
49 printf("WaitEvent: task %d\n", task);
50 #endif
51 return 0;
53 /**********************************************************************
54 * KERNEL_GetModuleFileName
56 int
57 KERNEL_GetModuleFileName(int module, char *filename, int bytes)
59 #ifdef RELAY_DEBUG
60 printf("GetModuleFileName: module %d, filename %x, bytes %d\n",
61 module, filename, bytes);
62 #endif
64 strcpy(filename, "TEST.EXE");
66 return strlen(filename);
69 /**********************************************************************
70 * KERNEL_DOS3Call
72 int
73 KERNEL_DOS3Call(int ax, int cx, int dx, int bx, int sp, int bp,
74 int si, int di, int ds, int es)
76 switch ((ax >> 8) & 0xff)
78 case 0x30:
79 return 0x0303;
81 case 0x25:
82 case 0x35:
83 return 0;
85 case 0x4c:
86 exit(ax & 0xff);
88 default:
89 fprintf(stderr, "DOS: AX %04x, BX %04x, CX %04x, DX %04x\n",
90 ax, bx, cx, dx);
91 fprintf(stderr, " SP %04x, BP %04x, SI %04x, DI %04x\n",
92 sp, bp, si, di);
93 fprintf(stderr, " DS %04x, ES %04x\n",
94 ds, es);
97 return 0;