2 * Emulation of processor ioports.
4 * Copyright 1995 Morten Welinder
8 - only a few ports are emulated.
9 - real-time clock in "cmos" is bogus. A nifty alarm() setup could
19 /* #define DEBUG_INT */
22 static BYTE cmosaddress
;
24 static BYTE cmosimage
[64] =
26 0x27, 0x34, 0x31, 0x47, 0x16, 0x15, 0x00, 0x01,
27 0x04, 0x94, 0x26, 0x02, 0x50, 0x80, 0x00, 0x00,
28 0x40, 0xb1, 0x00, 0x9c, 0x01, 0x80, 0x02, 0x00,
29 0x1c, 0x00, 0x00, 0xad, 0x02, 0x10, 0x00, 0x00,
30 0x08, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00,
31 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x58,
32 0x00, 0x1c, 0x19, 0x81, 0x00, 0x0e, 0x00, 0x80,
33 0x1b, 0x7b, 0x21, 0x00, 0x00, 0x00, 0x05, 0x5f
37 DWORD
inport( int port
, int count
)
42 dprintf_int(stddeb
, "IO: %d bytes from port 0x%02x\n", count
, port
);
52 b
= cmosimage
[cmosaddress
& 0x3f];
63 void outport( int port
, int count
, DWORD value
)
67 dprintf_int( stddeb
, "IO: 0x%lx (%d bytes) to port 0x%02x\n",
77 cmosaddress
= b
& 0x7f;
80 cmosimage
[cmosaddress
& 0x3f] = b
;