Jump to content

Thrustmaster Combined Full DX Mapping (extending the 32 DX buttons limit)


Recommended Posts

Hi all,

Since I created a new "all in one" profile based on the "DX extension" hack, I decided to use (reuse) this old topic to present it.

Presentation

Since TARGET 3.0.23.1205_rev1 Thrustmaster finally implemented its "Thustmaster Combined" virtual device with 120 HID buttons (DX buttons) out of the box, making the "Extend DX Module" of this script set de facto obselet on its historical core intent since you can now natively assign up to 120 DX buttons either from TARGET Script Editor or TARGET GUI

Combined Full DX is a script suite for Thrustmaster TARGET Script Editor which maps HID buttons (DX buttons) only. Instead of mapping the devices with emulated key strokes - which are all game or simulation module specific - this script only use HID buttons (DX buttons) to emulate a new virtual device with more of assignable buttons.

With such approach, there is no more need to load a specific mapping script each time you switch to another game or simulation module, you only need to load this one once for all. Since the combined device is seen as normal joystick/HOTAS (but with a lot of buttons), you can assign each button to the desired command within the game, each game will have its specific mapping for the same combied device.

Download & Usage

  1. Download the script suit from the DCS files sections : https://www.digitalcombatsimulator.com/fr/files/3318341/
  2. Extract the TM Combined Full DX folder where you usualy store your TARGET profiles files, or anywhere you want.
  3. Launch the TARGET Script Editor software (NOT TARGET GUI)
  4. In TARGET Script Editor, click the "Menu" button then select Open (Ctrl + O)
  5. Browse to find the run_complex.tmc or run_simple.tmc file within the TM Combined Full DX folder.
  6. Click the RUN button (big green triangle icon)

Download Page

Presets

There are three .tmc script files corresponding to three mapping presets, "simple", "hybrid" and "complex" to be used according your preferences. A fourth "custom" .tmc files is avaible to let you create your own custom preset. See the "CUSTOMIZATION" section below for more information about customization.

  • The "Simple" Preset: Only translate hardware buttons with Middle and Off switches positions
  • The "Complex" Preset: Enable S3 I/O mode for Hat1, Digital Axes buttons, Long-Press buttons and advanced AP button and LASTES switch behavior.
  • The "Curstom" Preset: Is here to allow you to create your own custom setup by editing its content, you also can duplicate this file to create several custom setups.

Graphical Charts

Notice that you will find high resolution printable version of these charts within the script suite folder.

TM_Combined_Full_DX_Chart_Warthog.png TM_Combined_Full_DX_Chart_ViperTQS.png


FAQ

The script compile but crash with "Runtime Error: Symbol not found: DX33 [...]"

This is because you run the Script on an outdated version of TARGET Script Editor, you need to install the latest version (3.0.23 or above) to properly run the script: https://support.thrustmaster.com/en/product/hotaswarthog-en/

I have compile error related to A320 device when I try to run the script

Same as above.

How is it possible to have more than 32 DX buttons ?

On the paper, Thrustmaster TARGET allow to emulate only up to 32 DX buttons. This limit is inherited from the old DirectInput API, however it does not reflect a true software or hardware limit anymore. Fortunately Thrustmaster does not took this old convension too seriously and developpers implemented the TARGET driver to allow to emulate a game device with up to 120 buttons and a 8-positions HAT.

By bypassing the proper initialization function within the script, we are able to create a virtual device with the desired amount of HID buttons (up to 120). Then, by completing the defined DX## macros list with the proper integer values, we can assign an extended list of DX buttons within the mapping functions.

Is this harmful for devices or system ?

Definitely not. The bigger risk is a BSOD in the case you try to use a virtual device with more than 120 buttons. In this case, due to an hard-coded array size within the driver the script will reach for an out of bound index which instantly crash the driver. Even in this case, the only consequence is a need  for system reboot.

Is this script can be used with other devices than HOTAS Warthog ?

As long as the devices are recognized by TARGET Script Editor, Yes. Currently only HOTAS Warthog mapping is done, but any other TARGET compatible combination can be made with the proper mapping functions. See the "Customization" section for more details.

Customization

The script is intented to be modular, so people can edit, add or remove the devices mapping of their choice to adapt the basis with their own devices.

Custom Preset

The file "run_custom.tmc" is intended to be modified to create your own specific preset if the three existing ones does not fit your needs. Each ".tmc" file declares general mapping options to enable or disable features and special behaviors such as buttons long-press, S3 I/O mode, Digital Axes, etc..

The file has comments (in green) that describe each parameter and will help you to edit features as your needs.

Custom Mapping (Advanced)

The mapping for devices are implemented within a dedicated per-device mapping function defined in Mapping Header *.tmh files located within the mapping folder of the script suite. You can edit the existing mapping functions ore create your own new mapping function for a device following instructions in the 'mapping\MapExample.tmh' file, then integrating it in the script set by following instructions and editing the 'headers\CommonInit.tmh' file.

"Hack" details

Since TARGET 3.0.23.1205_rev1 Thrustmaster finally implemented its "Thustmaster Combined" virtual device with 120 HID buttons (DX buttons) out of the box, making this "hack" de facto obselet since you can now natively assign up to 120 DX buttons either from TARGET Script Editor or TARGET GUI. You will find below the historical explanation as it were 'implemented' before the release of TARGET 3.0.23.1205_rev1 .

The "hack" is pretty straightforward to do for anybody have some coding experience. To create the "virtual device" (Thrustmaster Combined) the native init() function defined within the target.tmh call another function, PlugGame(), which take two arguments, the first is a stGameCfg structure that describe the virtual device to create, the second is the name of the device to create. The hack consist on editing or replacing the parameteres of this stGameCfg structure.

Here is how the structure is defined within the hid.tmh file ( at line 307 ) :

struct stGameCfg
{
	byte ButtonsNumber;
	byte HatPresent;		//hat present or not [1/0]
	byte AxisX;				//axis present or not [1/0]
	byte AxisY;
	byte AxisZ;
	byte AxisRx;
	byte AxisRy;
	byte AxisRz;
	byte AxisThrottle;
	byte AxisSlider1;
	byte AxisSlider2;
	byte AxisSlider3;
	byte AxisSlider4;
}

As you can see, the first member is a byte that define the count of buttons. This is precisely what wa have to edit. Now here is where the structure is defined within the target.tmh file (at line 180):

stGameCfg virtualj = { 32, 1,  1,  1,  1,  1,  1,  1,    1,   1,   0,   0,   0};

You can see the virtualj object (which is of stGameCfg type) is defined once and for all with 32 buttons. Now look at the Init() function you will find the call to PlugGame() function (at line 197):

if(cfg & CREATE_JOYSTICK) PlugGame(&virtualj, "Thrustmaster Combined");	// create a Virtual device

Now, to extend the count of button of the virtual device to be created, you simply have to modify the virtualj object before the initial call to the Init() function within your mapping script. One solution is to directly edit the target.tmh file, by replacing the "32" by any number but this is not a good practice.

Notice: DO NOT try a value greater than 120. I tested for you, it seem there is an hard-coded limit, a value greater than 120 crash the driver resulting in a BSOD.

You can instead simply modify the virtualj first member value juste before the call to the Init() function within your main() function:

int main()
{
  virtualj.ButtonsNumber = 120; //< Change virtual device param
  
  if(Init(&EventHandle, CREATE_JOYSTICK))
    return 1;
  
  // code continue here...

That was the first stage. Now that you have a virtual device with 120 buttons, you want to be able to map it, however, the default TARGET header declares only 32 DX buttons. Fortunately, this declaration is open source within the defines.tmh (begining at line 763) and very easy to extend:

define DX1			3000				
define DX2			3001
define DX3			3002
// [...]
define DX29			3028
define DX30			3029
define DX31			3030
define DX32			3031

// guess what come after 3031...

So you simply have to declare new macros (in C sens) named how you want (for example DX32 to DX120), with values from 3031 to 3119. Again, you can add the declarations within the defines.tmh file but it is better to declare them in one of your own mapping script to avoid alterating Thrustmaster original files.

define DX33         3032
define DX34         3033
define DX35         3034
define DX36         3035
define DX37         3036
// ... 
define DX118        3117
define DX119        3118
define DX120        3119

Edited by sedenion
Edit for 2.5 Release
  • Like 6
  • Thanks 4
Link to comment
Share on other sites

Very, very cool.

 

+rep inbound

ASUS ROG Maximus VIII Hero, i7-6700K, Noctua NH-D14 Cooler, Crucial 32GB DDR4 2133, Samsung 950 Pro NVMe 256GB, Samsung EVO 250GB & 500GB SSD, 2TB Caviar Black, Zotac GTX 1080 AMP! Extreme 8GB, Corsair HX1000i, Phillips BDM4065UC 40" 4k monitor, VX2258 TouchScreen, TIR 5 w/ProClip, TM Warthog, VKB Gladiator Pro, Saitek X56, et. al., MFG Crosswind Pedals #1199, VolairSim Pit, Rift CV1 :thumbup:

Link to comment
Share on other sites

Excellent

 

Sent from my A210 using Tapatalk

Check Six!!!_:gun_sniper:_:pilotfly:

||R7-2700X||ASUS ROG STRIX-X470F Gaming||GSKILL-TridentZRGB 16GBDDR4 3200C14||CORSAIR RM 1000X||SAPPHIRE RX 7900 XTX 24GB OC||WARTHOG HOTAS||:gun_smilie:

Link to comment
Share on other sites

  • 2 weeks later...

Hi Sedenion,

 

great mod with a straight forward approach. :thumbup:

 

Unfortunately I can't make it work. During compilation it bails out with error:

"Compile Error:Symbol not found: TBTN1 in targetdx128.tmh at line 867"

 

That line reads:

int TWCSThrottleMap[] = {TBTN1, DX1, TBTN2, DX2, TBTN3, DX3, TBTN4, DX4, TBTN5, DX5};

 

The same .tmc/.tmh runs with no errors when using the original target.tmh.

 

As I only have a Warthog (stick & throttle) connected, even an exclude

"Configure(&TWCSThrottle, MODE_EXCLUDED);"

does not help - If this still should be neccessary.

 

A compare with notepad++ shows the only differences you just mentioned:

DXBTCOUNT, new device name and the new defines for the DX-buttons.

 

I'm kinda clueless here...:cry:

Any idea?

Link to comment
Share on other sites

Hack for TM Warthog with 120 programmable DX buttons

 

I'm still digging on this issue but have no clue what the problem could be. Even a minimum tmc fails to compile with the error above.

 

I'd like to know if others were more successfull with this hack.


Edited by RightStuff
many typos corrected
Link to comment
Share on other sites

I'm still digging on this issue baut have no clue what the problem cound be. Even a minimum tmc fails to compile with the error above.

 

I'd like to know if others mere more successfull with this hack.

 

I got same error...I found that there was few duplicates (see picture) but even I removed them I did get those errors...prolly Sedenion original target.tmh file is different than mine.

 

So I made my own version where I edited those buttons to defines.tmh and saved it as definesdx128.tmh. I have only tested one button (DX56) with this so can't be sure does this work any better than Sedenions..:). But DCS understood that DX56 when I entered to edit game buttons..also TM Device Analyzer show 120 buttons.

 

I'm still not sure do I use this mod in future but it looks interesting.

DX120_duplicate_definitions.JPG.ced97a263ad1d92900cbb3be7402f06d.JPG

targetdx128_by_iku.zip

  • Thanks 1

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Sedenion original target.tmh file is different than mine.

On my first try I also saw many differences - then I realized, that there was an update for TARGET available and the new diff only shows the defines for the new DX-buttons.

 

Update available under "Software":

https://support.thrustmaster.com/en/product/hotaswarthog-en/

 

Edit:

Jup... Just checked your targetdx.tmh. You're using an old version of TARGET. Though the many differences.


Edited by RightStuff
Link to comment
Share on other sites

Ok..my problem was that old version of TARGET. After I installed latest version I didn't get any errors with Sedenion file..:)

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Nice to hear. :)

After kicking out the devices I don't own, the compiler errors disappeared.

Not the best solution, but I can live with it...

 

Ok..I always kick out devices that I don't own so that's why I didn't get errors...

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Just tested this by making tmc file which have about 116 dx buttons.

 

>>But when I started game and was trying to assign buttons I got weird problem...I had assinged button as DX51 but game recognized it as DX32....and the button that I was assigned as DX32 has same..so seems that it can mix up things.

This error was due the fact that I had TM Device Analyzer at background when I was trying to conf dx buttons at DCS...now I tested without it and all seems to work fine...

 

Now I need to think do I need this or not...

 

I attached my dx button profile...

DCS_Iku_DX_Buttons.zip


Edited by Iku64

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

  • 1 month later...

Seems it does not work for all games.

Star Citizen, for instance, only recon up to button 50. If I try to map a button higher than that, I'm unable to assign this button to any in game function...

Favorite modules : Huey, F-86F, F14 and P-51D

Quest 2, RTX 3080, i7 10700K, 16 Gb of RAM, Pro Flight Trainer PUMA helicopter setup, Warthog HOTAS with two force sensitive stick, custom cockpit and a GS-Cobra dynamic seat.

Link to comment
Share on other sites

The 32 button limit is the main reason I stopped using Target. Fortunately the scripting available in DCS World aircraft controls generally allows me to get the results I want. However many games don't have such a capability and I have to choose between scripting flexibility with a 32 button limit or no scripting and all buttons available as DX buttons.

 

The option to use Target's Combined mode AND have many more DX buttons available sounds great. But at this point, I am too lazy to even try this mod since I have got just about everything working exactly the way I want it in DCS World.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • 1 year later...

Still using this, i'm almost running out of binds now, i'm at 109.

 

 

Found a typo in the definitions that causes one button to not work:

 

 

 

 

define DX75 3074

define DX76 3075

define DX77 3076

define DX78 3076

define DX79 3078

define DX80 3079

 

 

I assume that is supposed to be 3077 :thumbup:

Fighting for peace is like screwing for virginity.

Link to comment
Share on other sites

How this works?

1-32 atick

33-64 throttle

65-91 mfd1

92-118 mfd2

Correct?

Or i am missing something?

🖥️ R7-5800X3D 64GB RTX-4090 LG-38GN950  🥽  Valve Index 🕹️ VPForce Rhino FFB, Virpil F-14 (VFX) Grip, Virpil Alpha Grip, Virpil CM3 Throttle + Control Panel 2, Winwing Orion (Skywalker) Pedals, Razer Tartarus V2 💺SpeedMaster Flight Seat, JetSeat

CVW-17_Profile_Background_VF-103.png

Link to comment
Share on other sites

How this works?

1-32 atick

33-64 throttle

65-91 mfd1

92-118 mfd2

Correct?

Or i am missing something?

 

 

I don't understand the question. You can map all of the DX buttons to any button in the script. You can make a single trigger press push 120 buttons if you want to.

Fighting for peace is like screwing for virginity.

Link to comment
Share on other sites

I don't understand the question. You can map all of the DX buttons to any button in the script. You can make a single trigger press push 120 buttons if you want to.
So i have hotas warthog and the mfds...

I tought that this hack assigned automatically dx 1-19 to joystick 20-52 to throttle and so on....

So just to make clear to me...using it i can assign for example dx 60 to an mfd button and dcs will see it?

I am asking because as far as i know dx devices can have 32 buttons + a pov hat at maximi...

Thanks

🖥️ R7-5800X3D 64GB RTX-4090 LG-38GN950  🥽  Valve Index 🕹️ VPForce Rhino FFB, Virpil F-14 (VFX) Grip, Virpil Alpha Grip, Virpil CM3 Throttle + Control Panel 2, Winwing Orion (Skywalker) Pedals, Razer Tartarus V2 💺SpeedMaster Flight Seat, JetSeat

CVW-17_Profile_Background_VF-103.png

Link to comment
Share on other sites

After kicking out the devices I don't own, the compiler errors disappeared.

 

 

How do I kick out the devices I don't own?

I only want to map my TM Throttle.

How do I change the script in targetdx128.tmh so that it only uses the TM Throttle. At the moment I am getting a lot of devices failing to initialize.


Edited by speedbird5
Link to comment
Share on other sites

So i have hotas warthog and the mfds...

I tought that this hack assigned automatically dx 1-19 to joystick 20-52 to throttle and so on....

So just to make clear to me...using it i can assign for example dx 60 to an mfd button and dcs will see it?

I am asking because as far as i know dx devices can have 32 buttons + a pov hat at maximi...

Thanks

 

 

Yeah, this file will bypass that 32 button limit. You can assign any button anywhere you like, or even all of them to a single button. I have over 100 buttons bound on my throttle.

Fighting for peace is like screwing for virginity.

Link to comment
Share on other sites

Yeah, this file will bypass that 32 button limit. You can assign any button anywhere you like, or even all of them to a single button. I have over 100 buttons bound on my throttle.

 

 

 

Will this allow more than 8 axis too? That’s my big problem with the TARGET software

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

  • 3 weeks later...
  • 9 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...