Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)  (Read 6127 times)

0 Members and 1 Guest are viewing this topic.

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
12-Way Rotary Joystick Interface Program. version 2.1

The aim of this encoder is to eliminate the need of a hardware encoder to translate the raw outputs of a mechanical rotary joystick into the clockwise and anti-clockwise turns as required by MAME.
The program sits in your taskbar and converts mechanical rotary joystick outputs to virtual joystick outputs using a virtual joystick (or, if you want, as keyboard presses but these won't be picked up by MAME).
Included also is a configuration tool that will hopefully make the process as easy as possible.



Here's the program and documentation, zipped up.
Rotary Joystick Interface download link: https://dl.dropbox.com/u/68787224/Rotary%20Joystick%20Interface/Rotary%20Joystick%20Interface.zip
You will also need to install PPJoy. The installation and configuation of PPJoy is also covered in the guides.
PPJoy setup download link: https://dl.dropbox.com/u/68787224/Rotary%20Joystick%20Interface/PPJoySetup.zip



I've added support for 2 rotary joysticks via a single virtual joystick device, but 1 will work fine too.
Wiring is the same as most (all?) hardware solutions, reducing 13 wires down to 4 (3 inputs and ground).
There is a wiring guide as well as a setup guide included in the documentation.


If you really like my program or it saves you from buying a hardware interface,
please right-click my program's icon in the system tray and hit "Donate" to bring you to my paypal page.
Buy me a virtual beer/pizza/whatever you think it's worth :)


This is largely to give me feedback and also some motivation to continue with bug fixes and updates.

Thanks to the author of PPJoy and someone called "Ninja Bob" whose DLL was used to help make this program.
Please report on your failures / successes / ideas and anything that may be useful for bug tracking or further development.

Plans for future versions:
- support VJoy as well as PPJoy (since PPJoy is unsigned and this can cause issues for Win7 users).
- allow low-level keyboard output so these too may be picked up by MAME (this seems to be very hard, so I'll probably never do it).
« Last Edit: December 20, 2012, 06:26:31 am by dragonstrap »

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
I had some post here that is now irrelevant and misleading given how much the program has now changed, so I'm removing it.
« Last Edit: December 19, 2012, 11:01:53 pm by dragonstrap »

matsadona

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 760
  • Last login:Yesterday at 06:37:56 am
This is an excellent idea and effort, and I will definitely try it. I am about to build a multi-rotary cabinet based on MAME so if this is really working it would save some money if I only have to buy one interface. Thanks.
Building, collecting and playing arcade machines :)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
I hate to ask, but have you actually tested this on a recent version of mame?  Sending keystrokes to mame in a reliable fashion is rather difficult. 

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
I hate to ask, but have you actually tested this on a recent version of mame?  Sending keystrokes to mame in a reliable fashion is rather difficult.

Thanks for asking. Nope, I didn't - it seems this will likely only work if you compile your own MAME.
Would need to use the DirectInput API by modifying a line in src\osd\windows\input.c to:
#define FORCE_DIRECTINPUT       1

damn.. if only things could be easier. Taking the download offline until I sort this out.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Let me help you out right now:

1.  Abandon any hope of using keystrokes... that just isn't going to work without modifying the mame source.

2.  Switch to using joystick input... that is much easier.

3.  Contact headkaze... he has an joystick simulator driver that will most likely help you out.  ;)

matsadona

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 760
  • Last login:Yesterday at 06:37:56 am
This is when internet forums are at its best - people helping others moving forward with great ideas :)
Building, collecting and playing arcade machines :)

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:May 27, 2020, 09:24:07 am
This is an excellent idea and effort, and I will definitely try it. I am about to build a multi-rotary cabinet based on MAME so if this is really working it would save some money if I only have to buy one interface. Thanks.

If you want a single interface that can also handle rotary, look at the GP-Wiz40 offered by GGG.  It can handle rotary inputs from a 12 position joystick as well.  Same concept, you combine every 3rd wire together.  It's what I use for my modular panel, including my rotary sticks.

matsadona

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 760
  • Last login:Yesterday at 06:37:56 am
Yes, thanks nick3092, I wasn't aware of that.
However I already have an interface from Ultimarc, so I'm still interested in this alternative.
Building, collecting and playing arcade machines :)

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8648
  • Last login:Today at 05:18:29 am
  • ...
Yes, thanks nick3092, I wasn't aware of that.
However I already have an interface from Ultimarc, so I'm still interested in this alternative.

It could probably be done in autohotkey.
It wouldn't surprise me if the OP's program is just a compiled ahk script.
If it is, it would be nice to share it with us.  ;D

It couldn't be too hard to change the keys it posts to fake gamepad button presses that MAME would detect.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:Today at 02:11:02 pm
  • 0x2b|~0x2b?
It couldn't be too hard to change the keys it posts to fake gamepad button presses that MAME would detect.

It's not easy to do without custom joystick drivers like VJoy.

There is a way to inject keys into RawInput using a dll I've written. There are still issues to contend with though, for example, you need to attach a 32 or 64 bit version of the dll depending on the bitness of the MAME process.

I think the easiest way to do it is to compile MAME with FORCE_DIRECTINPUT set.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8648
  • Last login:Today at 05:18:29 am
  • ...
It couldn't be too hard to change the keys it posts to fake gamepad button presses that MAME would detect.

It's not easy to do without custom joystick drivers like VJoy.

There is a way to inject keys into RawInput using a dll I've written. There are still issues to contend with though, for example, you need to attach a 32 or 64 bit version of the dll depending on the bitness of the MAME process.

I thought unlike keyboards, MAME would accept joystick input generated by autohotkey/glovepie/etc.
(provided there is a virtual joystick installed in windows)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
It will, easily.... that's how I did my glovepie scripts to get wiimotes to show up as joysticks in mame.  Not sure what headkaze is getting at. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:Today at 02:11:02 pm
  • 0x2b|~0x2b?
I was just saying you need to have virtual joystick drivers installed. You can't spoof joystick input easily like you can with keystrokes.

I believe GlovePie has been updated to support VJoy as it used to use PPJoy but the drivers wern't signed so you had to put your Windows 7 machine into test mode to use them. VJoy drivers on the other hand are signed.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
I believe GlovePie has been updated to support VJoy

Btw I've been meaning to talk to you about this one.  If is has, I would sure like the link.  CK's site has been "hacked" for ages and he hasn't visited the glovepie forums in months.  The latest version I found was updated in december of last year. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:Today at 02:11:02 pm
  • 0x2b|~0x2b?
When I spoke to Carl a few months ago he said he added support for VJoy so I have not idea why he wouldn't have released it yet.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Well his site has been screwed up for over a year as well.  It might be he added support for his personal use but never released it. 

Kokapetl

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:July 29, 2020, 12:59:49 am
nice
« Last Edit: December 20, 2012, 03:27:03 am by Kokapetl »

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
Release of version 2.1! - now working fine with MAME (via PPJoy) and 2 rotary joysticks supported.

First post has been updated. Please provide feedback / bug reports / suggestions. Thanks.

Also, I posted details of my USB rotary stick here: http://forum.arcadecontrols.com/index.php/topic,129303.0.html


Note and Request : For the software interface to work, you really need to set the Positional Delay to zero and the Positional Sensitivity to 100%.
Does anyone know in which version of MAME they decided to remove these options?
Furthermore, is anyone aware of any diff patches to restore it?
« Last Edit: December 20, 2012, 03:29:29 am by dragonstrap »

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #19 on: December 20, 2012, 03:39:53 am »
For testing purposes, if you try it out there are some things I'd like to know:
Did my program work for you?
Which Operating System are you running?
Which version of MAME?
Which game(s)?
Any problems, suggestions?

edit: removing a question that was stupid and has now been answered so as not to waste anyone's time.

Note to self / others. This may be of use:
http://mame.hower.us/rotary/
« Last Edit: December 20, 2012, 11:38:44 am by dragonstrap »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18573
  • Last login:Today at 03:32:08 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #20 on: December 20, 2012, 05:08:12 am »
Well yur dropbox link is dead... so I'm guessing that might be why you haven't gotten any response.  ;)

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #21 on: December 20, 2012, 06:27:17 am »
Fixed. Thanks for that, I hadn't noticed.

nick3092

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 211
  • Last login:May 27, 2020, 09:24:07 am
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #22 on: December 20, 2012, 10:09:32 am »

Also - if anyone finds a better way of configuring newer versions of MAME (the ones without positional delay and accuracy options), please let me know.
And.. does anyone know when (and why) MAME removed the options for accuracy and delay for rotary joysticks?


I'm using GGG's GP-Wiz for rotary, and it works pretty much the same way your software does by pressing a button based on combining every 3rd wire together.  I'm using MAME v.146 and the options are there and have been for several revisions.  So unless they were removed in .147 (which I sort of doubt) they should still be there.

Once you are in whatever game, you need to go to the Analog Controls menu option.  I have mine set the same way you said needs to be for your software.

Positional Digital Speed = 0
Positional Sensitivity = 100

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #23 on: December 20, 2012, 11:33:31 am »
I'm using MAME v.146 and the options are there and have been for several revisions.  So unless they were removed in .147 (which I sort of doubt) they should still be there.
Once you are in whatever game, you need to go to the Analog Controls menu option.  I have mine set the same way you said needs to be for your software.

Positional Digital Speed = 0
Positional Sensitivity = 100
Wow. I can not believe I missed that, I just assumed it was under the "Player 1 Controls" menu heading.
It's been so long since I've played around with MAME that I just assumed they killed it in a new version along with highscore support ;) haha. Thanks.

I'll fix up the readme and maybe find better default settings for my OutputDuration.

dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #24 on: December 20, 2012, 12:05:15 pm »
I'm using GGG's GP-Wiz for rotary, and it works pretty much the same way your software does by pressing a button based on combining every 3rd wire together.
I was considering doing every 4th wire at first, the program would be only slightly more complicated but it could handle very fast spins of the rotary better in theory.
It seems like there's no real need to do this though.

TPB

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 466
  • Last login:November 12, 2013, 06:58:23 am
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #25 on: October 17, 2013, 09:39:15 pm »
Hi Dragonstrap,

Is your program still at version 2.1 ?

Does it allow usage of Happ rotary joysticks in MAME without the need for a "rotary interface board" ?  That is, it renders the boards from GGG and Ultimarc unnecessary ?

Does it work with both Happ optical rotaries (50-5619-00) and Happ 12-position mechanical rotaries (50-5618-00) ?

Does it work OK with the current version of MAME, or if not, which version do you recommend ?


Thanks.


dragonstrap

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:January 10, 2014, 10:19:56 am
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #26 on: January 10, 2014, 08:55:17 am »
Is your program still at version 2.1 ?
Does it work OK with the current version of MAME, or if not, which version do you recommend ?
I've made some small changes to the configuration tool. It should be easier to understand now. (the link has been updated)
The program itself is still at 2.1, I haven't touched it since then. It should work fine with the current MAME version - try it out.

Does it allow usage of Happ rotary joysticks in MAME without the need for a "rotary interface board" ?  That is, it renders the boards from GGG and Ultimarc unnecessary ?
Does it work with both Happ optical rotaries (50-5619-00) and Happ 12-position mechanical rotaries (50-5618-00) ?
I've only tested this with what I had, and that was a rotary 12 way joystick. It worked for that without an interface board.
Essentially, I've bundled together every third position which you then wire up to as a button. My program translates these 3 button presses into presses triggered from a virtual joystick (which is what you will set to be used in MAME).
It should would for Happ 12-position rotaries without a problem, but not with the optical rotaries.
« Last Edit: January 10, 2014, 10:19:56 am by dragonstrap »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 8648
  • Last login:Today at 05:18:29 am
  • ...
Re: 12-Way Rotary Joystick Interface Program (translates to inputs for MAME)
« Reply #27 on: December 29, 2016, 10:40:16 am »
The DropBox link is dead again.

Does anyone still have this program or an equivalent solution?

Kokapetl

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 47
  • Last login:July 29, 2020, 12:59:49 am
https://drive.google.com/open?id=1cG9LhE7FcLztbox_QXUKQPgLxf7YtZt1

I lost access to the email / password for the DragonsTrap account.
Here's a link to the rotary interface. I haven't touched in years so hopefully it still all works with a current MAME setup.