Manic EMU is an all-in-one retro game emulator for iOS. It packs powerful features while keeping a clean, sleek UI and delivering buttery-smooth gameplay.
Swift
self.importScripts("./RomPatcher.js","./modules/BinFile.js","./modules/HashCalculator.js","./modules/RomPatcher.format.ips.js","./modules/RomPatcher.format.aps_n64.js","./modules/RomPatcher.format.aps_gba.js","./modules/RomPatcher.format.ups.js","./modules/RomPatcher.format.bps.js","./modules/RomPatcher.format.rup.js","./modules/RomPatcher.format.ppf.js","./modules/RomPatcher.format.bdf.js","./modules/RomPatcher.format.pmsr.js","./modules/RomPatcher.format.vcdiff.js"),self.onmessage=a=>{const e=new BinFile(a.data.romFileU8Array);e.fileName=a.data.romFileName;const r=new BinFile(a.data.patchFileU8Array);r.fileName=a.data.patchFileName;const t=RomPatcher.parsePatchFile(r);var s,o=!1;if(t)try{s=RomPatcher.applyPatch(e,t,a.data.options)}catch(a){o=a.message}else o="Invalid patch file";if(s){const e=a.data.patchExtraInfo;e&&("string"==typeof e.outputName&&s.setName(e.outputName),"string"==typeof e.outputExtension&&s.setExtension(e.outputExtension)),self.postMessage({success:!!o,romFileU8Array:a.data.romFileU8Array,patchFileU8Array:a.data.patchFileU8Array,patchedRomU8Array:s._u8array,patchedRomFileName:s.fileName,errorMessage:o},[a.data.romFileU8Array.buffer,a.data.patchFileU8Array.buffer,s._u8array.buffer])}else self.postMessage({success:!1,romFileU8Array:a.data.romFileU8Array,patchFileU8Array:a.data.patchFileU8Array,errorMessage:o},[a.data.romFileU8Array.buffer,a.data.patchFileU8Array.buffer])};