Emulation on Mac

Emulating classic video game consoles on Mac OS X

Monthly Archives: November 2010

Preserving CD and DVD-based Console Games (Pt. 2)

In the last post, I mentioned the use of a disk imaging command called dd. One of the shortcomings of dd is that it doesn’t provide any kind of progress information while it is working, and doesn’t integrity check the resulting output. Sometimes it has an error during the imaging process and just stops prematurely without an explanation. After going through 100 or so Playstation 1 games and trying to backup all of them using dd, I started looking for a better way.

One alternative I found was an improved version of dd called dcfldd, a tool by Nick Harbour when he worked at the Department of Defense’s Computer Forensic Laboratory (DCFL). To use it, you need to download the source and compile (no binary love for Mac OS X users). The steps are the same standard ones for GNU open source projects: extract the source code archive (should be just a double click in Finder after it downloads); open Terminal; cd to the directory of the source code; ./configure; make; sudo make install. Then you should be able to run dcfldd using the same parameters as with dd, except now you will get to see the progress. It also may have just been a coincidence, but dcfldd ripped my copy of MDK whereas dd was not getting the job done (it kept erroring out).

Advertisements

Preserving CD and DVD-based Console Games

In order to preserve a copy of a game that you own, you must make an “image” of the full CD.¬†Many Playstation game discs (especially earlier games) have a data track and one or more audio tracks such as the kind that play in a standard CD player. This makes them a little trickier than straight data discs which are fairly simple to image using the GUI application Disk Utility.

You may be familiar with the term “ISO”, a kind of disk image that is often used for software distribution. However, you cannot make an ISO out of a multi-session disc or a disc with audio tracks; the format doesn’t allow for it. At best, you will lose the audio tracks; at worst, you have an image that doesn’t contain all of the game code. We need a byte-for-byte copy of the original disc with all of its tracks. There is no one file extension associated with a disc image like this, as far as I can tell. I just call it an image file and the file extension is arbitrary, but some emulators want the “.iso” extension, and you might have to rename it to that. Various commercial ripping tools have their own file extensions, and maybe even their own image formats. I don’t see a point in using any of these proprietary formats or tools.

Most directions on how to image Playstation game discs start with “download this shitty Windows software…” or “launch your $70 copy of some professional-grade Mac OS X disc authoring software.” I wanted to accomplish this task without using any shady crapware or expensive commercial software. That left me with the command line tools for direct CD/DVD access.

The command-line tools I am aware of for doing direct-access imaging of storage devices on a Mac are hdiutil, dd, and cdrdao. The latter is not part of the default OS X tool set, but you can install it with Mac Ports (or build it yourself from source, but it’s easier to use Mac Ports). I was able to create a playable disc image using hdiutil, but only when the disc had only data. When it had both data and audio tracks, hdiutil would fail during the copy with an unhelpful “input/output error” message. The dd utility, however, seems to work just fine. So does cdrdao, but since dd comes with OS X, we’ll just use that.

Step 1: insert the game disc. It will show up on your desktop as one volume if it’s just a data track, or two volumes if it also has data. Annoyingly, iTunes will jump up and ask to import the audio tracks. I don’t know if there’s anything you can do about that, except say “don’t ask me again.” It will still pop to the front every time the disc is inserted, though.

Step 2: because we need exclusive access to the CD/DVD drive, we have to take access away from Finder by unmounting the volume(s) on the CD/DVD device. To do so, first we need to know the UNIX filename of the CD/DVD drive device. The command “drutil status” will show us a name in the form of “/dev/disk2” (yours may be different). We take that name and use it in the command “diskutil unmountdisk disk2”, which unmounts all volumes associated with this device.

Step 3: ripping the game disc. The command we want to use is “dd if=/dev/disk2 of=~/Desktop/Title\ Of\ Game.iso bs=2048”. I don’t know if the last parameter, which is specifying a block size of 2KB, is necessary or not. But one source I read claimed that it is necessary to prevent Mac OS X from changing the block size of the data on a CD from 2KB to 4KB, which is the default behavior.

To recap:

drutil status
diskutil unmount disk4
dd if=/dev/disk4 of=~/Desktop/Title\ Of\ Game.iso bs=2048

That’s it. It takes dd about six minutes or so to rip the game, and then you should have a single file containing all of the tracks of the original disc. PS1 emulators can load this file to play the game directly from your hard disk.

I’ve tested, and everything I’ve said above also applies to PlayStation 2 and Sega Saturn discs.