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
!function(t){"use strict";if(t.zWorkerInitialized)throw new Error("z-worker.js should be run only once");t.zWorkerInitialized=!0,addEventListener("message",function(t){var r,c,n=t.data,s=n.type,p=n.sn,o=e[s];if(o)try{o(n)}catch(t){r={type:s,sn:p,error:(c=t,{message:c.message,stack:c.stack})},postMessage(r)}});var e={importScripts:function(t){t.scripts&&0<t.scripts.length&&importScripts.apply(void 0,t.scripts),postMessage({type:"importScripts"})},newTask:c,append:s,flush:s},r={};function c(e){var c=t[e.codecClass],n=e.sn;if(r[n])throw Error("duplicated sn");r[n]={codec:new c(e.options),crcInput:"input"===e.crcType,crcOutput:"output"===e.crcType,crc:new p},postMessage({type:"newTask",sn:n})}var n=t.performance?t.performance.now.bind(t.performance):Date.now;function s(t){var e=t.sn,s=t.type,p=t.data,o=r[e];!o&&t.codecClass&&(c(t),o=r[e]);var a,i="append"===s,u=n();if(i)try{a=o.codec.append(p,function(t){postMessage({type:"progress",sn:e,loaded:t})})}catch(t){throw delete r[e],t}else delete r[e],a=o.codec.flush();var d=n()-u;u=n(),p&&o.crcInput&&o.crc.append(p),a&&o.crcOutput&&o.crc.append(a);var f=n()-u,h={type:s,sn:e,codecTime:d,crcTime:f},l=[];a&&(h.data=a,l.push(a.buffer)),i||!o.crcInput&&!o.crcOutput||(h.crc=o.crc.get());try{postMessage(h,l)}catch(t){postMessage(h)}}function p(){this.crc=-1}function o(){}p.prototype.append=function(t){for(var e=0|this.crc,r=this.table,c=0,n=0|t.length;c<n;c++)e=e>>>8^r[255&(e^t[c])];this.crc=e},p.prototype.get=function(){return~this.crc},p.prototype.table=function(){var t,e,r,c=[];for(t=0;t<256;t++){for(r=t,e=0;e<8;e++)1&r?r=r>>>1^3988292384:r>>>=1;c[t]=r}return c}(),(t.NOOP=o).prototype.append=function(t,e){return t},o.prototype.flush=function(){}}(this);