Release 941227
[wine/multimedia.git] / miscemu / ioports.c
blobfe86fc1a14f0066a5fc22484829de54d32cda546
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 #include "debug.h"
10 static BYTE cmosaddress;
12 static BYTE cmosimage[64] = {
13 0x27, 0x34, 0x31, 0x47, 0x16, 0x15, 0x00, 0x01,
14 0x04, 0x94, 0x26, 0x02, 0x50, 0x80, 0x00, 0x00,
15 0x40, 0xb1, 0x00, 0x9c, 0x01, 0x80, 0x02, 0x00,
16 0x1c, 0x00, 0x00, 0xad, 0x02, 0x10, 0x00, 0x00,
17 0x08, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00,
18 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x58,
19 0x00, 0x1c, 0x19, 0x81, 0x00, 0x0e, 0x00, 0x80,
20 0x1b, 0x7b, 0x21, 0x00, 0x00, 0x00, 0x05, 0x5f };
22 void inportb(struct sigcontext_struct *context)
24 dprintf_int(stddeb, "IO: inb (%x)\n", DX);
26 switch(DX) {
27 case 0x70:
28 AL = cmosaddress;
29 break;
30 case 0x71:
31 AL = cmosimage[cmosaddress & 0x3f];
32 break;
33 default:
37 void inport(struct sigcontext_struct *context)
39 dprintf_int(stdnimp, "IO: in (%x)\n", DX);
41 AX = 0xffff;
44 void inportb_abs(struct sigcontext_struct *context)
46 dprintf_int(stdnimp, "IO: in (%x)\n", *(BYTE *)(EIP+1));
47 AL = 0xff;
50 void inport_abs(struct sigcontext_struct *context)
52 dprintf_int(stdnimp, "IO: in (%x)\n", *(BYTE *)(EIP+1));
53 AX = 0xffff;
56 void outportb(struct sigcontext_struct *context)
58 dprintf_int(stdnimp, "IO: outb (%x), %x\n", DX, AX);
60 switch (EDX & 0xffff)
62 case 0x70:
63 cmosaddress = AL & 0x7f;
64 break;
65 case 0x71:
66 cmosimage[cmosaddress & 0x3f] = AL;
67 break;
68 default:
72 void outport(struct sigcontext_struct *context)
74 dprintf_int(stdnimp, "IO: out (%x), %x\n", DX, AX);
77 void outportb_abs(struct sigcontext_struct *context)
79 dprintf_int(stdnimp, "IO: out (%x), %x\n", *(BYTE *)(EIP+1), AL);
82 void outport_abs(struct sigcontext_struct *context)
84 dprintf_int(stdnimp, "IO: out (%x), %x\n", *(BYTE *)(EIP+1), AX);