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

79 thoughts on “USB reader for SNES game carts

  1. @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 :-)

  2. 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.

  3. @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 ;-)

  4. 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.

  5. @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.

  6. @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 ;-)

  7. 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.

  8. 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.

  9. 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.

  10. 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 ;)

  11. @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”;

    ;-)

  12. 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!
    ———–

  13. @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).

  14. 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)

  15. @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.

  16. @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 :-)

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

  18. 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.

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

  20. 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).

  21. @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.

  22. @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.

  23. 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?

  24. @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 :)

  25. 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!

  26. 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??

  27. @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.

  28. 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!

  29. 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?

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