Initializing Dosvm for direct port access

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Thu Jun 21 09:44:36 CDT 2001


>>>>> "Ove" == Ove Kaaven <ovehk at ping.uio.no> writes:

    Ove> On Thu, 21 Jun 2001, Uwe Bonnes wrote:

    >> Hallo Ove,
    >> 
    >> is something like appended patch right to get direct port access
    >> working for a win95 program? At least my dongle protected program
    >> (spde) doesn't crash any more and recognizes the license.

    Ove> I meant to reply sooner or later... it doesn't seem right to me to
    Ove> load the entire DOS subsystem for reading out the timer. Direct
    Ove> port access is probably not allowed for win32 apps under NT anyway?
    Ove> Perhaps there should be a fallback there for when the DOS subsystem
    Ove> is not loaded? Then again, I'm not sure how it's supposed to
    Ove> work... it probably can't hook the timer interrupt or set the timer
    Ove> rate or anything without upsetting the OS?

What about checking if Dosvm.GetTimer is initialized and if it isn't
initialized do give back the dummy value? At least the spde doesn't seem to
care...

@@ -291,7 +303,7 @@
        else
        {
            dummy_ctr -= 1 + (int)(10.0 * rand() / (RAND_MAX + 1.0));
-           if (chan == 0) /* System timer counter divisor */
+           if ((chan == 0) && (Dosvm.GetTimer))/* System timer counter divisor */
            {
                /* FIXME: Dosvm.GetTimer() returns quite rigid values */
                tempval = dummy_ctr + (WORD)Dosvm.GetTimer();
@@ -450,8 +470,9 @@
        case 0: /* latch timer */
            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 ((chan == 0) && (Dosvm.GetTimer))/* System timer divisor */
+               tmr_8253[chan].latch = dummy_ctr + 
+                 (Dosvm.GetTimer)?(WORD)Dosvm.GetTimer():0;
            else
            {
                /* FIXME: intelligent hardware timer emulation needed */


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

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------




More information about the wine-devel mailing list