News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How to properly rebuild Sega CD disc images?  (Read 699 times)

SpiralDrift

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
How to properly rebuild Sega CD disc images?
« on: February 21, 2021, 09:47:43 pm »
SHORT VERSION:
1. I extracted some files from Track 01.bin (Road Rash redump image) and edited them. These were proper edits as detailed in the long version below.
2. Using UltraISO, I overwrote the original files in the disc image and created a new bin/cue via "Save as".
3. The newly created bin/cue doesn't seem to work in any emulators.

How do I correctly save the new files to the disc image? Is overwriting the relevant bytes at the original positions the only way, or can it be done with some other disc image program?

LONG VERSION:
I'll go into detail in case anyone else tries to do the same with this particular game and could use the info. Basically, I'm trying to replace the licensed music in Road Rash with the sequenced music from the PS1, 3DO and PC versions.

Half of the audio tracks are stored on the data track with the extensions .22K. These are signed/magnitude 8-bit PCM, which can be converted to WAV with SCDTools. These files play on the menus but not in-game. The music that plays during races seems to be stored in pieces in the .ALV files (but this isn't relevant to my question).

I've converted the music I want to the required format using SCDTools. I CAN insert them using CDMage, right-clicking a file and clicking "Import" to insert the new file over the old one. It gives the option to pad the remaining bytes with zeros. The resulting image works in emulators with the new music but with long pauses after each song due to the added padding.

So, is this the only way to insert edited files, or is there a way to rebuild the data track using just the files? Any help or information will be greatly appreciated.
« Last Edit: February 21, 2021, 10:48:09 pm by SpiralDrift »

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7093
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: How to properly rebuild Sega CD disc images?
« Reply #1 on: March 02, 2021, 12:33:56 pm »
I don't know technical details but one thing I thought of right away is: EA was known to checksum-protect their Genesis games (aka "the Master Codes"), did they do that with Sega CD too?
"My watch says 30 chickens" Google, 2018

Tony H

  • Full Member
  • ***
  • Posts: 131
    • View Profile
    • The Code Hut
Re: How to properly rebuild Sega CD disc images?
« Reply #2 on: March 02, 2021, 06:01:31 pm »
That is possible, but I recently made a bunch of Sega CD editors that patch cheat codes into the ISO/bin file, and none of them needed a master code.  I'm not sure, but my guess is that it would take too long to do a checksum check on a file that big.
The Code Hut: http://codehut.gshi.org/

Game Genie codes and ROM hacking guides

SpiralDrift

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: How to properly rebuild Sega CD disc images?
« Reply #3 on: March 03, 2021, 02:28:55 pm »
I've done binary injects of the new songs and didn't have any trouble booting the disc image afterward. The new songs all worked as well (the menu songs at least).

The problem is that binary injects aren't optimal since you can't go past the original file sizes and going under poses problems of its own. So the ability to rebuild the data track from the extracted files would be super useful. Otherwise, if the locations are hard-coded like pointers or something, that would be useful to know as well. It's just been hard finding any info on this stuff.