Don't call uninitialized Dosvm functions

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Aug 15 11:27:51 CDT 2001


Changelog:
	msdos/ioports.c:
	Don't call Dosvm functions when Dosvm isn't initialized

Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Free Software: If you contribute nothing, expect nothing
--
Index: wine/msdos/ioports.c
===================================================================
RCS file: /home/wine/wine/msdos/ioports.c,v
retrieving revision 1.26
diff -u -r1.26 ioports.c
--- wine/msdos/ioports.c	2001/06/28 18:04:41	1.26
+++ wine/msdos/ioports.c	2001/08/15 15:21:14
@@ -98,7 +98,8 @@
 {
     switch (timer) {
         case 0: /* System timer counter divisor */
-            Dosvm.SetTimer(maxval);
+            if (Dosvm.Current())
+	      Dosvm.SetTimer(maxval);
             break;
         case 1: /* RAM refresh */
             FIXME("RAM refresh counter handling not implemented !\n");
@@ -307,7 +308,10 @@
 	    if (chan == 0) /* System timer counter divisor */
 	    {
 		/* FIXME: Dosvm.GetTimer() returns quite rigid values */
-		tempval = dummy_ctr + (WORD)Dosvm.GetTimer();
+	        if (Dosvm.Current())
+		  tempval = dummy_ctr + (WORD)Dosvm.GetTimer();
+		else
+		  tempval = dummy_ctr;
 	    }
 	    else
 	    {
@@ -415,7 +419,8 @@
     switch (port)
     {
     case 0x20:
-        Dosvm.OutPIC( port, (BYTE)value );
+        if (Dosvm.Current())
+	  Dosvm.OutPIC( port, (BYTE)value );
         break;
     case 0x40:
     case 0x41:
@@ -472,7 +477,10 @@
 	    tmr_8253[chan].latched = TRUE;
 	    dummy_ctr -= 1 + (int)(10.0 * rand() / (RAND_MAX + 1.0));
 	    if (chan == 0) /* System timer divisor */
-		tmr_8253[chan].latch = dummy_ctr + (WORD)Dosvm.GetTimer();
+	        if (Dosvm.Current())
+		  tmr_8253[chan].latch = dummy_ctr + (WORD)Dosvm.GetTimer();
+	        else
+		  tmr_8253[chan].latch = dummy_ctr;
 	    else
 	    {
 		/* FIXME: intelligent hardware timer emulation needed */




More information about the wine-patches mailing list