Release 940405
[wine/gsoc-2012-control.git] / miscemu / ioports.c
blob44fa971c4fe6455f43daced8b2ea537cbc6310ab
1 #include <stdio.h>
2 #include <time.h>
3 #include "msdos.h"
4 #include "wine.h"
6 static BYTE cmosaddress;
8 static BYTE cmosimage[64] = {
9 0x27, 0x34, 0x31, 0x47, 0x16, 0x15, 0x00, 0x01,
10 0x04, 0x94, 0x26, 0x02, 0x50, 0x80, 0x00, 0x00,
11 0x40, 0xb1, 0x00, 0x9c, 0x01, 0x80, 0x02, 0x00,
12 0x1c, 0x00, 0x00, 0xad, 0x02, 0x10, 0x00, 0x00,
13 0x08, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00,
14 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x58,
15 0x00, 0x1c, 0x19, 0x81, 0x00, 0x0e, 0x00, 0x80,
16 0x1b, 0x7b, 0x21, 0x00, 0x00, 0x00, 0x05, 0x5f };
18 void inportb(struct sigcontext_struct *context)
20 fprintf(stderr, "IO: inb (%x)\n", EDX & 0xffff);
22 switch(EDX & 0xffff)
24 case 0x70:
25 EAX = (EAX & 0xffffff00L) | cmosaddress;
26 break;
27 case 0x71:
28 EAX = (EAX & 0xffffff00L) | cmosimage[cmosaddress & 0x3f];
29 break;
30 default:
34 void inport(struct sigcontext_struct *context)
36 fprintf(stderr, "IO: in (%x)\n", EDX & 0xffff);
38 EAX = (EAX & 0xffff0000L) | 0xffff;
41 void outportb(struct sigcontext_struct *context)
43 fprintf(stderr, "IO: outb (%x), %x\n", EDX & 0xffff, EAX & 0xff);
45 switch (EDX & 0xffff)
47 case 0x70:
48 cmosaddress = EAX & 0xff;
49 break;
50 case 0x71:
51 cmosimage[cmosaddress & 0x3f] = EAX & 0xff;
52 break;
53 default:
57 void outport(struct sigcontext_struct *context)
59 fprintf(stderr, "IO: out (%x), %x\n", EDX & 0xffff, EAX & 0xffff);