So now I'm gonna do this, too! But instead of buying Retrozone stuff I'm going to program and install a PIC myself (a lot cheaper that way! Maybe $10 worth of parts, plus the controller itself.)
Please let us know how that goes! If you read that article that logik posted, they were trying to create an open-source (or, atleast free) code for the PICs. I would love to do this if I could create it from scratch.
Hey,
I finally did it! Maybe I can post some photos later...
I did screw up, though - I installed a version of my firmware that hadn't been tested on Windows - so my first finished USB NES pad works on Linux and Mac OS (8.6 and 10.3) but not on Windows XP.
I think the problem is that I tried to get too fancy. I used string descriptors on the buttons so that (in theory, at least) software would be able to identify the buttons as "A, B, Select, Start" rather than "1, 2, 3, 4". But none of the systems I've tested with seem to support this (The buttons are always identified by the system by number, not by name) and I think just the presence of those descriptors caused the gamepad to fail to work on Windows. (I saw similar effects on other systems when the descriptors were organized slightly differently...) So the bad news is, this first gamepad will never work on Windows unless I take the PIC out, put in a new one, and program it with new firmware. But the good news is, I never use Windows (more to the point, I made this controller specifically for use with my Apple Powerbook when travelling - so the fact that the first one produced has this incompatibility isn't so devastating.), and I'm planning to make a second one with simpler (and hopefully more universally compatible) USB firmware.
It's really been one hell of a learning experience. All the things I tried, that caused various incompatibilities or quirks on different OSes... Like I originally had the axes go from 0 to 255 and center on 127. That worked fine, but on Mac it didn't automatically know where center was until it'd been calibrated. (So I switched to -127 to 127 for the range..) I also tried packing the whole report in one byte (2 bits for X axis, 2 bits for Y axis, 4 bits for buttons) - which worked fine on Mac and Windows but caused Linux to spaz out. I wish I had access to more OS versions for testing, I'd like to develop my USB code to be more compatible...
I went with my initial plan for the conversion - pulled the controller's original 4021 shift register, and inserted a surface-mount-style PIC16C745. There were a lot of wires to solder... That was the worst of it. It sort of made me appreciate Retrozone's approach of taking the pre-encoded data from the original gamepad circuit (so many fewer wires to connect!). But most likely I'll do future controllers the same way.