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 Try the site in https mode Site News

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

  

Author Topic: Improved Light Output for StepMania and Open In-The-Groove  (Read 3343 times)

0 Members and 1 Guest are viewing this topic.

twistedsymphony

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 584
  • Last login:February 03, 2024, 11:13:51 pm
  • Play stupid games... win stupid prizes.
    • solid-orange.com
    • CollectorsEdition.org
Improved Light Output for StepMania and Open In-The-Groove
« on: February 16, 2014, 03:37:40 pm »
I have a Dance Dance Revolution Arcade machine and (like many people who own these machines) I swapped out the original PCB for a PC running StepMania. Obviously I wanted to get all of the cabinet lights working but I discovered that because of the way it was programmed light outputs only work on the parallel ports and even worse, the port addresses are hard-coded within StepMania. Since my PC uses a PCI based parallel port card I would have to modify the source and recompile...

I thought this was a exceedingly DUMB design so I did something about it.

I have some programming abilities (albeit not with C++) so rather than modify the source I decided to write a new parallel_lights_io.dll that works the way SM should have worked from the start. That way anyone who wants to add light output to SM can do so by simply adding these files to to their installation directory. Basically all this does is provide you with a .ini file that you can modify with your port addresses instead of having to do it in your source code. (also it uses the freely available and better inpout32.dll instead of the licensed and buggy io.dll that SM was built to use)

Download here: http://solid-orange.com/wp-content/uploads/2014/02/twistedsymphonys_stepmania_parallel_port_io_dll.zip

The download includes installation instructions as well as an FAQ with a bit more information than whats in this post.

Supported Versions:
This is tested and working on SM 3.9 Plus Redux and OpenITG Beta 2 in Windows XP... I wont work on any version that has light output intentionally disabled in source (which means vanilla SM 3.9 and 4.0 will not work) I haven't tested it on any other releases or OSs...

If you're using a Linux build then you don't need this... this is only for Windows.

If you're at all interested in getting light output working please feel free to download and try this out... I'm interested to see how it works for other people. You'll obviously need some hardware output on your parallel ports to see it working.


Hardware:
I'm using a Rosewill RC-304 dual parallel port PCI card (it's also low-profile if you're using a half-height PC case) though any properly installed parallel ports should work

As for building a light driver board for your parallel ports there are literally hundreds of ways you can do it... some great info can be found here: http://www.epanorama.net/circuits/parallel_output.html#realworld

If your intention is to hook this up to a real DDR Arcade machine. DDR has a light driver board already installed, you simply need to invert the parallel port outputs by using an opto-isolator OR a few 74 series inverter chips.... OR utilize the transistor/diode/resistor circuit for relay output described in the link above. The circuit requires a lot more soldering but I'm using that because it's self-powered from the parallel port which makes for a cleaner install (opt-isolators or inverter chips would require an outside power source)... the DDR driver boards don't draw much current, they're just checking for an on/off value on the pin.... If you try to power a lamp any larger than an LED then you'll likely blow out your parallel port which would be bad.

You can find pinouts for the DDR light connectors as well as the parallel port output map here: http://beta.stepmania.com/forums/general-questions/show/83#post543

Parallel Port Hardware Testing:
If you're having problems and you want to test your hardware with a program other than StepMania then I recommend this app: http://lpt-port-test-utility.software.informer.com/3.0/

I used that myself quite a bit when developing this little dll. you just plug in your port address and you can turn on and off the output pins on the parallel port to test out your hardware without the use of StepMania.


---------------

I'm just happy to get this working for myself but if it this helps someone else then that's even better...

If you want the source code for this let me know and I'll get it to you. (it was built using Visual Studio 2008, for some reason I couldn't get it to work using anything newer).

---------------

I'll post up information about my hardware interface board once I have it complete.

I've also acquired an Ultimarc Pac-Drive and I'll be looking into getting light output on that for a solution other than Parallel ports.
« Last Edit: February 16, 2014, 03:42:48 pm by twistedsymphony »

pbj

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11061
  • Last login:Yesterday at 08:00:32 pm
  • Obey.
    • The Chris Burke Band
Re: Improved Light Output for StepMania and Open In-The-Groove
« Reply #1 on: February 16, 2014, 05:01:42 pm »
You are a god amongst men.   :notworthy:

twistedsymphony

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 584
  • Last login:February 03, 2024, 11:13:51 pm
  • Play stupid games... win stupid prizes.
    • solid-orange.com
    • CollectorsEdition.org
Re: Improved Light Output for StepMania and Open In-The-Groove
« Reply #2 on: February 26, 2014, 12:08:12 pm »
So I wanted light output via PacDrive in SM 3.9 and added it...

Based on my earlier work I also add the improvements to  Win32Parallel into the source code instead of an external dll.

In order to use this you'll have to add/overwrite the files in the source code and recompile. The source code and all necessary files to make that work can be downloaded here: http://web-nine.com/files/twistedsymphonys_sm_3.9_lights_package.zip

The pin assignment follows the same pattern as the parallel ports so
1-8 are cabinet lights, 9-16 are platform lights.
detailed pinouts can be found here: http://beta.stepmania.com/forums/general-questions/show/83#post543

------------

These are both setup for Win32, though making them work in Linux would be very easy to do... I'm just not setup for compiling or testing in Linux so I didn't want to change that code and send out untested stuff.

Similarly these could easily be made to work with SM 5.0 or whatever, I built this in 3.9 because I'm using Beware's DDR Extreme simulation and wanted light output in that.

Feel free to use/distribute this code however you like so long as you give me appropriate credit.

1 thing that could be improved is that the parallel lights get their port addresses from a separate .ini file, I would think ideally you'd want it to get it's values from the StepMania.ini file, however I don't know the best way to do this (and my request from the SM devs for some insight was ignored)... so I'll leave that improvement to someone else who is more familiar with inner workings of SM.

-------------------

I have no plans to improve this further, however Beware will be adding this to his next release of the DDR Extreme simulation and will supposedly be getting Linux support working. Also LANman247 will be attempting to get Serial port/Arduino based light output working for SM 3.9/Beware... more info in this thread: http://zenius-i-vanisher.com/v5.2/viewthread.php?threadid=5076&page=1

-------------------

If you have any questions or need any help getting this to work let me know.
« Last Edit: February 26, 2014, 12:17:26 pm by twistedsymphony »