Documentation
¶
Overview ¶
Package romloader handles loading ROM files from various sources, including compressed archives (ZIP, 7z, gzip, tar.gz, RAR).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFileTooLarge = errors.New("file exceeds maximum size limit")
ErrFileTooLarge is returned when extracted content exceeds size limit
var ErrNoFile = errors.New("no matching file found in archive")
ErrNoFile is returned when no matching file is found in an archive
var ErrUnsupportedFormat = errors.New("unsupported file format")
ErrUnsupportedFormat is returned for unrecognized file formats
Functions ¶
func Load ¶
Load reads a ROM from a file path. It auto-detects compressed archives via magic bytes and extracts the first file matching one of the given extensions. For raw (non-archive) files, the extension must match or the file is loaded as-is if no archive format is detected.
Returns the ROM data, the filename (basename only, useful for display), and any error.
Types ¶
type Disc ¶ added in v0.3.0
type Disc struct {
// contains filtered or unexported fields
}
Disc is a streaming reader over a CHD disc image. It owns the open file handle and decodes hunks on demand, so the whole image is never read into memory. Its method set uses only stdlib types so it satisfies a disc-reader interface structurally without a shared type.
func OpenDisc ¶ added in v0.3.0
OpenDisc opens a CHD disc image for streaming. The file handle is held open for on-demand hunk reads until Close is called.
func (*Disc) ReadSector ¶ added in v0.3.0
ReadSector returns the raw 2352-byte sector at the given LBA.