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
const ROM_PATCHER_JS_PATH="./rom-patcher-js/",RomPatcherWeb=function(){const e=["modules/BinFile.js","modules/HashCalculator.js","modules/RomPatcher.format.ips.js","modules/RomPatcher.format.ups.js","modules/RomPatcher.format.aps_n64.js","modules/RomPatcher.format.aps_gba.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","modules/zip.js/zip.min.js","RomPatcher.js"],t=window.crypto&&window.crypto.subtle&&window.crypto.subtle.digest,a={language:"string"==typeof navigator.language?navigator.language.substring(0,2):"en",outputSuffix:!0,fixChecksum:!1,requireValidation:!1,allowDropFiles:!1,oninitialize:null,onloadrom:null,onvalidaterom:null,onloadpatch:null,onpatch:null};var i,n;const r=/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent),o=/Mobile(\/\S+)? /.test(navigator.userAgent);var c=null;const l=function(e){const t={file:e.file.trim(),name:null,description:null,outputName:null,outputExtension:null,patches:null};if("string"==typeof e.name?t.name=e.name.trim():t.name=e.file.replace(/(.*?\/)+/g,""),"string"==typeof e.description&&(t.description=e.description),t.optional=!!e.optional,"string"==typeof e.outputName&&(t.outputName=e.outputName),"string"==typeof e.outputExtension&&(t.outputExtension=e.outputExtension),void 0!==e.inputMd5){Array.isArray(e.inputMd5)||(e.inputMd5=[e.inputMd5]);const a=e.inputMd5.reduce(function(e,t){return"string"==typeof t&&/^(0x)?[0-9a-fA-F]{32}$/i.test(t.trim())?e.push(t.trim().toLowerCase()):console.warn("Rom Patcher JS: inputMd5 must be a string (32 characters long, characters allowed: 0-9, a-f)"),e},[]);a.length?t.inputValidation={type:"MD5",value:a}:console.warn("Rom Patcher JS: invalid inputMd5 for embeded patch",e.inputMd5)}if(void 0!==e.inputCrc32)if(t.inputValidation)console.warn("Rom Patcher JS: a valid inputMd5 was provided, inputCrc32 will be ignored",e);else{Array.isArray(e.inputCrc32)||(e.inputCrc32=[e.inputCrc32]);const a=e.inputCrc32.reduce(function(e,t){return"string"==typeof t&&/^(0x)?[0-9a-fA-F]{8}$/i.test(t.trim())?e.push(parseInt(t.trim().replace("0x",""),16)):"number"==typeof t?e.push(t>>>0&4294967295):console.warn("Rom Patcher JS: invalid inputCrc32 value"),e},[]);a.length?t.inputValidation={type:"CRC32",value:a}:console.warn("Rom Patcher JS: invalid inputCrc32 for embeded patch",e.inputCrc32)}return t};var s=!1;const d=function(e){if(s)throw new Error("Rom Patcher JS: already fetching another file");s=!0,R.disableAll();const t='<span class="rom-patcher-spinner" id="rom-patcher-spinner-patch"></span>';R.hide("select-patch"),R.empty("select-patch"),R.removeClass("select-patch","single"),R.removeClass("select-patch","multiple"),R.setEnabled("select-patch",!1),R.empty("container-optional-patches"),R.setText("span-loading-embeded-patch",w("Downloading...")+" "+t),R.show("span-loading-embeded-patch"),fetch(decodeURI(e.file)).then(e=>e.arrayBuffer()).then(a=>{const i=new BinFile(a);if(ZIPManager.isZipFile(i))"object"==typeof e.patches?Array.isArray(e.patches)?c=e.patches.map(e=>l(e)):console.warn("Rom Patcher JS: Invalid patches object for embeded patch",e):c=[l(e)],R.setText("span-loading-embeded-patch",w("Unzipping...")+" "+t),ZIPManager.unzipEmbededPatches(a,c);else{const t=l(e);c=[t];const a=document.createElement("option");a.innerHTML=t.name,R.get("select-patch").appendChild(a),R.setEnabled("select-patch",!1),R.addClass("select-patch","single"),R.hide("span-loading-embeded-patch"),R.show("select-patch"),i.fileName=e.file,RomPatcherWeb.providePatchFile(i)}s=!1}).catch(function(t){s=!1,g((w("Error downloading %s")+"<br />"+t.message).replace("%s",e.file.replace(/^.*[\/\\]/g,"")))})},p=function(e){return c?c.find(t=>t.file===e):null},m=function(e,t){for(var a=e.toString(16);a.length<2*t;)a="0"+a;return a},h=function(e,t){R.setEnabled("input-file-rom",e),R.setEnabled("input-file-patch",e),R.get("select-patch")&&R.setEnabled("select-patch",R.get("select-patch").children.length>1&&e),R.setEnabled("checkbox-alter-header",e),i&&n&&e?(a.requireValidation&&void 0!==t&&(e=!!t),R.setEnabled("button-apply",e)):R.setEnabled("button-apply",!1)},u=function(e,t){const a=c&&"patch"===e?"select-"+e:"input-file-"+e,i="spinner-"+e;if(R.removeClass(a,"empty"),t){const e=document.createElement("spinner");e.id="rom-patcher-"+i,e.className="rom-patcher-spinner";const t=R.get(a);return t&&("select-patch"===a?t.parentElement.insertBefore(e,R.get("span-loading-embeded-patch")):t.parentElement.appendChild(e)),R.addClass(a,"loading"),R.removeClass(a,"valid"),R.removeClass(a,"invalid"),e}{const e=R.get(i);return e&&e.parentElement.removeChild(e),R.removeClass(a,"loading"),e}},f=function(e){e?R.setText("button-apply",'<span class="rom-patcher-spinner"></span> '+w("Applying patch...")):R.setText("button-apply",w("Apply patch"))},g=function(e,t){const a=R.get("row-error-message"),i=R.get("error-message");a&&i?e?(R.addClass("row-error-message","show"),R.setText("error-message",e),"warning"===t?R.addClass("error-message","warning"):R.removeClass("error-message","warning")):(R.removeClass("row-error-message","show"),R.setText("error-message","")):console.error("Rom Patcher JS: "+e)},R={get:function(e){return document.getElementById("rom-patcher-"+e)},enableAll:function(){h(!0)},disableAll:function(){h(!1)},show:function(e){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).style.display="block")},hide:function(e){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).style.display="none")},setValue:function(e,t){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).value=t)},getValue:function(e,t,a){return document.getElementById("rom-patcher-"+e)?document.getElementById("rom-patcher-"+e).value:a||0},setFakeFile:function(e,t){if(!r&&document.getElementById("rom-patcher-input-file-"+e))try{const a=new File(new Uint8Array(0),t),i=new DataTransfer;i.items.add(a),document.getElementById("rom-patcher-input-file-"+e).files=i.files}catch(e){console.warning("File API constructor is not supported")}},setText:function(e,t){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).innerHTML=t)},empty:function(e){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).innerHTML="")},addClass:function(e,t){document.getElementById("rom-patcher-"+e)&&document.getElementById("rom-patcher-"+e).classList.add(t)},removeClass:function(e,t){document.getElementById("rom-patcher-"+e)&&document.getElementById("rom-patcher-"+e).classList.remove(t)},setClass:function(e,t){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).className=t)},setEnabled:function(e,t){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).disabled=!t)},setChecked:function(e,t){document.getElementById("rom-patcher-"+e)&&(document.getElementById("rom-patcher-"+e).checked=!!t)},isChecked:function(e){return!!document.getElementById("rom-patcher-"+e)&&document.getElementById("rom-patcher-"+e).checked},setSpinner:function(e,t){if("rom"!==e&&"patch"!==e)throw new Error("RomPatcherWeb.htmlElements.setSpinner: only rom or patch input file ids are allowed");return u(e,t)}},b=new Worker("./rom-patcher-js/RomPatcher.webworker.apply.js");b.onmessage=e=>{if(i._u8array=e.data.romFileU8Array,n._originalPatchFile._u8array=e.data.patchFileU8Array,R.enableAll(),f(!1),e.data.patchedRomU8Array&&!e.data.errorMessage){var t=new BinFile(e.data.patchedRomU8Array.buffer);if(t.fileName=e.data.patchedRomFileName,c){const e=c.filter(e=>e.optional);if(e.length){const a=t.fileName;for(var r=0;r<e.length;r++)e[r].checkbox.checked&&(t=RomPatcher.applyPatch(t,e[r].parsedPatch,{requireValidation:!1,fixChecksum:!0}));t.fileName=a}}"function"==typeof a.onpatch&&a.onpatch(t),t.save(),g()}else g(e.data.errorMessage)},b.onerror=e=>{R.enableAll(),f(!1),g("webWorkerApply error: "+e.message)};const y=new Worker("./rom-patcher-js/RomPatcher.webworker.crc.js");y.onmessage=e=>{R.setText("span-crc32",m(e.data.crc32,4)),R.setText("span-md5",m(e.data.md5,16)),i._u8array=e.data.u8array,t&&i.hashSHA1().then(function(e){R.setText("span-sha1",e)}),e.data.rom&&(R.setText("span-rom-info",e.data.rom),R.addClass("row-info-rom","show")),validRom=RomPatcherWeb.validateCurrentRom(e.data.checksumStartOffset),h(!0,validRom)},y.onerror=e=>{g("webWorkerCrc error: "+e.message)};const v=function(){if(i){const e=RomPatcher.isRomHeadered(i);if(e){const t=R.get("checkbox-alter-header");if(t&&t.checked)return e.size}}return 0},E=function(){const t=document.querySelectorAll("script"),a=function(){const e=document.querySelectorAll("script");var t;if(document.currentScript)t=document.currentScript.src;else{for(var a=0;a<e.length;a++)if(-1!==e[a].src.indexOf("RomPatcher.webapp.js")){t=e[a].src;break}t||(t="./rom-patcher-js/")}return t.substring(0,t.lastIndexOf("/")+1)}();for(var i=[],n=0;n<e.length&&!r;n++){for(var r=!1,o=0;o<t.length;o++)t[o].src===a+e[n]&&(r=!0);r||i.push(a+e[n])}return i},M=function(e){if(e){if("string"==typeof e&&(e={file:e}),"object"!=typeof e)throw new Error("Rom Patcher JS: invalid embeded patch parameter");if("string"!=typeof e.file)throw new Error("Rom Patcher JS: embeded patch missing file property");return e}return!1},P=function(e){if(e.dataTransfer.types)for(var t=0;t<e.dataTransfer.types.length;t++)if("Files"===e.dataTransfer.types[t])return!0;return!1},w=function(e){return ROM_PATCHER_LOCALE[a.language]&&ROM_PATCHER_LOCALE[a.language][e]?ROM_PATCHER_LOCALE[a.language][e]:e};var C=!1,O=0;return{_:function(e){return w(e)},getHtmlElements:function(){return R},isInitialized:function(){return C},getEmbededPatches:function(){return c},provideRomFile:function(e,t){R.disableAll(),i=e;const n=RomPatcher.canRomGetHeader(i),r=RomPatcher.isRomHeadered(i);RomPatcherWeb.getHtmlElements().setChecked("checkbox-alter-header",!1),n?(RomPatcherWeb.getHtmlElements().setText("span-alter-header",w("Add %s header").replace("%s",w(n.name))),RomPatcherWeb.getHtmlElements().addClass("row-alter-header","show")):r?(RomPatcherWeb.getHtmlElements().setText("span-alter-header",w("Remove %s header").replace("%s",w(r.name))),RomPatcherWeb.getHtmlElements().addClass("row-alter-header","show")):(RomPatcherWeb.getHtmlElements().setText("span-alter-header",""),RomPatcherWeb.getHtmlElements().removeClass("row-alter-header","show")),i.seek(0),u("rom",!1),ZIPManager.isZipFile(i)?ZIPManager.unzipRoms(i._u8array.buffer):("function"==typeof a.onloadrom&&a.onloadrom(i),RomPatcherWeb.calculateCurrentRomChecksums()),t&&R.setFakeFile("rom",i.fileName)},providePatchFile:function(e,t){if(R.disableAll(),n=null,e)if(ZIPManager.isZipFile(e))ZIPManager.unzipPatches(e._u8array.buffer);else try{const r=RomPatcher.parsePatchFile(e);if(r){n=r,u("patch",!1);const o=p(e.fileName);if(o){if(o.inputValidation){if("CRC32"===o.inputValidation.type)n.validateSource=function(e,t){for(var a=0;a<o.inputValidation.value.length;a++)if(o.inputValidation.value[a]===e.hashCRC32(t))return!0;return!1};else{if("MD5"!==o.inputValidation.type)throw new Error("Rom Patcher JS: Invalid inputValidation type");n.validateSource=function(e,t){for(var a=0;a<o.inputValidation.value.length;a++)if(o.inputValidation.value[a]===e.hashMD5(t))return!0;return!1}}n.getValidationInfo=function(){return o.inputValidation}}o.description&&(n.getDescription=function(){return o.description})}if(R.get("row-patch-requirements")&&R.get("patch-requirements-value"))if("function"==typeof n.getValidationInfo&&n.getValidationInfo()){var i=n.getValidationInfo();!Array.isArray(i)&&i.type||(i={type:"ROM",value:i}),R.setText("patch-requirements-value",""),R.setText("patch-requirements-type","ROM"===i.type?w("Required ROM:"):w("Required %s:").replace("%s",i.type)),Array.isArray(i.value)||(i.value=[i.value]),i.value.forEach(function(e){var t=document.createElement("div");if("string"!=typeof e)if("CRC32"===i.type)for(e=e.toString(16);e.length<8;)e="0"+e;else e=e.toString();t.innerHTML=e,R.get("patch-requirements-value").appendChild(t)}),R.addClass("row-patch-requirements","show")}else R.setText("patch-requirements-value",""),R.removeClass("row-patch-requirements","show");"function"==typeof n.getDescription&&n.getDescription()?(R.setText("patch-description",n.getDescription()),R.addClass("row-patch-description","show")):(R.setText("patch-description",""),R.removeClass("row-patch-description","show")),RomPatcherWeb.validateCurrentRom(v()),"function"==typeof a.onloadpatch&&a.onloadpatch(e,o,r),t&&R.setFakeFile("patch",e.fileName)}else g(w("Invalid patch file"))}catch(e){g(e.message)}n?R.removeClass("input-file-patch","invalid"):R.addClass("input-file-patch","invalid"),R.enableAll()},refreshRomFileName:function(){i&&R.setFakeFile("rom",i.fileName)},pickEmbededFile:function(e){if(!c)throw new Error("No embeded patches available");if("string"!=typeof e)throw new Error("Invalid embeded patch file name");const t=R.get("select-patch");for(var a=0;a<t.children.length;a++)if(t.children[a].patchFileName===e){if(t.value!=t.children[a].value){t.value=t.children[a].value;const e=new Event("change");t.dispatchEvent(e)}break}},initialize:function(e,t){if(C)throw new Error("Rom Patcher JS was already initialized");if(O)throw new Error("Rom Patcher JS is already loading or has failed to load");if("undefined"==typeof window||"function"!=typeof Worker||"function"!=typeof Array.isArray||"function"!=typeof window.addEventListener)throw new Error("Rom Patcher JS: incompatible browser");const c=E();O=c.length;const l=function(){if(0===--O)try{!function(e,t){var c=M(t);if(e&&"string"==typeof e.file&&console.warn("Rom Patcher JS: embeded patch info was provided in settings and will be ignored, must be passed as second parameter"),"object"!=typeof RomPatcher)throw new Error("Rom Patcher JS: core not found");if("object"!=typeof zip||"boolean"!=typeof zip.useWebWorkers)throw console.error("Rom Patcher JS: zip.js web worker not found"),new Error("Rom Patcher JS: zip.js web worker not found");zip.useWebWorkers=!0,zip.workerScriptsPath="./rom-patcher-js/modules/zip.js/";const l=R.get("input-file-rom");if(!l||"INPUT"!==l.tagName||"file"!==l.type)throw console.error("Rom Patcher JS: input#rom-patcher-input-file-rom[type=file] not found"),new Error("Rom Patcher JS: input#rom-patcher-input-file-rom[type=file] not found");if(l.addEventListener("change",function(e){this.files&&this.files.length?(R.disableAll(),new BinFile(this,RomPatcherWeb.provideRomFile)):i&&R.setFakeFile("rom",i.fileName)}),r||l.classList.add("no-file-selector-button"),c){const e=R.get("select-patch");if(!e||"SELECT"!==e.tagName)throw console.error("Rom Patcher JS: select#rom-patcher-select-patch not found"),new Error("Rom Patcher JS: select#rom-patcher-select-patch not found");e.addEventListener("change",function(e){const t=parseInt(this.value);this._unzipSelectedPatch(t)});const t=document.createElement("span");t.id="rom-patcher-span-loading-embeded-patch",t.style.display="none",e.parentElement.appendChild(t);const a=document.createElement("div");a.id="rom-patcher-container-optional-patches",a.style.display="none",e.parentElement.appendChild(a)}else{const e=R.get("input-file-patch");if(!e||"INPUT"!==e.tagName||"file"!==e.type)throw console.error("Rom Patcher JS: input#rom-patcher-input-file-patch[type=file] not found"),new Error("Rom Patcher JS: input#rom-patcher-input-file-patch[type=file] not found");e.addEventListener("change",function(e){this.files&&this.files.length?(R.disableAll(),new BinFile(this,RomPatcherWeb.providePatchFile)):n&&n._originalPatchFile&&R.setFakeFile("patch",n._originalPatchFile.fileName)}),r||e.classList.add("no-file-selector-button"),r&&o&&(e.accept="application/zip, application/octet-stream, application/x-zip-compressed, multipart/x-zip")}const s=R.get("button-apply");if(!s||"BUTTON"!==s.tagName)throw console.error("Rom Patcher JS: button#rom-patcher-button-apply not found"),new Error("Rom Patcher JS: button#rom-patcher-button-apply not found");s.addEventListener("click",RomPatcherWeb.applyPatch);const p=R.get("checkbox-alter-header");p&&"INPUT"===p.tagName&&"checkbox"===p.type&&p.addEventListener("change",function(e){if(!i)return!1;RomPatcher.isRomHeadered(i)&&(R.disableAll(),y.postMessage({u8array:i._u8array,fileName:i.fileName,checksumStartOffset:v()},[i._u8array.buffer]))}),R.disableAll(),R.setValue("input-file-rom",""),R.setValue("input-file-patch","");const m=document.querySelectorAll('*[data-localize="yes"]');for(var h=0;h<m.length;h++)m[h].setAttribute("data-localize",m[h].innerHTML);e&&e.allowDropFiles&&(window.addEventListener("dragover",function(e){P(e)&&e.preventDefault()}),window.addEventListener("drop",function(e){if(e.preventDefault(),P(e)){const t=e.dataTransfer.files;t&&1===t.length&&new BinFile(t[0],function(e){RomPatcherWeb.getEmbededPatches()?RomPatcherWeb.provideRomFile(e,!0):ZIPManager.isZipFile(e)?ZIPManager.unzipAny(e._u8array.buffer):RomPatcher.parsePatchFile(e)?RomPatcherWeb.providePatchFile(e,null,!0):RomPatcherWeb.provideRomFile(e,!0)})}}),l.addEventListener("drop",function(e){e.stopPropagation()}),c||R.get("input-file-patch").addEventListener("drop",function(e){e.stopPropagation()})),console.log("Rom Patcher JS initialized"),C=!0,RomPatcherWeb.setSettings(e),c?d(c):R.enableAll(),"function"==typeof a.oninitialize&&a.oninitialize(this)}(e,t)}catch(e){g(e.message),R.disableAll()}},s=function(){throw new Error("Rom Patcher JS: error loading script "+script.src)};console.log("Rom Patcher JS: loading "+c.length+" dependencies"),c.forEach(function(e){var t=document.createElement("script");t.onload=l,t.onerror=s,t.src=e,document.head.appendChild(t)})},setEmbededPatches:function(e){if(!c)throw new Error("Rom Patcher JS: not in embeded patch mode");var t=M(e);if(!t)throw new Error("Rom Patcher JS: invalid embeded patch parameter");d(t)},applyPatch:function(){if(i&&n){const e={requireValidation:a.requireValidation,removeHeader:RomPatcher.isRomHeadered(i)&&R.isChecked("checkbox-alter-header"),addHeader:RomPatcher.canRomGetHeader(i)&&R.isChecked("checkbox-alter-header"),fixChecksum:a.fixChecksum,outputSuffix:a.outputSuffix};R.disableAll(),f(!0);const t=p(n._originalPatchFile.fileName);b.postMessage({romFileU8Array:i._u8array,patchFileU8Array:n._originalPatchFile._u8array,romFileName:i.fileName,patchFileName:n._originalPatchFile.fileName,patchExtraInfo:t,options:e},[i._u8array.buffer,n._originalPatchFile._u8array.buffer])}else i?n||g(w("No patch file provided")):g(w("No ROM provided"))},calculateCurrentRomChecksums:function(e){if(i.fileSize>67108864&&!e)return R.setText("span-crc32",w("File is too big.")+' <span class="clickable" onclick="RomPatcherWeb.calculateCurrentRomChecksums(true)">'+w("Force calculate checksum")+"</span>"),R.setText("span-md5",""),R.setText("span-sha1",""),R.enableAll(),!1;R.setText("span-crc32",w("Calculating...")),R.setText("span-md5",w("Calculating...")),t&&R.setText("span-sha1",w("Calculating...")),R.setText("span-rom-info",""),R.removeClass("row-info-rom","show"),R.disableAll(),y.postMessage({u8array:i._u8array,fileName:i.fileName,checksumStartOffset:v()},[i._u8array.buffer])},validateCurrentRom:function(e){if(i&&n&&"function"==typeof n.validateSource){const t=RomPatcher.validateRom(i,n,e??0);return t?(R.addClass("input-file-rom","valid"),R.removeClass("input-file-rom","invalid"),g()):(R.addClass("input-file-rom","invalid"),R.removeClass("input-file-rom","valid"),g(w("Source ROM checksum mismatch"))),"function"==typeof a.onvalidaterom&&a.onvalidaterom(i,t),t}return R.removeClass("input-file-rom","valid"),R.removeClass("input-file-rom","invalid"),g(),i&&n&&"function"==typeof a.onvalidaterom&&a.onvalidaterom(i,!0),i&&n},enable:function(){R.enableAll()},disable:function(){R.disableAll()},setErrorMessage:function(e,t){g(e,t)},translateUI:function(e){"object"==typeof e&&"string"==typeof e.language&&(e=e.language),"string"==typeof e&&(a.language=e);const t=document.querySelectorAll("*[data-localize]");for(var i=0;i<t.length;i++)t[i].innerHTML=w(t[i].getAttribute("data-localize"))},getCurrentLanguage:function(){return a.language},setSettings:function(e){e&&"object"==typeof e&&("string"==typeof e.language&&(a.language=e.language),"boolean"==typeof e.outputSuffix&&(a.outputSuffix=e.outputSuffix),"boolean"==typeof e.fixChecksum&&(a.fixChecksum=e.fixChecksum),"boolean"==typeof e.requireValidation&&(a.requireValidation=e.requireValidation),"function"==typeof e.oninitialize?a.oninitialize=e.oninitialize:void 0!==e.oninitialize&&(a.oninitialize=null),"function"==typeof e.onloadrom?a.onloadrom=e.onloadrom:void 0!==e.onloadrom&&(a.onloadrom=null),"function"==typeof e.onvalidaterom?a.onvalidaterom=e.onvalidaterom:void 0!==e.onvalidaterom&&(a.onvalidaterom=null),"function"==typeof e.onloadpatch?a.onloadpatch=e.onloadpatch:void 0!==e.onloadpatch&&(a.onloadpatch=null),"function"==typeof e.onpatch?a.onpatch=e.onpatch:void 0!==e.onpatch&&(a.onpatch=null)),RomPatcherWeb.translateUI()}}}(),ZIPManager=function(e){const t=e._,a=e.getHtmlElements(),i=function(e){a.setSpinner("rom",e)},n=function(e){a.setSpinner("patch",e)},r=/\.(ips|ups|bps|aps|rup|ppf|ebp|bdf|bspatch|mod|xdelta|vcdiff)$/i,o=/(\.(txt|diz|rtf|docx?|xlsx?|html?|pdf|jpe?g|gif|png|bmp|webp|zip|rar|7z))$/i,c="rom-patcher-dialog-zip-backdrop",l=document.createElement("dialog");l.id="rom-patcher-dialog-zip",l.className="rom-patcher-dialog";const s=document.createElement("div");s.id="rom-patcher-dialog-zip-message",l.appendChild(s);const d=document.createElement("ul");d.id="rom-patcher-dialog-zip-file-list",l.appendChild(d);const p=function(e){const t=e.filter(function(e){return!o.test(e.filename)&&!r.test(e.filename)});return h(t),t},m=function(e){const t=e.filter(function(e){return r.test(e.filename)});return h(t),t},h=function(e){e.sort(function(e,t){return e.filename.toLowerCase().replace(/\.\S+$/,"").localeCompare(t.filename.toLowerCase().replace(/\.\S+$/,""))}).sort(function(e,t){return(-1===e.filename.indexOf("/")?0:1)-(-1===t.filename.indexOf("/")?0:1)})},u=function(t,r){if(a.disableAll(),r===e.provideRomFile)i(!0);else{if(r!==e.providePatchFile)throw new Error("ZIPManager._unzipEntry: invalid onUnzip callback");n(!0)}t.getData(new zip.BlobWriter,function(a){const o=new FileReader;o.onload=function(){const a=new BinFile(this.result);a.fileName=t.filename,r===e.provideRomFile?(i(!1),r(a,!0)):(n(!1),r(a,!0))},o.readAsArrayBuffer(a)})},f=function(a,i){const n=function(e){"function"==typeof l.close?l.close():document.getElementById(c).style.display="none",u(this.zipEntry,i)};if(i===e.provideRomFile)s.innerHTML=t("ROM file:");else{if(i!==e.providePatchFile)throw new Error("ZIPManager._unzipEntry: invalid onUnzip callback");s.innerHTML=t("Patch file:")}d.innerHTML="";for(var r=0;r<a.length;r++){var o=document.createElement("li");o.zipEntry=a[r],o.innerHTML=a[r].filename,o.title=a[r].filename,o.addEventListener("click",n),d.appendChild(o)}if("function"==typeof l.showModal)document.getElementById(l.id)||document.body.appendChild(l),l.showModal();else{if(!document.getElementById(c)){const e=document.createElement("div");e.id=c,e.className="rom-patcher-dialog-backdrop",e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.display="none",e.style.alignContent="center",e.style.justifyContent="center",e.style.zIndex=1e3,e.appendChild(l),document.body.appendChild(e)}document.getElementById(c).style.display="flex",l.style.display="block"}},g=function(a){a.message&&console.error("zip.js: "+a.message),e.enable(),e.setErrorMessage(t("Error unzipping file"),"error")};return{isZipFile:function(e){return e.seek(0),"jar"!==e.getExtension()&&e.readString(4).startsWith("PK")},unzipRoms:function(t){zip.createReader(new zip.BlobReader(new Blob([t])),function(t){t.getEntries(function(t){const a=p(t);1===a.length?u(a[0],e.provideRomFile):a.length>1?(f(a,e.provideRomFile),e.enable()):e.calculateCurrentRomChecksums()})},g)},unzipPatches:function(t){zip.createReader(new zip.BlobReader(new Blob([t])),function(t){t.getEntries(function(t){const a=m(t);1===a.length?u(a[0],e.providePatchFile):a.length>1?f(a,e.providePatchFile):e.providePatchFile(null)})},g)},unzipAny:function(t){zip.createReader(new zip.BlobReader(new Blob([t])),function(t){t.getEntries(function(t){const a=p(t),i=m(t);a.length&&0===i.length?1===a.length?u(a[0],e.provideRomFile):(f(a,e.provideRomFile),e.enable()):i.length&&0===a.length?1===i.length?u(i[0],e.providePatchFile):f(i,e.providePatchFile):console.warn("ZIPManager.unzipAny: zip file contains both ROMs and patches, cannot guess")})},g)},unzipEmbededPatches:function(i,n){zip.createReader(new zip.BlobReader(new Blob([i])),function(i){i.getEntries(function(i){const r=m(i);if(r.length){const i=[],c=[];for(var o=0;o<r.length;o++){const e=n.find(e=>e.file===r[o].filename);e&&e.optional?c.push(r[o]):i.push(r[o])}if(!i.length)throw e.setErrorMessage(t("No valid non-optional patches found in ZIP"),"error"),e.disable(),new Error("No valid non-optional patches found in ZIP");n.length&&1===n.length&&1===i.length&&(n[0].file=i[0].filename);for(o=0;o<i.length;o++){const e=n.find(e=>e.file===i[o].filename),t=document.createElement("option");t.innerHTML=e&&e.name?e.name:i[o].filename,t.value=o,t.patchFileName=i[o].filename,a.get("select-patch").appendChild(t)}a.get("select-patch")._unzipSelectedPatch=function(t){u(i[t],e.providePatchFile)};for(o=0;o<c.length;o++){const e=n.find(e=>e.file===c[o].filename),t=document.createElement("input");t.type="checkbox",t.value=o,t.checked=!1,t.disabled=!0,e.checkbox=t;const i=document.createElement("label");i.className="rom-patcher-checkbox-optional-patch",i.appendChild(t),i.appendChild(document.createTextNode(e.name||e.file)),e.description&&(i.title=e.description),a.get("container-optional-patches").appendChild(i),c[o].getData(new zip.BlobWriter,function(a){const i=new FileReader;i.onload=function(){const a=new BinFile(this.result);a.fileName="optional_patch.unk",e.parsedPatch=RomPatcher.parsePatchFile(a),t.disabled=!1},i.readAsArrayBuffer(a)})}1===c.length&&a.show("container-optional-patches"),1===i.length?a.addClass("select-patch","single"):a.addClass("select-patch","multiple"),a.setEnabled("select-patch",!1),a.hide("span-loading-embeded-patch"),a.show("select-patch"),u(i[0],e.providePatchFile)}else e.setErrorMessage(t("No valid patches found in ZIP"),"error"),e.disable()})},g)}}}(RomPatcherWeb),PatchBuilderWeb=function(e){var t,a;const i=/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent),n=function(t){const a=e.getCurrentLanguage();return ROM_PATCHER_LOCALE[a]&&ROM_PATCHER_LOCALE[a][t]?ROM_PATCHER_LOCALE[a][t]:t},r=function(e){document.getElementById("patch-builder-button-create").innerHTML=e?'<span class="rom-patcher-spinner"></span> '+n("Creating patch..."):n("Create patch")},o=function(e,t){const a=document.getElementById("patch-builder-row-error-message"),i=document.getElementById("patch-builder-error-message");a&&i?(e?(a.classList.add("show"),i.innerHTML=e):(a.classList.remove("show"),i.innerHTML=""),"warning"===t?i.classList.add("warning"):i.classList.remove("warning")):"warning"===t?console.warn("Patch Builder JS: "+e):console.error("Patch Builder JS: "+e)},c=function(e){document.getElementById("patch-builder-input-file-original").disabled=!e,document.getElementById("patch-builder-input-file-modified").disabled=!e,document.getElementById("patch-builder-select-patch-type").disabled=!e,document.getElementById("patch-builder-button-create").disabled=!(t&&a&&e)||!e},l=function(e){return"rup"===e?["Description"]:"ebp"===e?["Author","Title","Description"]:[]},s=function(e){return l(e).reduce((e,t)=>{const a=document.getElementById("patch-builder-input-metadata-"+t.toLowerCase().replace(/\s+/g,"-"));return a&&a.value.trim()&&(e[t]=a.value.trim()),e},{})};var d,p=!1;return{isInitialized:function(){return p},initialize:function(){if(p)throw new Error("Patch Builder JS was already initialized");if(!e.isInitialized())throw new Error("Rom Patcher JS must be initialized before Patch Builder JS");if(!document.getElementById("patch-builder-button-create")||"BUTTON"!==document.getElementById("patch-builder-button-create").tagName)throw console.error("Patch Builder JS: button#patch-builder-button-create not found"),new Error("Patch Builder JS: button#patch-builder-button-create not found");if(!document.getElementById("patch-builder-select-patch-type")||"SELECT"!==document.getElementById("patch-builder-select-patch-type").tagName)throw console.error("Patch Builder JS: select#patch-builder-select-patch-type not found"),new Error("Patch Builder JS: select#patch-builder-select-patch-type not found");if(!document.getElementById("patch-builder-input-file-original")||"INPUT"!==document.getElementById("patch-builder-input-file-original").tagName||"file"!==document.getElementById("patch-builder-input-file-original").type)throw console.error("Patch Builder JS: input[type=file]#patch-builder-input-file-original not found"),new Error("Patch Builder JS: input[type=file]#patch-builder-input-file-original not found");if(!document.getElementById("patch-builder-input-file-modified")||"INPUT"!==document.getElementById("patch-builder-input-file-modified").tagName||"file"!==document.getElementById("patch-builder-input-file-modified").type)throw console.error("Patch Builder JS: input[type=file]#patch-builder-input-file-modified not found"),new Error("Patch Builder JS: input[type=file]#patch-builder-input-file-modified not found");i||(document.getElementById("patch-builder-input-file-original").classList.add("no-file-selector-button"),document.getElementById("patch-builder-input-file-modified").classList.add("no-file-selector-button")),(d=new Worker("./rom-patcher-js/RomPatcher.webworker.create.js")).onmessage=e=>{t._u8array=e.data.originalRomU8Array,a._u8array=e.data.modifiedRomU8Array,c(!0),r(!1);const i=new BinFile(e.data.patchFileU8Array.buffer);i.fileName=a.getName()+"."+document.getElementById("patch-builder-select-patch-type").value,i.save(),o()},d.onerror=e=>{c(!0),r(!1),o("webWorkerCreate error: "+e.message)},document.getElementById("patch-builder-button-create").disabled=!0,document.getElementById("patch-builder-input-file-original").addEventListener("change",function(){this.files&&this.files.length&&(c(!1),this.classList.remove("empty"),t=new BinFile(this.files[0],function(e){c(!0),RomPatcher.isRomTooBig(t)?o(n("Using big files is not recommended"),"warning"):ZIPManager.isZipFile(t)&&o(n("Patch creation is not compatible with zipped ROMs"),"warning")}))}),document.getElementById("patch-builder-input-file-modified").addEventListener("change",function(){c(!1),this.classList.remove("empty"),a=new BinFile(this.files[0],function(e){c(!0),RomPatcher.isRomTooBig(a)?o(n("Using big files is not recommended"),"warning"):ZIPManager.isZipFile(a)&&o(n("Patch creation is not compatible with zipped ROMs"),"warning")})}),document.getElementById("patch-builder-select-patch-type").addEventListener("change",function(){document.getElementById("patch-builder-container-metadata-inputs")&&(document.getElementById("patch-builder-container-metadata-inputs").innerHTML="",l(this.value).forEach(function(e){const t=document.createElement("input");t.id="patch-builder-input-metadata-"+e.toLowerCase().replace(/\s+/g,"-"),t.className="patch-builder-input-metadata",t.type="text",t.placeholder=n(e),document.getElementById("patch-builder-container-metadata-inputs").appendChild(t)}))}),document.getElementById("patch-builder-button-create").addEventListener("click",function(){const e=document.getElementById("patch-builder-select-patch-type").value;c(!1),r(!0),d.postMessage({originalRomU8Array:t._u8array,modifiedRomU8Array:a._u8array,format:e,metadata:s(e)},[t._u8array.buffer,a._u8array.buffer])}),console.log("Patch Builder JS initialized"),p=!0,c(!0)}}}(RomPatcherWeb),ROM_PATCHER_LOCALE={fr:{"Creator mode":"Mode créateur",Settings:"Configurations","Use patch name for output":"Utiliser le nom du patch pour renommer la ROM une fois patchée","Light theme":"Thème Clair","Apply patch":"Appliquer le patch","ROM file:":"Fichier ROM:","Patch file:":"Fichier patch:","Remove %s header":"Supprimer l'en-tête %s","Compatible formats:":"Formats compatibles:","Applying patch...":"Application du patch...","Downloading...":"Téléchargement...","Unzipping...":"Décompresser...","Create patch":"Créer le patch","Original ROM:":"ROM originale:","Modified ROM:":"ROM modifiée:","Patch type:":"Type de patch:","Creating patch...":"Création du patch...","Source ROM checksum mismatch":"Non-concordance de la somme de contrôle de la ROM source","Target ROM checksum mismatch":"Non-concordance de la somme de contrôle de la ROM cible","Patch checksum mismatch":"Non-concordance de la somme de contrôle du patch","Error downloading %s":"Erreur lors du téléchargement du patch","Error unzipping file":"Erreur lors de la décompression du fichier","Invalid patch file":"Fichier patch invalide","Using big files is not recommended":"L'utilisation de gros fichiers n'est pas recommandée"},de:{"Creator mode":"Erstellmodus",Settings:"Einstellungen","Use patch name for output":"Output ist Name vom Patch","Fix ROM header checksum":"Prüfsumme im ROM Header korrigieren","Light theme":"Helles Design","Apply patch":"Patch anwenden","ROM file:":"ROM-Datei:","Patch file:":"Patch-Datei:","Remove %s header":"Header entfernen %s","Compatible formats:":"Unterstützte Formate:","Applying patch...":"Patch wird angewandt...","Downloading...":"Herunterladen...","Unzipping...":"Entpacken...","Create patch":"Patch erstellen","Original ROM:":"Originale ROM:","Modified ROM:":"Veränderte ROM:","Patch type:":"Patch-Format:","Creating patch...":"Patch wird erstellt...","Source ROM checksum mismatch":"Prüfsumme der Input-ROM stimmt nicht überein","Target ROM checksum mismatch":"Prüfsumme der Output-ROM stimmt nicht überein","Patch checksum mismatch":"Prüfsumme vom Patch stimmt nicht überein","Error downloading %s":"Fehler beim Herunterladen vom %s","Error unzipping file":"Fehler beim Entpacken","Invalid patch file":"Ungültiger Patch","Using big files is not recommended":"Große Dateien zu verwenden ist nicht empfohlen"},es:{"Creator mode":"Modo creador",Settings:"Configuración","Use patch name for output":"Guardar con nombre del parche","Fix ROM header checksum":"Corregir checksum cabecera ROM","Light theme":"Tema claro","Apply patch":"Aplicar parche","ROM file:":"Archivo ROM:","Patch file:":"Archivo parche:","Remove %s header":"Quitar cabecera %s","Add %s header":"Añadir cabecera %s","Compatible formats:":"Formatos compatibles:","Description:":"Descripción:","Required ROM:":"ROM requerida:","Required %s:":"%s requerido:","Applying patch...":"Aplicando parche...","Downloading...":"Descargando...","Unzipping...":"Descomprimiendo...","Calculating...":"Calculando...","Force calculate checksum":"Forzar cálculo de checksum","Create patch":"Crear parche","Original ROM:":"ROM original:","Modified ROM:":"ROM modificada:","Patch type:":"Tipo de parche:","Creating patch...":"Creando parche...",Author:"Autor",Title:"Título",Description:"Descripción","Source ROM checksum mismatch":"Checksum de ROM original no válida","Target ROM checksum mismatch":"Checksum de ROM creada no válida","Patch checksum mismatch":"Checksum de parche no válida","Error downloading %s":"Error descargando %s","Error unzipping file":"Error descomprimiendo archivo","Invalid patch file":"Archivo de parche no válido","Using big files is not recommended":"No es recomendable usar archivos muy grandes","SNES copier":"copión SNES"},it:{"Creator mode":"Modalità creatore",Settings:"Impostazioni","Use patch name for output":"Usa il nome della patch per uscita","Light theme":"Tema chiaro","Apply patch":"Applica patch","ROM file:":"File ROM:","Patch file:":"File patch:","Remove %s header":"Rimuovi header %s","Compatible formats:":"Formati:","Applying patch...":"Applica patch...","Downloading...":"Scaricamento...","Unzipping...":"Estrazione...","Create patch":"Crea patch","Original ROM:":"ROM originale:","Modified ROM:":"ROM modificata:","Patch type:":"Tipologia patch:","Creating patch...":"Creazione patch...","Source ROM checksum mismatch":"Checksum della ROM sorgente non valido","Target ROM checksum mismatch":"Checksum della ROM destinataria non valido","Patch checksum mismatch":"Checksum della patch non valido","Error downloading %s":"Errore di scaricamento %s","Error unzipping file":"Errore estrazione file","Invalid patch file":"File della patch non valido","Using big files is not recommended":"Non è raccomandato usare file di grandi dimensioni"},nl:{"Creator mode":"Creator-modus",Settings:"Settings","Use patch name for output":"Use patch name for output","Light theme":"Light theme","Apply patch":"Pas patch toe","ROM file:":"ROM bestand:","Patch file:":"Patch bestand:","Remove %s header":"Verwijder rubriek %s","Compatible formats:":"Compatibele formaten:","Applying patch...":"Patch toepassen...","Downloading...":"Downloaden...","Unzipping...":"Uitpakken...","Create patch":"Maak patch","Original ROM:":"Originale ROM:","Modified ROM:":"Aangepaste ROM:","Patch type:":"Type patch:","Creating patch...":"Patch maken...","Source ROM checksum mismatch":"Controlesom van bron-ROM komt niet overeen","Target ROM checksum mismatch":"Controlesom van doel-ROM komt niet overeen","Patch checksum mismatch":"Controlesom van patch komt niet overeen","Error downloading %s":"Fout bij downloaden van patch","Error unzipping file":"Fout bij uitpakken van bestand","Invalid patch file":"Ongeldig patchbestand","Using big files is not recommended":"Het gebruik van grote bestanden wordt niet aanbevolen"},sv:{"Creator mode":"Skaparläge",Settings:"Settings","Use patch name for output":"Use patch name for output","Light theme":"Light theme","Apply patch":"Tillämpa korrigeringsfil","ROM file:":"ROM-fil:","Patch file:":"Korrigeringsfil:","Remove %s header":"Ta bort rubrik %s","Compatible formats:":"Kompatibla format:","Applying patch...":"Tillämpar korrigeringsfil...","Downloading...":"Ladda ner...","Unzipping...":"Packa upp...","Create patch":"Skapa korrigeringsfil","Original ROM:":"Original-ROM:","Modified ROM:":"Modifierad ROM:","Patch type:":"Korrigeringsfil-typ:","Creating patch...":"Skapa korrigeringsfil...","Source ROM checksum mismatch":"ROM-källans kontrollsumman matchar inte","Target ROM checksum mismatch":"ROM-målets kontrollsumman matchar inte","Patch checksum mismatch":"korrigeringsfilens kontrollsumman matchar inte","Error downloading %s":"Fel vid nedladdning av korrigeringsfilen","Error unzipping file":"Det gick inte att packa upp filen","Invalid patch file":"Ogiltig korrigeringsfil","Using big files is not recommended":"Användning av stora filer rekommenderas inte"},ca:{"Creator mode":"Mode creador",Settings:"Configuració","Use patch name for output":"Desar amb nom del pedaç","Light theme":"Tema clar","Apply patch":"Aplicar pedaç","ROM file:":"Arxiu ROM:","Patch file:":"Arxiu pedaç:","Remove %s header":"Treure capçalera %s","Add %s header":"Afegir capçalera %s","Compatible formats:":"Formats compatibles:","Description:":"Descripció:","Required ROM:":"ROM requerida:","Required %s:":"%s requerit:","Applying patch...":"Aplicant pedaç...","Downloading...":"Descarregant...","Unzipping...":"Descomprimint...","Create patch":"Crear pedaç","Original ROM:":"ROM original:","Modified ROM:":"ROM modificada:","Patch type:":"Tipus de pedaç:","Creating patch...":"Creant pedaç...",Author:"Autor",Title:"Títol",Description:"Descripció","Source ROM checksum mismatch":"Checksum de ROM original no vàlida","Target ROM checksum mismatch":"Checksum de ROM creada no vàlida","Patch checksum mismatch":"Checksum de pedaç no vàlida","Error downloading %s":"Error descarregant %s","Error unzipping file":"Error descomprimint arxiu","Invalid patch file":"Arxiu de pedaç no vàlid","Using big files is not recommended":"No és recomanable usar arxius molt grans"},"ca-va":{"Creator mode":"Mode creador",Settings:"Configuració","Use patch name for output":"Guardar amb nom del pedaç","Light theme":"Tema clar","Apply patch":"Aplicar pedaç","ROM file:":"Arxiu ROM:","Patch file:":"Arxiu pedaç:","Remove %s header":"Llevar capçalera %s","Add %s header":"Afegir capçalera %s","Compatible formats:":"Formats compatibles:","Description:":"Descripció:","Required ROM:":"ROM requerida:","Required %s:":"%s requerit:","Applying patch...":"Aplicant pedaç...","Downloading...":"Descarregant...","Unzipping...":"Descomprimint...","Create patch":"Crear pedaç","Original ROM:":"ROM original:","Modified ROM:":"ROM modificada:","Patch type:":"Tipus de pedaç:","Creating patch...":"Creant pedaç...","Source ROM checksum mismatch":"Checksum de ROM original incorrecta","Target ROM checksum mismatch":"Checksum de ROM creada incorrecta","Patch checksum mismatch":"Checksum de pedaç incorrecte","Error downloading %s":"Error descarregant %s","Error unzipping file":"Error descomprimint arxiu","Invalid patch file":"Arxiu de pedaç incorrecte","Using big files is not recommended":"No és recomanable utilitzar arxius molt grans"},ru:{"Creator mode":"Режим создания",Settings:"Settings","Use patch name for output":"Use patch name for output","Light theme":"Light theme","Apply patch":"Применить патч","ROM file:":"Файл ROM:","Patch file:":"Файл патча:","Remove %s header":"Удалить заголовок перед применением","Compatible formats:":"Совместимые форматы:","Applying patch...":"Применяется патч...","Downloading...":"Загрузка...","Unzipping...":"Unzipping...","Create patch":"Создать патч","Original ROM:":"Оригинальный ROM:","Modified ROM:":"Изменённый ROM:","Patch type:":"Тип патча:","Creating patch...":"Патч создаётся...","Source ROM checksum mismatch":"Неправильная контрольная сумма входного ROM","Target ROM checksum mismatch":"Неправильная контрольная сумма выходного ROM","Patch checksum mismatch":"Неправильная контрольная сумма патча","Error downloading %s":"Ошибка при скачивании патча","Error unzipping file":"Error unzipping file","Invalid patch file":"Неправильный файл патча","Using big files is not recommended":"Не рекомендуется использовать большие файлы"},"pt-br":{"Creator mode":"Modo criador",Settings:"Configurações","Use patch name for output":"Usar o nome do patch na saída","Fix ROM header checksum":"Consertar o checksum do cabeçalho da ROM","Light theme":"Tema leve","Apply patch":"Aplicar patch","ROM file:":"Arquivo da ROM:","Patch file:":"Arquivo do patch:","Remove %s header":"Remover cabeçalho %s","Compatible formats:":"Formatos compatíveis:","Applying patch...":"Aplicando patch...","Downloading...":"Baixando...","Unzipping...":"Descompactando...","Create patch":"Criar patch","Original ROM:":"ROM original:","Modified ROM:":"ROM modificada:","Patch type:":"Tipo de patch:","Creating patch...":"Criando o patch...","Source ROM checksum mismatch":"O checksum da ROM original é inválido","Target ROM checksum mismatch":"O checksum da ROM alvo é inválido","Patch checksum mismatch":"O checksum do patch é inválido","Error downloading %s":"Erro ao baixar o %s","Error unzipping file":"Erro ao descompactar o arquivo","Invalid patch file":"Arquivo do patch inválido","Using big files is not recommended":"O uso de arquivos grandes não é recomendado"},ja:{"Creator mode":"作成モード",Settings:"設定","Use patch name for output":"パッチと同じ名前で出力","Light theme":"ライトテーマ","Apply patch":"パッチを当て","ROM file:":"ROMファィル:","Patch file:":"パッチファイル:","Remove %s header":"ヘッダーを削除","Compatible formats:":"互換性のあるフォーマット:","Applying patch...":"パッチを当ている…","Downloading...":"ダウンロードしている…","Unzipping...":"解凍している…","Create patch":"パッチを作成","Original ROM:":"元のROM:","Modified ROM:":"変更されたROM:","Patch type:":"パッチのタイプ:","Creating patch...":"パッチを作成している…","Source ROM checksum mismatch":"ソースROMチェックサムの不一致","Target ROM checksum mismatch":"ターゲットROMチェクサムの不一致","Patch checksum mismatch":"バッチチェックサムの不一致","Error downloading %s":"パッチのダウンロードエラー","Error unzipping file":"パッチの解凍エラー","Invalid patch file":"無効なパッチエラー","Using big files is not recommended":"大きなファイルの使いはおすすめしない。"},"zh-cn":{"Creator mode":"创建模式",Settings:"设置","Use patch name for output":"修改后ROM文件名和补丁保持一致","Light theme":"浅色主题","Apply patch":"打补丁","ROM file:":"ROM文件:","Patch file:":"补丁文件:","Remove %s header":"删除文件头","Compatible formats:":"兼容补丁格式:","Applying patch...":"正在打补丁……","Downloading...":"正在下载……","Unzipping...":"正在解压……","Create patch":"创建补丁","Original ROM:":"原始ROM:","Modified ROM:":"修改后ROM:","Patch type:":"补丁类型:","Creating patch...":"正在创建补丁……","Source ROM checksum mismatch":"原始ROM校验和不匹配","Target ROM checksum mismatch":"目标ROM校验和不匹配","Patch checksum mismatch":"补丁文件校验和不匹配","Error downloading %s":"下载出错:%s","Error unzipping file":"解压出错","Invalid patch file":"无效补丁","Using big files is not recommended":"不推荐使用大文件。"},"zh-tw":{"Creator mode":"創作者模式",Settings:"設定","Use patch name for output":"修改後ROM檔名和patch保持一致","Fix ROM header checksum":"修正ROM檔頭校驗碼","Light theme":"淺色主題","Apply patch":"套用patch","ROM file:":"ROM檔:","Patch file:":"patch檔:","Remove %s header":"刪除檔頭","Compatible formats:":"相容格式:","Applying patch...":"套用patch中……","Downloading...":"下載中……","Unzipping...":"解壓中……","Create patch":"創建patch","Original ROM:":"原始ROM:","Modified ROM:":"修改後ROM:","Patch type:":"patch類型:","Creating patch...":"正在創建patch……","Source ROM checksum mismatch":"原始ROM校驗碼不匹配","Target ROM checksum mismatch":"目標ROM校驗碼不匹配","Patch checksum mismatch":"patch檔校驗碼不匹配","Error downloading %s":"下載出錯:%s","Error unzipping file":"解壓出錯","Invalid patch file":"無效的patch檔","Using big files is not recommended":"不建議使用大檔。"}};