// copyright 2008 Joel Clemens - free to distribute on condition of keeping my name here //1024x768 resolution in q3a tests was measured to 1024 Y(vertical) mickys and //2048 horizontal mickys //ration 2048 mickies per 360degrees (5.6888888888888888888888888888889) pie.FrameRate = 70 //maximum framerate without everything screwing up.. //probably has something to do with the sixaxis datarate //calibration indicator (light turns on when yaw is successfully calibrated if abs(sixaxis.Yaw) >1 sixaxis.led1 = 0 else sixaxis.Led1 = 1 endif //calibration - set controller still on flat, LEVEL surface, and press circle btn If sixaxis.circle sixaxis.RawGyroZero = smooth(sixaxis.RawGyro) sixaxis.yaw = 0 var.rolloffset = smooth(RemoveUnits(sixaxis.smoothroll) , 5)/90 var.pitchoffset = smooth(RemoveUnits(sixaxis.smoothpitch) , 5)/-90 var.pressed = 1 endif //only excecuted if calibrated and button is not being pressed //this is what actually reads the data from sixaxis if (var.pressed) & (sixaxis.Circle = 0) //mouse.DirectInputY = (smooth(RemoveUnits(sixaxis.smoothPitch*-568) , 5))/100 mouse.DirectInputX = (RemoveUnits(sixaxis.yaw*568))/100 endif //this is used as a test to see if jitter is caused by joystick or game engine //the roll data is being mapped onto the x axis of virtual joystick to a maximum of 90degrees ppjoy.Analog0 = smooth(RemoveUnits(sixaxis.smoothroll) , 5)/90 -var.rolloffset ppjoy.Analog1 = smooth(RemoveUnits(sixaxis.smoothpitch) , 5)/-90 -var.pitchoffset ppjoy.Analog2 = sixaxis.Joy2x //left/right ppjoy.Analog3 = sixaxis.Joy2y //forward/backward //ppjoy.Analog1 = smooth(mouse.WheelDown, 15) + - smooth(mouse.Wheelup, 15) debug = ""+ppjoy.Analog0+' '+ppjoy.Analog1