Category Archives: Arcade

Repairing a DDRGame Dance Pad

Filed under Arcade, Stepmania

A long time ago, I built a MAME arcade machine. I call it the No18 Arqadium Engine. Head on over to to see it and a ton of other great arcade machine builds.

Over the years, it’s been extended, upgraded, and enhanced in a lot of different ways for a lot of different games.

Some time ago, I picked up a couple of these soft foam Psyclone Essentials Dance Pad controllers:


I couldn’t find the company anymore, so I doubt they’re still in business, but I did find a number of single and dual mat offering on on so if you’re inclined, I’d head that way.

In my case, my intent was always to build my own actual pads and just use the controller boards from the Psyclone mats for the electrical bits.

Years go by

Well, one thing led to another, and we played the soft mats quite a bit but I never got the time to build up the hardcore Dance Dance Revolution arcade-style pads I’d intended on.

And then the dance game craze kind of faded, and my daughter moved off to college, etc, etc.

CraigsList strikes

And then one day recently, I stumbled upon a great deal on a Cobalt Flux dance pad on my local CraigsList.

It included a controller, and… drumroll… it worked flawlessly when I connected it up to the Arqadium!

Upgraded the copy of StepMania I had installed and pullled some newer tracks from the interwebs, and we were hooked again on DDR style gaming!

No Competition

But after all that, I was still missing the DDR style-competition side-by-side danceoffs on dual dance mats.

So I hit CraigsList again and within a few weeks turned up a DDRGame pad complete with a handlebar and PS2/USB controller hardware. Perfect!


No so fast

Got it home, hooked it up and… Nothing. The Select and Start buttons on the actual controller box worked, but nothing on the pad. However, the LEDs did light up when I stepped on an arrow, so I knew it was at least connected and getting power.

I played with it off and on for a few weeks. Connected to other computers, Tried other PS2 to USB adapters plus the one that came with the DDRGame unit but I couldn’t get anything to properly send the mat presses.

Deep Dive

At this point, I wasn’t sure whether the mat itself or the controller board was the issue.

The mat itself connects to the controller using a standard high density 15 pin DSUB connector (the old style VGA connector).

So, a couple safety pins and a Digital multimeter later, and I’d verified that all the buttons on the mat did, in fact, work. At least, when pressed, they completed a circuit from ground (the outer shell of the DSUB connector) to a pin.

Perfect. Standard basic buttons. Nothing fancy in the pad itself.

At this point, it’s time to start cracking heads.

First up, the DDRGame controller board


The RED pins are the arrows and X and O buttons on the mat itself. These markings on the controller board lined up with what I’d determined experimentally using the multimeter, so I knew I was on the right track.

The YELLOW squares highlight the SELECT and START buttons, which are actually on the controller box itself.

This lead to a pinout of the 15 pin DSUB as follows.

Pin 1
Pin 2 X or Up Left
Pin 3
Pin 4 O or Up Right
Pin 5 Ground
Pin 6
Pin 7
Pin 8
Pin 9
Pin 10
Pin 11 Right
Pin 12 Left
Pin 13 Down
Pin 14 Up
Pin 15 Ground

Keep in mind that 15 pin High density DSUBs are numbered in 3 rows starting with one, as shown here:

Pan Pacific DHS-15S 15 Pin Hi-Density D-Sub Female Solder Type Connector

Notice that Pin 1 is at Top Right. Pin 6 is right below it and Pin 11 is Bottom Right.

Next up, opening the Psyclone controller.


I didn’t grab a photo of this board within it’s own housing. Here. it’s pictured already installed in the DDRGame controller housing.

Note the START and SELECT buttons (YELLOW), and the contact pads for the various buttons (labeled J1-J9 in RED) plus a large center pad (GROUND) and one peculiar pad, 4th from the right (LIGHT BLUE) that should be J7, but instead isn’t numbered at all.

After some experimenting, I was able to get the pin out here as:











START button 10

UpRight button 2


DownRight button 4



DownLeft button B1


UpLeft button B3

SELECT button B9

At this point, it was just a matter a digging up a 16pin male DSUB connector, and soldering wires from the DSUB to the contact pads on the controller.


So two minor things came up in the process.

First, I discovered that whatever the contact pads were coated with, solder did not stick to it. No amount of flux, resin etc worked, so I ended up gently scraping the pads down to the bare copper foil and then soldering.

Second, after I’d gotten it all soldered and together I plugged it in to try and nothing worked, at least the arrows didn’t.

Turns out, the mat itself uses the DSUB shell as a ground. I suspected as much and using a quick alligator jumper wire between the shell and a ground pin confirmed it.

So, another quick solder of a jumper wire between the shell and one of the ground pins, and presto! We were in business!

Now we have side by side metal dance pads and lots of DDR competition!

PhaseShift and Frets On Fire X Song Packs

Filed under Arcade, AutoHotKey, Frets On Fire, Games, Guitar, Stepmania

PhaseShift is an excellent freeware (not open source yet, as far as I can tell, but here’s hoping) version of the RockBand genre of games. It’s even more interesting in that it can interoperate with guitar controllers, game drum kits, vocals, keyboards, MIDI, and even step pads (for Dance Dance Revolution style games, all at the same time!).

Very cool stuff.

What’s even better is that it can read both Frets on Fire songs as well as Stepmania format songs.


There are a ton of great song packs available out on the web, and most that I’ve found work seamlessly with PhaseShift. However, I’ve run into a bunch that do not.

The problem appears to be with the NOTES.MID file (the file that contains all the midi notes that is used by the game to show the onscreen “notes”).

After some digging using a hex editor (my favorite right now is Tiny Hexer), I discovered that in all the cases that failed, the NOTES.MID file appears to contain extranous junk. In many cases, it was a string of keyboard key names, in others it was code snippets. I’m guessing that whatever MIDI editor was used to generate those MID files didn’t properly clear garbage out or compact memory.

At any rate, FoFix appears to ignore the extra junk but PhaseShift does not.

Enter EOF

EOF is a song editor for “fretting” songs for use with rhythm games like Frets On Fire and PhaseShift. The latest version even has specific features to take advantage of elements of PhaseShift that don’t exist in Frets On Fire.

I found that simply using FILE – IMPORT MIDI and importing the NOTES.MID file into EOF, then immediately SAVING the file (and clicking YES to the prompt of “The file hasn’t changed, Save Anyway?”), fixed the problem for every single song I tried it on.

It worked so good in fact, that I wrote up a simple script in AutoHotKey to just run through all the files in a directory and perform those magic steps on them

Convert songs via EOF


loop, 1 {
    ;match anywhere in title
    SetTitleMatchMode, 2
    IfWinExist \Songs\
        msgbox No Window

    ;Copy full path name
    sleep 500
    SendPlay ^+C
    sleep 500
    SendPlay ^+C
    ;msgbox %clipboard%

    ;Over to EOF
    IfWinExist EOF -
        msgbox No EOF

    sleep 500
    SendInput {F6}{F6}
    sleep 500
    SendInput %clipboard%{enter}
    sleep 1000
    Send ^s
    sleep 500
    Send ^s!FS
    sleep 200
    SendInput Y
    sleep 200
    SendInput Y

    ;Back to DirOpus
    IfWinExist \Songs\

    sleep 500
    SendPlay {down}


Change the loop value from 1 to some count if you want to run it through more than one song at a time.

To explain:

The F12 key I’ve mapped to a reload just to make editing this script easier. It’s not necessary for actually running the script.

The F11 key hooks to the secret sauce.

I used the SEARCH feature in Directory Opus to list only the NOTES.MID files from all songs in all subdirectories of a folder I was targeting. If you don’t have DirOpus, you’ll need to recode the script to accommodate some other logic for getting the list of full pathnames to process.

The script starts by activating the DirOpus window and copying the full path to the selected NOTES.MID file.

Then it switches to EOF, (which needs to already be loaded), and performs the FILE – IMPORT function, pasting in the filename of NOTES.MID.

It then immediately does a FILE – SAVE (and supplies a few Y keypresses to answer the “save anyway” prompt.

And finally, it switches back to DirOpen and moves down to the next file.

It’s a hack to be sure. But it worked a treat for me.

Rock on!

Normal Ol’ DLLs from

Filed under .NET, Arcade, Code Garage, MSBuild, VB Feng Shui

Every once in a while, I find a need to do something a bit off the wall. Recently, I had another one of those situations.

I’ve spent a lot of time working with some of the old arcade emulators that are floating around (the most famous of which is MAME, or Multi Arcade Machine Emulator).

Mame itself is pretty utilitarian, so there are a number of front ends  that are essentially menuing systems to provide a user with an easy to browse interface for selecting games to play and among the more popular front ends is MaLa.


MaLa Main screen (using one of many available skins) showing list of games, and a screenshot of the selected game

One nice aspect of MaLa is that it supports plugins, and there are a number of them out there, to control LED lights, play speech, etc.

I had had a few ideas about possible MaLa plugins for awhile, but the MaLa plugin architecture centers around creating a standard Win32 DLL with old fashioned C styled Entrypoints, and, well, I kinda like working in these days.

Gone Hunting

Eventually, curiousity got the better of me, and I started looking for ways to expose standard DLL entry points from a .net assembly. I ended up finded Sevin’s CodeProject entry called ExportDLL that allowed just that. Essentially, it works by:

  1. You add a reference in your project to a DLL he created, that only contains a single Attribute for marking the functions you want to export.
  2. Create the functions you want to export as shared functions in a MODULE
  3. You mark those functions with the Attribute
  4. You compile your DLL
  5. You then run ExportDLL against your freshly compiled DLL
  6. ExportDLL then decompiles your DLL into IL, tweaks it, and recompiles the IL code back into a DLL

It sounds complicated but it’s really not.

I set it all up and had things working in about 30 minutes.

Gone South

Unfortunately, all was not quite right. MaLa requires 2 entry points (among a host of them) defined with a single integer argument passed on the stack. Pretty simple stuff. So I coded up:

    <ExportDLL("MaLaOrientationSwitch", CallingConvention.Cdecl)> _
    Public Shared Sub EntryPoint_MaLaOrientationSwitch(ByVal Orientation As Integer)

But when I ran the DLL within MaLa, it crashed immediately after calling this function, even with NO CODE in the function itself.

What this meant is that something about the export process was trashing the stack. I spent a solid day hunting for clues as to what might be failing. I did find that eliminating the argument from the exposed entrypoint allowed MaLa to work properly AND call my entrypoint, but, being unable to get the passed Orientation value, the call was basically useless.

Gone Around Again

In digging through it all, I happened to notice a comment on the CodeProject page for Sevin’s article pointing to a similar library by Robert Giesecke. I’m not sure if the two were developed independently or not, but Robert’s is certainly a more polished set of deliverables. He even went so far as to put together a C# project template that makes it ridiculously easy to kick off a project using his technique.

It turns out, not only is Robert’s approach cleaner, it actually properly exports the MaLaOrientationSwitch function above with no problems. MaLa can call it, pass in the argument and all is good.

Gone Fishing

One big difference between the two techniques is the Robert actually defines an MSBuild targets file to patch his DLL directy into the Visual Studio build process. Very cool! But, his build step happens AFTER the PostBuildEvent target, and it was in that target that I’d setup some commands to copy the DLL into a file called *.MPLUGIN, which is what MaLa specifically looks for. Hooking that process into the build itself makes debugging things quite natural, but, Mr. Giesecke’s target wasn’t allowing for that.

Here’s Robert’s targets file:

  <UsingTask TaskName="RGiesecke.DllExport.MSBuild.DllExportTask"
  <Target Name="AfterBuild"
      <DllExportTask Platform="$(Platform)"

I’d worked with MSBuild scripts before, so I knew what it was capable of, I just couldn’t remember the exact syntax. A few google searches jogged my memory, and I ended up here at a great post describing exactly how you can precisely inject your own targets before or after certain other predefined targets.

I modified Robert’s targets file and came up with this:

    <UsingTask TaskName="RGiesecke.DllExport.MSBuild.DllExportTask"

  <!-- Add to the PostBuildEventDependsOn group to force the ExportDLLPoints
       target to run BEFORE any post build steps (cause it really should) -->

  <Target Name="ExportDLLPoints"
    <DllExportTask Platform="$(Platform)"

Now, I can perform the compile, and execute my postbuild event to copy the DLL over to the MaLa Plugins folder and give it the requisite MPLUGIN name, all completely automatically.

And, the icing on the cake is that I can build a MaLa plugin completely in, with no C or C# forwarding wrapper layer and with a fantastic XCOPY-able single DLL application footprint (save for the .net runtime, of course<g>).

It’s a wonderful thing.

OpenGL 2.1 on an ATI Radeon x1900XT

Filed under Arcade, Hardware

I converted my system over to Win7 64 about 5 months ago, but hadn’t really had much time to do any gaming.

Eventually, my daughter asked about playing a Disney Princess CD that she’d played for months under Vista 32.

So I pulled out the CD, ran through the install and started it up. Chug… Chug… Chug… Crash!

Ugh. This isn’t good. After some digging around, turns out that Disney Princesses is an OpenGL game that requires 1.1+. Ok fair enough. This is Win7 after all.

I found an app called OpenGL Extensions which shows detailed info about the OpenGL stack loaded and turns out, I was using the generic MS video driver and OpenGL 1.0. Yikes!.

So I tried installing the latest ATI drivers, which, as of April 2010, is 10.3. No dice. The x1900XT is no longer supported.

Double Yikes!

And this card is not  that old.

Long story short. I grabbed the 9.11 version of the Catalyst drivers off the ATI website here. They appear to be the last version (for Vista 64) that did support the x1900XT, and they DO install under Win7 64 (albeit the manager pops an error about some MOM file being missing, but that doesn’t seem to affect the drivers).

Now, OpenGL extensions reports OpenGL 2.1 and that game works flawlessly.

And, I suppose, I’ll be in the market for a newer video card at some point in the nearish future.

When Videos Only Play Audio

Filed under Arcade, Media, Troubleshooting

image I recently was doing some work with some videos. Things were working just fine at one point, but then I installed the latest version of JRiver Media Center (version 13).

Whammo. My videos wouldn’t play anymore. Well, actually, they’d play audio, but the video was just black.

I thought it was the particular app I was using, so I tried Media Center, and Microsoft’s Media Player. Same result.

From past experiences, I figured something had hosed a codec (codecs are utility libraries installed on your machine that code and decode video and audio files, each format has it’s own codec).

But, where to start looking?

So, I did some googling and found a great page that lists all the various FOURCC codes for codecs:

From that, I found a little app you run against a specific AVI to determine what codec it uses, called GSPOT:

Running that against the AVI in question yielded the XVID codec.

Alternatively, just view the AVI in a hex editor and look at the header in the file:


You should be able to pick out the four character CC code fairly readily.

Then, from the table at FOURCC, I went to the xvid codec page:
Downloaded and installed. Presto! Videos with audio and video again!

It’s just that simple 🙂

WinIPAC controller software isn’t quite right

Filed under Arcade, Hardware, Troubleshooting

image Here’s an example of the “When software doesn’t work right, it can cost loads and load of time” type bug.

I’m using an Ultimarc WinIPAC controller board for a project I’m working on. This is an awesome little controller board that looks like a USB keyboard, and supports mapping of up to 56 switch inputs to any normal keyboard key. It also has LED outputs for driving LED’s or other applicable circuits.

Anyway, the IPAC comes with a simple keyboard mapper/programmer that you use to layout your buttons, then assign which key to which button and finally to upload the mapping to the IPAC (It saves the mapping in non-volatile ram on the board, which is even more fantastic).

Anyway, I’d mapped a particular key to the ENTER key, as shown here.


But when I was testing all my mappings out, it didn’t work. Actually, it’d flash sometimes but not consistently. Every other key worked flawlessly.

I spent the better part of 3 hours trying to debug what the heck was happening, swapping wires, using a test meter to verify connections, switch operation, etc.

I even pulled the latest version of their website, but still no joy.

In the end, I discovered that it’s the WinIPAC software  that doesn’t quite handle ENTER keypresses properly. I opened up NOTEPAD and just started pressing buttons and all of them, including the switch I had mapped to ENTER, worked perfectly.


<UPDATE> I emailed with Andy at Ultimarc (these guys get back to you quickly! Very nice support). Anyway, his comment was that the WinIPAC software isn’t intended as a test application, only for programming.

I pointed out that if that’s the case, there really ought to be a warning somewhere to that effect, especially if you map keys whose actions can’t be displayed properly in the application. My rationale was, well, it DOES properly display keyboard status for virtually all the mappable keys so why wouldn’t any normal person assume it could be used as a test app? But, in the end, it’s easy enough to use notepad for those tested, IF you know enough to realize you need to!

Tiny PC

Filed under Arcade, Games, Hardware

image Here’s a slick little gizmo.

The VIA ArtiGo mini pc.

It’s a full PC, with space for a 2.5″ HD, onboard graphics and audio, and up to 1 GB ram. And it fits in a 5.25″ harddrive bay.

I know, I know, there are case modders out there making still smaller PC’s, but this one’s 300$ at Fry’s, no added bother, headaches, or a Dremel necessary.

The specs are decent, but I wouldn’t want to code on it. However, you could probably make a decent Mame cab out of just about anything you have lying around and I’m guessing this would be plenty powerful enough to drive it, not to mention it’d fit just about anywhere without even a second glance.

Arcade Ambience

Filed under Arcade, Media, MP3s

If you’re putting together an Arcade cabinet or if you just like the ambience of an old arcade parlor while hacking away at some code, you might get a kick from Andy Hofle’s Arcade Ambience project.


Basically, Andy took recordings of playing dozens of arcade machines, remixed them, adjusting volumes, pans, etc, and ended up with several, very large, mp3 tracks of background ambience that sounds very much like stepping into an old arcade. What’s even better, the tracks are so large (at 70+mb each), they effectively don’t loop, so you don’t get that been there, heard that feeling that’s typical of ambient tracks.

Couple that with an arcade front end that can play an arbitrary mp3 looped as background sounds, and couple that with a recent audio card that supports multiple simultaneous channels, and you get all the ambience of walking into an arcade while playing any emulator, Visual Pinball table, etc.

Visual Pinball. Is it real or is it…

Filed under Arcade

Take one Bally pinball plunger off EBay (7.99$)


Hack together a plate and attach a roller microswitch to it (4.95$ at Happ, but 1.98$ at Fry’s)


Position things such that the switch is pressed when the plunger is at rest, but when you pull back on the plunger, the switch releases, like so:


(it’s a vertical picture, normally the plunger sits horizontally)

Then wire the NC (normally closed) connection to an Ultimarc IPAC as just another pushbutton.

Finish up with a couple of Competition pushbuttons mounted to the side of your desk (or some other convenient place).

Now, load up Visual Pinball, grab a few table files (the Black Hole table is especially nice), crank the volume way up, and line up some quarters on the lip of your monitor, just for some ambience.


All (ok, most) of the arcade goodness of the early eighties in a fraction of the space. This nifty thing is, wired up this way, when you pull back on the plunger, the switch is released, which, because of wiring it to the NC connection, has the effect of pressing and holding that button, until you release the plunger. This exactly models the Visual Pinball concept of pressing the Enter key and holding down on it longer to “pull farther back” on the plunger. Granted, it’s not as exact as, say, a cog driven mouse wheel hack, but it seems to be pretty accurate so far and it was a heck of a lot simpler.

Next? Hook a tilt plumb bob


to several contacts to simulate a full-on tilt mechanism (Visual Pinball supports tilt-left and tilt-right keys, not sure about other pinball sims).

Grid Wars 2

Filed under Arcade, Games, VB Feng Shui

Ok, nothing to do with Visual Basic, but, you gotta come up for air sometimes!

It’s been a while since a video game really wowed me.

I mean, there’s lots of slick 1st person shooters out there now and with some of the heavy iron running around now, the graphics can make “Toy Story” almost look like “Dragon’ Lair.”

Still, nice graphics only go so far. And 1st person shooters are starting to see a little stale.

Then I stumbled into Grid Wars 2. Holy cow. I mean, seriously.


World of Stuart summed it up thusly in his review; “THIS is a video game.”

Go there for some wicked screenshots (far better than what I’ve put up here) and a link to download. You can’t get it from Marc Incitti’s site anymore <sigh>. Apparently, it’s a bit too much like “Geometry Wars” for the comfort of its creator. Grab your copy while you can.

I’ve never played it’s progenitor, but Grid Wars 2 definitely brings the frenetic back to video games. Plus, some subtle scoring tricks that WOS discusses in his writeup that make it all the more interesting. And there seems to be no end to the unique powerups that pop (get 150 bad guys, 3 black holes, 4 snakes, with quad cannons, side fire, fast fire and bouncing shots going all at once, and you’ll swear your screen is about to catch fire).

And, come to think of it, there is a little bit of VB goodness here, or rather BASIC goodness. It’s opensource, and written in BlitzMax, a pseudo-basic, game programming platform form Blitz Research. Plus, the install is unbelievably sweet. A zip file. Just unzip somewhere and run the EXE. T’would be a blessed day that Office trod down that path.