After adding this, you can modify the mouse rate by typing:
echo 'speed 3' > /dev/mousectl
John Carmack
Id Software
in 9/next/screen.c:
Add the variable:
/* JDC: for mouse acceleration */
int mouse_speed =3D 2;
In the kbdmouseintr() function, replace the mousetrack call with:
/* mousetrack(b, 3*-dx, 3*-dy);
JDC*/
{
int speed;
speed =3D abs(dx) > abs(dy) ? abs(dx) : abs(dy);
speed =3D speed*speed*mouse_speed;
mousetrack(b, speed*-dx, speed*-dy);
}
change mousectl to accept a "speed" parameter.
void
mousectl(char *arg)
{
int n;
char *field[3];
n =3D getfields(arg, field, 3, " ");
if(strncmp(field[0], "serial", 6) =3D=3D 0){
switch(n){
case 1:
serialmouse(atoi(field[0]+6), 0, 1);
break;
case 2:
serialmouse(atoi(field[1]), 0, 0);
break;
case 3:
default:
serialmouse(atoi(field[1]), field[2], 0);
break;
}
}
/* JDC */
else if (!strcmp(field[0], "speed") && n =3D=3D 2)
{
mouse_speed =3D atoi(field[1]);
if (mouse_speed < 1)
mouse_speed =3D 1;
}
=09
else
error(Ebadctl);
}
Borja.
--
*******************************************************************
Borja Marcos | Preferred: bor...@we.lc.ehu.es
Alangoeta, 11, 1. izq. | Others: borj...@mx.sarenet.es
48990 - Algorta (Vizcaya) | 10001...@compuserve.com
SPAIN | CIS: 100015,3502
******************************************************************
(c)1995 by the author.
This message cannot be transferred to the Microsoft(tm) Network.
I should be releasing Quake on Plan 9 shortly after the dos =
release (whenever that happens).
It will probably require some kernel hacks for proper control, =
though.
John Carmack
I'm pretty proud of releasing the wolfenstein source, even if it =
is crappy old 16 bit code.
Yes, I will be pushing to release the DOOM source after Quake has =
taken over the world.
In any case, most of the gameplay of Quake is written in an =
interpreted language, which is included in text form with the =
release.
(straying fairly far from plan9 here)
John Carmack