UNPKG

igir

Version:

🕹 A zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.

23 lines • 885 B
import APSGBAPatch from './apsGbaPatch.js'; import APSN64Patch from './apsN64Patch.js'; import Patch from './patch.js'; /** * @see https://github.com/btimofeev/UniPatcher/wiki/APS-(N64) */ class APSPatch extends Patch { static async patchFrom(file) { return file.extractToTempFilePoly('r', async (patchFile) => { patchFile.seek(APSPatch.FILE_SIGNATURE.length); const byteFive = (await patchFile.readNext(1)).toString(); const byteSix = (await patchFile.readNext(1)).readUInt8(); if (byteFive === '0' && (byteSix === 0 || byteSix === 1)) { return APSN64Patch.patchFrom(file); } return APSGBAPatch.patchFrom(file); }); } } APSPatch.SUPPORTED_EXTENSIONS = ['.aps']; APSPatch.FILE_SIGNATURE = Buffer.from('APS1'); export default APSPatch; //# sourceMappingURL=apsPatch.js.map