View Single Post
Old November 24th, 2007   #130 (permalink)
ChickenLiver
LilyPad Author
 
Join Date: Apr 2006
Location: Perdition
Posts: 532
Another day, another release. Version 0.8.4 released. It fixes the Silent Hill 4 issue. Also added support for a PS2 pad command that looks like it's supposed to make a pad exit DS2 native mode, or at least Silent Hill 4 seems to think it is. The -1 when pressing the up button is also fixed. Very urgent, that .

edit: Hmm...Just noticed the times between my release dates are following the Fibonacci sequence...18, 19, 20, 22, 25... I'm not sure just what this means.

cottonvibes:
The -1 when up is pressed is a bug in my display code (No effect when in game, but now fixed anyways ). POV objects give a value from 0 to 36000 when they're pressed, which is just 100 times the angle, in degress. Also return either 65535 or -1 when up, depending on how well the drivers adhere to the spec. Despite all the digits, a lot of pov controls only return one of 8 values (straight in one direction, or diagonal).

I actually don't keep track of right and left separately. I keep track of one value each for the 6 axes...2 for the d-pad and 2 more for each stick. Right/down is positive, left/up is negative (Or vice-versa on up/down. Can't remember). Once everything is summed up, for each pair, I check if either value is above/below 256/-256 (Which correspond to fully left/right). If so, I normalize the axis values so the larger's absolute value is 256, so, for example, if one axis is -512 and the other is 256, I convert them to -256 and 128. This doesn't happen often (Unless you're using a mouse), but it's useful in conjunction with the mode lock button...Or if you have multiple controls bound to one button.

I have to return just up or down for the digital buttons, but for the sticks and in full analog mode, the wider range is useful.

And your first gamepad is indeed not calibrated perfectly - that's pretty odd. Off by a constant factor of 8992/9000.

Last edited by ChickenLiver; November 26th, 2007 at 04:40. Reason: Massive global Fibonacci conspiracy
ChickenLiver is offline   Reply With Quote