Skip to content

v1.0.0

Choose a tag to compare

@drpetersonfernandes drpetersonfernandes released this 18 Jul 01:01
· 238 commits to main since this release

Initial release of CHDSharp — a fork of RomVault/CHDSharp by Gordon Jefferyes, heavily extended and modernized.

Available on NuGet:

dotnet add package CHDSharp

Targets net8.0, net9.0, and net10.0. Zero native dependencies — every codec is implemented in pure C#.


Highlights

  • Zstd codec support (zstd + cdzs), backed by the managed ZstdSharp.Port
  • V5 parent/child (differential) CHD chains with wrong-parent detection and CheckFileWithParent()
  • Random-access API — ChdFile.Open(), ReadHunk(), Read() (arbitrary byte ranges across hunk boundaries), ReadAllBytes(), EnumerateHunks()
  • Async API — OpenAsync, ReadHunkAsync, ReadAsync, IAsyncDisposable
  • Metadata support — expose game name, disc labels, and other CHD header metadata
  • Comprehensive xUnit test suite with generated test data, cross-checked byte-for-byte against MAME chdman (info, verify, extractraw)
  • New Compressionzero compression type for unallocated hunks in uncompressed V5 CHDs

New Applications

  • CHDSharpCli — verify directories recursively, verify from a path list, random-access self-test, parent/child verification
  • CHDSharpTester — WPF UI for batch testing, with progress status bar, About window, and exit confirmation during runs

API Modernization

  • Published as a proper NuGet package (CHDSharp) with SourceLink, symbols package, and package icon
  • Namespace renamed to CHDSharp; public API renamed to idiomatic PascalCase (Chd, ChdFile, ChdError, ChdResult, …)
  • New TaskCount property (1–64, validated) to configure parallel verification threads
  • New helpers: IsChdFile(), CheckHeader(), ChdResult with IsSuccess, Sha1Hex, and friendly error messages
  • Models and interfaces reorganized into dedicated namespaces; XML documentation added across the public API

Reliability & Hardening

  • Buffer bounds, null, and overflow checks across all codecs and readers
  • ReadByteChecked throws on truncated streams instead of silently mis-reading
  • FLAC BitReader safe lookahead fix
  • Guard against cyclic metadata chains
  • Fixed off-by-one, pointer, and null-check bugs in the codec state (ChdCodecState)
  • Fixed header version check; added cancellation token and proper task cleanup to the parallel decompression queue
  • Fixed compression name display; removed dead code, unused LZMA/FLAC classes, and telemetry

Licensing

  • Licensed under MIT

Special Thanks

Full Changelog: initial release