UNPKG

zelda64

Version:

Zelda64.js is a library that can compress, decompress and patch Nintendo 64 Zelda game ROMs.

29 lines (28 loc) 973 B
export declare enum Operation { COPY = 0, COMPRESS = 1, NULL = 2 } export declare type ProgressFn = (file: number, totalFiles: number, operation: Operation, size?: number, compressedSize?: number) => void; /** * The Compressor class implements functionality for compressing Nintendo 64 Zelda ROMs. */ export default class Compressor { private readonly _buffer; private readonly _in; private readonly _ops; private _progressFn?; constructor(buffer: ArrayBuffer, exclusions?: number[]); private _checkExclusions; deflate(): ArrayBuffer; private static _compress; /** * Writes a DMA record to the output buffer. * @param out A Writer instance to write the resulting DMA record to. * @param index The target index in the output DMA table. * @param record The DMA record to write. * @private */ private _writeDmaRecord; set onprogress(progressFn: ProgressFn); }