Class DiscDetector
- Namespace
- CHDSharp
- Assembly
- CHDSharpLib.dll
Detects the game platform of a disc image by probing sector-0 magic bytes, the ISO-9660
filesystem (PS1/PS2 SYSTEM.CNF, PSP PARAM.SFO, Neo Geo IPL.TXT, DVD Video), and the PC Engine
IPL header heuristic (CHDlite detect_game_platform parity,
detect_game_platform.cpp:51-318). Sector access is abstracted so both CHD files and
raw/disc images can be probed.
public static class DiscDetector
- Inheritance
-
DiscDetector
- Inherited Members
Methods
Detect(ChdFile)
Detects the platform of an already-open ChdFile.
public static DiscPlatformInfo Detect(ChdFile chd)
Parameters
chdChdFileAn open CHD file (CD, DVD, or raw image).
Returns
DetectCdFromSectors(SectorReader, string)
Runs the CD detection dispatch over a sector reader: sector-0 magic checks (3DO/Mega CD/Saturn/Dreamcast), ISO-9660 filesystem checks (PS1/PS2/PSP/Neo Geo/DVD-Video), then the PC Engine IPL heuristic; falls back to GenericCd.
public static DiscPlatformInfo DetectCdFromSectors(DiscDetector.SectorReader readSector, string source)
Parameters
readSectorDiscDetector.SectorReaderReads cooked 2048-byte sectors by LBA.
sourcestringHuman-readable description of the data source.
Returns
DetectChd(string, string?)
Detects the platform of a CHD file on disk: opens it (optionally with a parent) and runs the sector-based detection over its decompressed content.
public static DiscPlatformInfo DetectChd(string filename, string? parentFilename = null)
Parameters
filenamestringPath to the CHD file.
parentFilenamestringParent CHD path for a child CHD, or
nullfor standalone.
Returns
- DiscPlatformInfo
The detection result (platform, title, manufacturer ID).
Exceptions
- InvalidDataException
The CHD cannot be opened.
DetectDvdFromSectors(SectorReader, string)
Runs the DVD detection dispatch over a sector reader: ISO-9660 filesystem checks (PSP/PS1/PS2/DVD-Video), falling back to the DVD platform with the volume ID as title.
public static DiscPlatformInfo DetectDvdFromSectors(DiscDetector.SectorReader readSector, string source)
Parameters
readSectorDiscDetector.SectorReaderReads cooked 2048-byte sectors by LBA.
sourcestringHuman-readable description of the data source.