NoGripRacing.com

Go Back   NoGripRacing Forums > PC Racing > Rally Trophy

Reply
 
Thread Tools
Old 29 January 14, 21:37   #1
fk__
 
Join Date: Jan 2014
Default So I fixed that controls settings problem on Vista+.

Since they say an image is worth a thousand words, have a screen shot:



Yep, it's a working replacement for the original controller configuration dialog that went missing in Windows Vista. It's very plain and rather less black-and-green (IIRC) than the real thing, but it gets the job done. I tested it with a wireless XBox 360 pad and a Microsoft Sidewinder Precision 2 joystick (and at the same time) in addition to the keyboard, but it should work just as well for any DirectInput controller.

As a bonus, it should in theory work just as well for any other programs that suffer from this problem.

Download
http://www.nogripracing.com/details.php?filenr=41294

Quick installation instructions:
1. Copy the included dinput8.dll and dimap.dll into your Rally Trophy installation directory (next to RallyTrophy.exe).
2. Run the included vcredist_x86.exe to install the necessary Visual C++ redistributable bits.

The source code can be found at https://bitbucket.org/fk/rt-vista-controls-fix, released under the terms of the LGPL 2.1 or later.

Other games
While this patch was originally developed for Rally Trophy, it might be applicable to other games (or any programs) that have the same problem. This is a list of games that have been tested with the patch:
  • Juiced - works with 1.4
  • Rally Championship Xtreme - should work with 1.4

This list is not exhaustive; if you know of any other games that share this particular issue, just try them with this patch and report your findings in this thread.

Boring technical details

Basically, the issue is that Rally Trophy uses a controls settings dialog supplied by DirectInput, using the `IDirectInput8::ConfigureDevices` method. That method was deprecated in Vista and the dialog was removed. That's why it doesn't work. This fix is simply a special `dinput8.dll` that redirects most of the DirectInput API to the regular DirectInput, but also implements `ConfigureDevices` in a reasonable way (using code lifted from the Wine project, http://winehq.org).

Usage notes

Select the controller you want to use from the dropdown in the upper left corner to see all buttons, axes etc. and their assigned game actions for that device. To change an assignment, click on the thing in the right-most list, then double-click the action that you want to assign in the left list.

Changelog
  • 1.4 (2014-08-21)
    - better support for other games
    - switching devices doesn't discard changes; instead, the 'ok' and 'reset' buttons respectively save and discard changes for all devices
    - controller button numbering should start at 1 now
    - significantly updated action filtering; there shouldn't be any duplicated actions now with any game
  • 1.3 (2014-06-03)
    - and another fix regarding the "Show Assigned First" bug
  • 1.2 (2014-06-03)
    - add a shortcut to open the device's control panel to the config dialog
    - the config dialog now uses the Windows XP+ interface visual styles (see the screenshot)
    - fixed the disappearing mouse cursor when using the widescreen fix's windowed mode
    - the assignable "Pause" action now works on controllers (I'm relatively sure that was an original Rally Trophy bug)
    - fixed a somewhat embarrassing assigning bug when using the "Show Assigned First" option
  • 1.1 (2014-05-16)
    - add an extra confirmation dialog when changes might be silently lost
    - add required dimap.dll file (if you already had one, you don't really need to redownload)
  • original release (2014-01-29)
    - initial release

Now, if someone puts this game on GOG...

Last edited by fk__; 21 August 14 at 15:48. Reason: new version 1.4
fk__ is offline   Reply With Quote
Old 3 May 14, 18:55   #2
strn
 
Join Date: Apr 2007
Default

Thank you so much! I can finally play this again under W7 with the trusty old MS Sidewinder wheel.
strn is offline   Reply With Quote
Old 3 May 14, 19:10   #3
tarzar
 
tarzar's Avatar
 
Join Date: May 2011
Location: Uddevalla, Sweden
Default

Let's say I could find a way to attach the sidewinder with an even older gameport device, would that method still work?
tarzar is offline   Reply With Quote
Old 3 May 14, 19:51   #4
Goresh
Premium Member
 
Goresh's Avatar
 
Join Date: Jul 2006
Location: Ontario, Canada
Default

This is absolutely brilliant, worked like a charm! Thanks so much for this!!
Goresh is offline   Reply With Quote
Old 3 May 14, 22:40   #5
Goresh
Premium Member
 
Goresh's Avatar
 
Join Date: Jul 2006
Location: Ontario, Canada
Default

Might add I used a G27 wheel and it worked perfectly.
Goresh is offline   Reply With Quote
Old 6 May 14, 15:38   #6
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by tarzar View Post
Let's say I could find a way to attach the sidewinder with an even older gameport device, would that method still work?
So you're asking whether it would work with a gameport device? It should, so long as that device is supported by DirectInput. I think DirectInput is old enough for gameport devices, but I don't know for sure and I've no way to test it.

And good to hear my hack is working for people!
fk__ is offline   Reply With Quote
Old 6 May 14, 17:45   #7
jannus
 
Join Date: May 2014
Default

This is the best RT related news in a LOOONG time!! Thanks very much! I've been playing with the idea of figuring out the codes used for each button and trying to make something to create a control config file, but this is WAY better. Thanks a million!

will test with several wheels I have here and shout if there are problems.

This should be stickied / edited into the noobs guide, not sure who can do that?

Jan
jannus is offline   Reply With Quote
Old 6 May 14, 22:27   #8
Goresh
Premium Member
 
Goresh's Avatar
 
Join Date: Jul 2006
Location: Ontario, Canada
Default

It doesn't see my Fanatec wheel
Goresh is offline   Reply With Quote
Old 9 May 14, 19:49   #9
Zieman
Premium Member
 
Zieman's Avatar
 
Join Date: Feb 2005
Location: Finland, on border of the Wolf Zone
Age: 40
Default

Quote:
Originally Posted by jannus View Post
This should be stickied / edited into the noobs guide, not sure who can do that?

Jan
Stickied.
Zieman is offline   Reply With Quote
Old 10 May 14, 09:02   #10
stefanroess
 
stefanroess's Avatar
 
Join Date: Dec 2004
Location: Bavaria, GERMANY
Age: 43
Default

It works on my Windows 7 64bit system with a Thrustmaster T500 RS wheel!
Brilliant! Thank you!

Edit: I have the problem that I can`t find a way to reverse/exchange the settings for throttle and breaks and for shift up and shift down.
I have throttle on the break paddle and break on the throttle paddle and I can`t exchange them.

Last edited by stefanroess; 10 May 14 at 09:28.
stefanroess is offline   Reply With Quote
Old 10 May 14, 13:11   #11
DRatRedux
 
Join Date: Feb 2014
Default

Just heard about this over on SRMZ - haven't installed it yet but from the comments above it will work fine on my system. RC2K was the most fun of any rally app I've ever used, and thank you thank you thank you for building this patch!!!!!
DRatRedux is offline   Reply With Quote
Old 10 May 14, 13:48   #12
Goresh
Premium Member
 
Goresh's Avatar
 
Join Date: Jul 2006
Location: Ontario, Canada
Default

Quote:
Originally Posted by stefanroess View Post
It works on my Windows 7 64bit system with a Thrustmaster T500 RS wheel!
Brilliant! Thank you!

Edit: I have the problem that I can`t find a way to reverse/exchange the settings for throttle and breaks and for shift up and shift down.
I have throttle on the break paddle and break on the throttle paddle and I can`t exchange them.
Switch Shift UP/DOWN to Buttons 4 and 5. These buttons are used for shifting on the G27. You do this by clicking on Button 4 in the Mapping column then on the desired function in the Actions column. This works also for the throttle and brake.
Goresh is offline   Reply With Quote
Old 10 May 14, 18:36   #13
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by Goresh View Post
It doesn't see my Fanatec wheel
As in, it's not in the controller selection drop-down? If so, is it in the Windows game controller control panel? Whatever the case, if it's not in the drop-down, DirectInput seems to not have reported it so the game wouldn't be seeing it either.

Quote:
Edit: I have the problem that I can`t find a way to reverse/exchange the settings for throttle and breaks and for shift up and shift down.
I have throttle on the break paddle and break on the throttle paddle and I can`t exchange them.
Yeah, I admit that figuring out which of those unhelpfully named axes and buttons corresponds to what physical part on your controller can be... tricky. The Windows game controller control panel seems to report the same names though, so it should be helpful in figuring that out for your device (note that the Windows control panel starts its button numbering at 1 whereas the reported names in the patched dialog seem to start at 0; you'll have to mentally adjust that )
fk__ is offline   Reply With Quote
Old 12 May 14, 14:37   #14
DRatRedux
 
Join Date: Feb 2014
Default

Edited so it now makes sense: On my G25, the shift paddles are buttons 5 and 6 (Win 4 and 5) respectively, but this patch makes the G25 buttons 1 and 2 (Win 0 and 1) do the shifting, and they are on the shifter console. I'm unable to change these in your patch, but at least can drive with automatic shift (ugh!!!). I'd also like to change the handbrake to G25 button 9 (Win #8). Got any ideas where I can find those addresses, or how they could be implemented in the patch code?

One other note: I've got a load cell conversion on my brake pedal, which reverses the brake polarity and reduces its top value by half. Marking the polarity as reversed in the Logitech Profiler or the Windows controller panel has no effect on the recognized polarity in RT. Does this patch bypass those controller panels and direct-read the controller axes and buttons, or has anyone else encountered this and found a fix?

Also, thank you for coming up with this patch!

Edit: Resolved the brake load cell polarity problem by rewiring the load cell output.

Last edited by DRatRedux; 13 May 14 at 19:19. Reason: Regained my senses and corrected my numerous errors!
DRatRedux is offline   Reply With Quote
Old 13 May 14, 22:21   #15
stefanroess
 
stefanroess's Avatar
 
Join Date: Dec 2004
Location: Bavaria, GERMANY
Age: 43
Default

Quote:
Originally Posted by fk__ View Post
S

Usage notes

Select the controller you want to use from the dropdown in the upper left corner to see all buttons, axes etc. and their assigned game actions for that device. To change an assignment, click on the thing in the right-most list, then double-click the action that you want to assign in the left list.
It seems that the problem I have is, that the assigned game actions do NOT get saved.
When I reopen the wheel cofiguration, the assignments are reset again the way they have been before.
Any ideas?

Last edited by stefanroess; 14 May 14 at 18:22.
stefanroess is offline   Reply With Quote
Old 14 May 14, 00:17   #16
jgf
 
jgf's Avatar
 
Join Date: Nov 2005
Location: Columbus, OH
Age: 62
Default

Quote:
Originally Posted by DRatRedux View Post
...On my G25, the shift paddles are buttons 5 and 6 (Win 4 and 5) respectively, but this patch makes the G25 buttons 1 and 2 (Win 0 and 1) do the shifting, and they are on the shifter console. I'm unable to change these in your patch, but at least can drive with automatic shift (ugh!!!).
That's what I have with my Saitek without this patch (which I haven't tried yet); all the axes are correct but the shifters are on the upper thumb buttons instead of the paddles, so my only issue was being stuck with autoshift. I eventually edited all the engine files to tweak the shift points to better approximate how I would shift (and changed a few ratios for a better gear spread); not optimum but an improvement.

Quote:
Originally Posted by DRatRedux View Post
I'd also like to change the handbrake to G25 button 9 (Win #8). Got any ideas where I can find those addresses, or how they could be implemented in the patch code?....
In one of the other Rally Trophy controls threads here someone gave instructions for finding button assignments.
jgf is offline   Reply With Quote
Old 14 May 14, 12:03   #17
DRatRedux
 
Join Date: Feb 2014
Default

Fundamentally, the problems I'm encountering are now simply the same as reported by StefanRoess. With my skills, by the time I find the desired button codes and manage to edit them into a configuration file, the patch itself may well be fixed!
DRatRedux is offline   Reply With Quote
Old 14 May 14, 22:03   #18
stefanroess
 
stefanroess's Avatar
 
Join Date: Dec 2004
Location: Bavaria, GERMANY
Age: 43
Default

Quote:
Originally Posted by DRatRedux View Post
Fundamentally, the problems I'm encountering are now simply the same as reported by StefanRoess.
You mean, that your settings/assignments also do NOT get saved?

The ...\JoWooD\Rally Trophy folder is not write protected.
Hm, so why can`t I save the controller settings?
fk__ can you help on this?

Last edited by stefanroess; 15 May 14 at 10:24.
stefanroess is offline   Reply With Quote
Old 15 May 14, 11:05   #19
DRatRedux
 
Join Date: Feb 2014
Default

Quote:
Originally Posted by stefanroess View Post
You mean, that your settings/assignments also do NOT get saved?
That's correct. We can change them on the assignment form but when we exit the controls configuration our changes are lost. Either the default assignments are hard-coded in the patch, or the patch is unable to save changes.

By the way, my OS is Win7x64, if that is of help to fk .
DRatRedux is offline   Reply With Quote
Old 15 May 14, 14:19   #20
fk__
 
Join Date: Jan 2014
Default

Huh. I'm (metaphorically speaking) scratching my head right now because I've no real idea where that might come from. Alright, let's see...
  1. So the exact problem is:
    • you start Rally Trophy
    • go to the control options menu, click 'configure controllers'
    • the patched configuration dialog pops up
    • in the top left corner, you select your controller
    • you change an arbitrary assignment (by selecting a button or axis in the list on the right, then double-clicking an action in the left list)
    • the list updates to show the change you just made
    • you click 'ok' (without first switching to another controller)
    • you click 'configure controllers' again, the dialog opens again
    • you select the device you just changed
    • the change you made before has been reset, everything is as it was when you launched the game.

    Is that correct so far?

    Before we go on, just to totally rule out misleading interfaces -- if you make some changes in the dialog, then immediately switch to a different device, those changes will be lost. You have to click 'ok' without changing devices (or clicking 'reset'...) for your changes to be saved. I should probably introduce a message box for that.

  2. Does this problem only happen for your respective wheels (Logitech G25 and Thrustmaster T500, I think?) or does it happen equally for the keyboard settings? If you have any other joysticks, wheels, gamepads etc., does it happen with those?
  3. Those control settings aren't actually stored in your Rally Trophy folder. They're another stock DirectInput thing and normally, they go into
    Code:
    C:\Program Files\Common Files\DirectX\DirectInput\User Maps
    On 64-bit systems, they will be in
    Code:
    C:\Program Files (x86)\Common Files\...
    On Vista and newer with UAC enabled, these files will ultimately end up in
    Code:
    C:\Users\<username>\AppData\Local\VirtualStore\Program Files\Common Files\DirectX\DirectInput\User Maps
    (Or again ...\Program Files (x86)\... on 64-bit systems.)

    (Simple, isn't it )

    After running Rally Trophy at least once, this directory should contain several files (some parts might be in a different language depending on your Windows and RT language):

    Code:
    PLAYER 1X_MOUSEX_0.INI
    PLAYER 1X_KEYBOARDX_0.INI
    These are for keyboard and mouse and should always be there. For each controller, there's another two files with these name patterns:

    Code:
    PLAYER 1X_VID_<hex digits>&PID_<hex digits>X_0.INI
    For example, for my wireless XBox 360 pad, I have this:

    Code:
    PLAYER 1X_VID_045E&PID_02A1X_0.INI
    Also, when starting a race or opening the controller dialog, that directory will get another file per input device, with the same name but the leading PLAYER 1 removed. I'm not sure what those do... For clarification, this is what my User Maps directory looks like (on a German Windows, English RT, with two extra controllers):



    In any case, do you have those files? (If not, is that directory write-protected or otherwise inaccessible?) If yes, does deleting them and starting from scratch help?
  4. This is a bit of a long shot, but try this:
    • delete everything in User Maps
    • launch Rally Trophy
    • start a race
    • exit Rally Trophy
    • launch it again
    • go to control settings and see if saving assignments works now.
  5. Final idea, when you click 'ok' in the controller settings dialog, do the Last Modified dates on the files in User Maps get updated? If possible, could you:
    • make a copy of the User Maps folder
    • try to make a change in the controls dialog and confirm it
    • compare the User Maps folder with your copy of it, using something like WinMerge (alternatively, just package both copies and upload them; I'm pretty confident there's no private information in those files).

That's all I can think of for now. Let's hope something sticks.
fk__ is offline   Reply With Quote
Old 15 May 14, 15:03   #21
DRatRedux
 
Join Date: Feb 2014
Default

Quote:
Originally Posted by fk__ View Post
Huh. I'm (metaphorically speaking) scratching my head right now because I've no real idea where that might come from. Alright, let's see...

So the exact problem is:
  • you start Rally Trophy
  • go to the control options menu, click 'configure controllers'
  • the patched configuration dialog pops up
  • in the top left corner, you select your controller
  • you change an arbitrary assignment (by selecting a button or axis in the list on the right, then double-clicking an action in the left list)
  • the list updates to show the change you just made
  • you click 'ok' (without first switching to another controller)
  • you click 'configure controllers' again, the dialog opens again
  • you select the device you just changed
  • the change you made before has been reset, everything is as it was when you launched the game.

Is that correct so far?
Exactly!

Quote:
Before we go on, just to totally rule out misleading interfaces -- if you make some changes in the dialog, then immediately switch to a different device, those changes will be lost. You have to click 'ok' without changing devices (or clicking 'reset'...) for your changes to be saved. I should probably introduce a message box for that.

Does this problem only happen for your respective wheels (Logitech G25 and Thrustmaster T500, I think?) or does it happen equally for the keyboard settings? If you have any other joysticks, wheels, gamepads etc., does it happen with those?
Yes. I have tested this with the G25 and the keyboard, and it occurs with both.

Quote:
Those control settings aren't actually stored in your Rally Trophy folder. They're another stock DirectInput thing and normally, they go into
Code:
C:\Program Files\Common Files\DirectX\DirectInput\User Maps
On 64-bit systems, they will be in
Code:
C:\Program Files (x86)\Common Files\...
On Vista and newer with UAC enabled, these files will ultimately end up in
Code:
C:\Users\<username>\AppData\Local\VirtualStore\Program Files\Common Files\DirectX\DirectInput\User Maps
(Or again ...\Program Files (x86)\... on 64-bit systems.)

(Simple, isn't it )
Interestingly enough, I have Windows 7, 64 bit, but no DirectX folder under \Program Files (x86)\Common Files.

Quote:
After running Rally Trophy at least once, this directory should contain several files (some parts might be in a different language depending on your Windows and RT language):

Code:
PLAYER 1X_MOUSEX_0.INI
PLAYER 1X_KEYBOARDX_0.INI
These are for keyboard and mouse and should always be there. For each controller, there's another two files with these name patterns:

Code:
PLAYER 1X_VID_<hex digits>&PID_<hex digits>X_0.INI
For example, for my wireless XBox 360 pad, I have this:

Code:
PLAYER 1X_VID_045E&PID_02A1X_0.INI
Also, when starting a race or opening the controller dialog, that directory will get another file per input device, with the same name but the leading PLAYER 1 removed. I'm not sure what those do... For clarification, this is what my User Maps directory looks like (on a German Windows, English RT, with two extra controllers):



In any case, do you have those files? (If not, is that directory write-protected or otherwise inaccessible?) If yes, does deleting them and starting from scratch help?
No. I have run a system search for "PLAYER 1X*.*" but have found none, including hidden and system files.

Quote:
This is a bit of a long shot, but try this:
  • delete everything in User Maps
  • launch Rally Trophy
  • start a race
  • exit Rally Trophy
  • launch it again
  • go to control settings and see if saving assignments works now.

Final idea, when you click 'ok' in the controller settings dialog, do the Last Modified dates on the files in User Maps get updated? If possible, could you:
  • make a copy of the User Maps folder
  • try to make a change in the controls dialog and confirm it
  • compare the User Maps folder with your copy of it, using something like WinMerge (alternatively, just package both copies and upload them; I'm pretty confident there's no private information in those files).

That's all I can think of for now. Let's hope something sticks.
It appears that something has stuck ...

This PC has numerous sims and games installed, complete with versions 7 and up of DirectX. Perhaps if I download and install specifically DX8, might it create the missing common folder? Or should I suspect something else?
DRatRedux is offline   Reply With Quote
Old 15 May 14, 17:29   #22
fk__
 
Join Date: Jan 2014
Default

Actually. I believe we have a winner! And it is...

*drumroll*

dimap.dll!

I remember noticing that file in my Rally Trophy directory when I was making my patch, but I couldn't figure out what it was good for. I renamed it just now -- and then I couldn't update my control assignments properly (in fact, it didn't even load my stored settings anymore, just offering me the game's defaults).

Turns out, dimap.dll is not part of the game or the official patch, it's something that I've had in my local collection of files to get RT working and forgot about. Some quick research later, I think it's the version attached to this post (wherever you are now, andye26, you were right); it seems that file was extracted from some old DirectX distribution.

So, try it with that file. I'm very confident now that that's the reason for the problem you're seeing. Not that I'm really looking forward to redistributing that file in a way that's probably breaching so many license terms.
fk__ is offline   Reply With Quote
Old 15 May 14, 17:52   #23
stefanroess
 
stefanroess's Avatar
 
Join Date: Dec 2004
Location: Bavaria, GERMANY
Age: 43
Default

Thx for your help!
I removed the one of your patch and tried it with the dimap.dll file (dated 07.11.2000) you linked above.
But still no success. Hm...

Edit: I also tried all your steps from 1-5.
Attached are the folders ("User Maps" and a copy "User Maps - Kopie") and a screenshot of the result of WinMerge you linked in setp 5.

My OS is Windows 7 64bit, German version of Rally Trophy.
Attached Images
File Type: jpg Dwm 2014-05-15 20-09-22-22.jpg (134.1 KB, 13 views)
Attached Files
File Type: zip User Maps.zip (5.3 KB, 11 views)
File Type: zip User Maps - Kopie.zip (5.5 KB, 4 views)

Last edited by stefanroess; 15 May 14 at 18:17.
stefanroess is offline   Reply With Quote
Old 15 May 14, 18:20   #24
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by stefanroess View Post
Thx for your help!
I removed the one of your patch and tried it with the dimap.dll file (dated 07.11.2000) you linked above.
But still no success. Hm...
Wait, what did you remove? You need both my dinput8.dll as well as the linked dimap.dll in your Rally Trophy folder. If you leave out dinput8.dll, the controller dialog will go back to being non-existent, without dimap.dll the dialog will not work correctly. I'm very certain of that now. With those two files in your RT directory, does the dialog display and work properly? Because if not, this must be the reddest herring ever.
fk__ is offline   Reply With Quote
Old 15 May 14, 18:43   #25
stefanroess
 
stefanroess's Avatar
 
Join Date: Dec 2004
Location: Bavaria, GERMANY
Age: 43
Default

Quote:
Originally Posted by fk__ View Post
Wait, what did you remove? You need both my dinput8.dll as well as the linked dimap.dll in your Rally Trophy folder. If you leave out dinput8.dll, the controller dialog will go back to being non-existent, without dimap.dll the dialog will not work correctly. I'm very certain of that now. With those two files in your RT directory, does the dialog display and work properly? Because if not, this must be the reddest herring ever.
Both files are in the folder. No success.
See attached screenshot of my RT folder.
I also attached 3 screenshots of my config settings.

Note: Have you seen the attached folders at my post #23 above?
Attached Images
File Type: jpg Dwm 2014-05-15 20-32-24-52.jpg (111.1 KB, 15 views)
File Type: jpg Dwm 2014-05-15 20-32-58-97.jpg (63.4 KB, 5 views)
File Type: jpg Dwm 2014-05-15 20-33-22-39.jpg (70.3 KB, 4 views)
File Type: jpg Dwm 2014-05-15 20-33-48-89.jpg (64.0 KB, 5 views)
stefanroess is offline   Reply With Quote
Old 15 May 14, 19:32   #26
DRatRedux
 
Join Date: Feb 2014
Default

It may be that we are missing the DirectX\DirectInput\User Maps folder and the PLAYER 1X_....ini that resides in it. (location per your post above, depending on OS) ...
DRatRedux is offline   Reply With Quote
Old 15 May 14, 19:39   #27
DRatRedux
 
Join Date: Feb 2014
Default

Just tested that premise - it works! Need to do some more testing for full functionality, but that appears to be the answer......

First time RT is run and configured after creating that folder, it stores the current settings. Changing the settings for G25 use saves the new settings properly. Now your patch is fully functional!

I would suspect that some OS auto-update probably removed that common folder since Microsoft did away with DirectInput in Vista and later OS's. It may still be there in 32 bit systems, or you would have gotten a lot more of this type of feedback!

Thanks again for creating and distributing the controls patch, and for leading the way in finding the solution!
DRatRedux is offline   Reply With Quote
Old 15 May 14, 21:31   #28
stefanroess
 
stefanroess's Avatar
 
Join Date: Dec 2004
Location: Bavaria, GERMANY
Age: 43
Default

FIXED!

The folder
C:\Program Files (x86)\Common Files\DirectX\DirectInput\User Maps
did already exist.

But on my Win7 64bit system there was no folder
C:\Users\<username>\AppData\Local\VirtualStore\Pro gram Files (x86)\Common Files\DirectX\DirectInput\User Maps

There was even missing the folder Common Files and all its subfolders.
So I created, resp. copied the ...Common Files\DirectX\DirectInput\User Maps into the "users" section. And now it works.

The strange thing is (at least for me). That when I do changes to the control settings I can see by the save date that only the files in the
C:\Program Files (x86)\Common Files\DirectX\DirectInput\User Maps
get updated. Not the ones in the user section, even so the files of the "User Maps" folder also have to be in the user section to work properly.

Anyway it works now.
Thx for this great patch!
stefanroess is offline   Reply With Quote
Old 15 May 14, 22:09   #29
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by DRatRedux View Post
It may still be there in 32 bit systems, or you would have gotten a lot more of this type of feedback!
I think it's just that a lot of people here already had dimap.dll because that one's also necessary for the "copy configuration from an XP machine" approach.

Quote:
Originally Posted by stefanroess View Post
FIXED!
Well that's good. I was kind of out of ideas here From your first screenshot, it seems you're running RT as admin (possibly because you set it to XP compatibility mode?); that would explain why it can use the regular directory in Program Files rather than the virtualised one. I don't think compatibility settings help with this game, you might as well turn it off (so long as you haven't installed the game into C:\Program Files (x86), that is...)

I guess I can now make a new bundle with dimap.dll.
fk__ is offline   Reply With Quote
Old 16 May 14, 13:21   #30
AedanClarke
 
Join Date: May 2014
Default

Well, now I've got myself a problem. Prior to installing this, I had the normal problem with the screen going to desktop before flickering back to the game when you went to configure the controls. With this installed, instead of that, the game just crashes. And since I'm a complete idiot, I have no clue what the problem may be. :/
AedanClarke is offline   Reply With Quote
Old 16 May 14, 15:29   #31
handsomerob
Banned for duplicate accounts
 
Join Date: May 2012
Default

Before I re-install my old copy of Rally Trophy on my PC, I want to know if someone has got the game working with the Fanatec Clubsport Wheel?

Thanks in advance!
handsomerob is offline   Reply With Quote
Old 16 May 14, 17:20   #32
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by AedanClarke View Post
Well, now I've got myself a problem. Prior to installing this, I had the normal problem with the screen going to desktop before flickering back to the game when you went to configure the controls. With this installed, instead of that, the game just crashes. And since I'm a complete idiot, I have no clue what the problem may be. :/
Yay, random crashes, my favourite kind!

So, with my patch installed, the game still launches normally etc., but when you click 'configure controllers', the game crashes, right? Is it the regular "this application has stopped working" Windows box?
  • What Windows version are you using? Also, 32-bit or 64-bit?
  • Did you run the included vcredist_x86.exe?
  • Did you use the original release or the updated 1.1 release? (It shouldn't make a difference, but still...)
  • Can you start a race or does that crash as well?
  • Is that a fresh Rally Trophy installation or one with a history? In any case, try with a fresh installation from disc, then the official 1.01 patch (one of these), then the non-file-checking executable, then my patch (the updated version). That order should work.
  • What language is your Rally Trophy? I can switch mine between German and English, but the patch listing suggests there are other distinct language versions.
  • What game controllers (wheels, joysticks, gamepads etc.) do you have connected? Try unplugging all of those and see if it still crashes.
  • To quote myself:
    Quote:
    Those control settings aren't actually stored in your Rally Trophy folder. They're another stock DirectInput thing and normally, they go into

    Code:
    C:\Program Files\Common Files\DirectX\DirectInput\User Maps
    On 64-bit systems, they will be in

    Code:
    C:\Program Files (x86)\Common Files\...
    On Vista and newer with UAC enabled, these files will ultimately end up in

    Code:
    C:\Users\<username>\AppData\Local\VirtualStore\Program Files\Common Files\DirectX\DirectInput\User Maps
    (Or again ...\Program Files (x86)\... on 64-bit systems.)

    (Simple, isn't it )
    If you ever used the old "copy the configuration from an XP machine" trick, you'll probably have at least one of these directories. Even if not, see if you have any of these, rename them so they're out of the way (but don't delete them quite yet) and see if that helps.
fk__ is offline   Reply With Quote
Old 19 May 14, 18:56   #33
AedanClarke
 
Join Date: May 2014
Default

Sorry I didn't reply sooner. Life's a bit busy at the moment.

Anyway, I tried out the patch with the non-file-checking .exe and that did the job. After setting up the controls, I still feel like steering is too sensitive, even with the sensitivity all the way down, but it can be managed with practice, I'm sure. Thank you very much for this. c:
AedanClarke is offline   Reply With Quote
Old 19 May 14, 19:27   #34
DRatRedux
 
Join Date: Feb 2014
Default

Quote:
Originally Posted by AedanClarke View Post
After setting up the controls, I still feel like steering is too sensitive, even with the sensitivity all the way down, but it can be managed with practice, I'm sure.
In the TTRealMod patch, there are instructions on how to moderate the steering by changing a value in the input.ini file. It works just fine for me, and I have to recommend this series of patches (TTRealMod2006, 2007 Real Tyre Mod, Realmod supplement). You need to install the BZF manager to install these patches, if you want to. They're all here on NoGrip.

"Last not least a special hint for the steering settings(this is only related if you are using a steeringwheel - if you're driving with a keyboard, you can ignore this chapter): BB uses a linear steering-setup by default. This may cause some strange behavior around the steering-center and makes the cars a little oversensitive in straightways-direction and when you are doing only slight steering-movements. We recommend to use a non-linear setup. You can do it in the following way: open the folder Rally Trophy/Data/Settings. The only file inside is the input.ini. Open it in a texteditor (notepad, wordpad or something similar). Look for a item called "SteeringExponent". The default setting is 1.00, that means a linear steeringbehavior. Change it to a value between 1.1 and 1.5 or even more, if you prefer a very smooth steering-input (for a MSFFB-wheel a value of 1.16 - 1.2 works fine for example). Save your changes and fire up RT. Perhaps try different values until it matches your personal preference."
DRatRedux is offline   Reply With Quote
Old 19 May 14, 19:57   #35
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by AedanClarke View Post
Anyway, I tried out the patch with the non-file-checking .exe and that did the job.
Huh. That's surprising, I'm not sure why that is. Probably not a huge deal though.

And, for the record: this patch only modifies the controller configuration, but not how the game handles input or steering. If the steering is very sensitive, it would've been like that in unpatched Rally Trophy.

Quote:
In the TTRealMod patch, there are instructions on how to moderate the steering by changing a value in the input.ini file.
Ooooh, I need to try that. Thanks for that info!

Oh, and I have another neat Rally Trophy thing coming up (read: I'm waiting for the file upload to be approved). Watch this forum
fk__ is offline   Reply With Quote
Old 21 May 14, 19:30   #36
jannus
 
Join Date: May 2014
Default

Quote:
Originally Posted by Zieman View Post
Stickied.
why thank you kind sir.

Quote:
Originally Posted by fk__ View Post

Oh, and I have another neat Rally Trophy thing coming up (read: I'm waiting for the file upload to be approved). Watch this forum
MORE treats!?? A good day for RT indeed! Looking forward to it!

Thanks!
J

Last edited by jannus; 21 May 14 at 20:19.
jannus is offline   Reply With Quote
Old 3 June 14, 02:17   #37
fk__
 
Join Date: Jan 2014
Default

A quick heads-up, I rolled out a new version. The changelog is in the opening post; it's some bugfixes and icing, but I also got the assignable "Pause" button for controllers to work, which I'm pretty sure didn't ever work before.

Edit: Oh look, I missed a spot with the "Show Assigned First" fix, so yet another release.

Last edited by fk__; 3 June 14 at 12:24. Reason: yet another release
fk__ is offline   Reply With Quote
Old 17 June 14, 09:54   #38
trafiken
 
Join Date: Jun 2014
Default Rally Championship Xtreme

Thank you fk__. I have now a working Rally Championship Xtreme on my Windows 7 Home Premium (Swedish) computer thanks to your code. I have made a few changes to the source code that I will post here later. The changes are:

1. Bump button numbers to match the numbers in Control Panel. Button 0 to Button 98 are shown as Button 1 to Button 99 in the dialog.

2. Change settings for more than one device and save the changes when you press OK.

3. Show all actions in actions list. This to work around a bug in Rally Championship Xtreme. Actions 'Handbrake' and 'Reverse' are missing from the controller actions but are present twice in the keyboard actions. So if I want to handbrake with my controller I have to assign a keyboard action to it.

Note: Visual Studio 2012 Express does not work with the project. ATL stuff is missing. The full version of Visual Studio 2012 is available as a 30 day demo from Microsoft (90 day demo if you care to register). That is what I am using now.

/trafiken
trafiken is offline   Reply With Quote
Old 17 June 14, 10:00   #39
trafiken
 
Join Date: Jun 2014
Default Bump button numbers

Search for 'Button 0' to prevent that we bump more than once, for example when 'Reset' is pressed.


Code:
static void fill_device_object_list(HWND dialog)
{
    DeviceData *device = get_cur_device(dialog);
    LPDIACTIONFORMAT lpdiaf = get_cur_lpdiaf(dialog);
    LVITEM item;
    int i, j;

    /* Clean the listview */
    SendDlgItemMessage(dialog, IDC_DEVICEOBJECTSLIST, LVM_DELETEALLITEMS, 0, 0);

	bool bump = false; // "Button 0" not found yet

    /* Add each object */
    for (i=0; i < device->nobjects; i++)
    {
        int action = -1;

        item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
        item.iItem = i;
        item.iSubItem = 0;
        // We use iImage to store the original index of the object for sorting. Why yes, that *is* a giant hack.
        item.iImage = i;

		LPSTR tszName = device->ddo[i].tszName;
		int len = lstrlen(tszName);

		// looking for "Button 0" 
		if ( (tszName[len-1] == '0') && ((tszName[len-2] < '0') || (tszName[len-2] > '9')) ) {
			// "Button 0" found, bump all buttons
			bump = true;
		}

		if (bump) {
			
			// bump button number
			if ( (tszName[len-1] >= '0') && (tszName[len-1] <= '9') ) {
				tszName[len-1]++;

				if ( tszName[len-1] == ('9' + 1) ) {
					if ( (tszName[len-2] >= '0') && (tszName[len-2] <= '9') ) {
						tszName[len-2]++;
						tszName[len-1] = '0';
					}
					else {
						tszName[len-1] = '1';
						tszName[len] = '0';
						tszName[len+1] = 0;
					}
				}
			}

			item.pszText = tszName;
		}
		else {
			item.pszText = tszName;
		}
		
        item.cchTextMax = lstrlen(item.pszText);

        /* Add the item */
        SendDlgItemMessage(dialog, IDC_DEVICEOBJECTSLIST, LVM_INSERTITEM, 0, (LPARAM) &item);

        /* Search for an assigned action for this device */
        for (j=0; j < lpdiaf->dwNumActions; j++)
        {
            if (IsEqualGUID(lpdiaf->rgoAction[j].guidInstance, device->ddi.guidInstance) &&
                lpdiaf->rgoAction[j].dwObjID == device->ddo[i].dwType)
            {
                action = j;
                break;
            }
        }

        lv_set_action(dialog, i, action, lpdiaf);
    }

    sort_device_object_list(dialog, true);
}
trafiken is offline   Reply With Quote
Old 17 June 14, 10:24   #40
trafiken
 
Join Date: Jun 2014
Default Save all devices

New functions:

Code:
static void save_all_actions(HWND dialog)   // trafiken - new function
{  
	// save changes on all pages
	ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtr(dialog, DWLP_USER);

	for (int i=0; i < data->devices_data.ndevices; i++) {
		DeviceData *device = &data->devices_data.devices[i];
		HRESULT hr = device->lpdid->SetActionMap(device->lpdiaf, data->userName, DIDSAM_FORCESAVE);
	}
}

static void reset_all_actions(HWND dialog)   // trafiken - new function
{
    // reset changes on all pages
	ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtr(dialog, DWLP_USER);
					
	for (int i=0; i < data->devices_data.ndevices; i++)
	{
		DeviceData* device = &data->devices_data.devices[i];
		copy_actions(device->lpdiaf, device->original_lpdiaf);
	}
}
Function not used any more:

Code:
// trafiken - deleted function
//static void save_actions(HWND dialog) {
//    ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtr(dialog, DWLP_USER);
//    DeviceData *device = get_cur_device(dialog);
//    LPDIACTIONFORMAT lpdiaf = get_cur_lpdiaf(dialog);
//    HRESULT hr = device->lpdid->SetActionMap(lpdiaf, data->userName, DIDSAM_FORCESAVE);
//}

When device changed, do not reset.

Code:
case IDC_CONTROLLERCOMBO:

                    switch (HIWORD(wParam))
                    {
                        case CBN_SELCHANGE:   // trafiken - changed

                           ConfigureDevicesData *data = (ConfigureDevicesData*) GetWindowLongPtr(dialog, DWLP_USER);														
                            show_suitable_actions(dialog);
                            fill_device_object_list(dialog);
                            data->selected_device_id = SendDlgItemMessage(dialog, IDC_CONTROLLERCOMBO, CB_GETCURSEL, 0, 0);
														
                            break;
                    }
                    break;

When OK pressed save all devices.

Code:
case IDOK:
					
                    // trafiken - changed
                    // save changes on all pages
                    save_all_actions(dialog);
					
                    // the end
                    EndDialog(dialog, 0);
                    destroy_data(dialog);                    
					break;
When Cancel pressed reset all devices.


Code:
case IDCANCEL:
					
                   // trafiken - changed
                   // reset changes on all pages
                   reset_all_actions(dialog);

                    // the end
                    EndDialog(dialog, 0);
                    destroy_data(dialog);
                    break;
trafiken is offline   Reply With Quote
Old 17 June 14, 10:41   #41
trafiken
 
Join Date: Jun 2014
Default Show all actions

The game presents actions to the dialog. The actions are tagged for use with controller, keyboard or mouse. It is however possible to assign a keyboard action to a controller button. I have changed the actions list so that the suitable actions are at the top, then a clear action as delimiter, then not suitable actions , delimiter, and last probably totally inappropriate actions.




Code:
static void show_suitable_actions(HWND dialog)  // trafiken - changed function
{
    DeviceData *device = get_cur_device(dialog);
    LPDIACTIONFORMAT lpdiaf = get_cur_lpdiaf(dialog);
    int i, added = 0;
    int obj = lv_get_cur_item(dialog);
    int old_action = lv_get_item_data(dialog, obj);

    if (obj < 0) return;

    if (old_action >= 0 && lpdiaf->rgoAction[old_action].dwFlags & DIA_APPFIXED) {
        // The old action was DIA_APPFIXED, we don't offer config for that.
        EnableWindow(GetDlgItem(dialog, IDC_ACTIONLIST), FALSE);
    } else {
        EnableWindow(GetDlgItem(dialog, IDC_ACTIONLIST), TRUE);
    }

    SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_RESETCONTENT, 0, 0);

	// Add actions list
	switch (GET_DIDEVICE_TYPE(device->ddi.dwDevType)) {

	case DI8DEVTYPE_KEYBOARD:
	
		// First, suitable actions - keyboard actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

	        // Keep keyboard actions only //
		    if ((lpdiaf->rgoAction[i].dwSemantic & DIKEYBOARD_MASK) != DIKEYBOARD_MASK) continue;
			
            if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

            // Add action string and index in the action format to the list entry
            if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
            {
                SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
                SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
                added++;
            }
        }

		// add 'clear' option
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) TEXT("-"));
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) -1);
		added++;

		// Second, mouse actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

			// keep mouse actions only
			if ((lpdiaf->rgoAction[i].dwSemantic & DIMOUSE_MASK) != DIMOUSE_MASK) continue;
						        
			if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

			// Add action string and index in the action format to the list entry
			if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
			{
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
				added++;
			}
		}

		// add 'clear' option
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) TEXT("-"));
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) -1);
		added++;

		// Third, controller actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

			// Skip keyboard actions
			if ( (lpdiaf->rgoAction[i].dwSemantic & DIKEYBOARD_MASK) == DIKEYBOARD_MASK) continue;

			// Skip mouse actions
			if ( (lpdiaf->rgoAction[i].dwSemantic & DIMOUSE_MASK) == DIMOUSE_MASK) continue;
        
			if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

			// Add action string and index in the action format to the list entry
			if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
			{
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
				added++;
			}
		}
	
		break;

	case DI8DEVTYPE_MOUSE:

		// First, suitable actions - mouse actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

	        // Keep mouse actions only
		    if ((lpdiaf->rgoAction[i].dwSemantic & DIMOUSE_MASK) != DIMOUSE_MASK) continue;
			
            if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

            // Add action string and index in the action format to the list entry
            if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
            {
                SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
                SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
                added++;
            }
        }

		// add 'clear' option
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) TEXT("-"));
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) -1);
		added++;

		// Second, keyboard actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

	        // Keep keyboard actions only
		    if ((lpdiaf->rgoAction[i].dwSemantic & DIKEYBOARD_MASK) != DIKEYBOARD_MASK) continue;
			
            if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

            // Add action string and index in the action format to the list entry
            if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
            {
                SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
                SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
                added++;
            }
        }

		// add 'clear' option
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) TEXT("-"));
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) -1);
		added++;

		// Third, controller actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

			// Skip keyboard actions
			if ( (lpdiaf->rgoAction[i].dwSemantic & DIKEYBOARD_MASK) == DIKEYBOARD_MASK) continue;

			// Skip mouse actions
			if ( (lpdiaf->rgoAction[i].dwSemantic & DIMOUSE_MASK) == DIMOUSE_MASK) continue;
        
			if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

			// Add action string and index in the action format to the list entry
			if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
			{
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
				added++;
			}
		}

		break;

	default: // game controllers like joystick, wheel, gamepad...

		// First, suitable actions - controller actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

			// Skip keyboard actions
			if ( (lpdiaf->rgoAction[i].dwSemantic & DIKEYBOARD_MASK) == DIKEYBOARD_MASK) continue;

			// Skip mouse actions
			if ( (lpdiaf->rgoAction[i].dwSemantic & DIMOUSE_MASK) == DIMOUSE_MASK) continue;
        
			if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

			// Add action string and index in the action format to the list entry
			if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
			{
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
				added++;
			}
		}

		// add 'clear' option, also as list delimiter
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) TEXT("-"));
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) -1);
		added++;

		// Second, keyboard actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

			// keep keyboard actions only
			if ((lpdiaf->rgoAction[i].dwSemantic & DIKEYBOARD_MASK) != DIKEYBOARD_MASK) continue;
						        
			if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

			// Add action string and index in the action format to the list entry
			if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
			{
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
				added++;
			}
		}

		// add 'clear' option
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) TEXT("-"));
		SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) -1);
		added++;

		// Third, mouse actions
		for (i=0; i < lpdiaf->dwNumActions; i++) {

			// Keep mouse actions only
			if ((lpdiaf->rgoAction[i].dwSemantic & DIMOUSE_MASK) != DIMOUSE_MASK) continue;
						        
			if (lpdiaf->rgoAction[i].dwFlags & DIA_APPFIXED) continue;

			// Add action string and index in the action format to the list entry
			if (DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwSemantic) & DIDFT_GETTYPE(device->ddo[lv_get_item_id(dialog, obj)].dwType))
			{
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_ADDSTRING, 0, (LPARAM) lpdiaf->rgoAction[i].lptszActionName);
				SendDlgItemMessage(dialog, IDC_ACTIONLIST, LB_SETITEMDATA, added, (LPARAM) i);
				added++;
			}
		}

		break;
	}
}
trafiken is offline   Reply With Quote
Old 26 June 14, 21:47   #42
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by trafiken View Post
Thank you fk__. I have now a working Rally Championship Xtreme on my Windows 7 Home Premium (Swedish) computer thanks to your code. I have made a few changes to the source code that I will post here later. The changes are:

1. Bump button numbers to match the numbers in Control Panel. Button 0 to Button 98 are shown as Button 1 to Button 99 in the dialog.

2. Change settings for more than one device and save the changes when you press OK.
Thanks, very nice! I'll look through that when I find the time.

Quote:
3. Show all actions in actions list. This to work around a bug in Rally Championship Xtreme. Actions 'Handbrake' and 'Reverse' are missing from the controller actions but are present twice in the keyboard actions. So if I want to handbrake with my controller I have to assign a keyboard action to it.
I wouldn't be so sure that's a game bug My code (well, rather the Wine code that I started from) might just be filtering entirely incorrectly. I've been pointed towards another game (Juiced) where the filtering also causes actions to be missing, so right now Rally Trophy with its clean filterability is the odd one out. I'll have to include basic game detection at runtime anyway, so Rally Trophy can keep its clean lists and everyone else gets slightly more expansive and redundant lists.

Quote:
Note: Visual Studio 2012 Express does not work with the project. ATL stuff is missing. The full version of Visual Studio 2012 is available as a 30 day demo from Microsoft (90 day demo if you care to register). That is what I am using now.
Thanks for the heads-up; should've known there would be something. It seems one can get ATL from the Windows Driver Kit though, so I guess I'll include a reference to that in the readme.
fk__ is offline   Reply With Quote
Old 1 July 14, 18:53   #43
trafiken
 
Join Date: Jun 2014
Default

Quote:
My code (well, rather the Wine code that I started from) might just be filtering entirely incorrectly. I've been pointed towards another game (Juiced) where the filtering also causes actions to be missing, so right now Rally Trophy with its clean filterability is the odd one out.

I have looked at the dialog in Windows XP. It seems that Microsoft at some point decided to don't care if the action is for controller, keyboard, or mouse. Windows XP lists all actions except that actions with identical names are only present once. I don't know if they kept the controller version or the keyboard version of the duplicate actions, maybe it does not matter. This is why the bug in Rally Championship Xtrem was never noticed.

So the correct approach would be to use my complete list of actions and filter out any duplicate action. I was too lazy to do all that...


Quote:
I'll have to include basic game detection at runtime anyway, so Rally Trophy can keep its clean lists
Don't make it harder than it is. Make two versions of the dll. One nice for Rally Trophy and one ugly for everyone else.
trafiken is offline   Reply With Quote
Old 2 July 14, 18:03   #44
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by trafiken View Post
I have looked at the dialog in Windows XP. It seems that Microsoft at some point decided to don't care if the action is for controller, keyboard, or mouse. Windows XP lists all actions except that actions with identical names are only present once. I don't know if they kept the controller version or the keyboard version of the duplicate actions, maybe it does not matter. This is why the bug in Rally Championship Xtrem was never noticed.

So the correct approach would be to use my complete list of actions and filter out any duplicate action. I was too lazy to do all that...
That makes sense, I guess. I'll try doing that then; it sounds like the most sensible solution.

Quote:
Don't make it harder than it is. Make two versions of the dll. One nice for Rally Trophy and one ugly for everyone else.
Too late It's not terribly complicated, I just check if the current process was launched from anything called "RallyTrophy.exe"; that should cover the relevant scenarios.
fk__ is offline   Reply With Quote
Old 13 August 14, 09:06   #45
Nordschleife
 
Join Date: Feb 2011
Default

Hello, it also have the problem that my new configuration is not saved. I tried deleting the User Map folder and the other steps but it didn't help. Any other solutions?
Nordschleife is offline   Reply With Quote
Old 13 August 14, 13:45   #46
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by Nordschleife View Post
Hello, it also have the problem that my new configuration is not saved. I tried deleting the User Map folder and the other steps but it didn't help. Any other solutions?
Huh. First, you have the `dimap.dll` file (since 1.1), right?

Does it stick while the game is running? I.e., if you set up your controls, then close the dialog, then re-open it, are your settings still there (and they only disappear when you actually exit the game)? Or do they reset immediately?

In any case, more relevant information would be: what Windows version are you using? Do you have UAC disabled? Are you running Rally Trophy as administrator (possibly because you set it to XP compatibility at some point)?
fk__ is offline   Reply With Quote
Old 13 August 14, 18:09   #47
Nordschleife
 
Join Date: Feb 2011
Default

I have UAC on standard ("Standard" in German) and I have Win 7 Professional.
The settings reset immediately (I reopened the dialog just after closing it and the settings have disappeared) and I can't use them for driving. I tred it as admin and UAC disabled but it didn't help. Basicly, I want to change the settings for the shifter as the auto gearbox is not good.
Nordschleife is offline   Reply With Quote
Old 15 August 14, 09:51   #48
Nordschleife
 
Join Date: Feb 2011
Default

I have just reinstalled the game and now it saves the settings but the numbers of the buttons don't fit to the ones I get from other games.
Nordschleife is offline   Reply With Quote
Old 16 August 14, 19:57   #49
fk__
 
Join Date: Jan 2014
Default

Quote:
Originally Posted by Nordschleife View Post
I have just reinstalled the game and now it saves the settings but the numbers of the buttons don't fit to the ones I get from other games.
Well that's good. As for the button numbers, they are currently 0-based, i.e. the first button is Button 0 rather than 1 etc. Is that what you're referring to? I do plan to fix that in the next update.

Edit: Well, I mentioned an update, here it is (download link in the first post). Changes:

Quote:
- better support for other games
- switching devices doesn't discard changes; instead, the 'ok' and 'reset' buttons respectively save and discard changes for all devices
- controller button numbering should start at 1 now
- significantly updated action filtering; there shouldn't be any duplicated actions now with any game
The button re-numbering works fine with both of my controllers and I think it should be sufficiently generalised, but I'm not totally sure it'll work for all possible controllers, so if anyone's device still has button numbers starting at 0, do tell.

Last edited by fk__; 21 August 14 at 15:54.
fk__ is offline   Reply With Quote
Old 21 August 14, 20:27   #50
Lynx Driver
 
Lynx Driver's Avatar
 
Join Date: Mar 2006
Location: Kurikka, Finland
Age: 23
Default

New version works perfectly with PS3 Logitech Chillstream controller. I had some issues with previous version, but now it's perfect for me. Thank you very much about this fix! I can enjoy RT like I enjoyed it 10 years ago.
Lynx Driver is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 19:23.
Home - Top

Powered by vBulletin® - Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

www.nogripracing.com 2003 - 2015
Page generated in 0.11476 seconds with 11 queries