Romhacking.net

Romhacking => Newcomer's Board => Topic started by: Mlxue on September 26, 2021, 08:35:37 am

Title: How do I patch a Sega CD .bin/.cue ROM?
Post by: Mlxue on September 26, 2021, 08:35:37 am
The Google results say to Google it.
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: FAST6191 on September 26, 2021, 10:17:01 am
Same way you patch any other file.

1) The patch will come as some kind of premade patch designed for something already out in the world. Good old IPS used by most older consoles will not work here as it has a limit of 16 megabytes (give or take a few bytes) and also does not handle reallocations. To that end you will probably have something in the xdelta, ppf or similar regime. Sadly most of those alternatives have multiple versions so you will want to hunt down the right patcher version to match your patch (they tend to be available in the download section here, or easily found in a search), in addition to making sure you have the right version of the bin/cue in the first place*. Most patching programs then amounting to telling it the source file, patch file and then possibly destination file (some will do in place).

2) The patch will come as something aimed at more individual files contained within the filesystem. This will tend to involve you slicing out individual files from the iso and then rebuilding it afterwards.


*I don't know what goes for the megacd side of things here. By the time of the PS1 (not so very long after the rise and fall of the megacd) then CD writers were cheap enough for mortals to afford and it was something of an unofficial contest between CD ripping software (nero with nrg, clonecd, cdrwin... all the formats that the likes of magiciso, ultraiso and the rest claim to handle and more besides) to rip the best PS1 games and dodge any anti piracy involved there. Today then PS1 hackers are faced with supporting legacy iso formats/rips out there for decades at this point or forcing people to rip their own new copy (and hope they have the right version in the case of rereleases with bugfixes), and one of the reasons, most of which are good, 2) above is a thing people do. Megacd being before this and not emulated for a while or probably with much of a Warez/Scene following means you will probably be largely spared that but I note it anyway.

Not knowing what game, what patch and what you have tried already means we are going to struggle to give you more than that.
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: Tony H on September 26, 2021, 12:43:15 pm
Have a bunch of Sega CD editors that will patch changes into a SCD bin/iso/img file: https://codehut.gshi.org/Download.htm

Tried submitting them here at RHDN, but since they're mainly for patching cheats into the game, they wouldn't accept them.

If you're planning on patching cheat codes into your Sega CD file, know that many SCD games will require that you patch multiple places in the file.  Sonic CD for example, has around 75 different levels, and requires 75 different changes for each cheat code. 

There is also a ton of discussion and examples on how to patch cheats into a SCD file using a hex editor:

https://gamehacking.org/vb/forum/video-game-hacking-and-development/retro-hacking/7598-sega-mega-cd-iso-hacks-editors

https://gamehacking.org/vb/forum/video-game-hacking-and-development/retro-hacking/4650-sega-mega-cd-hacks-patches
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: Mlxue on September 26, 2021, 12:54:25 pm
But which file do I patch?
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: MysticLord on September 26, 2021, 02:07:33 pm
What is the file extension (*.ips, *.ppf, etc) of the patch that you want to apply? If you can't figure it out, link to the patch or upload it to anonfile or something.
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: FAST6191 on September 26, 2021, 03:09:28 pm
But which file do I patch?

Again you are going to need to link up the patch you are trying to do and note what game it is for if it was not obvious as part of the previous.

bin and cue is an older but somewhat popular format for ripping and distributing rips of CD based things.
cue files are usually tiny things that note a few things about the files and where they land on disc (more useful if there is a bunch of CD audio with the thing)
bin files are the data actually on the CD. In the vast majority of cases this will be what you patch, however depending upon what goes then you might have to alter the cue file if the patch changes the disc layout too much.

Other files tend to be CD audio for the games to play while the game is playing, popular enough on such devices as it allows "CD quality" audio where before a few seconds of crackly 11KHz speech was a notable thing and everything else was chiptunes.
Theoretically there could be others (see multi session discs) but you are not going to see those on a rip of a commercial game.

Most patch makers will tend to include a readme/lissez moi/nfo/whatever text format detailing what the user needs to do, but if somehow one was not made or got lost along the way (there are some hosts that strip such things from files here) then we will still need to know what patch you are trying to use (preferably able to download it ourselves to try to figure out any oddities that might be involved without having to go back and forth with you) and what game it is for.
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: Mlxue on September 26, 2021, 04:47:08 pm
This is the patch I was trying to apply: https://www.romhacking.net/translations/1567/
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: Jorpho on September 26, 2021, 08:36:12 pm
This is the patch I was trying to apply: https://www.romhacking.net/translations/1567/
Thank you for providing that link. As has been mentioned several times now, the clue is to read the documentation.

Quote
First you will need to obtain image files of the Game Can discs. Hopefully
they will be split into tracks rather than a single file. If not, you will
need to extract the data track, which must be Mode 1 / 2048 bytes per block.

The included patches are in the IPS format so you can theoretically use any
IPS-compatible program. However, the data tracks are somewhat larger than
most IPS programs typically deal with, so you might run into problems.
So, like it says, you need to extract the data track. (Admittedly, it might be nice if the documentation provided an example of how to do that.)

Assuming you are starting with an image in bin/cue format, TurboRIP is probably the most expedient way – it should be able to convert a bin/cue file into iso/wav/cue, and then you can apply the patch to the .iso file. You should then be able to keep using the files with any emulator. It's an old program, and originally written for PC Engine games, but it should work here as well.
https://www.pcenginefans.com/forum/index.php?topic=1604.0
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: Mlxue on September 27, 2021, 08:05:50 am
I should also mention that I have Ubuntu and can't install Wine.
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: Jorpho on September 27, 2021, 12:13:55 pm
I should also mention that I have Ubuntu and can't install Wine.
Yes, you should mention that.

Any decent CD-image manipulation program should be able to at least extract the data track. Try IsoMaster.

If you can't find anything, then you might as well install VirtualBox and get Windows running, because if finding something like this is that difficult, then you're probably going to need Windows sooner or later. :P (Surely if you're running Ubuntu, you should be used to trying to interpret other people's crappy documentation by now?)

Or you can just try to find a rip of the CD that's already in iso/wav/cue format (or more likely iso/mp3/cue – the data track is the same in either case), but those are not as popular as they once were.
Title: Re: How do I patch a Sega CD .bin/.cue ROM?
Post by: Mlxue on September 29, 2021, 08:29:08 am
Oh, well. Anyway, I found an iso file.