R6 code is currently under review... Should be finished in the about a week or two.jbansk wrote:QUOTE (jbansk @ Oct 14 2010, 09:59 PM) Bard...? Any answer would be appreciated.
x52 and x52 pro saitek joysticks do not work in r5.
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
The "review" "should" be done in a week or two.....pkk wrote:QUOTE (pkk @ Oct 14 2010, 05:08 PM) R6 code is currently under review... Should be finished in the about a week or two.
And then how long until it's released?
[15:25] <BBT_> oh, so da vinci's mona lisa isn't his work?
[15:25] <+fuh-zz> No, he simply put effort into it.
[15:25] <BBT_> are you really that retarded?
[15:25] <+fuh-zz> No, he simply put effort into it.
[15:25] <BBT_> are you really that retarded?
This is an Autohotkey script and supporting dlls that allows much more programmability of the Saitek X52 than the software provided by Saitek, and in the meantime also works around the issues R5 has with the X52.
*update*
The .dll that gets raw data from the X52 seems to have some issues on X64 systems. I will look into that. In the meantime, I've posted X52AllegianceThrottleMapNoX52DLL-Release.ahk to the share linked below. This does not make use of the X52 dll that was causing problems, but also does not allow data about the mouse stick or the scroll wheel to be collected.
*update 2*
After more testing, I've discovered that you get better utility by allowing SST to send keystrokes for some of the axes, rather than trying to do this myself. This means that the mode switch isn't available to the autohotkey script, but it does simplify the setup procedure. I probably could just use the X52AllegianceThrottleMapNoX52DLL-Release.ahk script, but I spent too much time working out the DLL to not use it anymore.
This script implements the following features:
- Joystick button press at throttle full forward
- Joystick button press at throttle full back
- POV hat up mapped to PPJoy POV
- All other buttons on the X52 mapped straight to PPJoy button presses except the Mode Switch, Wheel Up, Wheel Down and Wheel Click
For the throttle full forward and back button press feature, this script remaps the throttle axis so that 0% is at the idle detent and 100% is at the afterburner detent. Moving the throttle to the full forward position will cause a joystick button press to register, as will moving the throttle to the full back position.
In the script comments, there are examples of a dual stage trigger button press de-coupler. This causes button 1 to stop being pressed when the trigger is fully depressed. Additionally, there is a timer so that button 1 has to be held for 250 ms before the button press registers. This is to enables the second stage trigger press to be registered without registering the first stage trigger press.
This script makes use of a DLL that is very specific to the X52. This DLL could be easily adapted to work with other USB joysticks, so the source code is also attached. This DLL is heavily derived from the HClient sample program in the Window Device Driver Kit, and might be useful to people looking for examples of how to work with HID reports.
This script also makes use of a PPJoy.dll that enables multiple PPJoy virtual joysticks to be used within the same script. This was originally because the X52 has more than 32 buttons to press, and I wanted to use more than one virtual joystick to contain them all. However, multiple PPJoy joysticks turned out not to be supported by Allegiance, so the usefulness of this might not be obvious in the script. Nevertheless, the source for this is also included in case anybody finds that useful as well.
The PPJoy.dll was adapted from the one published by ninjabob7 on the autohotkey.com forums here:
http://www.autohotkey.com/forum/topic52913...highlight=ppjoy
Download:
http://cid-51fc5ec244cdf7f3.skydrive.live....4CDF7F3!144
Installation:
1. Install autohotkey (http://www.autohotkey.com/)
2. Install PPJoy (http://rapidshare.com/#!download|118tl3 ... e.exe|2173)
3. Configure PPJoy Joystick
3.1 Goto "Start|All Programs|PPJoy Joystick Driver", and click on "Configure Joysticks"
3.2 In the Joystick Configuration Utility, click "Add"
3.3 Select "Controller 1" and click Add
3.4 Select "PPJoy Virtual Joystick 1" and click "Mapping"
3.5 Select the "Modify the mapping ..." radio button and click "Next"
3.6. Set the controller to "4 Axes, 32 buttons, 1 POV hat"
3.7 Map Axis 1 to X Axis; Axis 2 to Y Axis; Axis 3 to Throttle; and Axis 4 to rudder
3.8 Click "next"
3.9 Map X Axis to Analog 0; Y Axis to Analog 1; Throttle to Analog 2; Rudder to Analog 3
3.10 click "next"
3.11 click "next" again to get to mappings for buttons 17-32
3.12 map "Button N" to "Digital N-1" for buttons 17-32
3.13 click "next"
3.14 eat pie
3.15 map North to Digital 32; East to Digital 33; West to Digital 34; South to Digital 35
Step 4 was made obsolete when I stopped trying to capture the mini-stick, mode, and wheel turns myself
4. Replace Saitek HID driver with Microsoft generic driver
4.0 Make certain X52 is plugged in
4.1 Open device manager
4.2 Expand "Human Interface Devices" section
4.3 Right click on Saitek Device, select "properties"
4.4 On HID-compliant game controller Properties dialog, go to the "Driver" tab, and click "Update Driver"
4.5 On "Update Driver Software" dialog, click "Browse computer ..."
4.6 On "Update Driver Software" dialog, click "Let me pick ..."
4.7 On "Update Driver Software" dialog, select "HID-compliant game controller", then click "next"
5. Unzip "X52AllegianceThrottleMap" to a convenient directory
6. Run "X52AllegianceThrottleMap+SST-Release.ahk"
7. Do any SST programming you might want for the rotaries, slider, mini-stick and the wheel
8. Enjoy using your X52 in Alleg
*update*
The .dll that gets raw data from the X52 seems to have some issues on X64 systems. I will look into that. In the meantime, I've posted X52AllegianceThrottleMapNoX52DLL-Release.ahk to the share linked below. This does not make use of the X52 dll that was causing problems, but also does not allow data about the mouse stick or the scroll wheel to be collected.
*update 2*
After more testing, I've discovered that you get better utility by allowing SST to send keystrokes for some of the axes, rather than trying to do this myself. This means that the mode switch isn't available to the autohotkey script, but it does simplify the setup procedure. I probably could just use the X52AllegianceThrottleMapNoX52DLL-Release.ahk script, but I spent too much time working out the DLL to not use it anymore.
This script implements the following features:
- Joystick button press at throttle full forward
- Joystick button press at throttle full back
- POV hat up mapped to PPJoy POV
- All other buttons on the X52 mapped straight to PPJoy button presses except the Mode Switch, Wheel Up, Wheel Down and Wheel Click
For the throttle full forward and back button press feature, this script remaps the throttle axis so that 0% is at the idle detent and 100% is at the afterburner detent. Moving the throttle to the full forward position will cause a joystick button press to register, as will moving the throttle to the full back position.
In the script comments, there are examples of a dual stage trigger button press de-coupler. This causes button 1 to stop being pressed when the trigger is fully depressed. Additionally, there is a timer so that button 1 has to be held for 250 ms before the button press registers. This is to enables the second stage trigger press to be registered without registering the first stage trigger press.
This script makes use of a DLL that is very specific to the X52. This DLL could be easily adapted to work with other USB joysticks, so the source code is also attached. This DLL is heavily derived from the HClient sample program in the Window Device Driver Kit, and might be useful to people looking for examples of how to work with HID reports.
This script also makes use of a PPJoy.dll that enables multiple PPJoy virtual joysticks to be used within the same script. This was originally because the X52 has more than 32 buttons to press, and I wanted to use more than one virtual joystick to contain them all. However, multiple PPJoy joysticks turned out not to be supported by Allegiance, so the usefulness of this might not be obvious in the script. Nevertheless, the source for this is also included in case anybody finds that useful as well.
The PPJoy.dll was adapted from the one published by ninjabob7 on the autohotkey.com forums here:
http://www.autohotkey.com/forum/topic52913...highlight=ppjoy
Download:
http://cid-51fc5ec244cdf7f3.skydrive.live....4CDF7F3!144
Installation:
1. Install autohotkey (http://www.autohotkey.com/)
2. Install PPJoy (http://rapidshare.com/#!download|118tl3 ... e.exe|2173)
3. Configure PPJoy Joystick
3.1 Goto "Start|All Programs|PPJoy Joystick Driver", and click on "Configure Joysticks"
3.2 In the Joystick Configuration Utility, click "Add"
3.3 Select "Controller 1" and click Add
3.4 Select "PPJoy Virtual Joystick 1" and click "Mapping"
3.5 Select the "Modify the mapping ..." radio button and click "Next"
3.6. Set the controller to "4 Axes, 32 buttons, 1 POV hat"
3.7 Map Axis 1 to X Axis; Axis 2 to Y Axis; Axis 3 to Throttle; and Axis 4 to rudder
3.8 Click "next"
3.9 Map X Axis to Analog 0; Y Axis to Analog 1; Throttle to Analog 2; Rudder to Analog 3
3.10 click "next"
3.11 click "next" again to get to mappings for buttons 17-32
3.12 map "Button N" to "Digital N-1" for buttons 17-32
3.13 click "next"
3.14 eat pie
3.15 map North to Digital 32; East to Digital 33; West to Digital 34; South to Digital 35
Step 4 was made obsolete when I stopped trying to capture the mini-stick, mode, and wheel turns myself
4. Replace Saitek HID driver with Microsoft generic driver
4.0 Make certain X52 is plugged in
4.1 Open device manager
4.2 Expand "Human Interface Devices" section
4.3 Right click on Saitek Device, select "properties"
4.4 On HID-compliant game controller Properties dialog, go to the "Driver" tab, and click "Update Driver"
4.5 On "Update Driver Software" dialog, click "Browse computer ..."
4.6 On "Update Driver Software" dialog, click "Let me pick ..."
4.7 On "Update Driver Software" dialog, select "HID-compliant game controller", then click "next"
5. Unzip "X52AllegianceThrottleMap" to a convenient directory
6. Run "X52AllegianceThrottleMap+SST-Release.ahk"
7. Do any SST programming you might want for the rotaries, slider, mini-stick and the wheel
8. Enjoy using your X52 in Alleg
Last edited by Wanderer on Fri Feb 25, 2011 9:42 pm, edited 1 time in total.
-
- Posts: 2013
- Joined: Fri Jun 27, 2003 7:00 am
- Location: Contact me regarding: CC, Slayer and AllegWiki.
I tried this under Windows 64... after putting it into test mode, the PPJoy driver installed fine. However upon running the script, I get a constant stream of '-'s and the virtual joxis doesn't work under game controller panel (no axis movement etc). Have you encountered anything like this?
Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.
Just hoping against hope: the constant stream of '-' could indicate that the slider is positioned at the minimum. Did you try moving the slider or commenting out the slider portion of the script?Spunkmeyer wrote:QUOTE (Spunkmeyer @ Feb 3 2011, 12:34 AM) I tried this under Windows 64... constant stream of '-'s
Again with the hope: When you say the axes show no movement in the game controller panel, are you looking at the virtual joystick or the X52?
I don't have access to a x64 system, so I can't test this out there. I can imagine several places in the flow of data where x64 could cause some problems (e.g., getting the data from the USB, packing the data into the structure that is sent to the script, sending the data to PPJoy, and whatever PPJoy does with it).
I've added a script I used for testing called X52GetDataTest.ahk to the shared folder I originally posted. Put that in the same directory as the X52ReportViewer.dll, run it, and see if data is showing up in the GUI created by the script.
Sorry things didn't go as smoothly as I hoped they would. Software development, like second marriages, seems to be a constant stream of hope trumping experience.
Last edited by Wanderer on Thu Feb 03, 2011 7:37 am, edited 1 time in total.
-
- Posts: 2013
- Joined: Fri Jun 27, 2003 7:00 am
- Location: Contact me regarding: CC, Slayer and AllegWiki.
I've moved the slider, throttle etc. I'm looking at the panel for PP joystick device 1. X52 panel stops working when I switch from Saitek to generic HID driver, as expected. There is a second entry for Saitek under Device Manager marked USB instead of HID, I tried moving that to a generic USB device driver too, no effect either way.
The GUI shows all zeros. This is Windows 7 64 bit btw.
Yeah I understand there could be a lot of points where it could be going awry. No problem, there are a lot of X52 owners out there with 32 bit systems who'll love this, thanks for doing it. Me, I can wait for R6.
The GUI shows all zeros. This is Windows 7 64 bit btw.
Yeah I understand there could be a lot of points where it could be going awry. No problem, there are a lot of X52 owners out there with 32 bit systems who'll love this, thanks for doing it. Me, I can wait for R6.
Want bigger games? Log on to play at the official game time: 9pmET/8pmCT/7pmMT/6pmPT every day of the week. Also Saturdays 8pm UTC.
Well, poo. That indicates it's the X52Reportviewer.dll.Spunkmeyer wrote:QUOTE (Spunkmeyer @ Feb 3 2011, 09:01 AM) The GUI shows all zeros. This is Windows 7 64 bit btw.
One other thing to consider - are you using an X52 or an X52 pro?
If you aren't using the X52 pro, I'll see about subverting some corporate resources to see if I can find a fix.
If you are using an X52 pro, I've likely made some invalid assumptions about how the buttons are working. I have an idea where the problem could be, if that is the case. If you are using an X52 pro, would you be willing to test what I think the fix could be?
In the meantime, I can put together something that will work that doesn't rely on that DLL. You'll lose the mouse stick and the scroll wheel, but everything else should still work.
-
- Posts: 2013
- Joined: Fri Jun 27, 2003 7:00 am
- Location: Contact me regarding: CC, Slayer and AllegWiki.
I've posted a new AHK script to http://cid-51fc5ec244cdf7f3.skydrive.live....4CDF7F3!144.
The script X52AllegianceThrottleMapNoX52DLL-Release.ahk does not rely on the X52ReportViewer.dll which does not seem to work on X64 systems. I don't know if the PPJoy.dll is going to work any better, but I hope it will.
This script does not enable the mouse stick or the scroll wheel, but everything else should work, if the PPJoy.dll does.
Any feedback would be appreciated.
The script X52AllegianceThrottleMapNoX52DLL-Release.ahk does not rely on the X52ReportViewer.dll which does not seem to work on X64 systems. I don't know if the PPJoy.dll is going to work any better, but I hope it will.
This script does not enable the mouse stick or the scroll wheel, but everything else should work, if the PPJoy.dll does.
Any feedback would be appreciated.