Release 941030
[wine/dcerpc.git] / miscemu / ioports.c
blobd8b09f3d03a943ecda2eff49de7b0e18a96f23b6
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <time.h>
4 #include "registers.h"
5 #include "wine.h"
6 #include "stddebug.h"
7 /* #define DEBUG_INT */
8 /* #undef DEBUG_INT */
9 #include "debug.h"
11 static BYTE cmosaddress;
13 static BYTE cmosimage[64] = {
14 0x27, 0x34, 0x31, 0x47, 0x16, 0x15, 0x00, 0x01,
15 0x04, 0x94, 0x26, 0x02, 0x50, 0x80, 0x00, 0x00,
16 0x40, 0xb1, 0x00, 0x9c, 0x01, 0x80, 0x02, 0x00,
17 0x1c, 0x00, 0x00, 0xad, 0x02, 0x10, 0x00, 0x00,
18 0x08, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00,
19 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x58,
20 0x00, 0x1c, 0x19, 0x81, 0x00, 0x0e, 0x00, 0x80,
21 0x1b, 0x7b, 0x21, 0x00, 0x00, 0x00, 0x05, 0x5f };
23 void inportb(struct sigcontext_struct *context)
25 dprintf_int(stddeb, "IO: inb (%x)\n", DX);
27 switch(DX) {
28 case 0x70:
29 AL = cmosaddress;
30 break;
31 case 0x71:
32 AL = cmosimage[cmosaddress & 0x3f];
33 break;
34 default:
38 void inport(struct sigcontext_struct *context)
40 dprintf_int(stdnimp, "IO: in (%x)\n", DX);
42 AX = 0xffff;
45 void outportb(struct sigcontext_struct *context)
47 dprintf_int(stdnimp, "IO: outb (%x), %x\n", DX, AX);
49 switch (EDX & 0xffff)
51 case 0x70:
52 cmosaddress = AL & 0x7f;
53 break;
54 case 0x71:
55 cmosimage[cmosaddress & 0x3f] = AL;
56 break;
57 default:
61 void outport(struct sigcontext_struct *context)
63 dprintf_int(stdnimp, "IO: out (%x), %x\n", DX, AX);