USB reader for SNES game carts

Reader, [Matthias_H], sent in a video about his USB adapter for SNES game carts. All you have to do is plug in the SNES game cartridge and USB cable, then a ROM file of the game shows up as an external storage device on your computer. After that, you can play the ROM with your choice of emulator. We emailed [Matthias] asking for more information, and he quickly replied with a very nice writeup about the hack that is pasted below.

Update: [Matthias] launched a site for the “snega2usb” with updates on the development of the board and a FAQ.

[Matthias] writes:

Part list:
Atmel AT90USBKey Evaluation Board (Digikey – $30)
FCI 10046971-003LF 70-pos. 2-row connector (Digikey – $4.76)
a little piece of prototyping board to solder the connector onto
thousands of little wires

I used the following reference documents:
http://www.emulatronia.com/doctec/consolas/snes/sneskart.html
(SNES cart pinout and ROM memory map)
http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx
(FAT16/32 specs)

The somewhat ugly cable solution is due to the USBKey’s weird choice for .05″ pitch port connectors, for which I was not able to find suitable pin headers and ribbon cable connectors. The exact pinout is a bit weird and not worth publishing yet, since many of the I/O pins are in fact shared by the onboard peripherals, so I have to spread the address and data bits among the available pins. A cleaner version with all parts on a custom PCB is on its way, as well as support for the Sega Genesis (working hard towards the all-in-one solution :-))

Code is based on the Atmel USB Mass Storage example app, to which I added a module for ROM access and a read-only FAT16 (the latter was hard-coded in a hex editor – FUN!). Again, development is still at a very early stage (I tested this on exactly one game cart), and as of now, redistribution of the source is in fact prohibited by Atmel’s proprietary license.

I’m not quite satisfied with the data rate yet. As of now, newer-generation console carts (N64 etc), while absolutely possible to read out, would take forever to load. The device is running at USB 2.0 full-speed (12 Mbps), and I am not aware of any cheap solution that offers high-speed USB (480 Mbps).

Open issues:
– testing with as many different games as possible (feel free to donate your least favorite game carts! :-))
– issuing a refresh when the cartridge is removed/replaced! The USB Mass Storage protocol uses the SCSI command set, so the device cannot send requests (“refresh directory, file may have changed”) to the host.
– optimization for speed
– add compatibility for HiROM games

By the way, I’ve never done anything like this before. The fact that it was so easy kind of scares the hell out of me ;-)

I think this is as exhaustive a description as I can give for now.
Hope you’re fine with it.

-Matthias

Comments

  1. Lupin says:

    wow, it’s playing “directly” from cart! Really nice. Kicks ass!

  2. foley says:

    esata?

  3. Matthias_H says:

    @foley: Please name
    (1) ONE eSATA capable microcontroller that is within reach for hobbyist developers and
    (2) ONE smartphone or portable open handheld with eSATA interface

    There you go. (1) Impossible and (2) useless :-)

  4. GaryC says:

    Nice Job! Can’t wait to see one that supports Mega Drive carts too :)

  5. sly says:

    all-in-one system? that would have about … atari, nes, snes, master system (card and cart), genesis, n64… we’re looking at about 7 or more cart slots. That’s ambitious! and I want one if it gets pulled off.

  6. KnightGeek says:

    Dude! You need to keep us posted on this! This could actually be a product I would pay good money for (assuming a reasonable price)!

  7. smilr says:

    Favorite part of the video:
    “Awww…crud.”
    :)

  8. Matthias_H says:

    @sly: Don’t forget the handhelds…. :) No, seriously: I’m doing exactly the platforms that I think are worth it (also, of course they need to be documented somewhere). If you think I should think your favorite console is worth it, you should start sending me game cartridges NOW ;-)

  9. Tordre says:

    First off awesome…
    Secondly awesome…

    Third i pondered doing this back in my days of high school, the idea was to fill a bunch of 5.25 drive slots in a computer with different game consoles and play directly off the original carts. I am glad someone has more initiative than me.

    Forth a great addition but seems like it would be much more work. Make it so you can write the save file directly to it. This would probably need a custom emu or special decode on your usb board because i don’t think emus save the same format as the games itself.

    Fifth… Don’t stop.

  10. foley says:

    @Matthias_H

    1) I have no idea what your price range is or capabilities.

    2) I didn’t realize that was the intended use. I assumed if you were going to be using bulky cartridges that portability was not the intent.

    My point was to see if it was a possibility. If it does not meet the requirements of your intended use then that is all well and good. This does not make it impossible nor useless.

  11. foley says:

    Tordre said the type of application I was thinking of.

  12. nubie says:

    Oh god, just waiting for the lawsuits.

    Does it create a filename? Cool, must check it out later.

  13. nubie says:

    Love the genesis, hope that works :)

  14. Matthias_H says:

    @foley: Just look at the sophisticated cabling, and you will get a pretty good estimate about my price range and capabilities ;-) Portability was in fact a key issue when I came up with the idea. The smaller the host device, the larger the eyes of the people around you when you plug a huge SNES cartridge into it ;-)

    @tordre: (ad savegames to the device) Probably not. Most emulators I’ve met tend to store savegames in their own directory. Also, this would mean I have to add a considerable amount of rewritable external memory to the circuit. Strictly sticking to a read-only structure keeps the effort on a tolerable level.

    @nubie: Lawsuits? Please elaborate. The filename and size are taken straight from the info header on the cartridge. This will probably break once the first Japanese cart comes along :-)

    @everyone: Genesis support is definitely coming, but for now I guess this is it. Perhaps someday I’ll build a limited number of overpriced all-in-one readers coated with 24kt sheet gold and encrusted with diamonds ;-)

  15. Spork says:

    Very nice hack, I really like to see this cross-platform interface. It would be interesting to have a modular socket for the carts and maybe a modular socket for controllers. This could be a method to allow gamers to play nostalgia games on their PC!

    @nubie

    I don’t see any room for lawsuits, as long as he doesn’t release any copy written code.

  16. Tordre says:

    foley, i think we are not alone, me and my friends have all dreamed of the ultimate universal retro system.

    Since i am the more technical of the bunch i put way more thought into it. The one thing we could never agree on would be is what control will we use. One of my friends suggest make the ultimate controller for convenient use with all systems emulated. I was all for having the right ports for all the old controller, but that would make too much clutter.

  17. Jordan says:

    Aww yea getting my roms from Russian porn sites ;)

  18. brian says:

    this is begging for a remake using an avropendous and LUFA.

  19. phreak97 says:

    Nice work!
    I love projects like this, i’ve never started with just an idea though.
    Truthfully It’s a just for fun project right? So anyone saying it isnt useful or that it’s too hard are looking at it the wrong way or are not the people this is targeted at.

    I havnt looked at the datasheets, but I’ve got heaps of Atmel ATMEGA8-16’s which were cheap on ebay.. do these have the capabilities required for this project?

    would it be possible some time down the track to copy save data to and from the cartridge? I own all the original consoles for my games and I really dont enjoy playing games emulated, but I sure would love to back up my saves.. I’m a collector and I have enough games that it often takes me years to get back into a game I’ve started. more than once I’ve gone back to find the battery in the cart had died and lost my save.

  20. strider_mt2k says:

    very cool work!

    Well done!

  21. thecityspiders says:

    Very nice hack.I can see this as a nice way to get rom images from your own carts instead of ripping off a unreliable site.
    Which means if you own the cart no real legal issues … {not many to begin with}
    Support for Sega sounds great ;because there are a ton of super cool Sega games out there.
    Having more than one cart slot will pose an issue with the current controller being used etc …
    Perhaps others have tried this before and would like to share some tips or a bit of their source code that they wrote from scratch ;)

  22. Matthias_H says:

    @thecityspiders – you want source code candy? Here you are:

    // hard-coded FAT16 reserved area (sector 0)
    const U8 Sector0[] = “\xEB\x3C\x90MSDOS5.0\x00\x02\x01\x02\x00\
    \x02\x00\x02\x00\x80\xf8\x7f\x00\x3f\x00\xff\x00\x00\x00\x00\x00\
    \x00\x00\x00\x00\x00\x00\x29\x12\x34\x56\x78NO NA\
    ME FAT16 \x33\xC9\
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
    [more zeros]
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x55\xAA”;

    // How to assemble a long filename from SNES cartridge name field. These are the offsets in Sector 256 for the 21 letters (plus 5 more for extension and terminating null) of the game title
    const U8 VfatAddr[] = “\
    \x41\x43\x45\x47\x49\x4E\x50\x52\x54\x56\x58\x5C\x5E\
    \x21\x23\x25\x27\x29\x2E\x30\x32\x34\x36\x38\x3C\x3E”;

    ;-)

  23. Matthias_H says:

    Seriously: During the early debugging phase, I compared “my” SMW image on a binary level to various ROMs of what I thought should be the same game. Turns out that many of the roms that can be obtained through said channels are in fact far from original rips. You find all kinds of glitches and watermarks, but also signatures of other tools:
    ———–
    Lunar Magic Version 1.51 ©2002 FuSoYa, Defender of Relm http://fusoya.cjb.net fusoya@moon.co.jp I am Naaall, and I love fiiiish!
    ———–

  24. michaelb says:

    Really nice! I really want this (or how to make it).
    .. but… how many zeros are in [more zeros]?

  25. ian says:

    @matthias_h – Nice work, and clever fake-out of the FAT tables. Another way to get them would be to copy the tables from an SD card using a hex editor (my lazy method).

    Converting the game title and using it for the file name is super sweet. I’d probably just expose a single file called ‘game.rom’. It’s easier, and Microsoft claims active patents on the use of long file names in the FAT file system (one reason why digital cameras stick with 8.3 naming format).

  26. mrrix32 says:

    Cool!
    I was thinking of “making” a N64, using a small PC, some Controler to USB leads and some ROMS, if I could get this working then I can skip the ROMs!

    (I have an N64, I want to be able to add stuff like high res textures and online play. Also I want to be able to claim I got my N64 to play DVDs :P)

  27. foley says:

    @Matthias_H

    Right on man, I meant no disrespect. Great job. I was just thinking of a device that you could plug into your comp and have just sit there. Then you could have one possibly with multiple cartridge ports and a built in emulator, kind of like an all in one classic game station. I think I was dreaming outside of the original design ideals. LOL I just got carried away.

  28. foley says:

    *edit* When I said ‘built in’ I meant ‘accompanying’ it’s early and I’m tired.

  29. Matthias_H says:

    @ian: Using the same filename for all games will get you in trouble with the savegame handling, since most emulators relate their nomenclature to the ROM name. Since Microsoft has filed a patent infringement lawsuit related to FAT exactly once (TomTom), I don’t think I am in big danger here… Otherwise, I’m simply going to switch to unique 8-char hashes, retaining the possibility for savegame identification.

    @foley: No offense taken and none intended from my side. My only PC happens to be this laptop (with an OpenPandora to come soon, hopefully), so this is what I am developing for.

    @michaelb: Just add zeros until you have a total of 512 bytes :-)

  30. digidev says:

    Awesome HaX0ry!! A pretty neat idea and it would be cool if use with one of these: http://www.joystiq.com/2009/06/20/modders-gut-an-snes-cram-in-a-pc/ !

  31. Shabadage says:

    Heya Matthias! Glad to see you’re still plugging along! Great hardware hacking here. You just keep getting better and better!

  32. Andrewr05 says:

    That pretty awesome dude, it is amazing that it was that easy. This has the potential to be the next “big thing”, if I were you I would try to secure your work so some company doesn’t pop out of nowhere and gobble up your idea.

  33. MarkyB86 says:

    This is freaking amazing. IF you ever are to produce another, and have a reasonable price please inform me!

  34. YLS says:

    it’s a kool project, would be nice to use with the Pandora for quick game transfers

  35. Jiremi says:

    Does this have write capabilities? It would be awesome if I could take a spare cartridge and put whatever I want on it.

  36. Teebo says:

    Beautiful. A hack I like. Could you ever do the opposite setup, ie make your own cuttle cart that just draws in the data from a system?

    I would love to see this setup for all consoles. You would have the ultimate cart tester & hybrid emulator(ie real hardware carts, software-driven console).

  37. Matthias_H says:

    @jiremi: no, it doesn’t, and since I am not a homebrew person, this is not on my list even in the long term. In the limited time I have, there are only so many things I can focus on, and I hope nobody will mind if I pick the ones that matter the most to myself.

    Which are, as of now:
    – reading game carts correctly
    – getting more games to work
    – adding genesis/megadrive support
    – custom PCB and a nice case
    – possibly organizing a group order for kits

    The following, among many others, are definitely not on my list:
    – fighting with bitchy games that I don’t care about and not even the SWC can do
    – write support of any kind (flash ROM, savestates)

    Which doesn’t mean these things will never happen. I mean, I will hardly file a patent for connecting 20-year old technology with a bunch of wires, and once the idea is out there, someone might still sit down and do it.

  38. Matthias_H says:

    One more thing: Of the many enhancement chips that can be found on SNES carts, the SA-1 and S-DD1 are particularly notorious for being a pain in the butt. Don’t expect games using these chips ever to work in the USB reader. here’s a list of affected titles:

    http://en.wikipedia.org/wiki/List_of_Super_NES_enhancement_chips#List_of_Super_NES_games_that_use_enhancement_chips

  39. @matthias_h
    aren’t these chips separate from the actual game data? I thought these were just co processors that linked into the console in a completely different way.

  40. Acha says:

    nice…bro..
    thanks so much…
    _salam anget_

  41. Matthias_H says:

    @gerrit: Not these two particular ones. The S-dd1 is a cryptic data compression/decompression chip, so whichever part of the ROM is hidden behind that chip remains mingled or incomplete. Super FX and others should be fine, though.

  42. tom61 says:

    Neat.

    As far as 480mbps USB 2.0 in a hobbyist microcontroller platform, the Gumstix Overo and the TI Beagleboard both support that speed (both host and client). Though, they are on the upper end of the hobbyist price range, and most would not get one to just to dump carts, unless they collect uber-rares and prototypes.

    Can you give a general area where you are, that way shipping could be figured out if someone wanted to donate carts to you?

  43. We actually need the reverse of this.. a modern day MultiGameDoctor would be awesome and easily done if you’ve got FPGA skills. But not one has yet :(.

  44. Matthias_H says:

    @tom61: Beagleboard and Gumstix are of course a possibility, but (1) you would still have to add extra hardware, (2) they are pretty darn expensive and what they offer is a total overkill for a simple cart reader, and (3) it would easily double the power consumption of your mobile device.

    In case someone actually wants to send me games (I wouldn’t mind :-)), I am in Boston MA for another week, but moving back to Germany next Saturday (Jun 27). Address inquiries to hackaday at matthias.hu(please_disregard)llin.net.

    @daniel palmer: Sorry, but I don’t need the reverse of this :)

  45. Roger says:

    Awesome little invention, Matthias! I came from Kotaku. This device would be awesome with a little pine box case! Does this device heat up at all? Perhaps cooling would help with the slow downs if you have a high-speed USB, etc. I don’t know much about electronics.

    Hope everything works out with this. I would love to be able to pick one of these up. Keep up the good work!

  46. Alo Press says:

    That device is really cool ^ ^

    I have a question for you! If u can access the game on the cart – could u also put your own (converted) games on it or just use it as external memor like usb sticks??

  47. Matthias_H says:

    @alo: Please familiarize yourself with the difference between reading data from vs. writing data to a device…. you can’t write to read-only devices, period.

    again: this is a device for l e g a l l y taking games that are stored on a read-only cartridge, and playing them on your computer. a device that stores your illegal (however modified you or others may have them) roms to a writable cartridge for playing them on the console, while technically possible, is exactly the opposite of what I did / will ever do.

  48. JP says:

    This is incredible! Please give us as much detail as possible, and when you make something sellable make sure I can buy it here in the UK!
    I’d also really love to have a Gameboy version – you should set up a getsatisfaction account so people can vote on features & console support!
    Cheers!

  49. Tim says:

    So to all of you who are intellegent, forgive me I don’t know a lot about this stuff, and forgive me further if someone already sugested this, but could a posible solution be firewire 800 I know it is suposed to be faster than usb 2?

  50. meow says:

    Cypress EZ-USB FX2LP.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,354 other followers