Saturday, October 16, 2010

BOO-YAAAA!

I've been busy this morning, and I've got two GREAT pieces of news to report on.

The first piece of good news is that I figured out why my code was lagging so bad, and I'm almost too embarrassed to admit what the problem was.

When the AVR polls the SNES controller, it's suppsed to hold the clock line high for 12 micro-seconds before pulling it low again. It was really late the other night when I got all this working in the first place, and instead of delaying for 12 micro-seconds, I was delaying for 12 milli-seconds. Now you may be thinking, "milli, micro, what's the difference? They're both so small that we can't tell a difference." Well, here's a practical comparison between the difference. Let's say that when coded properly that it takes one day to fully poll the SNES controller for the button states. When coded improperly (the way I had it to begin with), it would take a little over three months!

And now for the second, and more important piece of news. Not only does the adapter that I've built work with all my computers, it also works with the PS3. The buttons are a little screwey since they're not being reported in the order that the PS3 wants to see them, but it does work. Furthermore, this has been accomplished with very little customization of the USB protocol. I'm not currently spoofing the PID/VID of any other working controller, and the report descriptor is just a basic dual-axis/eight-button report. This leads me to believe that accomplishing the ultimate goal of this project won't be as hard as I initially figured it would be.

But wait, it gets better! I'VE GOT VIDEO! I've just finished uploading the video to vimeo.com, and it will be a little bit before it will be available. Once it is, I'll make another post.

No comments:

Post a Comment