|
Re: Negative numbers?
The joystick inputs are of type unsigned char. Trying to do arithmetic with them that yields negative results (e.g. p1_x - 127 when p1_x is less than 127) is just asking for things to blow up.
I get around the problem by reading the joystick input values into a temporary int first, and do all the computations with that.
|