[aquaria] joystick support

Mathias Panzenböck grosser.meister.morti at gmx.net
Sat Apr 23 16:01:11 EDT 2011


PS: About leftMotor/rightMotor/strong_magnitude/weak_magnitude:
I looked into the xpad driver[1] an it seems like the left motor is "strong" and the right motor is 
"weak". So I assigned the values like this and tested how it feels.

I think the only place where leftMotor gets another value than rightMotor is in water currents. 
Using this:

	effect.u.rumble.strong_magnitude = (uint16_t) (leftMotor * 0xffff);
	effect.u.rumble.weak_magnitude = (uint16_t) (rightMotor * 0xffff);

I get a strong rumble effect in currents that flow from left to right and a weak effect in currents 
that flow from right to left. I think that does not "feel" right. I seems like you can't simulate 
motion (ab)using the rumble effect. So I guess I should just do this?

	if (leftMotor > rightMotor) {
		effect.u.rumble.strong_magnitude = (uint16_t) (leftMotor * 0xffff);
		effect.u.rumble.weak_magnitude = (uint16_t) (rightMotor * 0xffff);
	}
	else {
		effect.u.rumble.strong_magnitude = (uint16_t) (rightMotor * 0xffff);
		effect.u.rumble.weak_magnitude = (uint16_t) (leftMotor * 0xffff);
	}

This makes the water currents feel "fair" but is it like Bit Blot intended? What do you think?

	-panzi

[1] https://github.com/mirrors/linux-2.6/blob/master/drivers/input/joystick/xpad.c#L622


More information about the aquaria mailing list