Ripping 16-bit CD games on Ubuntu and playing them on the Ouya

Background

This guide was specifically written for Ubuntu 12.04-14.04 and the launch edition of the Ouya running MD.emu & PCE.emu. The instructions should work on other Linux distributions, Android devices, and emulators but your milage may vary.

I was a backer of the Ouya on Kickstarter. My thought process went something like - well, if the games don't pan out that's still a pretty good deal for a dedicated emulation and media device. Roughly one year later my prophecy has come to pass. The little Android box is great at the two things I thought it would excel at. With a 1TB external hard drive attached, it can hold more games than I'd ever have time to play.

As of this writing the Ouya has two emulators that support 16-bit CD games: MD.emu for Sega CD / Mega Drive CD games and PCE.emu for TurboGrafx-16 CD / PC Engine CD games. By the time I finally get around to posting this there will probably be others. The emulation quality on each is fine but getting CD games to work on them requires a bit of gymnastics.

Quick note: this guide is not advocating game piracy. This is a tutorial on how to play CD games you already own on an emulator that does not support CD drives. Why would you want to do this anyway?


Setup

You will need to install a free utility called cdrdao. There are two ways to do this, the simplest is to install it from the Ubuntu Software Center:

Install cdrdao

For you command line junkies it's:

sudo apt-get install cdrdao

For those of you that hate command line terminals, I've got some bad news about the remainder of the instructions here...


TurboGrafx-16 CD / PC Engine CD

First off, you'll need to rip the CD to an image file. PCE.emu supports running games from a .bin/.toc format. The .bin is the image of the CD and the .toc file describes the structure of the .bin file.

Insert the CD in your computer's drive (hopefully you didn't need to know this step). Then open up a terminal window and navigate to the location where you want to store the CD image. Enter the following command:

cdrdao read-cd --read-raw --read-subchan rw_raw --datafile TITLE.bin --device /dev/sr0 --driver generic-mmc-raw TITLE.toc

Obviously you'll want to substitute "TITLE" for the name of your game. The "/dev/sr0" part may also be different on your PC. That is referring to the name of your CD drive. To find what it's called on your PC the simplest approach is to look in the Disk Utility. From a command line, "dmesg | grep -i dvd" would work too.

You'll need to select a System Card file in PCE.emu's settings panel. This article does not provide downloads of System Cards but finding them is trivial. Since these systems are region-free it doesn't matter which country's card you use. The version does matter though because the Super CD and Arcade CD games require version 3.0. The 1.x and 2.x versions are practically useless. The file titled "TurboGrafx CD Super System Card (USA) (v3.0)" generally works with everything.

Once you have the System Card file setup you can open the .toc file just like you would any other game in the emulator.

So far I haven't found a game that didn't work. Here are a couple random screenshots for your viewing pleasure:

Ys and The Manhole


Sega CD / Mega Drive CD

The MD.emu emulator is a tad more finicky than PCE.emu when it comes to supported image formats so the ripping commands are slightly different. MD.emu supports running games from a .bin/.cue format which is effectively the same as .bin/.toc. It also requires that CD audio be stored in a particular byte order which PCE.emu is ambivalent about.

Insert the CD in your computer's drive (hopefully you didn't need to know this step). On TurboGrafx-16/PC Engine CD game the first track is an audio track so Ubuntu just treats it like an audio CD. Sega/Mega Drive CD games start with a data track so Ubuntu mounts it like a data disc. cdrdao can't rip a mounted drive so you'll need to unmount it. The simplest way is through Disk Utility:

Unmount from Disk Utility

This can also be done through the umount command if you prefer.

Open up a terminal window and navigate to the location where you want to store the CD image. Enter the following command:

cdrdao read-cd --datafile TITLE.bin --device /dev/sr0 --driver generic-mmc:0x20000 TITLE.toc

Again you'll want to substitute "TITLE" for the name of your game. See above for the "/dev/sr0" part. The "0x20000" flag forces the byte order to little endian. Without this the audio will be distorted on MD.emu or other emulators based on Genesis Plus.

Next you need to convert the .toc file to a .cue file. Enter the following command:

toc2cue TITLE.toc TITLE.cue

You'll need to select a BIOS file in MD.emu's settings panel. This article does not provide downloads of BIOS files. Since these systems are region-locked you'll need to switch when playing games from other countries. The BIOS version is not as important as it is for TurboGrafx-16/PC Engine games. Quite conversely, the 1.0 version of the BIOS is the most reliable one.

Once you have the BIOS file setup you can open the .cue file just like you would any other game in the emulator.

One way to double-check that the audio was ripped correctly is to flail on the C button at the Sega CD splash screen and test from the CD player:

Sega CD player

The compatibility on MD.emu isn't perfect, about half the games I tried had some kind of a problem. Here are a couple screenshots from ones that worked fine:

Wonder Dog and Eternal Champions


What about other systems?

If I were to try a different system I would start with the Sega CD instructions. The only other CD system emulator I spotted on the Ouya market was for the PlayStation and I've always found PlayStation emulators to be more hassle than they're worth. There's also a Neo Geo emulator but I didn't try it since I don't own any Neo Geo CD games.



Related