[Prev][Next][Index][Thread]

fix for Wine 951212..



Ok, this fix is for the inw/outw stuff.

The byte order is critical to shutting up Quikpict.

With this, things are better.

--- wine951212/miscemu/ioports.c	Thu Jul 27 13:15:26 1995
+++ wine951212-new/miscemu/ioports.c	Sat Dec 30 01:19:00 1995
@@ -14,6 +14,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
+#include <asm/io.h>
+#include <unistd.h>
 #include "windows.h"
 #include "stddebug.h"
 /* #define DEBUG_INT */
@@ -38,12 +40,14 @@
 {
     DWORD res = 0;
     BYTE b;
+    int origport = port, origcount = count;
 
-    dprintf_int(stddeb, "IO: %d bytes from port 0x%02x\n", count, port );
+/*     dprintf_int(stddeb, "IO: %d bytes from port 0x%02x\n", count, port ); */
 
+    port = port + count - 1;
     while (count-- > 0)
     {
-        switch (port++)
+        switch (port)
 	{
 	case 0x70:
             b = cmosaddress;
@@ -51,11 +55,23 @@
 	case 0x71:
             b = cmosimage[cmosaddress & 0x3f];
             break;
+	case 0x378:
+	case 0x379:
+	case 0x37a:
+	    if (ioperm(0x378, 3, 1))
+	        dprintf_int(stddeb, "IO: can't get ioperm");
+	    b = inb(port);
+	    ioperm(0x378, 3, 0);
+	    break;
 	default:
 	  b = 0xff;
 	}
+	port--;
         res = (res << 8) | b;
     }
+
+    dprintf_int(stddeb, "IO: read %d bytes from port 0x%02x, result = 0x%04lx\n", origcount, origport, res );
+
     return res;
 }
 
@@ -64,14 +80,14 @@
 {
     BYTE b;
 
-    dprintf_int( stddeb, "IO: 0x%lx (%d bytes) to port 0x%02x\n",
+    dprintf_int( stddeb, "IO: 0x%04lx (%d bytes) to port 0x%02x\n",
                  value, count, port );
 
     while (count-- > 0)
     {
         b = value & 0xff;
         value >>= 8;
-        switch (port++)
+        switch (port)
 	{
 	case 0x70:
             cmosaddress = b & 0x7f;
@@ -79,8 +95,16 @@
 	case 0x71:
             cmosimage[cmosaddress & 0x3f] = b;
             break;
+	case 0x378:
+	case 0x379:
+	case 0x37a:
+	    ioperm(0x378, 3, 1);
+	    outb(b, port);
+	    ioperm(0x378, 3, 0);
+	    break;
 	default:
             /* Rien du tout.  */
 	}
+	port++;
     }
 }

-- 
Thomas Davis			| Internet:	Thomas.Davis@mnscorp.com
Systems Consultant		| Snail Mail:	Suite 528
Midwest Network Solutions Corp.	| 		1941 South 42nd Street
(402) 346-7687			|		Omaha, NE 68105-2939