Re: [AD] Mouse (DOS and WINDOWS) patches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


If you look at the last line of the dmouse.c you will see this piece of code
wrote by shawn:
static void polling_exit()
{
   __dpmi_regs r;

   r.x.ax = 15;                  /* reset sensitivity */
   r.x.cx = 8;
   r.x.dx = 16;
   __dpmi_int(0x33, &r);
}

ax is the function number (set the sensivity)
cx is the horizontal sensivity and dx is the vertical sensivity
so, if cx = 8 (that is the mouse default, it's when allegro is given 2) and
dx = 16 (the mouse default, it's when allegro is given 2) it sets the
sensivity to the default
so imho, if in the actual code we specify mouse_setspeed(2, 2), cx would be
2 and dx would be 2, meanwhile it should be cx = 8 and dx = 16.
That's why i've changed that to cx = xspeed * 4 (if it's given 2, its 8) and
dx = yspeed * 8 (if it's given 2, its 16 as it should be too)
That's the why of the patch
Also, an old microsoft mouse driver book i've got agrees with me :)

----- Original Message -----
From: "Eric Botcazou" <ebotcazou@xxxxxxxxxx>
To: "Allegro Conductors" <conductors@xxxxxxxxxx>
Sent: Friday, December 22, 2000 10:31 PM
Subject: Re: [AD] Mouse (DOS and WINDOWS) patches


> > The dos one is a patch for the int33 speed function. Because the
standard
> > speed in allegro is 2, 2 and the standard speed used in function 15 is
8,
> > 16, my old microsoft mouse book say cx should be mul by 4 (2 * 4 = 8)
and
> > dx by 8 (2 * 8 = 16)
>
> I don't know the DOS mouse code very well, but isn't the scaling factor
> already in the code ?
> I think the int33_set_range() function implicitly sets it.
>
> --
> Eric Botcazou (ebotcazou@xxxxxxxxxx)
> Web Site: http://www.multimania.com/ebotcazou
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/