DirectX app worked on Pentium but has probs on AMD64

Started by
6 comments, last by bobbinus 19 years, 2 months ago
Hi I have a directX game(DX 8.1) I wrote over many months running fine on the machine upon which it was written - Pentium4 2.4Ghz, Asus M/B. I also tested the game on my secondary pc at the time which was a Pentium3 866Mhz also with Asus M/B and it ran fine on that. However I just bought a new pc with AMD64 3400+ cpu again with Asus M/B and there is a problem with driect input. Basically the system devices all enumerate ok(joystick, mouse, keyboard) but when I try to Aqcuire() them so that I can poll for device data the call fails. The code has not changed at all and windows XP has been used on all occasions. I created a directX app wizard that had direct input(the teapot one)support on my new pc and it worked fine. My code is based on this app wizard(the directinput code has barely changed). Has anyone a clue as to why this would happen? My only idea was that it could be to do with processor instruction sets in the compiler environment settings but I really wouldnt know where to start tinkering... Thanks for your time.. ;p
Advertisement
Pay attention to all compiler warnings.
Well all i can suggest is rebuild the entire project including any custom libraries u have used and put warnings on level four.

ace
Actually, this doesn't really sound like a platform compatability issue to me. Not one that is likely to trigger compiler warnings, anyway. Its always worth looking at warnings, however. In fact, its best if you try to get your code to compile without any warnings at all.

Also, I've found the that acquiring devices in direct input is a fickle thing. In my application, I've found that it fails sometimes for no appearant reason. I think it has to do with the state of the application's window (whether it is active) and appears to be sensitive to the timing of events such as fullscreen mode. The first thing I would check is if you are trying to use a different cooperative level than the sample application that works. Secondly, I would try rewriting the code so that if the acquire fails, it skips the acquire and tries to acquire it again on the next game loop. If it is a timing issue, then that should fix the problem. Also, if it is a timing issue, it may explain why it happens on one computer but not another (the computer may simply be running at a different speed).

Edit: PS, as you can probably tell, I haven't really figures this problem out, so if anyone can fill us in, I'd very much appreciate knowing why this happens myself.
thanks for the responses. I quickly tried changing the cooperative level as nimrand suggested but no luck there. Havn't got time for anything else today but will be looking into it tomorrow. The starting plan is to strip out all the directinput code and replace with virgin directx app wizard directinput code then rebuild from there hopefully isolating the problem.

I dont understand a thing about compiler warnings. Could anyone clue me in here as to what settings i need to make(using vc++6) to detect any potential problems.

By the way i forgot to mention in my original post that the keyboard, mouse and joystick were the same for all systems. Thats what led me to suspect the cpu, M/b combo but its really just a guess on my part. Anyways when i do resolve this problem i will report my findings to this thread.

Oh and something else that means nothing to me but might give a clue to someone with more experience: when my app loads it the standard "loading please wait.." message except that i have altered it to also have a few game instructions on a few seperate lines. However on my new system the tab spaces i made in the code to space out the lines are printed as '|' characters so i get a whole lot of this buisiness |||||||||||||||. Didnt happen on the p4, although i fixed just using newline chars and spaces....
With level 4 warnings enabled i am getting 254 warnings in total. However most of these involve the code provided with DX wizard app...
ok i figured it out. It was fixed by deleting the config files in:
C:\Program Files\Common Files\DirectX\DirectInput\User Maps then after stripping out all my directinput code and replacing with the original app wizard code then recompiling. After doing that i reinserted my direct input code and recompiled and it worked fine. Weird...

The only conclusion i can draw is that my code was at fault and for reasons i cant fully explain was not creating the correct user config files for action mapping. It was to do with my code for receiving mouse input data which was using a call to GetDeviceState() which i believe is not generally used with action mapping(the app wizard uses this). The result of this was weakness was that my program ran fine only on a pc that had previously had my code compiled with the directinput app wizard part untouched - as both of my previous systems had because i partially wrote the game on both of them and the input was the last part i wrote so that both of those systems has user map config files that would support my code.

Fortunatly for me by migrating to a brand new pc this weakness was exposed and so i have reworked my code to use just GetDeviceData() to receive input data which means that now i will be able to run on any system confident that the appropriate user map config files will be generated. I know this will happen now because i can delete the user map files and they are regenerated correctly with each execution of the program.

thanks for your post nimrand: you were the only person to suggest it wasnt a hardware issue at all and you were certainly right on that.

This topic is closed to new replies.

Advertisement