| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
The library can present a CHD image as a virtual CUE sheet with BIN/ISO/WAV files — no conversion to disk required. Mount the image with a GenericCue* console type and the resulting .cue, .bin/.iso, and per-track .wav files appear as entries in the virtual file tree, readable through the normal ReadFile API.
| ConsoleType | Output | Data sector size | Audio |
|---|---|---|---|
| GenericCueBin2352 | .cue + .bin | 2352 (raw) | inside .bin |
| GenericCueBin2048 | .cue + .bin | 2048 (cooked) | inside .bin (still 2352-byte sectors) |
| GenericCueIso2352 | .cue + .iso | 2352 | inside .iso |
| GenericCueIso2048 | .cue + .iso | 2048 | inside .iso |
| GenericCueBinWav2352 | .cue + .bin + .wav per audio track | 2352 | separate .wav files |
| GenericCueBinWav2048 | .cue + .bin + .wav per audio track | 2048 | separate .wav files |
| GenericCueIsoWav2352 | .cue + .iso + .wav per audio track | 2352 | separate .wav files |
| GenericCueIsoWav2048 | .cue + .iso + .wav per audio track | 2048 | separate .wav files |
Special case: MountAndParse(ConsoleType.PcEngineCd) and ConsoleType.PcFx additionally build a virtual CUE/BIN export (2352 mode) alongside the parsed track files, so the raw disc can still be re-assembled.
Mounting, for example, game.chd with GenericCueBinWav2352 produces:
| Virtual file | Contents |
|---|---|
| \game.cue | CUE sheet with FILE/TRACK/INDEX statements for every track |
| \game.bin | Data tracks (raw 2352-byte sectors) |
| \game_TrackNN.wav | One WAV per audio track — game_Track01.wav, game_Track02.wav, ... (two-digit, zero-padded). 44-byte PCM header, 16-bit 44.1 kHz stereo |
Names derive from the CHD file name (e.g. game.chd → game.cue).
The CUE sheet writes MODE1/2352, MODE2/2352, MODE1/2048, MODE2/2048, etc. according to the actual sector size used for that track and the track type from the CHD metadata (MODE1/MODE2/CDI detection). Audio tracks are written as AUDIO.
using VideoGameFileSystemParser.Models;
using VideoGameFileSystemParser.Parsers;
using var container = new ChdContainer(@"C:\ROMs\game.chd");
if (!container.MountAndParse(ConsoleType.GenericCueBin2352))
{
Console.WriteLine("Mount failed.");
return;
}
foreach (var entry in container.Entries)
{
if (entry.IsDirectory) continue;
var outPath = Path.Combine(@"C:\out", entry.Name);
using var fs = File.Create(outPath);
var buffer = new byte[256 * 1024];
ulong offset = 0;
while (offset < entry.Size)
{
int read = container.ReadFile(entry, offset, buffer, 0, buffer.Length);
if (read <= 0) break;
fs.Write(buffer, 0, read);
offset += (ulong)read;
}
Console.WriteLine($"Extracted {entry.Name} ({entry.Size:N0} bytes)");
}container.MountAndParse(ConsoleType.GenericCueBinWav2352);
var cueFile = container.FindFile("\\game.cue");
if (cueFile is not null)
{
var cueData = new byte[cueFile.Size];
container.ReadFile(cueFile, 0, cueData, 0, cueData.Length);
Console.WriteLine(Encoding.ASCII.GetString(cueData));
}Previous: Supported Consoles · Next: API Reference · Back to Home
| Back | FazBrowse Home | New Git URL |