Jump to content
SpesoftPinballXConvert-It
headkaze

[PLUGIN] PlugInUltraStik 1.21

Recommended Posts

I decided to pull out my U360's and see if I could sort out the issues a few people have been experiencing with Oggalz UltraStik plugin. Unfortunately I couldn't get it to work on my XP 64 machine. I believe there is a bug in ICSharpCode.USBLib.

So I decided to write my own C++ UltraStik library and p/invoke it from C# instead of trying to find another libusb wrapper in C#.

So here is version 1.0 of my own UltraStik plugin, and I hope Oggalz isn't offended by me releasing it.

If you have any problems with it please post here. If your a Vista 32/64 user please let me know if it works on your machine.

Just gave this new version a thorough testing and it is changing some UltraStik mappings, unfortunately it's not changing them per the mameinfo.dat or PlugInUltraStik.ini.

I started with my UltraStiks in 8 Way Easy Diagonal modes programmed with Ultramap and confirmed they were working. I copied all of the files from the attachment above to the GameEx-->PlugIns folder. I also built a custom map with UltraMap, named it testcustommap.um (it has all directions inverted for easy testing), confirmed that it worked and moved it into the GameEx-->PlugIns-->UltraStikMaps folder.

I then turned on the Plugin and fired up GameEx. No matter the game, it appears to stay in joy4way mode. I tried changing all of the defaults in the PlugInUltraStik.ini file to joy8way and/or easyjoy8way and this had no effect. I also tried a custom entry (for the robotron since it's the easiest to tell if 8 way is working) robotron=joy8way which had no effect. I also tried my custom map on several roms (robotron=testcustommap.um) but that had no effect. The plugin does accurately change to 'mouse' mode upon exiting GameEx.

Seems like you're close, it's obviously changing the UltraStik maps, just not accurately.

Share this post


Link to post
Share on other sites

Hmm very strange, although there were a few bugs I found (fixed in 1.01) it definately should be loading settings from the ini file okay.

Turn on debug (it works now), although you won't see the popup message until you exit the game. I'll have to ask Tom if he can fix it so the message will appear before the game is launched.

A good way to test this is to run GameEx in windowed mode, and run UltraMap along side it. When you run a game you can tell if it's changed the settings from watching the little + cursor in UltraMap.

At least we know it's sorta working for you, but with 1.01 I really can't fault it. Can you also attach your testcustommap.um.

Share this post


Link to post
Share on other sites

Okay I've knocked up a little test program to check that my library is working okay for you. This should help determine if the problem lies in the plugin or my library.

Make sure you select a joystick from the list before you try setting a map. Again running UltraMap alongside this will help you figure out if the mapping is working okay.

post-367-1211854135_thumb.png

UltraStikTest.zip

Share this post


Link to post
Share on other sites

PlugInUltraStik 1.02 Released

- Added support for using parent ROM names in PlugInUltraStik.ini

- Added support for UltraMap Config (.ugc) files

Share this post


Link to post
Share on other sites
PlugInUltraStik 1.02 Released

- Added support for using parent ROM names in PlugInUltraStik.ini

- Added support for UltraMap Config (.ugc) files

Hey Headkaze, thanks for the updates. I've given this the go-through, results below:

  1. The UltraStik test utility works perfectly. I was able to run it side by side with Ultramap and set every map type, including customs successfully. Not sure what the 'Set Flash' and 'Set Ram' do.
  2. Upon launching GameEx joys successfully changed to joy4way and successfully changed to mouse upon exit.
  3. Upon launching any Mame game, the joys stubbornly stayed in 4 way mode. Tried changing Mame's default to joy8way in the init file, didn't work. Tried custom rom entries, ie. robotron=joy4way and robotron=testcustom.um, didn't work.
  4. Initially in addition to staying in 4 way mode the joystick was drifting rather sharply. Found the following entries in the mame.ini file for digital joys:
    joystick_map auto
    joystick_deadzone 0.3
    joystick_saturation 0.85
    Removing them fixed this problem but the joy remains in 4 way mode. Tried leaving just joystick_map setting on auto and set to 0 and 1 but didn't seem to have an effect.
  5. Turned on debug mode and tested 4 games, none of them show a joystick type, only rom names along with their clones in hash marks. Oddly, the 1943 dialog showed before the game launched but was blank. See below:
    /xmvsfu/xmvsf (Xmen vs. Street Fighter)
    /pacman/puckman (Pacman)
    /robotron/ (robotron)
    blank (1943)
  6. Not sure how you implemented loading of .ugc files, so I didn't test that.

That's all I got. The utility works perfectly. Note for others testing that the change isn't reflected in the dropdown menu in UltraMap, the only way to see the joy has been remapped is to look at the crosshair in UltraMap and move the joystick.

Custom map with directions inverted below. Seem to be getting closer. :)

Share this post


Link to post
Share on other sites

That's good news about the library working, so it must be a problem in the plugin.

I think I know were the problem is but I still can't see any problem in the code. So attached is a test plugin that will show a MessageBox when it attempts to get the right map file.

You will need to run GameEx in Windowed mode to see the MessageBox's because I'm not using the internal one. You should see two messages called UltraStikMap1 and UltraStikMap2 when it attempts to set a map. The first one shows game details and the second shows the map file.

If there is an error it should show a MessageBox with the error. I'm expecting an error and hopefully this should give me enough info to figure out what's going on.

BTW ugc files allow you to have different mappings for different joysticks.

Eg.

# This is an Ultimarc UltraStik Game Configuration file
UltraStikGameConfigurationFileFormatVersion=1.0

UltraStik1MapFile=Analog
UltraStik2MapFile=Mouse Pointer
UltraStik3MapFile=Analog
UltraStik4MapFile=Analog

Share this post


Link to post
Share on other sites

Thanks for the heads up Stub.

Okay I've uploaded a new version, this time when you turn on debug it will output to a log file called PlugInUltraStik.log. This should make life much easier. So shaunopp just run it with debug turned on then post your log here.

Share this post


Link to post
Share on other sites
Thanks for the heads up Stub.

Okay I've uploaded a new version, this time when you turn on debug it will output to a log file called PlugInUltraStik.log. This should make life much easier. So shaunopp just run it with debug turned on then post your log here.

Log file from test below. Ran a variety of games with different controls, Tron, Qbert, Space Invaders, Marvel vs. Street Fighter, Robotron, Galaga, Pacman etc...

Share this post


Link to post
Share on other sites
Log file from test below. Ran a variety of games with different controls, Tron, Qbert, Space Invaders, Marvel vs. Street Fighter, Robotron, Galaga, Pacman etc...

Wrong log file, that's the GameEx log file, I need PlugInUltraStik.log located in the PLUGINS folder.

Also can you tell me what version of Mame your running?

Share this post


Link to post
Share on other sites
Wrong log file, that's the GameEx log file, I need PlugInUltraStik.log located in the PLUGINS folder.

Also can you tell me what version of Mame your running?

Oops, sorry about that. Correct log below.

Running vanilla mame .122

Share this post


Link to post
Share on other sites
Thanks shaunopp, I think I found the bug, please try 1.04.

Excellent, tried this quick over lunch and everything worked well with a variety of games. Will test more tonight.

Share this post


Link to post
Share on other sites
Version 1.1 Released

- Support for default mame maps

That's great headkaze, seems to work suhweet!! I'll let you know if I find any snafu's but so far so good. Thanks for getting this figured out!

Share this post


Link to post
Share on other sites
That's great headkaze, seems to work suhweet!! I'll let you know if I find any snafu's but so far so good. Thanks for getting this figured out!

Plugin Seems to work great, bounced back and forth between 4way and 8way games and everything seemed to play fine. Thanks for developing this, definately my most valuable plugin now. Running Vista64.

Not directly related to your plugin, but I have noticed that the UltraMap tool on my system does not show the actual map loaded, it seems to only display the last map loaded by the tool itself. I set my U360s to 2way, fired up GameEx and was able to navigate the menus fine in all directions. Alt tabbed over to UltraMap and it still showed 2way even after rescanning. Played 1943 in fine 8way fashion and chedk UltraMap again and it still showed 2way. So I would not rely too heavily on what it shows as being loaded.

Share this post


Link to post
Share on other sites
Plugin Seems to work great, bounced back and forth between 4way and 8way games and everything seemed to play fine. Thanks for developing this, definately my most valuable plugin now. Running Vista64.

Not directly related to your plugin, but I have noticed that the UltraMap tool on my system does not show the actual map loaded, it seems to only display the last map loaded by the tool itself. I set my U360s to 2way, fired up GameEx and was able to navigate the menus fine in all directions. Alt tabbed over to UltraMap and it still showed 2way even after rescanning. Played 1943 in fine 8way fashion and chedk UltraMap again and it still showed 2way. So I would not rely too heavily on what it shows as being loaded.

Glad you like it :)

As for UltraMap not showing the current map loaded to the stick, I don't think it can since programming the stick is mostly one way. AFAIK You can't query the device for what type of map it's using. Even if you could query it the maps can be totally custom so I can't image how it could do that anyway.

The way I use UltraMap is to watch the little + cursor as that shows the limitations of the joystick when you move it. In other words if the + cursor only moves up/down/left/right you know it's fourway, if it also moves diagonals it's 8-way, if it moves anywhere it's analog etc.

Share this post


Link to post
Share on other sites

I've tested the plugin pretty thoroughly now, in addition to testing the regular mame controller types I tested custom .um and .ugc files which worked great.

The only game that didn't cooperate was Crazy Climber but it turns out that it has a weird mame configuration. For example, even though it's double 8-way joysticks you have to manually program Right and Left joystick directions manually specifically for Crazy Climber, you can't just rely on your default P1/P2 joystick configuration. Other double 8ways like Robotron don't seem to have this issue. The point I'm making here is that if it appears that the Plugin isn't setting the map correctly double check that is isn't a mame issue.

Great job Headkaze, this is invaluable for people who have U360's w/Vista and your time working on it is greatly appreciated. Make my gaming life much more :D

Share this post


Link to post
Share on other sites

Cheers shaunopp! Happy to help out where I can. Good to see .um and .ugc files working good for you as well.

Now all I have to do is find some time to finally install my U360's into my panel! I'm not looking forward to the job actually mainly because I will have to undo all the microswitch wiring for my current joysticks and I'm wondering if I'll even be able to unscrew the handles as I put a small amount of glue on the thread to stop them spinning around. I found out later on it's better to use tape instead so you can actually unscrew them if you need to; something I regret not doing now!

Share this post


Link to post
Share on other sites
Cheers shaunopp! Happy to help out where I can. Good to see .um and .ugc files working good for you as well.

Now all I have to do is find some time to finally install my U360's into my panel! I'm not looking forward to the job actually mainly because I will have to undo all the microswitch wiring for my current joysticks and I'm wondering if I'll even be able to unscrew the handles as I put a small amount of glue on the thread to stop them spinning around. I found out later on it's better to use tape instead so you can actually unscrew them if you need to; something I regret not doing now!

Well hopefully installation won't be too bad if you use the wiring harness for the buttons instead of wiring them for keymapping. Bummer on the glue, that could be a major pain. I just hand tightened mine by holding down the post with a crescent wrench and they've never come loose. The work is well worth it though as they're killer joysticks and even more so now with a cool GameEx plugin! B)

Share this post


Link to post
Share on other sites
I decided to pull out my U360's and see if I could sort out the issues a few people have been experiencing with Oggalz UltraStik plugin. Unfortunately I couldn't get it to work on my XP 64 machine. I believe there is a bug in ICSharpCode.USBLib.

So I decided to write my own C++ UltraStik library and p/invoke it from C# instead of trying to find another libusb wrapper in C#.

So here is version 1.0 of my own UltraStik plugin, and I hope Oggalz isn't offended by me releasing it.

If you have any problems with it please post here. If your a Vista 32/64 user please let me know if it works on your machine.

You've done a terrific job here HK! I've given it the run through and it seems to be working well in my XP cab using the latest GameEx. This is the most cool thing in GameEx in a LONG while. (Sorry Tom, I just don't use most of the newest features, but love it otherwise. Nonetheless it's running so much faster and more efficiently than from my last update, about a year ago. SO thanks for that)

My only question, HK: is there a way I can choose which map loads for a game? I have optimized maps I've created for Qbert, Sinistar, Frogger and others. Even when I copied in my custom QBert map, for example, into the plugin's maps folder, and renamed it to the filename that came with your plug-in (and deleted the one that came with your plugin), the QBert game is still is not playing right. So that's one that has me especially puzzled.

But most games and maps seem to be working as expected.

Thanks again!

Share this post


Link to post
Share on other sites
My only question, HK: is there a way I can choose which map loads for a game? I have optimized maps I've created for Qbert, Sinistar, Frogger and others. Even when I copied in my custom QBert map, for example, into the plugin's maps folder, and renamed it to the filename that came with your plug-in (and deleted the one that came with your plugin), the QBert game is still is not playing right. So that's one that has me especially puzzled.

Can you turn on debug in the PlugInUltraStik.ini file then post your PlugInUltraStik.log file. Also can you zip up your custom map files and post them as well.

Share this post


Link to post
Share on other sites
Can you turn on debug in the PlugInUltraStik.ini file then post your PlugInUltraStik.log file.

Sorry HK, I'm pretty obtuse when it comes to something as technical as debugging and running logs. One thing I can say, this morning I went and copied the QBert map that comes with your plugin over unto my Ultramap so I could look at the settings visually. It looks identical to the one I built for myself -- though mine may have a slightly larger sticky center. Anyhow, via GameEx I can confirm that QBert is not loading your .um file on the fly -- at least for me. (It appears to be playing a standard 4-way or 8-way; definitely isn't playing right. QBert keeps jumping wrong ways.) Yet if I load your map into my Stiks and play MAME direct -- not via GameEx -- the map is playing fine.

Honestly I'm still a little new to your software; just spent time updating GameEx and testing out your plugin yesterday. So possibly other maps are not loading properly. But I ran through 12-15 different games. Pac-Man appears to be loading a 4-way; Joust appears to be loading the 2-way; Sinistar appears to be loading the analog; Fighter games like Marvel seems to be loading 8-way; etc. Most seem to be doing fine. QBert was the first that raised my eyebrows. Well and besides that I'd love to be able to also load some of my optimized maps for some specific games.

Also a note: I am not running the latest UltraStik firmware. About a year ago Andy and I were trying like to devil to figure out why my Stiks didn't recognize using his latest firmware at that time (1.1.18) -- always forced me to manually plug and unplug them on every startup. So I ended up downgrading to 1.1.15 and staying with that since then in order for my Stiks to load "seen" and functional every time I turn on the machine. I don't know if that would be connected or not to any issues that may or may not crop up with your plugin. Just thought I'd mention in case.

Also can you zip up your custom map files and post them as well.

Yeah, I'd always be willing to share my .um files -- if that's what you're asking for. Honestly, some aren't perfected, like mine for Sinistar, which is damn hard playing just via analog settings. It gets to be a pain when you have to manually run Ultramap before every game. That's the only thing I have had a love/hate reltionship with these Stiks. But with something as slick as what you've developed so they load on the fly, if there is a way to easily marry maps with games -- would be so cool if you could just choose via drop down in the frontend -- there's no reason we shouldn't all be sharing optimized maps one with another.

BJ

Share this post


Link to post
Share on other sites

If you go into the GameEx\PLUGINS folder you will see a file called PlugInUltraStik.ini. Open that file in Notepad as that is where you set custom maps.

There is an option in there called Debug=True. Remove the # from the beginning of the line then run GameEx again. This time it will output a file called PlugInUltraStik.log in the GameEx\PLUGINS folder.

It will help me determine if there is a problem. The firmware version could very well be causing the problem, I may need to add some extra logging output to display some extra info about your UltraStik's. You could of course update your firmware to see if that changes anything then downgrade again. For now though I really need you to turn on debug and post your PlugInUltraStik.log file here.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...