Table of Contents
The Sega CD
The Sega CD was an attachment for the Sega Genesis console.
[[ To do: Write up a better description or at least link to one. -ArielMT ]]
The Game
I own a copy of Keio Flying Squadron, a Sega CD game, and I've kept that game since about 1996, but I haven't had a console to play it on since then. Recently, I found a Genesis/CD combination that would allow me to play the game. I looked up what the game is worth, and I was shocked to find out that it was fetching up to $500. With that revelation, I set about trying to protect that investment.
Under copyright law in the United States, I as a consumer am permitted to create a backup copy of computer software, including Sega CD games, but the information on how to do so using only a GNU/Linux system is lacking from the Internet at large. This is how I made my backup copy, playing the backup to ensure it was created successfully.
Copying the Sega CD Disc
The System Performing the Copy
The system I used is a Dell Inspiron 600m laptop with built-in CD-RW drive.
The OS was Ubuntu 10.04 LTS, the long-term supported edition of Ubuntu 10.04 Lucid.
The software I needed were the following packages: cdparanoia, cdrdao, python, and probably wodim, which contains the command readom. I used dd from coreutils instead of readom, but that was a bit of a gamble since there's no real error checking.
Ripping the Original Disc
To rip the original Sega CD disc, I copied and adapted a Python script I found on the Internet. The script is here on Breaking Eggs and Making Omelettes. This is the adaptation I used:
#!/usr/bin/python import os import commands from sys import argv # programs SOURCE_DRIVE = "/dev/cdrom" DD_COMMAND = "/bin/dd" CDPARANOIA_COMMAND = "/usr/bin/cdparanoia --quiet" # Not needed because not ripping to MP3s # LAME_COMMAND = "/usr/bin/lame --quiet --preset insane" LAME_COMMAND = "/bin/cp" RM_COMMAND = "/bin/rm" if (len(argv) <2): print "USAGE: rip-sega-cd.py <title>" else: title = argv[1] print "ripping " + title # rip ISO-9660 filesystem in the first track data_rip_command = DD_COMMAND + " if=" + SOURCE_DRIVE + " of=\"" + title + " .iso\"" print "ripping data track..." print data_rip_command commands.getstatusoutput(data_rip_command) print # rip CD audio tracks -> MP3 files until cdparanoia reports an error # actually, leaving as WAV files because we're writing back to disc, not saving for emulation print "ripping audio tracks..." n = 2 error = 0 rm_command = RM_COMMAND + " cdda.wav" while (error == 0): # rip audio_rip_command = '%(cmd)s %(n)d' % \ { 'cmd' : CDPARANOIA_COMMAND, 'n' : n } print audio_rip_command commands.getstatusoutput(audio_rip_command) # encode # audio_encode_command = '%(cmd)s cdda.wav "%(title)s %(n)02d.mp3"' % \ # { 'cmd' : LAME_COMMAND, 'title' : title, 'n' : n } # copying file instead audio_encode_command = '%(cmd)s cdda.wav "%(title)s %(n)02d.wav" % \ { 'cmd' : LAME_COMMAND, 'title' : title, 'n' : n } print audio_encode_command if (commands.getstatusoutput(audio_encode_command)[0]): error = 1 # cleanup print rm_command commands.getstatusoutput(rm_command) n = n + 1 print
Running this script gave me the game ISO and 26 audio files from its 27 CD tracks saved in the current directory. The exact command I used was:
rip-sega-cd.py "Keio Flying Squadron"
Creating the TOC File
Once ripped, the next step was to create a .toc file for writing the tracks back to a blank CD-R in DAO (disc-at-once) mode. I ran the following Bash commands to do it, but I could've easily put them in a script as well. In script form, it would look like:
#!/bin/bash touch game.toc.tmp; echo "CD_ROM" >> game.toc.tmp; echo "TRACK MODE1" >> game.toc.tmp; for i in *.[iI][sS][oO]; do echo "DATAFILE \"$i\"" >> game.toc.tmp; done echo "ZERO 00:02:00 // post-gap" >> game.toc.tmp; echo "" >> game.toc.tmp; for i in *.[wW][aA][vV]; do echo "TRACK AUDIO" >> game.toc.tmp; echo "FILE \"$i\" 0" >> game.toc.tmp; done sed -e 7\i\START -e 7\i\SILENCE\ 00:02:00\ //\ pre-gap game.toc.tmp > game.toc; rm game.toc.tmp
Similar to the script I found for that purpose here at Segaxtreme Community.
And renaming the resulting game.toc file, just to keep everything orderly, with:
mv game.toc Keio\ Flying\ Squadron.toc
Burning the Game to Disc
This was the easy part. With the new disc inserted (and telling Ubuntu not to do anything with the disc), I wrote the backup with just one command:
cdrdao write --driver generic-mmc-raw --device /dev/scd0 --speed 4 Keio\ Flying\ Squadron.toc
The most enjoyable way for me to verify that the burn succeeded was to pop the backup disc in my Sega CD and play it. The copy was perfect enough to satisfy me.
Now the original is safely in its case as my legal backup copy while the burned CD-R is the play copy.


