Multi-Disc CHD support?

rockaholica
Posts: 11
Joined: Tue Sep 21, 2021 1:32 am
Has thanked: 3 times
Been thanked: 1 time

Multi-Disc CHD support?

Unread post by rockaholica »

I was toying with the idea of converting all of my CD based roms to CHD format, for mister purposes and software based emulation. In testing the mister with multi-disc games I noticed that the standard way of handling multi-disc CHD's, m3u playlists, does not seem to be currently supported by the MegaCD core (and potentially the MiSTer?) as files with a m3u extension aren't selectable when loading a CD.

There aren't very many multi-disc games on the MegaCD but supporting multi-disc CHD's will likely be "in demand" for future cores, assuming PSX and Saturn cores are completed/released at some point. This may be a non-issue depending on how saves are handled by the core, or by a specific game, but if m3u files are something that is fairly easy to support it might be worth it to implement what seems to be the standard way of supporting multi-disc games with chd files.

I'm not sure if the level of effort to support this on MiSTer is feasible, or if any alternative solutions exist, but I wanted to ask the question and potentially start that discussion.

As a note/background information:
On various platforms that support CHD files, the way of handling multi-disc games is by creating a playlist file in the form of an m3u.
The m3u file is simply a text file, generally Unicode encoded, with a relative filename or absolute path to the chd files in for a given game.
One path per line, in disc order.

e.g. Contents of Night Trap (USA).m3u

Code: Select all

Night Trap (USA) (Disc 1).chd
Night Trap (USA) (Disc 2).chd
User avatar
darksakul
Posts: 353
Joined: Mon May 25, 2020 4:34 pm
Has thanked: 397 times
Been thanked: 73 times

Re: Multi-Disc CHD support?

Unread post by darksakul »

Here, read this

viewtopic.php?t=379

CHD files work, you just need each game in the same sub-folder.
m3u files are not supported

The format should be as such

Example:

\games\MegaCD\Game A\Game A.cue
\games\MegaCD\Game A\Game A(track 1).bin
\games\MegaCD\Game A\Game A(track 2).bin
\games\MegaCD\Game B\Game B.cue
\games\MegaCD\Game B\Game B.(track 1).bin
\games\MegaCD\Game B\Game B.(track 2).bin
It is my great regret that we live in an age that is proud of machines that think and suspicious of people who try to.
rockaholica
Posts: 11
Joined: Tue Sep 21, 2021 1:32 am
Has thanked: 3 times
Been thanked: 1 time

Re: Multi-Disc CHD support?

Unread post by rockaholica »

Hey darksakul!

I have seen conflicting information on the need to have subfolders, specifically with CHD's. The post you are referring to was actually created before zakk4223 added CHD support to MiSTer, so I'm not certain it's a great source at this point. Ref: viewtopic.php?p=15464#p15464

I completely understand and agree that m3u files aren't supported today, but my question is more about feasibility of supporting them.

Thanks again for engaging :D
zakk4223
Posts: 289
Joined: Sun May 24, 2020 10:55 pm
Been thanked: 120 times

Re: Multi-Disc CHD support?

Unread post by zakk4223 »

For the megaCD just put the chds in a game specific directory. CUE or CHD files loaded from the same directory won't trigger a BIOS reload/core reset and the save file name for the backup RAM will be retained. This means it will always be named after the first disk in the set, but that's probably fine.

This logic doesn't look like it was transfered over to the PCE-CD core, but I'm not 100% sure if that is how it should also work there. Someone more familiar with how the PCE-CD handles disc swaps would have to weigh in here.

This probably means in general you should put even single CHDs in their own directory.

I can say that trying to implement m3us would be fairly awkward given how things work now. Probably not much motivation to do that when just putting the files in the same directory achieves pretty much the same thing.

I'll try to track someone down about the PCE-CD stuff, and if it can work the same way I'll make it work that way.
rockaholica
Posts: 11
Joined: Tue Sep 21, 2021 1:32 am
Has thanked: 3 times
Been thanked: 1 time

Re: Multi-Disc CHD support?

Unread post by rockaholica »

Awesome! Thanks for chiming in! I'll update my conversion scripts to create dirs for each game.
I'm not an expert, but I don't know if there are actually any multi-disc PC-CD games, so hopefully it's a non-issue there.
seastalker
Posts: 249
Joined: Tue Jun 02, 2020 6:49 pm
Has thanked: 26 times
Been thanked: 53 times

Re: Multi-Disc CHD support?

Unread post by seastalker »

I debate the CHD format a lot and if it is right for my setup. For many systems, it would be a space saver in theory. If it is not fully compatible with flash carts, FPGA, best emulators etc., then I end up needing BIN/CUE anyway.

I think I have MAME CHDs and maybe Neo Geo CD. I also have Neo Geo CD Bin/Cue redumps because the set is small enough. If a Neo Geo CD core happens and it supports CHD, I'll probably go in that direction. I should look into PCE-CD as a potential CHD world since Mister is my way to play (too good to justify a Terraonion ODE for me personally).

Anyone have a great simple tool to convert back and forth between CHD and bin/cue/[and other formats]?
rockaholica
Posts: 11
Joined: Tue Sep 21, 2021 1:32 am
Has thanked: 3 times
Been thanked: 1 time

Re: Multi-Disc CHD support?

Unread post by rockaholica »

chdman is the defacto tool and comes bundled with mame releases.

CLI options: https://www.mankier.com/1/chdman
The createcd and extractcd options are mostly what you'll be looking for.

There are some bat files to easily convert a whole folder of images to chd. The powershell script I wrote can be found here https://gist.github.com/revoice1/73e297 ... 16437013ac

It is primarily designed to convert 7z compressed bun/cue files to chd, but it should be fairly easy to edit for whatever purpose. You would just want to target cue files, rather than 7z and skip the 7z extract etc.. It also pulls a copy of chdman from archive.org for you if you don't have it.
User avatar
lamarax
Top Contributor
Posts: 472
Joined: Wed Nov 11, 2020 6:28 pm
Has thanked: 33 times
Been thanked: 202 times

Re: Multi-Disc CHD support?

Unread post by lamarax »

rockaholica wrote: Mon Nov 15, 2021 3:18 pm chdman is the defacto tool and comes bundled with mame releases.
Right it is! Good luck making it work in our use case :)
Not everyone and his cat, has MAME installed
seastalker wrote: Mon Nov 15, 2021 12:48 pm Anyone have a great simple tool to convert back and forth between CHD and bin/cue/[and other formats]?
Here's your shortcut ;)
CHDMAN.7z
(540.61 KiB) Downloaded 385 times
...just drop your unzipped folders into it, and run the CUE to CHD.bat. There's also a .bat in there should you wish to revert.
rockaholica
Posts: 11
Joined: Tue Sep 21, 2021 1:32 am
Has thanked: 3 times
Been thanked: 1 time

Re: Multi-Disc CHD support?

Unread post by rockaholica »

Yeah that's the bat file I was referring to, thanks. My reply this morning was done on my mobile and didn't feel like searching the link down on my phone.

I went about writing the more complex script because the library I had were all 7z'd and my script also places the CHD's in their own folder, (as was the result of my OP question), tries to account for multi-disc games and has the ability to create playlist files if you want them for other emulators etc... Also had different source and destinations dirs (and an optional working dir) to avoid disk thrashing if you have multiple disks for different purposes like I do. In the end the script is built for my specific needs but I figured I might as well put it out there for the community if anyone else wants to mess with it.
Bandit721
Posts: 7
Joined: Mon May 25, 2020 2:32 am
Has thanked: 13 times
Been thanked: 1 time

Re: Multi-Disc CHD support?

Unread post by Bandit721 »

Thanks rockaholica! Your script is perfect for converting any of the redump collections to CHDs. I was using another script but it kept breaking when it hit multiple .cue files in the .7z file...was about to write my own, but yours works just as I would have written it. A great time-saver.
rockaholica
Posts: 11
Joined: Tue Sep 21, 2021 1:32 am
Has thanked: 3 times
Been thanked: 1 time

Re: Multi-Disc CHD support?

Unread post by rockaholica »

Awesome! Glad it was useful!
Post Reply