Path: blob/main/static/emulatorjs/EmulatorJS-main/emujs_data/emu-main.js
595 views
window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {1'use strict';2window.EJS_RESET_VARS = [];3for (let k in window) {4window.EJS_RESET_VARS.push(k);5}6const _0x470424 = _0x2c1832(1);7_0x2c1832.r(_0x17edbf);8let _0x39ca5e = {9'volume': 0.5,10'muted': false,11'i18n': {12'restart': 'Restart',13'play': 'Play',14'pause': 'Pause',15'played': 'Played',16'volume': 'Volume',17'mute': 'Mute (F9)',18'unmute': 'Unmute (F9)',19'enterFullscreen': 'Enter fullscreen',20'exitFullscreen': 'Exit fullscreen',21'settings': 'Settings',22'saveState': 'Save State (Shift + F2)',23'loadState': 'Load State (Shift + F4)',24'screenRecord': 'Start Screen Recording',25'cacheManager': 'Cache Manager',26'netplay': 'Netplay',27'gamepad': 'Control Settings',28'cheat': 'Cheats',29'menuBack': 'Go back to previous menu',30'normal': 'Normal',31'all': 'All',32'reset': 'Reset',33'disabled': 'Disabled',34'enabled': 'Enabled',35'playNow': 'Start Game'36},37'listeners': {38'play': null,39'pause': null,40'restart': null,41'rewind': null,42'mute': null,43'volume': null,44'fullscreen': null45},46'events': ['ready'],47'selectors': {48'editable': 'input, textarea, select, [contenteditable]',49'container': '.ejs',50'controls': {51'container': null,52'wrapper': '.jes__controls'53},54'buttons': {55'play': '[data-btn="play"]',56'pause': '[data-btn="pause"]',57'mute': '[data-btn="mute"]',58'fullscreen': '[data-btn="fullscreen"]',59'settings': '[data-btn="settings"]',60'saveState': '[data-btn="save-state"]',61'loadState': '[data-btn="load-state"]',62'screenRecord': '[data-btn="screen-record"]',63'cacheManager': '[data-btn="cache-manager"]',64'gamepad': '[data-btn="gamepad"]',65'netplay': '[data-btn="netplay"]',66'cheat': '[data-btn="cheat"]'67},68'inputs': {69'volume': '[data-range="volume"]'70}71},72'classNames': {73'type': 'ejs--video',74'video': 'ejs__video-wrapper',75'poster': 'ejs__poster',76'posterEnabled': 'ejs__poster-enabled',77'control': 'ejs__control',78'controlPressed': 'ejs__control--pressed',79'playing': 'ejs--playing',80'paused': 'ejs--paused',81'stopped': 'ejs--stopped',82'loading': 'ejs--loading',83'hover': 'ejs--hover',84'tooltip': 'ejs__tooltip',85'hidden': 'ejs__sr-only',86'hideControls': 'ejs--hide-controls',87'isIos': 'ejs--is-ios',88'isTouch': 'ejs--is-touch',89'uiSupported': 'ejs--full-ui',90'noTransition': 'ejs--no-transition',91'menu': {92'value': 'ejs__menu__value',93'badge': 'ejs__badge',94'open': 'ejs--menu-open'95},96'fullscreen': {97'enabled': 'ejs--fullscreen-enabled',98'fallback': 'ejs--fullscreen-fallback'99},100'tabFocus': 'ejs__tab-focus'101}102},103renderErrorPage = _0x2c1832(0),104_0x5127f4 = _0x2c1832(0x9d),105_0x48e5ff = _0x2c1832.n(_0x5127f4),106_0x406e79 = function(_0x2aa74f) {107return null != _0x2aa74f ? _0x2aa74f.constructor : null;108},109_0x1b0c2c = function(_0x8ec039, _0x1cb5ff) {110return Boolean(_0x8ec039 && _0x1cb5ff && _0x8ec039 instanceof _0x1cb5ff);111},112_0x19f739 = function(_0x3e8e1f) {113return null == _0x3e8e1f;114},115_0x4fc5a1 = function(_0x37a418) {116return _0x406e79(_0x37a418) === Object;117},118_0x34f3e8 = function(_0x2d2e5c) {119return _0x406e79(_0x2d2e5c) === String;120},121_0x1ca546 = function(_0x4d698f) {122return Array.isArray(_0x4d698f);123},124_0x37cc52 = function(_0x3a8b14) {125return _0x1b0c2c(_0x3a8b14, NodeList);126},127_0x555ee8 = function(_0x1fde53) {128return _0x19f739(_0x1fde53) || (_0x34f3e8(_0x1fde53) || _0x1ca546(_0x1fde53) || _0x37cc52(_0x1fde53)) && !_0x1fde53.length || _0x4fc5a1(_0x1fde53) && !Object.keys(_0x1fde53).length;129},130_0x1e2c68 = {131'nullOrUndefined': _0x19f739,132'object': _0x4fc5a1,133'number': function(_0x1d08d4) {134return _0x406e79(_0x1d08d4) === Number && !Number.isNaN(_0x1d08d4);135},136'string': _0x34f3e8,137'boolean': function(_0x340d71) {138return _0x406e79(_0x340d71) === Boolean;139},140'function': function(_0x10f562) {141return _0x406e79(_0x10f562) === Function;142},143'array': _0x1ca546,144'weakMap': function(_0x70b79f) {145return _0x1b0c2c(_0x70b79f, WeakMap);146},147'nodeList': _0x37cc52,148'element': function(_0xc21062) {149return _0x1b0c2c(_0xc21062, Element);150},151'textNode': function(_0x3e6b67) {152return _0x406e79(_0x3e6b67) === Text;153},154'event': function(_0x247601) {155return _0x1b0c2c(_0x247601, Event);156},157'keyboardEvent': function(_0x2b3224) {158return _0x1b0c2c(_0x2b3224, KeyboardEvent);159},160'cue': function(_0x57ee67) {161return _0x1b0c2c(_0x57ee67, window.TextTrackCue) || _0x1b0c2c(_0x57ee67, window.VTTCue);162},163'track': function(_0x23318b) {164return _0x1b0c2c(_0x23318b, TextTrack) || !_0x19f739(_0x23318b) && _0x34f3e8(_0x23318b.kind);165},166'url': function(_0xd61cf4) {167if (_0x1b0c2c(_0xd61cf4, window.URL)) return true;168let _0x17edbf = _0xd61cf4;169_0xd61cf4.startsWith('http://') && _0xd61cf4.startsWith('https://') || (_0x17edbf = 'http://' .concat(_0xd61cf4));170try {171return !_0x555ee8(new URL(_0x17edbf).hostname);172} catch (_0x5e6cd2) {173return false;174}175},176'empty': _0x555ee8177},178_0x168698 = function() {179let _0xa88a13 = false;180try {181let _0x17edbf = Object.defineProperty({}, 'passive', {182'get': function() {183return _0xa88a13 = true, null;184}185});186window.addEventListener('test', null, _0x17edbf), window.removeEventListener('test', null, _0x17edbf);187} catch (_0x1db3b5) {}188return _0xa88a13;189}();190191function _0x1ef215(_0xa482e6, _0x474854, _0xc30d6e) {192let _0x57056f = this,193_0x3f468e = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],194_0x79ce58 = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4],195_0x23848b = arguments.length > 5 && void 0 !== arguments[5] && arguments[5];196if (_0xa482e6 && 'addEventListener' in _0xa482e6 && !_0x1e2c68.empty(_0x474854) && _0x1e2c68.function(_0xc30d6e)) {197let _0x4a2da0 = _0x474854.split(' '),198_0x40de8d = _0x23848b;199_0x168698 && (_0x40de8d = {200'passive': _0x79ce58,201'capture': _0x23848b202}), _0x4a2da0.forEach(function(_0x487d3c) {203_0x57056f && _0x57056f.eventListeners && _0x3f468e && _0x57056f.eventListeners.push({204'element': _0xa482e6,205'type': _0x487d3c,206'callback': _0xc30d6e,207'options': _0x40de8d208}), _0xa482e6[_0x3f468e ? 'addEventListener' : 'removeEventListener'](_0x487d3c, _0xc30d6e);209});210}211}212213function _0x1093f4(_0x4d8d94) {214let _0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '',215_0x2c1832 = arguments.length > 2 ? arguments[2] : undefined,216_0x4adcdf = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3],217_0x2f85bc = arguments.length > 4 && void 0 !== arguments[4] && arguments[4];218_0x1ef215.call(this, _0x4d8d94, _0x17edbf, _0x2c1832, true, _0x4adcdf, _0x2f85bc);219}220221function _0x20109b(_0x550b1a) {222let _0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '',223_0x2c1832 = arguments.length > 2 ? arguments[2] : undefined,224_0x5e10a2 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3],225_0x5c9512 = arguments.length > 4 && void 0 !== arguments[4] && arguments[4];226_0x1ef215.call(this, _0x550b1a, _0x17edbf, _0x2c1832, false, _0x5e10a2, _0x5c9512);227}228229function _0x455c85(_0x4e4b15) {230let _0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '',231_0x2c1832 = arguments.length > 2 ? arguments[2] : void 0,232_0x2b8c91 = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3],233_0x23e991 = arguments.length > 4 && void 0 !== arguments[4] && arguments[4];234235_0x1ef215.call(this, _0x4e4b15, _0x17edbf, function _0x5127f4() {236_0x20109b(_0x4e4b15, _0x17edbf, _0x5127f4, _0x2b8c91, _0x23e991);237let _0x1fe440 = arguments.length,238_0x1d3219 = new Array(_0x1fe440);239for (let _0x54457c = 0; _0x54457c < _0x1fe440; _0x54457c++) _0x1d3219[_0x54457c] = arguments[_0x54457c];240_0x2c1832.apply(this, _0x1d3219);241}, true, _0x2b8c91, _0x23e991);242}243244function _0xbae705(_0x975ccc) {245let _0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '',246_0x2c1832 = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],247_0x57297b = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};248if (_0x1e2c68.element(_0x975ccc) && !_0x1e2c68.empty(_0x17edbf)) {249let _0x4f631e = new CustomEvent(_0x17edbf, {250'bubbles': _0x2c1832,251'detail': Object.assign({}, _0x57297b, {252'emulator': this253})254});255_0x975ccc.dispatchEvent(_0x4f631e);256}257}258let _0x55349e = _0x2c1832(0x9e),259_0x42870c = _0x2c1832.n(_0x55349e);260261function _0x30f85e(_0x3ed035, _0xd96db3) {262return function(_0x18bbf3) {263if (Array.isArray(_0x18bbf3)) return _0x18bbf3;264}(_0x3ed035) || function(_0x2bb2ab, _0x4993ee) {265let _0x2c1832 = [],266_0x629f39 = true,267_0xde5653 = false,268_0x346a0d = undefined;269try {270for (let _0x57d79d, _0x557ef0 = _0x2bb2ab[Symbol.iterator](); !(_0x629f39 = (_0x57d79d = _0x557ef0.next()).done) && (_0x2c1832.push(_0x57d79d.value), !_0x4993ee || _0x2c1832.length !== _0x4993ee); _0x629f39 = true);271} catch (_0x54a546) {272_0xde5653 = true, _0x346a0d = _0x54a546;273} finally {274try {275_0x629f39 || null == _0x557ef0.return || _0x557ef0.return();276} finally {277if (_0xde5653) throw _0x346a0d;278}279}280return _0x2c1832;281}(_0x3ed035, _0xd96db3) || function() {282throw new TypeError('Invalid attempt to destructure non-iterable instance');283}();284}285286function _0x580edd(_0x39eb34, _0x86c3db) {287let _0x2c1832 = _0x39eb34.length ? _0x39eb34 : [_0x39eb34];288Array.from(_0x2c1832).reverse().forEach(function(_0x35fc48, _0x79e6bf) {289let _0x1510e4 = _0x79e6bf > 0 ? _0x86c3db.cloneNode(true) : _0x86c3db,290_0x247f26 = _0x35fc48.parentNode,291_0x3a5422 = _0x35fc48.nextSibling;292_0x1510e4.appendChild(_0x35fc48), _0x3a5422 ? _0x247f26.insertBefore(_0x1510e4, _0x3a5422) : _0x247f26.appendChild(_0x1510e4);293});294}295296function _0x154f99(_0x5e4eb3, _0x1acdad) {297_0x1e2c68.element(_0x5e4eb3) && !_0x1e2c68.empty(_0x1acdad) && Object.entries(_0x1acdad).filter(function(_0x37e04b) {298let _0x1acdad = _0x30f85e(_0x37e04b, 2)[1];299return !_0x1e2c68.nullOrUndefined(_0x1acdad);300}).forEach(function(_0x4993dd) {301let _0x2c1832 = _0x30f85e(_0x4993dd, 2),302_0x24704f = _0x2c1832[0],303_0x52ac21 = _0x2c1832[1];304return _0x5e4eb3.setAttribute(_0x24704f, _0x52ac21);305});306}307308function _0x428003(_0x1397c4, _0x1ec8c9, _0x1a02af) {309let _0xca6ad9 = document.createElement(_0x1397c4);310return _0x1e2c68.object(_0x1ec8c9) && _0x154f99(_0xca6ad9, _0x1ec8c9), _0x1e2c68.string(_0x1a02af) && (_0xca6ad9.innerText = _0x1a02af), _0xca6ad9;311}312313function _0x12a55d(_0x27d9d8) {314_0x1e2c68.nodeList(_0x27d9d8) || _0x1e2c68.array(_0x27d9d8) ? Array.from(_0x27d9d8).forEach(_0x12a55d) : _0x1e2c68.element(_0x27d9d8) && _0x1e2c68.element(_0x27d9d8.parentNode) && _0x27d9d8.parentNode.removeChild(_0x27d9d8);315}316317function _0xa949a8(_0x3bc809, _0x215e7f) {318if (!_0x1e2c68.string(_0x3bc809) || _0x1e2c68.empty(_0x3bc809)) return {};319let _0x2c1832 = {},320_0x3ab896 = _0x215e7f;321return _0x3bc809.split(',').forEach(function(_0x2b6c5b) {322let _0x215e7f = _0x2b6c5b.trim(),323_0x2b2f76 = _0x215e7f.replace('.', ''),324_0x499377 = _0x215e7f.replace(/[[\]]/g, '').split('='),325_0x1db3b8 = _0x499377[0],326_0x520bcf = _0x499377.length > 1 ? _0x499377[1].replace(/["']/g, '') : '';327switch (_0x215e7f.charAt(0)) {328case '.':329_0x1e2c68.object(_0x3ab896) && _0x1e2c68.string(_0x3ab896.class) && (_0x3ab896.class += ' ' .concat(_0x2b2f76)), _0x2c1832.class = _0x2b2f76;330break;331case '#':332_0x2c1832.id = _0x215e7f.replace('#', '');333break;334case '[':335_0x2c1832[_0x1db3b8] = _0x520bcf;336}337}), _0x2c1832;338}339340function _0x132da7(_0x275729, _0x511d6f) {341if (_0x1e2c68.element(_0x275729)) {342let _0x2c1832 = _0x511d6f;343_0x1e2c68.boolean(_0x2c1832) || (_0x2c1832 = !_0x275729.hidden), _0x2c1832 ? _0x275729.setAttribute('hidden', '') : _0x275729.removeAttribute('hidden');344}345}346347function _0x3a8e2f(_0x2bf197, _0x46e2bb, _0x3b6b0b) {348if (_0x1e2c68.nodeList(_0x2bf197)) return Array.from(_0x2bf197).map(function(_0x543362) {349return _0x3a8e2f(_0x543362, _0x46e2bb, _0x3b6b0b);350});351if (_0x1e2c68.element(_0x2bf197)) {352let _0x34f25e = 'toggle';353return void 0 !== _0x3b6b0b && (_0x34f25e = _0x3b6b0b ? 'add' : 'remove'), _0x2bf197.classList[_0x34f25e](_0x46e2bb), _0x2bf197.classList.contains(_0x46e2bb);354}355return false;356}357358function _0x350d73(_0x273517, _0x36ffc8) {359return _0x1e2c68.element(_0x273517) && _0x273517.classList.contains(_0x36ffc8);360}361362function _0x13f491(_0x11bf98, _0x674fa2) {363let _0x2c1832 = {364'Element': Element365};366return (_0x2c1832.matches || _0x2c1832.webkitMatchesSelector || _0x2c1832.mozMatchesSelector || _0x2c1832.msMatchesSelector || function() {367return Array.from(document.querySelectorAll(_0x674fa2)).includes(this);368}).call(_0x11bf98, _0x674fa2);369}370371function _0x23ffa1(_0x16eec8) {372return this.elements.container.querySelectorAll(_0x16eec8);373}374375function _0x530042(_0xbc0da2) {376return this.elements.container.querySelector(_0xbc0da2);377}378379function _0x5e0c7d() {380let _0xa88a13 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,381_0x17edbf = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];382if (_0x1e2c68.element(_0xa88a13)) {383let _0x2c1832 = _0x23ffa1.call(this, 'button:not(:disabled), input:not(:disabled), [tabindex]'),384_0x1c6631 = _0x2c1832[0],385_0x52c9df = _0x2c1832[_0x2c1832.length - 1];386_0x1ef215.call(this, this.elements.container, 'keydown', function(_0x1bba02) {387if ('Tab' === _0x1bba02.key && 0x9 === _0x1bba02.keyCode) {388let _0x17edbf = document.activeElement;389_0x17edbf !== _0x52c9df || _0x1bba02.shiftKey ? _0x17edbf === _0x1c6631 && _0x1bba02.shiftKey && (_0x52c9df.focus(), _0x1bba02.preventDefault()) : (_0x1c6631.focus(), _0x1bba02.preventDefault());390}391}, _0x17edbf, false);392}393}394395function _0x31cc23() {396let _0xa88a13 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,397_0x17edbf = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];398_0x1e2c68.element(_0xa88a13) && (_0xa88a13.focus(), _0x17edbf && _0x3a8e2f(_0xa88a13, this.config.classNames.tabFocus));399}400401function getClass(_0x589e98) {402return _0x48e5ff.a.bind(_0x42870c.a)(_0x589e98);403}404let _0x32d193, _0x5f365a, _0x820caf, _0x5a2767 = (_0x32d193 = document.createElement('span'), _0x5f365a = {405'WebkitTransition': 'webkitTransitionEnd',406'MozTransition': 'transitionend',407'OTransition': 'oTransitionEnd otransitionend',408'transition': 'transitionend'409}, _0x820caf = Object.keys(_0x5f365a).find(function(_0x5bdb45) {410return void 0 !== _0x32d193.style[_0x5bdb45];411}), !!_0x1e2c68.string(_0x820caf) && _0x5f365a[_0x820caf]);412413function _0x2b30e0(_0x1fb76b) {414setTimeout(function() {415try {416_0x132da7(_0x1fb76b, true), _0x1fb76b.offsetHeight, _0x132da7(_0x1fb76b, false);417} catch (_0x517747) {}418}, 0);419}420let _0x296fa9, _0x59aa33 = {421'isEdge': 'Netscape' === navigator.appName && navigator.appVersion.indexOf('Edge') > -1,422'isIE': !!document.documentMode,423'isWebkit': 'WebkitAppearance' in document.documentElement.style && !/Edge/ .test(navigator.userAgent),424'isIPhone': /(iPhone|iPod)/gi .test(navigator.platform),425'isIos': (/(iPad|iPhone|iPod)/gi .test(navigator.userAgent) || (/Macintosh/i.test(navigator.userAgent) && navigator.maxTouchPoints && navigator.maxTouchPoints > 1)),426'info': function() {427let _0xa88a13 = /(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d\.apre]+)/ .exec(navigator.userAgent);428return {429'name': _0xa88a13[1].toLowerCase(),430'version': _0xa88a13[2]431};432}433},434_0x2d904a = {435'rangeInput': (_0x296fa9 = document.createElement('input'), _0x296fa9.type = 'range', 'range' === _0x296fa9.type),436'touch': 'ontouchstart' in document.documentElement,437'transitions': false !== _0x5a2767,438'reducedMotion': 'matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches,439'webgl': function() {440let _0xa88a13 = {441'DETECTED': false442};443if (!_0xa88a13.DETECTED) {444let _0x17edbf = document.createElement('canvas');445if (_0x17edbf && _0x17edbf.getContext)446for (let _0x2c1832 = ['webgl2', 'experimental-webgl2', 'webgl', 'experimental-webgl'], _0x44cd27 = 0, _0x12b7b8 = _0x2c1832.length; _0x44cd27 < _0x12b7b8; ++_0x44cd27) {447let _0x11cb40 = _0x2c1832[_0x44cd27],448_0x26b3b2 = _0x17edbf.getContext(_0x11cb40);449if (_0x26b3b2) {450_0xa88a13.WEBGL_CONTEXT = _0x11cb40, _0xa88a13.WEBGL_VERSION = _0x26b3b2.getParameter(_0x26b3b2.VERSION), _0xa88a13.WEBGL_VENDOR = _0x26b3b2.getParameter(_0x26b3b2.VENDOR), _0xa88a13.WEBGL_SL_VERSION = _0x26b3b2.getParameter(_0x26b3b2.SHADING_LANGUAGE_VERSION), _0xa88a13.MAX_TEXTURE_SIZE = _0x26b3b2.getParameter(_0x26b3b2.MAX_TEXTURE_SIZE);451let _0x40c8fc = _0x26b3b2.getExtension('WEBGL_debug_renderer_info');452_0x40c8fc && (_0xa88a13.WEBGL_VENDOR = _0x26b3b2.getParameter(_0x40c8fc.UNMASKED_VENDOR_WEBGL), _0xa88a13.WEBGL_RENDERER = _0x26b3b2.getParameter(_0x40c8fc.UNMASKED_RENDERER_WEBGL)), _0xa88a13.DETECTED = true;453break;454}455}456}457return _0xa88a13;458}(),459'wasm': 'undefined' != typeof WebAssembly && _0x1e2c68.object(WebAssembly),460'audioContext': 'undefined' != typeof AudioContext461};462463function _0x55cbbe(_0x43ca9d, _0x1fbf80, _0x332d13) {464return _0x1fbf80 in _0x43ca9d ? Object.defineProperty(_0x43ca9d, _0x1fbf80, {465'value': _0x332d13,466'enumerable': true,467'configurable': true,468'writable': true469}) : _0x43ca9d[_0x1fbf80] = _0x332d13, _0x43ca9d;470}471472function _0x344e81(_0xa095b0, _0x3d8795) {473return _0x3d8795.split('.').reduce(function(_0x1a1fcd, _0x5112cd) {474return _0x1a1fcd && _0x1a1fcd[_0x5112cd];475}, _0xa095b0);476}477478function _0x5dc0c0() {479let _0xa88a13 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},480_0x2c1832 = new Array(_0x17edbf > 1 ? _0x17edbf - 1 : 0);481for (let _0x17edbf = arguments.length, _0x189546 = 1; _0x189546 < _0x17edbf; _0x189546++) _0x2c1832[_0x189546 - 1] = arguments[_0x189546];482if (!_0x2c1832.length) return _0xa88a13;483let _0x279e54 = _0x2c1832.shift();484return _0x1e2c68.object(_0x279e54) ? (Object.keys(_0x279e54).forEach(function(_0x53b45a) {485_0x1e2c68.object(_0x279e54[_0x53b45a]) ? (Object.keys(_0xa88a13).includes(_0x53b45a) || Object.assign(_0xa88a13, _0x55cbbe({}, _0x53b45a, {})), _0x5dc0c0(_0xa88a13[_0x53b45a], _0x279e54[_0x53b45a])) : Object.assign(_0xa88a13, _0x55cbbe({}, _0x53b45a, _0x279e54[_0x53b45a]));486}), _0x5dc0c0.apply(undefined, [_0xa88a13].concat(_0x2c1832))) : _0xa88a13;487}488489function _0x1a0e98() {490let _0xa88a13 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '',491_0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : '',492_0x2c1832 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : '';493return _0xa88a13.replace(new RegExp(_0x17edbf.toString().replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\x5c$1'), 'g'), _0x2c1832.toString());494}495496function _0x9fdcea() {497let _0xa88a13 = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '').toString();498return (_0xa88a13 = function() {499let _0xa88a13 = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '').toString();500return _0xa88a13 = _0x1a0e98(_0xa88a13, '-', ' '), _0xa88a13 = _0x1a0e98(_0xa88a13, '_', ' '), _0x1a0e98(_0xa88a13 = function() {501return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '').toString().replace(/\w\S*/g, function(_0x5b5cba) {502return _0x5b5cba.charAt(0).toUpperCase() + _0x5b5cba.substr(1).toLowerCase();503});504}(_0xa88a13), ' ', '');505}(_0xa88a13)).charAt(0).toLowerCase() + _0xa88a13.slice(1);506}507508function _0x419e30(_0x3614ce, _0x5196ee) {509return function(_0x38f65b) {510if (Array.isArray(_0x38f65b)) return _0x38f65b;511}(_0x3614ce) || function(_0x20a132, _0x481bd0) {512let _0x2c1832 = [],513_0x930e75 = true,514_0x40863e = false,515_0xf7a5cf = undefined;516try {517for (let _0x9d4c5a, _0x2f59ed = _0x20a132[Symbol.iterator](); !(_0x930e75 = (_0x9d4c5a = _0x2f59ed.next()).done) && (_0x2c1832.push(_0x9d4c5a.value), !_0x481bd0 || _0x2c1832.length !== _0x481bd0); _0x930e75 = true);518} catch (_0x383181) {519_0x40863e = true, _0xf7a5cf = _0x383181;520} finally {521try {522_0x930e75 || null == _0x2f59ed.return || _0x2f59ed.return();523} finally {524if (_0x40863e) throw _0xf7a5cf;525}526}527return _0x2c1832;528}(_0x3614ce, _0x5196ee) || function() {529throw new TypeError('Invalid attempt to destructure non-iterable instance');530}();531}532let _0xb9b2ff = {533'get': function() {534let _0xa88a13 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '',535_0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};536if (_0x1e2c68.empty(_0xa88a13) || _0x1e2c68.empty(_0x17edbf)) return '';537let _0x2c1832 = _0x344e81(_0x17edbf.i18n, _0xa88a13);538if (_0x1e2c68.empty(_0x2c1832)) return '';539let _0x54bf45 = {540'{seektime}': _0x17edbf.seekTime,541'{title}': _0x17edbf.title542};543return Object.entries(_0x54bf45).forEach(function(_0x34ee43) {544let _0x17edbf = _0x419e30(_0x34ee43, 2),545_0x473ebb = _0x17edbf[0],546_0x56ec0 = _0x17edbf[1];547_0x2c1832 = _0x1a0e98(_0x2c1832, _0x473ebb, _0x56ec0);548}), _0x2c1832;549}550};551552function _0x4c97b0(_0xb3d5fd, _0x2cda5d) {553for (let _0x2c1832 = 0; _0x2c1832 < _0x2cda5d.length; _0x2c1832++) {554let _0x3f3944 = _0x2cda5d[_0x2c1832];555_0x3f3944.enumerable = _0x3f3944.enumerable || false, _0x3f3944.configurable = true, 'value' in _0x3f3944 && (_0x3f3944.writable = true), Object.defineProperty(_0xb3d5fd, _0x3f3944.key, _0x3f3944);556}557}558let _0x2f61ba = function() {559function _0x566dbe(_0x3a7165, _0x3d2e3a) {560! function(_0x48c5c0, _0x2b027d) {561if (!(_0x48c5c0 instanceof _0x2b027d)) throw new TypeError('Cannot call a class as a function');562}(this, _0x566dbe), this.enabled = true, this.key = _0x3d2e3a;563}564let _0x17edbf, _0x2c1832, _0x4496fc;565return _0x17edbf = _0x566dbe, _0x4496fc = [{566'key': 'supported',567'get': function() {568try {569return 'localStorage' in window && (window.localStorage.getItem('___test') || window.localStorage.setItem('___test', '___test'), true);570} catch (_0x42cafd) {571return false;572}573}574}], (_0x2c1832 = [{575'key': 'get',576'value': function(_0x4ed865) {577if (!_0x566dbe.supported || !this.enabled) return null;578let _0x2c1832 = window.localStorage.getItem(this.key);579if (_0x1e2c68.empty(_0x2c1832)) return null;580let _0x57ebf7 = JSON.parse(_0x2c1832);581return _0x1e2c68.string(_0x4ed865) && _0x4ed865.length ? _0x57ebf7[_0x4ed865] : _0x57ebf7;582}583}, {584'key': 'set',585'value': function(_0x443e7a) {586if (_0x566dbe.supported && this.enabled && _0x1e2c68.object(_0x443e7a)) {587let _0x2c1832 = this.get();588_0x1e2c68.empty(_0x2c1832) && (_0x2c1832 = {}), _0x5dc0c0(_0x2c1832, _0x443e7a), window.localStorage.setItem(this.key, JSON.stringify(_0x2c1832));589}590}591}]) && _0x4c97b0(_0x17edbf.prototype, _0x2c1832), _0x4496fc && _0x4c97b0(_0x17edbf, _0x4496fc), _0x566dbe;592}();593let _0x13fb79,594_0x4ad1c6 = _0x2c1832(6),595_0x4704b1 = _0x2c1832(159),596_0x3a58c8 = _0x2c1832.n(_0x4704b1),597shaders = {598"2xScaleHQ.glslp": "shaders = 1\n\nshader0 = \"2xScaleHQ.glsl\"\nfilter_linear0 = false\nscale_type_0 = source\n",599"4xScaleHQ.glslp": "shaders = 1\n\nshader0 = \"4xScaleHQ.glsl\"\nfilter_linear0 = false\nscale_type_0 = source\n",600"crt-easymode.glslp": "shaders = 1\n\nshader0 = crt-easymode.glsl\nfilter_linear0 = false\nscale_type_0 = source\n",601"crt-aperture.glslp": "shaders = 1\n\nshader0 = crt-aperture.glsl\nfilter_linear0 = false\n",602"crt-geom.glslp": "shaders = 1\n\nshader0 = crt-geom.glsl\nfilter_linear0 = false\nscale_type_0 = source\n",603"crt-mattias.glslp": "\nshaders = 1\nshader0 = crt-mattias.glsl\nfilter_linear0 = false\n",604"2xScaleHQ.glsl": "/*\n2xGLSLHqFilter shader\n\nCopyright (C) 2005 guest(r) - [email protected]\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n*/\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING out\n#define COMPAT_ATTRIBUTE in\n#define COMPAT_TEXTURE texture\n#else\n#define COMPAT_VARYING varying \n#define COMPAT_ATTRIBUTE attribute \n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nCOMPAT_ATTRIBUTE vec4 VertexCoord;\nCOMPAT_ATTRIBUTE vec4 COLOR;\nCOMPAT_ATTRIBUTE vec4 TexCoord;\nCOMPAT_VARYING vec4 COL0;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\n\nvec4 _oPosition1; \nuniform mat4 MVPMatrix;\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\n\n// compatibility #defines\n#define vTexCoord TEX0.xy\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nvoid main()\n{\ngl_Position = MVPMatrix * VertexCoord;\nTEX0.xy = TexCoord.xy;\nfloat x = 0.5 * SourceSize.z;\nfloat y = 0.5 * SourceSize.w;\nvec2 dg1 = vec2( x, y);\nvec2 dg2 = vec2(-x, y);\nvec2 dx = vec2(x, 0.0);\nvec2 dy = vec2(0.0, y);\nt1 = vec4(vTexCoord - dg1, vTexCoord - dy);\nt2 = vec4(vTexCoord - dg2, vTexCoord + dx);\nt3 = vec4(vTexCoord + dg1, vTexCoord + dy);\nt4 = vec4(vTexCoord + dg2, vTexCoord - dx);\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING in\n#define COMPAT_TEXTURE texture\nout vec4 FragColor;\n#else\n#define COMPAT_VARYING varying\n#define FragColor gl_FragColor\n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\n\n// compatibility #defines\n#define Source Texture\n#define vTexCoord TEX0.xy\n\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nfloat mx = 0.325; // start smoothing wt.\nfloat k = -0.250; // wt. decrease factor\nfloat max_w = 0.25; // max filter weight\nfloat min_w =-0.05; // min filter weight\nfloat lum_add = 0.25; // affects smoothing\nvec3 dt = vec3(1.0);\n\nvoid main()\n{\nvec3 c00 = COMPAT_TEXTURE(Source, t1.xy).xyz; \nvec3 c10 = COMPAT_TEXTURE(Source, t1.zw).xyz; \nvec3 c20 = COMPAT_TEXTURE(Source, t2.xy).xyz; \nvec3 c01 = COMPAT_TEXTURE(Source, t4.zw).xyz; \nvec3 c11 = COMPAT_TEXTURE(Source, vTexCoord).xyz; \nvec3 c21 = COMPAT_TEXTURE(Source, t2.zw).xyz; \nvec3 c02 = COMPAT_TEXTURE(Source, t4.xy).xyz; \nvec3 c12 = COMPAT_TEXTURE(Source, t3.zw).xyz; \nvec3 c22 = COMPAT_TEXTURE(Source, t3.xy).xyz; \n\nfloat md1 = dot(abs(c00 - c22), dt);\nfloat md2 = dot(abs(c02 - c20), dt);\n\nfloat w1 = dot(abs(c22 - c11), dt) * md2;\nfloat w2 = dot(abs(c02 - c11), dt) * md1;\nfloat w3 = dot(abs(c00 - c11), dt) * md2;\nfloat w4 = dot(abs(c20 - c11), dt) * md1;\n\nfloat t1 = w1 + w3;\nfloat t2 = w2 + w4;\nfloat ww = max(t1, t2) + 0.0001;\n\nc11 = (w1 * c00 + w2 * c20 + w3 * c22 + w4 * c02 + ww * c11) / (t1 + t2 + ww);\n\nfloat lc1 = k / (0.12 * dot(c10 + c12 + c11, dt) + lum_add);\nfloat lc2 = k / (0.12 * dot(c01 + c21 + c11, dt) + lum_add);\n\nw1 = clamp(lc1 * dot(abs(c11 - c10), dt) + mx, min_w, max_w);\nw2 = clamp(lc2 * dot(abs(c11 - c21), dt) + mx, min_w, max_w);\nw3 = clamp(lc1 * dot(abs(c11 - c12), dt) + mx, min_w, max_w);\nw4 = clamp(lc2 * dot(abs(c11 - c01), dt) + mx, min_w, max_w);\nFragColor = vec4(w1 * c10 + w2 * c21 + w3 * c12 + w4 * c01 + (1.0 - w1 - w2 - w3 - w4) * c11, 1.0);\n} \n#endif\n",605"4xScaleHQ.glsl": "/*\n4xGLSLHqFilter shader\n\nCopyright (C) 2005 guest(r) - [email protected]\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n*/\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING out\n#define COMPAT_ATTRIBUTE in\n#define COMPAT_TEXTURE texture\n#else\n#define COMPAT_VARYING varying \n#define COMPAT_ATTRIBUTE attribute \n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nCOMPAT_ATTRIBUTE vec4 VertexCoord;\nCOMPAT_ATTRIBUTE vec4 COLOR;\nCOMPAT_ATTRIBUTE vec4 TexCoord;\nCOMPAT_VARYING vec4 COL0;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\nCOMPAT_VARYING vec4 t5;\nCOMPAT_VARYING vec4 t6;\n\nvec4 _oPosition1; \nuniform mat4 MVPMatrix;\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\n\n// compatibility #defines\n#define vTexCoord TEX0.xy\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nvoid main()\n{\ngl_Position = MVPMatrix * VertexCoord;\nTEX0.xy = TexCoord.xy;\nfloat x = 0.5 * SourceSize.z;\nfloat y = 0.5 * SourceSize.w;\nvec2 dg1 = vec2( x, y);\nvec2 dg2 = vec2(-x, y);\nvec2 sd1 = dg1 * 0.5;\nvec2 sd2 = dg2 * 0.5;\nvec2 ddx = vec2(x, 0.0);\nvec2 ddy = vec2(0.0, y);\nt1 = vec4(vTexCoord - sd1, vTexCoord - ddy);\nt2 = vec4(vTexCoord - sd2, vTexCoord + ddx);\nt3 = vec4(vTexCoord + sd1, vTexCoord + ddy);\nt4 = vec4(vTexCoord + sd2, vTexCoord - ddx);\nt5 = vec4(vTexCoord - dg1, vTexCoord - dg2);\nt6 = vec4(vTexCoord + dg1, vTexCoord + dg2);\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING in\n#define COMPAT_TEXTURE texture\nout vec4 FragColor;\n#else\n#define COMPAT_VARYING varying\n#define FragColor gl_FragColor\n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nCOMPAT_VARYING vec4 TEX0;\nCOMPAT_VARYING vec4 t1;\nCOMPAT_VARYING vec4 t2;\nCOMPAT_VARYING vec4 t3;\nCOMPAT_VARYING vec4 t4;\nCOMPAT_VARYING vec4 t5;\nCOMPAT_VARYING vec4 t6;\n\n// compatibility #defines\n#define Source Texture\n#define vTexCoord TEX0.xy\n\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nfloat mx = 1.0; // start smoothing wt.\nfloat k = -1.10; // wt. decrease factor\nfloat max_w = 0.75; // max filter weight\nfloat min_w = 0.03; // min filter weight\nfloat lum_add = 0.33; // affects smoothing\nvec3 dt = vec3(1.0);\n\nvoid main()\n{\nvec3 c = COMPAT_TEXTURE(Source, vTexCoord).xyz;\nvec3 i1 = COMPAT_TEXTURE(Source, t1.xy).xyz; \nvec3 i2 = COMPAT_TEXTURE(Source, t2.xy).xyz; \nvec3 i3 = COMPAT_TEXTURE(Source, t3.xy).xyz; \nvec3 i4 = COMPAT_TEXTURE(Source, t4.xy).xyz; \nvec3 o1 = COMPAT_TEXTURE(Source, t5.xy).xyz; \nvec3 o3 = COMPAT_TEXTURE(Source, t6.xy).xyz; \nvec3 o2 = COMPAT_TEXTURE(Source, t5.zw).xyz;\nvec3 o4 = COMPAT_TEXTURE(Source, t6.zw).xyz;\nvec3 s1 = COMPAT_TEXTURE(Source, t1.zw).xyz; \nvec3 s2 = COMPAT_TEXTURE(Source, t2.zw).xyz; \nvec3 s3 = COMPAT_TEXTURE(Source, t3.zw).xyz; \nvec3 s4 = COMPAT_TEXTURE(Source, t4.zw).xyz; \n\nfloat ko1=dot(abs(o1-c),dt);\nfloat ko2=dot(abs(o2-c),dt);\nfloat ko3=dot(abs(o3-c),dt);\nfloat ko4=dot(abs(o4-c),dt);\n\nfloat k1=min(dot(abs(i1-i3),dt),max(ko1,ko3));\nfloat k2=min(dot(abs(i2-i4),dt),max(ko2,ko4));\n\nfloat w1 = k2; if(ko3<ko1) w1*=ko3/ko1;\nfloat w2 = k1; if(ko4<ko2) w2*=ko4/ko2;\nfloat w3 = k2; if(ko1<ko3) w3*=ko1/ko3;\nfloat w4 = k1; if(ko2<ko4) w4*=ko2/ko4;\n\nc=(w1*o1+w2*o2+w3*o3+w4*o4+0.001*c)/(w1+w2+w3+w4+0.001);\nw1 = k*dot(abs(i1-c)+abs(i3-c),dt)/(0.125*dot(i1+i3,dt)+lum_add);\nw2 = k*dot(abs(i2-c)+abs(i4-c),dt)/(0.125*dot(i2+i4,dt)+lum_add);\nw3 = k*dot(abs(s1-c)+abs(s3-c),dt)/(0.125*dot(s1+s3,dt)+lum_add);\nw4 = k*dot(abs(s2-c)+abs(s4-c),dt)/(0.125*dot(s2+s4,dt)+lum_add);\n\nw1 = clamp(w1+mx,min_w,max_w); \nw2 = clamp(w2+mx,min_w,max_w);\nw3 = clamp(w3+mx,min_w,max_w); \nw4 = clamp(w4+mx,min_w,max_w);\n\nFragColor = vec4((w1*(i1+i3)+w2*(i2+i4)+w3*(s1+s3)+w4*(s2+s4)+c)/(2.0*(w1+w2+w3+w4)+1.0), 1.0);\n} \n#endif\n",606"crt-easymode.glsl": "#if defined(VERTEX)\n\n #if __VERSION__ >= 130\n #define COMPAT_VARYING out\n #define COMPAT_ATTRIBUTE in\n #define COMPAT_TEXTURE texture\n #else\n #define COMPAT_VARYING varying\n #define COMPAT_ATTRIBUTE attribute\n #define COMPAT_TEXTURE texture2D\n #endif\n \n #ifdef GL_ES\n #define COMPAT_PRECISION mediump\n #else\n #define COMPAT_PRECISION\n #endif\n COMPAT_VARYING float _frame_rotation;\n struct input_dummy {\n vec2 _video_size;\n vec2 _texture_size;\n vec2 _output_dummy_size;\n float _frame_count;\n float _frame_direction;\n float _frame_rotation;\n };\n vec4 _oPosition1;\n vec4 _r0005;\n COMPAT_ATTRIBUTE vec4 VertexCoord;\n COMPAT_ATTRIBUTE vec4 TexCoord;\n COMPAT_VARYING vec4 TEX0;\n \n uniform mat4 MVPMatrix;\n uniform int FrameDirection;\n uniform int FrameCount;\n uniform COMPAT_PRECISION vec2 OutputSize;\n uniform COMPAT_PRECISION vec2 TextureSize;\n uniform COMPAT_PRECISION vec2 InputSize;\n void main()\n {\n vec2 _oTex;\n _r0005 = VertexCoord.x*MVPMatrix[0];\n _r0005 = _r0005 + VertexCoord.y*MVPMatrix[1];\n _r0005 = _r0005 + VertexCoord.z*MVPMatrix[2];\n _r0005 = _r0005 + VertexCoord.w*MVPMatrix[3];\n _oPosition1 = _r0005;\n _oTex = TexCoord.xy;\n gl_Position = _r0005;\n TEX0.xy = TexCoord.xy;\n }\n #elif defined(FRAGMENT)\n \n #if __VERSION__ >= 130\n #define COMPAT_VARYING in\n #define COMPAT_TEXTURE texture\n out vec4 FragColor;\n #else\n #define COMPAT_VARYING varying\n #define FragColor gl_FragColor\n #define COMPAT_TEXTURE texture2D\n #endif\n \n #ifdef GL_ES\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n #define COMPAT_PRECISION mediump\n #else\n #define COMPAT_PRECISION\n #endif\n COMPAT_VARYING float _frame_rotation;\n struct input_dummy {\n vec2 _video_size;\n vec2 _texture_size;\n vec2 _output_dummy_size;\n float _frame_count;\n float _frame_direction;\n float _frame_rotation;\n };\n vec4 _ret_0;\n float _TMP30;\n float _TMP29;\n float _TMP28;\n float _TMP13;\n float _TMP32;\n float _TMP11;\n float _TMP10;\n float _TMP31;\n float _TMP9;\n float _TMP8;\n float _TMP15;\n float _TMP14;\n float _TMP33;\n vec4 _TMP34;\n vec4 _TMP27;\n vec4 _TMP25;\n vec4 _TMP23;\n vec4 _TMP21;\n vec4 _TMP26;\n vec4 _TMP24;\n vec4 _TMP22;\n vec4 _TMP20;\n float _TMP4;\n vec4 _TMP3;\n vec4 _TMP2;\n float _TMP19;\n float _TMP18;\n float _TMP17;\n float _TMP16;\n vec4 _TMP1;\n vec2 _TMP0;\n uniform sampler2D Texture;\n input_dummy _IN1;\n float _TMP43;\n float _x_step0044;\n float _curve0044;\n float _a0048;\n float _val0052;\n float _a0052;\n vec4 _TMP57;\n vec4 _x0072;\n vec2 _c0086;\n vec4 _x0088;\n vec4 _x0094;\n vec2 _c0098;\n vec4 _x0100;\n vec2 _c0104;\n vec4 _x0106;\n vec4 _sample_min0110;\n vec4 _sample_max0110;\n vec4 _r0112;\n vec4 _TMP117;\n vec2 _co0124;\n vec2 _c0126;\n vec4 _x0128;\n vec4 _x0134;\n vec2 _c0138;\n vec4 _x0140;\n vec2 _c0144;\n vec4 _x0146;\n vec4 _sample_min0150;\n vec4 _sample_max0150;\n vec4 _r0152;\n vec4 _TMP157;\n float _TMP163;\n float _x_step0164;\n float _curve0164;\n float _a0168;\n float _val0172;\n float _a0172;\n float _TMP183;\n float _TMP189;\n float _x0190;\n float _a0196;\n float _x0198;\n vec2 _x0200;\n float _x0208;\n COMPAT_VARYING vec4 TEX0;\n \n uniform COMPAT_PRECISION vec2 OutputSize;\n uniform COMPAT_PRECISION vec2 TextureSize;\n uniform COMPAT_PRECISION vec2 InputSize;\n void main()\n {\n vec2 _dx1;\n vec2 _dy;\n vec2 _pix_co;\n vec2 _tex_co;\n vec2 _dist;\n vec3 _col2;\n vec3 _col21;\n vec4 _coeffs1;\n float _luma;\n float _bright;\n float _scan_weight;\n vec2 _mod_fac;\n int _dot_no;\n vec3 _mask_weight;\n vec3 _TMP37;\n _dx1 = vec2(1.00000000E+00/TextureSize.x, 0.00000000E+00);\n _dy = vec2(0.00000000E+00, 1.00000000E+00/TextureSize.y);\n _pix_co = TEX0.xy*TextureSize - vec2( 5.00000000E-01, 5.00000000E-01);\n _TMP0 = floor(_pix_co);\n _tex_co = (_TMP0 + vec2( 5.00000000E-01, 5.00000000E-01))/TextureSize;\n _dist = fract(_pix_co);\n _x_step0044 = float((_dist.x >= 5.00000000E-01));\n _a0048 = 2.50000000E-01 - (_dist.x - _x_step0044)*(_dist.x - _x_step0044);\n _TMP33 = inversesqrt(_a0048);\n _TMP14 = 1.00000000E+00/_TMP33;\n _a0052 = 5.00000000E-01 - _dist.x;\n _val0052 = float((_a0052 > 0.00000000E+00));\n _TMP15 = _val0052 - float((_a0052 < 0.00000000E+00));\n _curve0044 = 5.00000000E-01 - _TMP14*_TMP15;\n _TMP43 = _dist.x + 2.50000000E-01*(_curve0044 - _dist.x);\n _coeffs1 = 3.14159274E+00*vec4(1.00000000E+00 + _TMP43, _TMP43, 1.00000000E+00 - _TMP43, 2.00000000E+00 - _TMP43);\n _TMP1 = abs(_coeffs1);\n _TMP57 = max(_TMP1, vec4( 9.99999975E-06, 9.99999975E-06, 9.99999975E-06, 9.99999975E-06));\n _TMP16 = sin(_TMP57.x);\n _TMP17 = sin(_TMP57.y);\n _TMP18 = sin(_TMP57.z);\n _TMP19 = sin(_TMP57.w);\n _TMP2 = vec4(_TMP16, _TMP17, _TMP18, _TMP19);\n _x0072 = _TMP57/2.00000000E+00;\n _TMP16 = sin(_x0072.x);\n _TMP17 = sin(_x0072.y);\n _TMP18 = sin(_x0072.z);\n _TMP19 = sin(_x0072.w);\n _TMP3 = vec4(_TMP16, _TMP17, _TMP18, _TMP19);\n _coeffs1 = ((2.00000000E+00*_TMP2)*_TMP3)/(_TMP57*_TMP57);\n _TMP4 = dot(_coeffs1, vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _coeffs1 = _coeffs1/_TMP4;\n _c0086 = _tex_co - _dx1;\n _TMP20 = COMPAT_TEXTURE(Texture, _c0086);\n _x0088 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP20 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP21 = _TMP20*_x0088;\n _TMP22 = COMPAT_TEXTURE(Texture, _tex_co);\n _x0094 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP22 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP23 = _TMP22*_x0094;\n _c0098 = _tex_co + _dx1;\n _TMP24 = COMPAT_TEXTURE(Texture, _c0098);\n _x0100 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP24 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP25 = _TMP24*_x0100;\n _c0104 = _tex_co + 2.00000000E+00*_dx1;\n _TMP26 = COMPAT_TEXTURE(Texture, _c0104);\n _x0106 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP26 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP27 = _TMP26*_x0106;\n _r0112 = _coeffs1.x*_TMP21;\n _r0112 = _r0112 + _coeffs1.y*_TMP23;\n _r0112 = _r0112 + _coeffs1.z*_TMP25;\n _r0112 = _r0112 + _coeffs1.w*_TMP27;\n _sample_min0110 = min(_TMP23, _TMP25);\n _sample_max0110 = max(_TMP23, _TMP25);\n _TMP34 = min(_sample_max0110, _r0112);\n _TMP117 = max(_sample_min0110, _TMP34);\n _co0124 = _tex_co + _dy;\n _c0126 = _co0124 - _dx1;\n _TMP20 = COMPAT_TEXTURE(Texture, _c0126);\n _x0128 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP20 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP21 = _TMP20*_x0128;\n _TMP22 = COMPAT_TEXTURE(Texture, _co0124);\n _x0134 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP22 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP23 = _TMP22*_x0134;\n _c0138 = _co0124 + _dx1;\n _TMP24 = COMPAT_TEXTURE(Texture, _c0138);\n _x0140 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP24 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP25 = _TMP24*_x0140;\n _c0144 = _co0124 + 2.00000000E+00*_dx1;\n _TMP26 = COMPAT_TEXTURE(Texture, _c0144);\n _x0146 = vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00) + (_TMP26 - vec4( 1.00000000E+00, 1.00000000E+00, 1.00000000E+00, 1.00000000E+00));\n _TMP27 = _TMP26*_x0146;\n _r0152 = _coeffs1.x*_TMP21;\n _r0152 = _r0152 + _coeffs1.y*_TMP23;\n _r0152 = _r0152 + _coeffs1.z*_TMP25;\n _r0152 = _r0152 + _coeffs1.w*_TMP27;\n _sample_min0150 = min(_TMP23, _TMP25);\n _sample_max0150 = max(_TMP23, _TMP25);\n _TMP34 = min(_sample_max0150, _r0152);\n _TMP157 = max(_sample_min0150, _TMP34);\n _x_step0164 = float((_dist.y >= 5.00000000E-01));\n _a0168 = 2.50000000E-01 - (_dist.y - _x_step0164)*(_dist.y - _x_step0164);\n _TMP33 = inversesqrt(_a0168);\n _TMP14 = 1.00000000E+00/_TMP33;\n _a0172 = 5.00000000E-01 - _dist.y;\n _val0172 = float((_a0172 > 0.00000000E+00));\n _TMP15 = _val0172 - float((_a0172 < 0.00000000E+00));\n _curve0164 = 5.00000000E-01 - _TMP14*_TMP15;\n _TMP163 = _dist.y + (_curve0164 - _dist.y);\n _col2 = _TMP117.xyz + _TMP163*(_TMP157.xyz - _TMP117.xyz);\n _luma = dot(vec3( 2.12599993E-01, 7.15200007E-01, 7.22000003E-02), _col2);\n _TMP8 = max(_col2.y, _col2.z);\n _TMP9 = max(_col2.x, _TMP8);\n _bright = (_TMP9 + _luma)/2.00000000E+00;\n _TMP31 = min(6.49999976E-01, _bright);\n _TMP183 = max(3.49999994E-01, _TMP31);\n _x0190 = _bright*1.50000000E+00;\n _TMP31 = min(1.50000000E+00, _x0190);\n _TMP189 = max(1.50000000E+00, _TMP31);\n _a0196 = TEX0.y*2.00000000E+00*3.14159274E+00*TextureSize.y;\n _TMP10 = cos(_a0196);\n _x0198 = _TMP10*5.00000000E-01 + 5.00000000E-01;\n _TMP11 = pow(_x0198, _TMP189);\n _scan_weight = 1.00000000E+00 - _TMP11;\n _x0200 = (TEX0.xy*OutputSize*TextureSize)/InputSize;\n _mod_fac = floor(_x0200);\n _x0208 = _mod_fac.x/3.00000000E+00;\n _TMP32 = floor(_x0208);\n _TMP13 = _mod_fac.x - 3.00000000E+00*_TMP32;\n _dot_no = int(_TMP13);\n if (_dot_no == 0) {\n _mask_weight = vec3( 1.00000000E+00, 6.99999988E-01, 6.99999988E-01);\n } else {\n if (_dot_no == 1) {\n _mask_weight = vec3( 6.99999988E-01, 1.00000000E+00, 6.99999988E-01);\n } else {\n _mask_weight = vec3( 6.99999988E-01, 6.99999988E-01, 1.00000000E+00);\n }\n }\n if (InputSize.y >= 4.00000000E+02) {\n _scan_weight = 1.00000000E+00;\n }\n _col21 = _col2.xyz;\n _col2 = _col2*vec3(_scan_weight, _scan_weight, _scan_weight);\n _col2 = _col2 + _TMP183*(_col21 - _col2);\n _col2 = _col2*_mask_weight;\n _TMP28 = pow(_col2.x, 5.55555582E-01);\n _TMP29 = pow(_col2.y, 5.55555582E-01);\n _TMP30 = pow(_col2.z, 5.55555582E-01);\n _col2 = vec3(_TMP28, _TMP29, _TMP30);\n _TMP37 = _col2*1.20000005E+00;\n _ret_0 = vec4(_TMP37.x, _TMP37.y, _TMP37.z, 1.00000000E+00);\n FragColor = _ret_0;\n return;\n }\n #endif\n",607"crt-aperture.glsl": "\n/*\nCRT Shader by EasyMode\nLicense: GPL\n*/\n/*\n#pragma parameter SHARPNESS_IMAGE \"Sharpness Image\" 1.0 1.0 5.0 1.0\n#pragma parameter SHARPNESS_EDGES \"Sharpness Edges\" 3.0 1.0 5.0 1.0\n#pragma parameter GLOW_WIDTH \"Glow Width\" 0.5 0.05 0.65 0.05\n#pragma parameter GLOW_HEIGHT \"Glow Height\" 0.5 0.05 0.65 0.05\n#pragma parameter GLOW_HALATION \"Glow Halation\" 0.1 0.0 1.0 0.01\n#pragma parameter GLOW_DIFFUSION \"Glow Diffusion\" 0.05 0.0 1.0 0.01\n#pragma parameter MASK_COLORS \"Mask Colors\" 2.0 2.0 3.0 1.0\n#pragma parameter MASK_STRENGTH \"Mask Strength\" 0.3 0.0 1.0 0.05\n#pragma parameter MASK_SIZE \"Mask Size\" 1.0 1.0 9.0 1.0\n#pragma parameter SCANLINE_SIZE_MIN \"Scanline Size Min.\" 0.5 0.5 1.5 0.05\n#pragma parameter SCANLINE_SIZE_MAX \"Scanline Size Max.\" 1.5 0.5 1.5 0.05\n#pragma parameter GAMMA_INPUT \"Gamma Input\" 2.4 1.0 5.0 0.1\n#pragma parameter GAMMA_OUTPUT \"Gamma Output\" 2.4 1.0 5.0 0.1\n#pragma parameter BRIGHTNESS \"Brightness\" 1.5 0.0 2.0 0.05\n* */\n\n#define Coord TEX0\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define OUT out\n#define IN in\n#define tex2D texture\n#else\n#define OUT varying \n#define IN attribute \n#define tex2D texture2D\n#endif\n\n#ifdef GL_ES\n#define PRECISION mediump\n#else\n#define PRECISION\n#endif\n\nIN vec4 VertexCoord;\nIN vec4 Color;\nIN vec2 TexCoord;\nOUT vec4 color;\nOUT vec2 Coord;\n\nuniform mat4 MVPMatrix;\nuniform PRECISION int FrameDirection;\nuniform PRECISION int FrameCount;\nuniform PRECISION vec2 OutputSize;\nuniform PRECISION vec2 TextureSize;\nuniform PRECISION vec2 InputSize;\n\nvoid main()\n{\ngl_Position = MVPMatrix * VertexCoord;\ncolor = Color;\nCoord = TexCoord;\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define IN in\n#define tex2D texture\nout vec4 FragColor;\n#else\n#define IN varying\n#define FragColor gl_FragColor\n#define tex2D texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define PRECISION mediump\n#else\n#define PRECISION\n#endif\n\nuniform PRECISION int FrameDirection;\nuniform PRECISION int FrameCount;\nuniform PRECISION vec2 OutputSize;\nuniform PRECISION vec2 TextureSize;\nuniform PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nIN vec2 Coord;\n\n#ifdef PARAMETER_UNIFORM\nuniform PRECISION float SHARPNESS_IMAGE;\nuniform PRECISION float SHARPNESS_EDGES;\nuniform PRECISION float GLOW_WIDTH;\nuniform PRECISION float GLOW_HEIGHT;\nuniform PRECISION float GLOW_HALATION;\nuniform PRECISION float GLOW_DIFFUSION;\nuniform PRECISION float MASK_COLORS;\nuniform PRECISION float MASK_STRENGTH;\nuniform PRECISION float MASK_SIZE;\nuniform PRECISION float SCANLINE_SIZE_MIN;\nuniform PRECISION float SCANLINE_SIZE_MAX;\nuniform PRECISION float GAMMA_INPUT;\nuniform PRECISION float GAMMA_OUTPUT;\nuniform PRECISION float BRIGHTNESS;\n#else\n#define SHARPNESS_IMAGE 1.0\n#define SHARPNESS_EDGES 3.0\n#define GLOW_WIDTH 0.5\n#define GLOW_HEIGHT 0.5\n#define GLOW_HALATION 0.1\n#define GLOW_DIFFUSION 0.05\n#define MASK_COLORS 2.0\n#define MASK_STRENGTH 0.3\n#define MASK_SIZE 1.0\n#define SCANLINE_SIZE_MIN 0.5\n#define SCANLINE_SIZE_MAX 1.5\n#define GAMMA_INPUT 2.4\n#define GAMMA_OUTPUT 2.4\n#define BRIGHTNESS 1.5\n#endif\n\n#define FIX(c) max(abs(c), 1e-5)\n#define PI 3.141592653589\n#define saturate(c) clamp(c, 0.0, 1.0)\n#define TEX2D(c) pow(tex2D(tex, c).rgb, vec3(GAMMA_INPUT))\n\nmat3 get_color_matrix(sampler2D tex, vec2 co, vec2 dx)\n{\nreturn mat3(TEX2D(co - dx), TEX2D(co), TEX2D(co + dx));\n}\n\nvec3 blur(mat3 m, float dist, float rad)\n{\nvec3 x = vec3(dist - 1.0, dist, dist + 1.0) / rad;\nvec3 w = exp2(x * x * -1.0);\n\nreturn (m[0] * w.x + m[1] * w.y + m[2] * w.z) / (w.x + w.y + w.z);\n}\n\nvec3 filter_gaussian(sampler2D tex, vec2 co, vec2 tex_size)\n{\nvec2 dx = vec2(1.0 / tex_size.x, 0.0);\nvec2 dy = vec2(0.0, 1.0 / tex_size.y);\nvec2 pix_co = co * tex_size;\nvec2 tex_co = (floor(pix_co) + 0.5) / tex_size;\nvec2 dist = (fract(pix_co) - 0.5) * -1.0;\n\nmat3 line0 = get_color_matrix(tex, tex_co - dy, dx);\nmat3 line1 = get_color_matrix(tex, tex_co, dx);\nmat3 line2 = get_color_matrix(tex, tex_co + dy, dx);\nmat3 column = mat3(blur(line0, dist.x, GLOW_WIDTH),\n blur(line1, dist.x, GLOW_WIDTH),\n blur(line2, dist.x, GLOW_WIDTH));\n\nreturn blur(column, dist.y, GLOW_HEIGHT);\n}\n\nvec3 filter_lanczos(sampler2D tex, vec2 co, vec2 tex_size, float sharp)\n{\ntex_size.x *= sharp;\n\nvec2 dx = vec2(1.0 / tex_size.x, 0.0);\nvec2 pix_co = co * tex_size - vec2(0.5, 0.0);\nvec2 tex_co = (floor(pix_co) + vec2(0.5, 0.0)) / tex_size;\nvec2 dist = fract(pix_co);\nvec4 coef = PI * vec4(dist.x + 1.0, dist.x, dist.x - 1.0, dist.x - 2.0);\n\ncoef = FIX(coef);\ncoef = 2.0 * sin(coef) * sin(coef / 2.0) / (coef * coef);\ncoef /= dot(coef, vec4(1.0));\n\nvec4 col1 = vec4(TEX2D(tex_co), 1.0);\nvec4 col2 = vec4(TEX2D(tex_co + dx), 1.0);\n\nreturn (mat4(col1, col1, col2, col2) * coef).rgb;\n}\n\nvec3 get_scanline_weight(float x, vec3 col)\n{\nvec3 beam = mix(vec3(SCANLINE_SIZE_MIN), vec3(SCANLINE_SIZE_MAX), col);\nvec3 x_mul = 2.0 / beam;\nvec3 x_offset = x_mul * 0.5;\n\nreturn smoothstep(0.0, 1.0, 1.0 - abs(x * x_mul - x_offset)) * x_offset;\n}\n\nvec3 get_mask_weight(float x)\n{\nfloat i = mod(floor(x * OutputSize.x * TextureSize.x / (InputSize.x * MASK_SIZE)), MASK_COLORS);\n\nif (i == 0.0) return mix(vec3(1.0, 0.0, 1.0), vec3(1.0, 0.0, 0.0), MASK_COLORS - 2.0);\nelse if (i == 1.0) return vec3(0.0, 1.0, 0.0);\nelse return vec3(0.0, 0.0, 1.0);\n}\n\nvoid main()\n{\nvec3 col_glow = filter_gaussian(Texture, Coord, TextureSize);\nvec3 col_soft = filter_lanczos(Texture, Coord, TextureSize, SHARPNESS_IMAGE);\nvec3 col_sharp = filter_lanczos(Texture, Coord, TextureSize, SHARPNESS_EDGES);\nvec3 col = sqrt(col_sharp * col_soft);\n\ncol *= get_scanline_weight(fract(Coord.y * TextureSize.y), col_soft);\ncol_glow = saturate(col_glow - col);\ncol += col_glow * col_glow * GLOW_HALATION;\ncol = mix(col, col * get_mask_weight(Coord.x) * MASK_COLORS, MASK_STRENGTH);\ncol += col_glow * GLOW_DIFFUSION;\ncol = pow(col * BRIGHTNESS, vec3(1.0 / GAMMA_OUTPUT));\n\nFragColor = vec4(col, 1.0);\n}\n\n#endif\n",608"crt-geom.glsl": "\n/*\nCRT-interlaced\n\nCopyright (C) 2010-2012 cgwg, Themaister and DOLLS\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the Free\nSoftware Foundation; either version 2 of the License, or (at your option)\nany later version.\n\n(cgwg gave their consent to have the original version of this shader\ndistributed under the GPL in this message:\n\nhttp://board.byuu.org/viewtopic.php?p=26075#p26075\n\n\"Feel free to distribute my shaders under the GPL. After all, the\nbarrel distortion code was taken from the Curvature shader, which is\nunder the GPL.\"\n)\nThis shader variant is pre-configured with screen curvature\n*/\n/*\n#pragma parameter CRTgamma \"CRTGeom Target Gamma\" 2.4 0.1 5.0 0.1\n#pragma parameter monitorgamma \"CRTGeom Monitor Gamma\" 2.2 0.1 5.0 0.1\n#pragma parameter d \"CRTGeom Distance\" 1.6 0.1 3.0 0.1\n#pragma parameter CURVATURE \"CRTGeom Curvature Toggle\" 1.0 0.0 1.0 1.0\n#pragma parameter R \"CRTGeom Curvature Radius\" 2.0 0.1 10.0 0.1\n#pragma parameter cornersize \"CRTGeom Corner Size\" 0.03 0.001 1.0 0.005\n#pragma parameter cornersmooth \"CRTGeom Corner Smoothness\" 1000.0 80.0 2000.0 100.0\n#pragma parameter x_tilt \"CRTGeom Horizontal Tilt\" 0.0 -0.5 0.5 0.05\n#pragma parameter y_tilt \"CRTGeom Vertical Tilt\" 0.0 -0.5 0.5 0.05\n#pragma parameter overscan_x \"CRTGeom Horiz. Overscan %\" 100.0 -125.0 125.0 1.0\n#pragma parameter overscan_y \"CRTGeom Vert. Overscan %\" 100.0 -125.0 125.0 1.0\n#pragma parameter DOTMASK \"CRTGeom Dot Mask Toggle\" 0.3 0.0 0.3 0.3\n#pragma parameter SHARPER \"CRTGeom Sharpness\" 1.0 1.0 3.0 1.0\n#pragma parameter scanline_weight \"CRTGeom Scanline Weight\" 0.3 0.1 0.5 0.05\n*/\n\n#ifndef PARAMETER_UNIFORM\n#define CRTgamma 2.4\n#define monitorgamma 2.2\n#define d 1.6\n#define CURVATURE 1.0\n#define R 2.0\n#define cornersize 0.03\n#define cornersmooth 1000.0\n#define x_tilt 0.0\n#define y_tilt 0.0\n#define overscan_x 100.0\n#define overscan_y 100.0\n#define DOTMASK 0.3\n#define SHARPER 1.0\n#define scanline_weight 0.3\n#endif\n\n#if defined(VERTEX)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING out\n#define COMPAT_ATTRIBUTE in\n#define COMPAT_TEXTURE texture\n#else\n#define COMPAT_VARYING varying \n#define COMPAT_ATTRIBUTE attribute \n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nCOMPAT_ATTRIBUTE vec4 VertexCoord;\nCOMPAT_ATTRIBUTE vec4 COLOR;\nCOMPAT_ATTRIBUTE vec4 TexCoord;\nCOMPAT_VARYING vec4 COL0;\nCOMPAT_VARYING vec4 TEX0;\n\nvec4 _oPosition1; \nuniform mat4 MVPMatrix;\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\n\nCOMPAT_VARYING vec2 overscan;\nCOMPAT_VARYING vec2 aspect;\nCOMPAT_VARYING vec3 stretch;\nCOMPAT_VARYING vec2 sinangle;\nCOMPAT_VARYING vec2 cosangle;\nCOMPAT_VARYING vec2 one;\nCOMPAT_VARYING float mod_factor;\nCOMPAT_VARYING vec2 ilfac;\n\n#ifdef PARAMETER_UNIFORM\nuniform COMPAT_PRECISION float CRTgamma;\nuniform COMPAT_PRECISION float monitorgamma;\nuniform COMPAT_PRECISION float d;\nuniform COMPAT_PRECISION float CURVATURE;\nuniform COMPAT_PRECISION float R;\nuniform COMPAT_PRECISION float cornersize;\nuniform COMPAT_PRECISION float cornersmooth;\nuniform COMPAT_PRECISION float x_tilt;\nuniform COMPAT_PRECISION float y_tilt;\nuniform COMPAT_PRECISION float overscan_x;\nuniform COMPAT_PRECISION float overscan_y;\nuniform COMPAT_PRECISION float DOTMASK;\nuniform COMPAT_PRECISION float SHARPER;\nuniform COMPAT_PRECISION float scanline_weight;\n#endif\n\n#define FIX(c) max(abs(c), 1e-5);\n\nfloat intersect(vec2 xy)\n{\nfloat A = dot(xy,xy)+d*d;\nfloat B = 2.0*(R*(dot(xy,sinangle)-d*cosangle.x*cosangle.y)-d*d);\nfloat C = d*d + 2.0*R*d*cosangle.x*cosangle.y;\nreturn (-B-sqrt(B*B-4.0*A*C))/(2.0*A);\n}\n\nvec2 bkwtrans(vec2 xy)\n{\nfloat c = intersect(xy);\nvec2 point = vec2(c)*xy;\npoint -= vec2(-R)*sinangle;\npoint /= vec2(R);\nvec2 tang = sinangle/cosangle;\nvec2 poc = point/cosangle;\nfloat A = dot(tang,tang)+1.0;\nfloat B = -2.0*dot(poc,tang);\nfloat C = dot(poc,poc)-1.0;\nfloat a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);\nvec2 uv = (point-a*sinangle)/cosangle;\nfloat r = R*acos(a);\nreturn uv*r/sin(r/R);\n}\n\nvec2 fwtrans(vec2 uv)\n{\nfloat r = FIX(sqrt(dot(uv,uv)));\nuv *= sin(r/R)/r;\nfloat x = 1.0-cos(r/R);\nfloat D = d/R + x*cosangle.x*cosangle.y+dot(uv,sinangle);\nreturn d*(uv*cosangle-x*sinangle)/D;\n}\n\nvec3 maxscale()\n{\nvec2 c = bkwtrans(-R * sinangle / (1.0 + R/d*cosangle.x*cosangle.y));\nvec2 a = vec2(0.5,0.5)*aspect;\nvec2 lo = vec2(fwtrans(vec2(-a.x,c.y)).x, fwtrans(vec2(c.x,-a.y)).y)/aspect;\nvec2 hi = vec2(fwtrans(vec2(+a.x,c.y)).x, fwtrans(vec2(c.x,+a.y)).y)/aspect;\nreturn vec3((hi+lo)*aspect*0.5,max(hi.x-lo.x,hi.y-lo.y));\n}\n\nvoid main()\n{\n// START of parameters\n\n// gamma of simulated CRT\n//\tCRTgamma = 1.8;\n// gamma of display monitor (typically 2.2 is correct)\n//\tmonitorgamma = 2.2;\n// overscan (e.g. 1.02 for 2% overscan)\noverscan = vec2(1.00,1.00);\n// aspect ratio\naspect = vec2(1.0, 0.75);\n// lengths are measured in units of (approximately) the width\n// of the monitor simulated distance from viewer to monitor\n//\td = 2.0;\n// radius of curvature\n//\tR = 1.5;\n// tilt angle in radians\n// (behavior might be a bit wrong if both components are\n// nonzero)\nconst vec2 angle = vec2(0.0,0.0);\n// size of curved corners\n//\tcornersize = 0.03;\n// border smoothness parameter\n// decrease if borders are too aliased\n//\tcornersmooth = 1000.0;\n\n// END of parameters\n\nvec4 _oColor;\nvec2 _otexCoord;\ngl_Position = VertexCoord.x * MVPMatrix[0] + VertexCoord.y * MVPMatrix[1] + VertexCoord.z * MVPMatrix[2] + VertexCoord.w * MVPMatrix[3];\n_oPosition1 = gl_Position;\n_oColor = COLOR;\n_otexCoord = TexCoord.xy;\nCOL0 = COLOR;\nTEX0.xy = TexCoord.xy;\n\n// Precalculate a bunch of useful values we'll need in the fragment\n// shader.\nsinangle = sin(vec2(x_tilt, y_tilt)) + vec2(0.001);//sin(vec2(max(abs(x_tilt), 1e-3), max(abs(y_tilt), 1e-3)));\ncosangle = cos(vec2(x_tilt, y_tilt)) + vec2(0.001);//cos(vec2(max(abs(x_tilt), 1e-3), max(abs(y_tilt), 1e-3)));\nstretch = maxscale();\n\nilfac = vec2(1.0,clamp(floor(InputSize.y/200.0), 1.0, 2.0));\n\n// The size of one texel, in texture-coordinates.\nvec2 sharpTextureSize = vec2(SHARPER * TextureSize.x, TextureSize.y);\none = ilfac / sharpTextureSize;\n\n// Resulting X pixel-coordinate of the pixel we're drawing.\nmod_factor = TexCoord.x * TextureSize.x * OutputSize.x / InputSize.x;\n\n}\n\n#elif defined(FRAGMENT)\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING in\n#define COMPAT_TEXTURE texture\nout vec4 FragColor;\n#else\n#define COMPAT_VARYING varying\n#define FragColor gl_FragColor\n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nstruct output_dummy {\nvec4 _color;\n};\n\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nCOMPAT_VARYING vec4 TEX0;\n\n// Comment the next line to disable interpolation in linear gamma (and\n// gain speed).\n#define LINEAR_PROCESSING\n\n// Enable screen curvature.\n// #define CURVATURE\n\n// Enable 3x oversampling of the beam profile\n#define OVERSAMPLE\n\n// Use the older, purely gaussian beam profile\n//#define USEGAUSSIAN\n\n// Macros.\n#define FIX(c) max(abs(c), 1e-5);\n#define PI 3.141592653589\n\n#ifdef LINEAR_PROCESSING\n# define TEX2D(c) pow(COMPAT_TEXTURE(Texture, (c)), vec4(CRTgamma))\n#else\n# define TEX2D(c) COMPAT_TEXTURE(Texture, (c))\n#endif\n\nCOMPAT_VARYING vec2 one;\nCOMPAT_VARYING float mod_factor;\nCOMPAT_VARYING vec2 ilfac;\nCOMPAT_VARYING vec2 overscan;\nCOMPAT_VARYING vec2 aspect;\nCOMPAT_VARYING vec3 stretch;\nCOMPAT_VARYING vec2 sinangle;\nCOMPAT_VARYING vec2 cosangle;\n\n#ifdef PARAMETER_UNIFORM\nuniform COMPAT_PRECISION float CRTgamma;\nuniform COMPAT_PRECISION float monitorgamma;\nuniform COMPAT_PRECISION float d;\nuniform COMPAT_PRECISION float CURVATURE;\nuniform COMPAT_PRECISION float R;\nuniform COMPAT_PRECISION float cornersize;\nuniform COMPAT_PRECISION float cornersmooth;\nuniform COMPAT_PRECISION float x_tilt;\nuniform COMPAT_PRECISION float y_tilt;\nuniform COMPAT_PRECISION float overscan_x;\nuniform COMPAT_PRECISION float overscan_y;\nuniform COMPAT_PRECISION float DOTMASK;\nuniform COMPAT_PRECISION float SHARPER;\nuniform COMPAT_PRECISION float scanline_weight;\n#endif\n\nfloat intersect(vec2 xy)\n{\nfloat A = dot(xy,xy)+d*d;\nfloat B = 2.0*(R*(dot(xy,sinangle)-d*cosangle.x*cosangle.y)-d*d);\nfloat C = d*d + 2.0*R*d*cosangle.x*cosangle.y;\nreturn (-B-sqrt(B*B-4.0*A*C))/(2.0*A);\n}\n\nvec2 bkwtrans(vec2 xy)\n{\nfloat c = intersect(xy);\nvec2 point = vec2(c)*xy;\npoint -= vec2(-R)*sinangle;\npoint /= vec2(R);\nvec2 tang = sinangle/cosangle;\nvec2 poc = point/cosangle;\nfloat A = dot(tang,tang)+1.0;\nfloat B = -2.0*dot(poc,tang);\nfloat C = dot(poc,poc)-1.0;\nfloat a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A);\nvec2 uv = (point-a*sinangle)/cosangle;\nfloat r = FIX(R*acos(a));\nreturn uv*r/sin(r/R);\n}\n\nvec2 transform(vec2 coord)\n{\ncoord *= TextureSize / InputSize;\ncoord = (coord-vec2(0.5))*aspect*stretch.z+stretch.xy;\nreturn (bkwtrans(coord)/vec2(overscan_x / 100.0, overscan_y / 100.0)/aspect+vec2(0.5)) * InputSize / TextureSize;\n}\n\nfloat corner(vec2 coord)\n{\ncoord *= TextureSize / InputSize;\ncoord = (coord - vec2(0.5)) * vec2(overscan_x / 100.0, overscan_y / 100.0) + vec2(0.5);\ncoord = min(coord, vec2(1.0)-coord) * aspect;\nvec2 cdist = vec2(cornersize);\ncoord = (cdist - min(coord,cdist));\nfloat dist = sqrt(dot(coord,coord));\nreturn clamp((cdist.x-dist)*cornersmooth,0.0, 1.0);\n}\n\n// Calculate the influence of a scanline on the current pixel.\n//\n// 'distance' is the distance in texture coordinates from the current\n// pixel to the scanline in question.\n// 'color' is the colour of the scanline at the horizontal location of\n// the current pixel.\nvec4 scanlineWeights(float distance, vec4 color)\n{\n// \"wid\" controls the width of the scanline beam, for each RGB\n// channel The \"weights\" lines basically specify the formula\n// that gives you the profile of the beam, i.e. the intensity as\n// a function of distance from the vertical center of the\n// scanline. In this case, it is gaussian if width=2, and\n// becomes nongaussian for larger widths. Ideally this should\n// be normalized so that the integral across the beam is\n// independent of its width. That is, for a narrower beam\n// \"weights\" should have a higher peak at the center of the\n// scanline than for a wider beam.\n#ifdef USEGAUSSIAN\nvec4 wid = 0.3 + 0.1 * pow(color, vec4(3.0));\nvec4 weights = vec4(distance / wid);\nreturn 0.4 * exp(-weights * weights) / wid;\n#else\nvec4 wid = 2.0 + 2.0 * pow(color, vec4(4.0));\nvec4 weights = vec4(distance / scanline_weight);\nreturn 1.4 * exp(-pow(weights * inversesqrt(0.5 * wid), wid)) / (0.6 + 0.2 * wid);\n#endif\n}\n\nvoid main()\n{\n// Here's a helpful diagram to keep in mind while trying to\n// understand the code:\n//\n// | | | | |\n// -------------------------------\n// | | | | |\n// | 01 | 11 | 21 | 31 | <-- current scanline\n// | | @ | | |\n// -------------------------------\n// | | | | |\n// | 02 | 12 | 22 | 32 | <-- next scanline\n// | | | | |\n// -------------------------------\n// | | | | |\n//\n// Each character-cell represents a pixel on the output\n// surface, \"@\" represents the current pixel (always somewhere\n// in the bottom half of the current scan-line, or the top-half\n// of the next scanline). The grid of lines represents the\n// edges of the texels of the underlying texture.\n\n// Texture coordinates of the texel containing the active pixel.\nvec2 xy = (CURVATURE > 0.5) ? transform(TEX0.xy) : TEX0.xy;\n\nfloat cval = corner(xy);\n\n// Of all the pixels that are mapped onto the texel we are\n// currently rendering, which pixel are we currently rendering?\nvec2 ilvec = vec2(0.0,ilfac.y > 1.5 ? mod(float(FrameCount),2.0) : 0.0);\nvec2 ratio_scale = (xy * TextureSize - vec2(0.5) + ilvec)/ilfac;\n#ifdef OVERSAMPLE\nfloat filter_ = InputSize.y/OutputSize.y;//fwidth(ratio_scale.y);\n#endif\nvec2 uv_ratio = fract(ratio_scale);\n\n// Snap to the center of the underlying texel.\nxy = (floor(ratio_scale)*ilfac + vec2(0.5) - ilvec) / TextureSize;\n\n// Calculate Lanczos scaling coefficients describing the effect\n// of various neighbour texels in a scanline on the current\n// pixel.\nvec4 coeffs = PI * vec4(1.0 + uv_ratio.x, uv_ratio.x, 1.0 - uv_ratio.x, 2.0 - uv_ratio.x);\n\n// Prevent division by zero.\ncoeffs = FIX(coeffs);\n\n// Lanczos2 kernel.\ncoeffs = 2.0 * sin(coeffs) * sin(coeffs / 2.0) / (coeffs * coeffs);\n\n// Normalize.\ncoeffs /= dot(coeffs, vec4(1.0));\n\n// Calculate the effective colour of the current and next\n// scanlines at the horizontal location of the current pixel,\n// using the Lanczos coefficients above.\nvec4 col = clamp(mat4(\n TEX2D(xy + vec2(-one.x, 0.0)),\n TEX2D(xy),\n TEX2D(xy + vec2(one.x, 0.0)),\n TEX2D(xy + vec2(2.0 * one.x, 0.0))) * coeffs,\n 0.0, 1.0);\nvec4 col2 = clamp(mat4(\n TEX2D(xy + vec2(-one.x, one.y)),\n TEX2D(xy + vec2(0.0, one.y)),\n TEX2D(xy + one),\n TEX2D(xy + vec2(2.0 * one.x, one.y))) * coeffs,\n 0.0, 1.0);\n\n#ifndef LINEAR_PROCESSING\ncol = pow(col , vec4(CRTgamma));\ncol2 = pow(col2, vec4(CRTgamma));\n#endif\n\n// Calculate the influence of the current and next scanlines on\n// the current pixel.\nvec4 weights = scanlineWeights(uv_ratio.y, col);\nvec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);\n#ifdef OVERSAMPLE\nuv_ratio.y =uv_ratio.y+1.0/3.0*filter_;\nweights = (weights+scanlineWeights(uv_ratio.y, col))/3.0;\nweights2=(weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2))/3.0;\nuv_ratio.y =uv_ratio.y-2.0/3.0*filter_;\nweights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0;\nweights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0;\n#endif\n\nvec3 mul_res = (col * weights + col2 * weights2).rgb * vec3(cval);\n\n// dot-mask emulation:\n// Output pixels are alternately tinted green and magenta.\nvec3 dotMaskWeights = mix(\nvec3(1.0, 1.0 - DOTMASK, 1.0),\nvec3(1.0 - DOTMASK, 1.0, 1.0 - DOTMASK),\nfloor(mod(mod_factor, 2.0))\n);\n\nmul_res *= dotMaskWeights;\n\n// Convert the image gamma for display on our output device.\nmul_res = pow(mul_res, vec3(1.0 / monitorgamma));\n\n// Color the texel.\noutput_dummy _OUT;\n_OUT._color = vec4(mul_res, 1.0);\nFragColor = _OUT._color;\nreturn;\n} \n#endif\n\n",609"crt-mattias.glsl": "\n#pragma parameter CURVATURE \"Curvature\" 0.5 0.0 1.0 0.05\n#pragma parameter SCANSPEED \"Scanline Crawl Speed\" 1.0 0.0 10.0 0.5\n#if defined(VERTEX)\n#if __VERSION__ >= 130\n#define COMPAT_VARYING out\n#define COMPAT_ATTRIBUTE in\n#define COMPAT_TEXTURE texture\n#else\n#define COMPAT_VARYING varying \n#define COMPAT_ATTRIBUTE attribute \n#define COMPAT_TEXTURE texture2D\n#endif\n\n#ifdef GL_ES\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\nCOMPAT_ATTRIBUTE vec4 VertexCoord;\nCOMPAT_ATTRIBUTE vec4 COLOR;\nCOMPAT_ATTRIBUTE vec4 TexCoord;\nCOMPAT_VARYING vec4 COL0;\nCOMPAT_VARYING vec4 TEX0;\n\nvec4 _oPosition1; \nuniform mat4 MVPMatrix;\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\n\n#define vTexCoord TEX0.xy\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\nvoid main()\n{\n gl_Position = MVPMatrix * VertexCoord;\n TEX0.xy = TexCoord.xy;\n}\n\n#elif defined(FRAGMENT)\n\n#ifdef GL_ES\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n#define COMPAT_PRECISION mediump\n#else\n#define COMPAT_PRECISION\n#endif\n\n#if __VERSION__ >= 130\n#define COMPAT_VARYING in\n#define COMPAT_TEXTURE texture\nout COMPAT_PRECISION vec4 FragColor;\n#else\n#define COMPAT_VARYING varying\n#define FragColor gl_FragColor\n#define COMPAT_TEXTURE texture2D\n#endif\n\nuniform COMPAT_PRECISION int FrameDirection;\nuniform COMPAT_PRECISION int FrameCount;\nuniform COMPAT_PRECISION vec2 OutputSize;\nuniform COMPAT_PRECISION vec2 TextureSize;\nuniform COMPAT_PRECISION vec2 InputSize;\nuniform sampler2D Texture;\nCOMPAT_VARYING vec4 TEX0;\n\n// compatibility #defines\n#define Source Texture\n#define vTexCoord TEX0.xy\n\n#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize\n#define OutSize vec4(OutputSize, 1.0 / OutputSize)\n\n#ifdef PARAMETER_UNIFORM\nuniform COMPAT_PRECISION float CURVATURE, SCANSPEED;\n#else\n#define CURVATURE 0.5\n#define SCANSPEED 1.0\n#endif\n\n#define iChannel0 Texture\n#define iTime (float(FrameCount) / 60.0)\n#define iResolution OutputSize.xy\n#define fragCoord gl_FragCoord.xy\n\nvec3 sample_( sampler2D tex, vec2 tc )\n{\n vec3 s = pow(COMPAT_TEXTURE(tex,tc).rgb, vec3(2.2));\n return s;\n}\n\nvec3 blur(sampler2D tex, vec2 tc, float offs)\n{\n vec4 xoffs = offs * vec4(-2.0, -1.0, 1.0, 2.0) / (iResolution.x * TextureSize.x / InputSize.x);\n vec4 yoffs = offs * vec4(-2.0, -1.0, 1.0, 2.0) / (iResolution.y * TextureSize.y / InputSize.y);\n tc = tc * InputSize / TextureSize;\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += sample_(tex,tc + vec2(xoffs.x, yoffs.x)) * 0.00366;\n color += sample_(tex,tc + vec2(xoffs.y, yoffs.x)) * 0.01465;\n color += sample_(tex,tc + vec2( 0.0, yoffs.x)) * 0.02564;\n color += sample_(tex,tc + vec2(xoffs.z, yoffs.x)) * 0.01465;\n color += sample_(tex,tc + vec2(xoffs.w, yoffs.x)) * 0.00366;\n \n color += sample_(tex,tc + vec2(xoffs.x, yoffs.y)) * 0.01465;\n color += sample_(tex,tc + vec2(xoffs.y, yoffs.y)) * 0.05861;\n color += sample_(tex,tc + vec2( 0.0, yoffs.y)) * 0.09524;\n color += sample_(tex,tc + vec2(xoffs.z, yoffs.y)) * 0.05861;\n color += sample_(tex,tc + vec2(xoffs.w, yoffs.y)) * 0.01465;\n \n color += sample_(tex,tc + vec2(xoffs.x, 0.0)) * 0.02564;\n color += sample_(tex,tc + vec2(xoffs.y, 0.0)) * 0.09524;\n color += sample_(tex,tc + vec2( 0.0, 0.0)) * 0.15018;\n color += sample_(tex,tc + vec2(xoffs.z, 0.0)) * 0.09524;\n color += sample_(tex,tc + vec2(xoffs.w, 0.0)) * 0.02564;\n \n color += sample_(tex,tc + vec2(xoffs.x, yoffs.z)) * 0.01465;\n color += sample_(tex,tc + vec2(xoffs.y, yoffs.z)) * 0.05861;\n color += sample_(tex,tc + vec2( 0.0, yoffs.z)) * 0.09524;\n color += sample_(tex,tc + vec2(xoffs.z, yoffs.z)) * 0.05861;\n color += sample_(tex,tc + vec2(xoffs.w, yoffs.z)) * 0.01465;\n \n color += sample_(tex,tc + vec2(xoffs.x, yoffs.w)) * 0.00366;\n color += sample_(tex,tc + vec2(xoffs.y, yoffs.w)) * 0.01465;\n color += sample_(tex,tc + vec2( 0.0, yoffs.w)) * 0.02564;\n color += sample_(tex,tc + vec2(xoffs.z, yoffs.w)) * 0.01465;\n color += sample_(tex,tc + vec2(xoffs.w, yoffs.w)) * 0.00366;\n\n return color;\n}\n\nfloat rand(vec2 co)\n{\n float a = 12.9898;\n float b = 78.233;\n float c = 43758.5453;\n float dt= dot(co.xy ,vec2(a,b));\n float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\nvec2 curve(vec2 uv)\n{\n uv = (uv - 0.5) * 2.0;\n uv *= 1.1;\t\n uv.x *= 1.0 + pow((abs(uv.y) / 5.0), 2.0);\n uv.y *= 1.0 + pow((abs(uv.x) / 4.0), 2.0);\n uv = (uv / 2.0) + 0.5;\n uv = uv *0.92 + 0.04;\n return uv;\n}\n\nvoid main()\n{\n vec2 q = (vTexCoord.xy * TextureSize.xy / InputSize.xy);//fragCoord.xy / iResolution.xy;\n vec2 uv = q;\n uv = mix( uv, curve( uv ), CURVATURE ) * InputSize.xy / TextureSize.xy;\n vec3 col;\n float x = sin(0.1*iTime+uv.y*21.0)*sin(0.23*iTime+uv.y*29.0)*sin(0.3+0.11*iTime+uv.y*31.0)*0.0017;\n float o =2.0*mod(fragCoord.y,2.0)/iResolution.x;\n x+=o;\n uv = uv * TextureSize / InputSize;\n col.r = 1.0*blur(iChannel0,vec2(uv.x+0.0009,uv.y+0.0009),1.2).x+0.005;\n col.g = 1.0*blur(iChannel0,vec2(uv.x+0.000,uv.y-0.0015),1.2).y+0.005;\n col.b = 1.0*blur(iChannel0,vec2(uv.x-0.0015,uv.y+0.000),1.2).z+0.005;\n col.r += 0.2*blur(iChannel0,vec2(uv.x+0.0009,uv.y+0.0009),2.25).x-0.005;\n col.g += 0.2*blur(iChannel0,vec2(uv.x+0.000,uv.y-0.0015),1.75).y-0.005;\n col.b += 0.2*blur(iChannel0,vec2(uv.x-0.0015,uv.y+0.000),1.25).z-0.005;\n float ghs = 0.05;\n col.r += ghs*(1.0-0.299)*blur(iChannel0,0.75*vec2(0.01, -0.027)+vec2(uv.x+0.001,uv.y+0.001),7.0).x;\n col.g += ghs*(1.0-0.587)*blur(iChannel0,0.75*vec2(-0.022, -0.02)+vec2(uv.x+0.000,uv.y-0.002),5.0).y;\n col.b += ghs*(1.0-0.114)*blur(iChannel0,0.75*vec2(-0.02, -0.0)+vec2(uv.x-0.002,uv.y+0.000),3.0).z;\n \n \n\n col = clamp(col*0.4+0.6*col*col*1.0,0.0,1.0);\n float vig = (0.0 + 1.0*16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y));\n vig = pow(vig,0.3);\n col *= vec3(vig);\n\n col *= vec3(0.95,1.05,0.95);\n col = mix( col, col * col, 0.3) * 3.8;\n\n float scans = clamp( 0.35+0.15*sin(3.5*(iTime * SCANSPEED)+uv.y*iResolution.y*1.5), 0.0, 1.0);\n \n float s = pow(scans,0.9);\n col = col*vec3( s) ;\n\n col *= 1.0+0.0015*sin(300.0*iTime);\n \n col*=1.0-0.15*vec3(clamp((mod(fragCoord.x+o, 2.0)-1.0)*2.0,0.0,1.0));\n col *= vec3( 1.0 ) - 0.25*vec3( rand( uv+0.0001*iTime), rand( uv+0.0001*iTime + 0.3 ), rand( uv+0.0001*iTime+ 0.5 ) );\n col = pow(col, vec3(0.45));\n\n if (uv.x < 0.0 || uv.x > 1.0)\n col *= 0.0;\n if (uv.y < 0.0 || uv.y > 1.0)\n col *= 0.0;\n \n\n float comp = smoothstep( 0.1, 0.9, sin(iTime) );\n\n FragColor = vec4(col,1.0);\n} \n#endif\n"610},611IDBStore = _0x2c1832(0x39),612_0x550f17 = _0x2c1832(0xb),613_0x5ab74d = {614'addStyleHook': function() {615_0x3a8e2f(this.elements.container, this.config.selectors.container.replace('.', ''), true), _0x3a8e2f(this.elements.container, this.config.classNames.uiSupported, true), _0x3a8e2f(this.elements.container, this.config.classNames.hideControls, true);616},617'build': function() {618this.listeners.media(), _0x1e2c68.element(this.elements.controls) || (_0x2593da.inject.call(this), this.listeners.controls()), this.volume = null, this.muted = null, _0x2593da.updateVolume.call(this), _0x3a8e2f(this.elements.container, this.config.classNames.isTouch, this.touch), this.ready = true;619},620'toggleControls': function(_0x4dbb7a) {621let _0x17edbf = this.elements.controls;622if (_0x17edbf) {623let _0x2c1832 = 0,624_0x4b4cd5 = _0x23ffa1.call(this, '.' .concat(getClass({625'ejs__dialogs': true626}), ' > .').concat(getClass({627'ejs__dialog': true628})));629Array.from(_0x4b4cd5).forEach(function(_0x208a40, _0xd7fcf0) {630true !== _0x208a40.hidden && (_0x2c1832 += 1);631}), _0x2c1832 > 0 ? this.toggleControls(false) : this.toggleControls(Boolean(_0x4dbb7a || this.paused || _0x17edbf.pressed || _0x17edbf.hover));632}633}634};635636function _0x5272a8(_0x4d422a) {637return (_0x5272a8 = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(_0x241239) {638return typeof _0x241239;639} : function(_0x39f252) {640return _0x39f252 && 'function' == typeof Symbol && _0x39f252.constructor === Symbol && _0x39f252 !== Symbol.prototype ? 'symbol' : typeof _0x39f252;641})(_0x4d422a);642}643644function _0x3189ba(_0x4380c5, _0x3c0d58) {645if ('object' === _0x5272a8(_0x4380c5) && _0x4380c5.files && (_0x4380c5 = _0x4380c5.files[0]), this.littleEndian = false, this.offset = 0, this._lastRead = null, 'object' === _0x5272a8(_0x4380c5) && _0x4380c5.name && _0x4380c5.size) {646if ('function' != typeof window.FileReader) throw new Error('Incompatible Browser');647this.fileName = _0x4380c5.name, this.fileType = _0x4380c5.type, this.fileSize = _0x4380c5.size, this._fileReader = new FileReader(), this._fileReader.marcFile = this, this._fileReader.addEventListener('load', function() {648this.marcFile._u8array = new Uint8Array(this.result), this.marcFile._dataView = new DataView(this.result), _0x3c0d58 && _0x3c0d58.call();649}, false), this._fileReader.readAsArrayBuffer(_0x4380c5);650} else if ('object' === _0x5272a8(_0x4380c5) && 'string' == typeof _0x4380c5.fileName && 'boolean' == typeof _0x4380c5.littleEndian) {651this.fileName = _0x4380c5.fileName, this.fileType = _0x4380c5.fileType, this.fileSize = _0x4380c5.fileSize;652let _0x2c1832 = new ArrayBuffer(_0x4380c5);653this._u8array = new Uint8Array(this.fileType), this._dataView = new DataView(this.fileType), _0x4380c5.copyToFile(this, 0), _0x3c0d58 && _0x3c0d58.call();654} else if ('object' === _0x5272a8(_0x4380c5) && 'number' == typeof _0x4380c5.byteLength) this.fileName = 'file.bin', this.fileType = 'application/octet-stream', this.fileSize = _0x4380c5.byteLength, void 0 !== _0x4380c5.buffer && (_0x4380c5 = _0x4380c5.buffer), this._u8array = new Uint8Array(_0x4380c5), this._dataView = new DataView(_0x4380c5), _0x3c0d58 && _0x3c0d58.call();655else {656if ('number' != typeof _0x4380c5) throw new Error('Invalid source');657this.fileName = 'file.bin', this.fileType = 'application/octet-stream', this.fileSize = _0x4380c5;658_0x2c1832 = new ArrayBuffer(_0x4380c5);659this._u8array = new Uint8Array(_0x2c1832), this._dataView = new DataView(_0x2c1832), _0x3c0d58 && _0x3c0d58.call();660}661}662_0x3189ba.IS_MACHINE_LITTLE_ENDIAN = (_0x13fb79 = new ArrayBuffer(2), new DataView(_0x13fb79).setInt16(0, 0x100, true), 0x100 === new Int16Array(_0x13fb79)[0]), _0x3189ba.prototype.seek = function(_0x13e235) {663this.offset = _0x13e235;664}, _0x3189ba.prototype.skip = function(_0xfa033c) {665this.offset += _0xfa033c;666}, _0x3189ba.prototype.isEOF = function() {667return !(this.offset < this.fileSize);668}, _0x3189ba.prototype.slice = function(_0x2bfcbb, _0x8026e) {669let _0x2c1832;670return _0x8026e = _0x8026e || this.fileSize - _0x2bfcbb, void 0 !== this._u8array.buffer.slice ? ((_0x2c1832 = new _0x3189ba(0)).fileSize = _0x8026e, _0x2c1832._u8array = new Uint8Array(this._u8array.buffer.slice(_0x2bfcbb, _0x2bfcbb + _0x8026e))) : (_0x2c1832 = new _0x3189ba(_0x8026e), this.copyToFile(_0x2c1832, _0x2bfcbb, _0x8026e, 0)), _0x2c1832.fileName = this.fileName, _0x2c1832.fileType = this.fileType, _0x2c1832.littleEndian = this.littleEndian, _0x2c1832;671}, _0x3189ba.prototype.copyToFile = function(_0x51f9b5, _0x1ada3e, _0x3997cd, _0x38ae1a) {672void 0 === _0x38ae1a && (_0x38ae1a = _0x1ada3e), _0x3997cd = _0x3997cd || this.fileSize - _0x1ada3e;673for (let _0x3bc3d8 = 0; _0x3bc3d8 < _0x3997cd; _0x3bc3d8++) _0x51f9b5._u8array[_0x38ae1a + _0x3bc3d8] = this._u8array[_0x1ada3e + _0x3bc3d8];674}, _0x3189ba.prototype.save = function() {675let _0xa88a13;676try {677_0xa88a13 = new Blob([this._u8array], {678'type': this.fileType679});680} catch (_0x1dfb06) {681if (window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder, 'InvalidStateError' !== _0x1dfb06.name || !window.BlobBuilder) throw new Error('Incompatible Browser');682let _0x17edbf = new BlobBuilder();683_0x17edbf.append(this._u8array.buffer), _0xa88a13 = _0x17edbf.getBlob(this.fileType);684}685saveAs(_0xa88a13, this.fileName);686}, _0x3189ba.prototype.readU8 = function() {687return this._lastRead = this._u8array[this.offset], this.offset++, this._lastRead;688}, _0x3189ba.prototype.readU16 = function() {689return this.littleEndian ? this._lastRead = this._u8array[this.offset] + (this._u8array[this.offset + 1] << 0x8) : this._lastRead = (this._u8array[this.offset] << 0x8) + this._u8array[this.offset + 1], this.offset += 2, this._lastRead >>> 0;690}, _0x3189ba.prototype.readU24 = function() {691return this.littleEndian ? this._lastRead = this._u8array[this.offset] + (this._u8array[this.offset + 1] << 0x8) + (this._u8array[this.offset + 2] << 0x10) : this._lastRead = (this._u8array[this.offset] << 0x10) + (this._u8array[this.offset + 1] << 0x8) + this._u8array[this.offset + 2], this.offset += 3, this._lastRead >>> 0;692}, _0x3189ba.prototype.readU32 = function() {693return this.littleEndian ? this._lastRead = this._u8array[this.offset] + (this._u8array[this.offset + 1] << 0x8) + (this._u8array[this.offset + 2] << 0x10) + (this._u8array[this.offset + 3] << 0x18) : this._lastRead = (this._u8array[this.offset] << 0x18) + (this._u8array[this.offset + 1] << 0x10) + (this._u8array[this.offset + 2] << 0x8) + this._u8array[this.offset + 3], this.offset += 4, this._lastRead >>> 0;694}, _0x3189ba.prototype.readBytes = function(_0x455cfd) {695this._lastRead = new Array(_0x455cfd);696for (let _0x17edbf = 0; _0x17edbf < _0x455cfd; _0x17edbf++) this._lastRead[_0x17edbf] = this._u8array[this.offset + _0x17edbf];697return this.offset += _0x455cfd, this._lastRead;698}, _0x3189ba.prototype.readString = function(_0x4fe914) {699this._lastRead = '';700for (let _0x17edbf = 0; _0x17edbf < _0x4fe914 && this.offset + _0x17edbf < this.fileSize && this._u8array[this.offset + _0x17edbf] > 0; _0x17edbf++) this._lastRead = this._lastRead + String.fromCharCode(this._u8array[this.offset + _0x17edbf]);701return this.offset += _0x4fe914, this._lastRead;702}, _0x3189ba.prototype.writeU8 = function(_0x276206) {703this._u8array[this.offset] = _0x276206, this.offset++;704}, _0x3189ba.prototype.writeU16 = function(_0x1bfd8f) {705this.littleEndian ? (this._u8array[this.offset] = 0xff & _0x1bfd8f, this._u8array[this.offset + 1] = _0x1bfd8f >> 0x8) : (this._u8array[this.offset] = _0x1bfd8f >> 0x8, this._u8array[this.offset + 1] = 0xff & _0x1bfd8f), this.offset += 2;706}, _0x3189ba.prototype.writeU24 = function(_0x3d6067) {707this.littleEndian ? (this._u8array[this.offset] = 0xff & _0x3d6067, this._u8array[this.offset + 1] = (0xff00 & _0x3d6067) >> 0x8, this._u8array[this.offset + 2] = (0xff0000 & _0x3d6067) >> 0x10) : (this._u8array[this.offset] = (0xff0000 & _0x3d6067) >> 0x10, this._u8array[this.offset + 1] = (0xff00 & _0x3d6067) >> 0x8, this._u8array[this.offset + 2] = 0xff & _0x3d6067), this.offset += 3;708}, _0x3189ba.prototype.writeU32 = function(_0xa4dd26) {709this.littleEndian ? (this._u8array[this.offset] = 0xff & _0xa4dd26, this._u8array[this.offset + 1] = (0xff00 & _0xa4dd26) >> 0x8, this._u8array[this.offset + 2] = (0xff0000 & _0xa4dd26) >> 0x10, this._u8array[this.offset + 3] = (0xff000000 & _0xa4dd26) >> 0x18) : (this._u8array[this.offset] = (0xff000000 & _0xa4dd26) >> 0x18, this._u8array[this.offset + 1] = (0xff0000 & _0xa4dd26) >> 0x10, this._u8array[this.offset + 2] = (0xff00 & _0xa4dd26) >> 0x8, this._u8array[this.offset + 3] = 0xff & _0xa4dd26), this.offset += 0x4;710}, _0x3189ba.prototype.writeBytes = function(_0x5ad6b9) {711for (let _0x17edbf = 0; _0x17edbf < _0x5ad6b9.length; _0x17edbf++) this._u8array[this.offset + _0x17edbf] = _0x5ad6b9[_0x17edbf];712this.offset += _0x5ad6b9.length;713}, _0x3189ba.prototype.writeString = function(_0x58c146, _0x23e582) {714_0x23e582 = _0x23e582 || _0x58c146.length;715for (let _0x2c1832 = 0; _0x2c1832 < _0x58c146.length && _0x2c1832 < _0x23e582; _0x2c1832++) this._u8array[this.offset + _0x2c1832] = _0x58c146.charCodeAt(_0x2c1832);716for (; _0x2c1832 < _0x23e582; _0x2c1832++) this._u8array[this.offset + _0x2c1832] = 0;717this.offset += _0x23e582;718};719let _0x863031 = _0x3189ba,720_0x34e7cf = 0;721722function _0x454881() {723this.records = [], this.truncate = false;724}725726function _0x288092(_0x1ab789) {727let _0x17edbf = new _0x454881();728_0x1ab789.seek(0x5);729for (let _0x2c1832 = 0, _0x195f00 = 0; !_0x1ab789.isEOF();) {730if (0x454f46 === (_0x2c1832 = _0x1ab789.readU24())) {731if (_0x1ab789.isEOF()) break;732if (_0x1ab789.offset + 3 === _0x1ab789.fileSize) {733_0x17edbf.truncate = _0x1ab789.readU24();734break;735}736}(_0x195f00 = _0x1ab789.readU16()) === _0x34e7cf ? _0x17edbf.addRLERecord(_0x2c1832, _0x1ab789.readU16(), _0x1ab789.readU8()) : _0x17edbf.addSimpleRecord(_0x2c1832, _0x1ab789.readBytes(_0x195f00));737}738return _0x17edbf;739}740_0x454881.prototype.addSimpleRecord = function(_0x37166f, _0x2e61e0) {741this.records.push({742'offset': _0x37166f,743'type': 1,744'length': _0x2e61e0.length,745'data': _0x2e61e0746});747}, _0x454881.prototype.addRLERecord = function(_0x4ae2fb, _0x507845, _0x92bb02) {748this.records.push({749'offset': _0x4ae2fb,750'type': _0x34e7cf,751'length': _0x507845,752'byte': _0x92bb02753});754}, _0x454881.prototype.toString = function() {755nSimpleRecords = 0, nRLERecords = 0;756for (let _0xa88a13 = 0; _0xa88a13 < this.records.length; _0xa88a13++) this.records[_0xa88a13].type === _0x34e7cf ? nRLERecords++ : nSimpleRecords++;757let _0x17edbf = 'Simple records: ' + nSimpleRecords;758return _0x17edbf += '\nRLE records: ' + nRLERecords, _0x17edbf += '\nTotal records: ' + this.records.length, this.truncate && (_0x17edbf += '\nTruncate at: 0x' + this.truncate.toString(0x10)), _0x17edbf;759}, _0x454881.prototype.export = function(_0x4d18dc) {760for (let _0x17edbf = 5, _0x2c1832 = 0; _0x2c1832 < this.records.length; _0x2c1832++) this.records[_0x2c1832].type === _0x34e7cf ? _0x17edbf += 0x8 : _0x17edbf += 5 + this.records[_0x2c1832].data.length;761_0x17edbf += 3, this.truncate && (_0x17edbf += 3), tempFile = new _0x863031(_0x17edbf), tempFile.fileName = _0x4d18dc + '.ips', tempFile.writeString('PATCH');762for (_0x2c1832 = 0; _0x2c1832 < this.records.length; _0x2c1832++) {763let _0x512785 = this.records[_0x2c1832];764tempFile.writeU24(_0x512785.offset), _0x512785.type === _0x34e7cf ? (tempFile.writeU16(0), tempFile.writeU16(_0x512785.length), tempFile.writeU8(_0x512785.byte)) : (tempFile.writeU16(_0x512785.data.length), tempFile.writeBytes(_0x512785.data));765}766return tempFile.writeString('EOF'), _0x512785.truncate && tempFile.writeU24(_0x512785.truncate), tempFile;767}, _0x454881.prototype.apply = function(_0xefa71d) {768let _0x17edbf;769if (this.truncate) _0x17edbf = _0xefa71d.slice(0, this.truncate);770else {771for (let _0x2c1832 = _0xefa71d.fileSize, _0x5a0a71 = 0; _0x5a0a71 < this.records.length; _0x5a0a71++) {772let _0x105576 = this.records[_0x5a0a71];773_0x105576.type === _0x34e7cf ? _0x105576.offset + _0x105576.length > _0x2c1832 && (_0x2c1832 = _0x105576.offset + _0x105576.length) : _0x105576.offset + _0x105576.data.length > _0x2c1832 && (_0x2c1832 = _0x105576.offset + _0x105576.data.length);774}775_0x2c1832 === _0xefa71d.fileSize ? _0x17edbf = _0xefa71d.slice(0, _0xefa71d.fileSize) : (_0x17edbf = new _0x863031(_0x2c1832), _0xefa71d.copyToFile(_0x17edbf, 0));776}777_0xefa71d.seek(0);778for (_0x5a0a71 = 0; _0x5a0a71 < this.records.length; _0x5a0a71++)779if (_0x17edbf.seek(this.records[_0x5a0a71].offset), this.records[_0x5a0a71].type === _0x34e7cf)780for (let _0x729105 = 0; _0x729105 < this.records[_0x5a0a71].length; _0x729105++) _0x17edbf.writeU8(this.records[_0x5a0a71].byte);781else _0x17edbf.writeBytes(this.records[_0x5a0a71].data);782return _0x17edbf;783};784'0123456789abcdef' .split('');785let _0x1aa7ba = function() {786for (let _0xa88a13, _0x17edbf = [], _0x2c1832 = 0; _0x2c1832 < 0x100; _0x2c1832++) {787_0xa88a13 = _0x2c1832;788for (let _0x32bcf1 = 0; _0x32bcf1 < 0x8; _0x32bcf1++) _0xa88a13 = 1 & _0xa88a13 ? 0xedb88320 ^ _0xa88a13 >>> 1 : _0xa88a13 >>> 1;789_0x17edbf[_0x2c1832] = _0xa88a13;790}791return _0x17edbf;792}();793794function _0x2d78e9(_0x509ecf, _0x4219e1, _0xd66d2b) {795for (let _0x185f93 = _0x4219e1 ? new Uint8Array(_0x509ecf._u8array.buffer, _0x4219e1) : _0x509ecf._u8array, _0x20e2c1 = -1, _0x3d100a = _0xd66d2b ? _0x185f93.length - 4 : _0x185f93.length, _0x56a6e6 = 0; _0x56a6e6 < _0x3d100a; _0x56a6e6++) _0x20e2c1 = _0x20e2c1 >>> 0x8 ^ _0x1aa7ba[0xff & (_0x20e2c1 ^ _0x185f93[_0x56a6e6])];796return (-0x1 ^ _0x20e2c1) >>> 0;797}798let _0x37eff4 = 0,799_0x34d681 = 1,800_0x4c50e7 = 2,801_0xf9eeea = 3;802803function _0x5b02d3() {804this.sourceSize = 0, this.targetSize = 0, this.metaData = '', this.actions = [], this.sourceChecksum = 0, this.targetChecksum = 0, this.patchChecksum = 0;805}806807function _0x356089(_0x1bf770) {808_0x1bf770.readVLV = _0x45da2c, _0x1bf770.littleEndian = true;809let _0x17edbf = new _0x5b02d3();810_0x1bf770.seek(0x4), _0x17edbf.sourceSize = _0x1bf770.readVLV(), _0x17edbf.targetSize = _0x1bf770.readVLV();811let _0x2c1832 = _0x1bf770.readVLV();812_0x2c1832 && (_0x17edbf.metaData = _0x1bf770.readString(_0x2c1832));813for (let _0x157bba = _0x1bf770.fileSize - 0xc; _0x1bf770.offset < _0x157bba;) {814let _0x31dcc2 = _0x1bf770.readVLV(),815_0x21bafe = {816'type': 3 & _0x31dcc2,817'length': 1 + (_0x31dcc2 >> 2)818};819if (_0x21bafe.type === _0x34d681) _0x21bafe.bytes = _0x1bf770.readBytes(_0x21bafe.length);820else if (_0x21bafe.type === _0x4c50e7 || _0x21bafe.type === _0xf9eeea) {821let _0x4c6327 = _0x1bf770.readVLV();822_0x21bafe.relativeOffset = (0x1 & _0x4c6327 ? -0x1 : 1) * (_0x4c6327 >> 1);823}824_0x17edbf.actions.push(_0x21bafe);825}826if (_0x17edbf.sourceChecksum = _0x1bf770.readU32(), _0x17edbf.targetChecksum = _0x1bf770.readU32(), _0x17edbf.patchChecksum = _0x1bf770.readU32(), _0x17edbf.patchChecksum !== _0x2d78e9(_0x1bf770, 0, true)) throw new Error('error_crc_patch');827return _0x17edbf;828}829830function _0x45da2c() {831for (let _0xa88a13 = 0, _0x17edbf = 1;;) {832let _0x2c1832 = this.readU8();833if (_0xa88a13 += (0x7f & _0x2c1832) * _0x17edbf, 0x80 & _0x2c1832) break;834_0xa88a13 += _0x17edbf <<= 0x7;835}836return this._lastRead = _0xa88a13, _0xa88a13;837}838839function _0x152a53(_0x33f58d) {840for (;;) {841let _0x17edbf = 0x7f & _0x33f58d;842if (0x0 === (_0x33f58d >>= 0x7)) {843this.writeU8(0x80 | _0x17edbf);844break;845}846this.writeU8(_0x17edbf), _0x33f58d--;847}848}849850function _0x5a4975(_0x221175) {851for (let _0x17edbf = 0;;) {852if (0x0 === (_0x221175 >>= 0x7)) {853_0x17edbf++;854break;855}856_0x17edbf++, _0x221175--;857}858return _0x17edbf;859}860861function _0x562e68() {862this.offset = 0, this.next = null;863}864_0x5b02d3.prototype.toString = function() {865let _0xa88a13 = 'Source size: ' + this.sourceSize;866return _0xa88a13 += '\nTarget size: ' + this.targetSize, _0xa88a13 += '\nMetadata: ' + this.metaData, _0xa88a13 += '\n#Actions: ' + this.actions.length;867}, _0x5b02d3.prototype.validateSource = function(_0x48d2df, _0x3c15dd) {868return this.sourceChecksum === _0x2d78e9(_0x48d2df, _0x3c15dd);869}, _0x5b02d3.prototype.apply = function(_0x393f39, _0x76e509) {870if (_0x76e509 && !this.validateSource(_0x393f39)) throw new Error('error_crc_input');871for (let _0x2c1832 = new _0x863031(this.targetSize), _0x4df6ae = 0, _0xad0fa9 = 0, _0x38240a = 0; _0x38240a < this.actions.length; _0x38240a++) {872let _0x4b1026 = this.actions[_0x38240a];873if (_0x4b1026.type === _0x37eff4) _0x393f39.copyToFile(_0x2c1832, _0x2c1832.offset, _0x4b1026.length), _0x2c1832.skip(_0x4b1026.length);874else if (_0x4b1026.type === _0x34d681) _0x2c1832.writeBytes(_0x4b1026.bytes);875else if (_0x4b1026.type === _0x4c50e7) {876_0x4df6ae += _0x4b1026.relativeOffset;877for (let _0x5c2263 = _0x4b1026.length; _0x5c2263--;) _0x2c1832.writeU8(_0x393f39._u8array[_0x4df6ae]), _0x4df6ae++;878} else if (_0x4b1026.type === _0xf9eeea) {879_0xad0fa9 += _0x4b1026.relativeOffset;880for (_0x5c2263 = _0x4b1026.length; _0x5c2263--;) _0x2c1832.writeU8(_0x2c1832._u8array[_0xad0fa9]), _0xad0fa9++;881}882}883if (_0x76e509 && this.targetChecksum !== _0x2d78e9(_0x2c1832)) throw new Error('error_crc_output');884return _0x2c1832;885}, _0x5b02d3.prototype.export = function(_0x3e1e58) {886let _0x17edbf = 'BPS1' .length;887_0x17edbf += _0x5a4975(this.sourceSize), _0x17edbf += _0x5a4975(this.targetSize), _0x17edbf += _0x5a4975(this.metaData.length), _0x17edbf += this.metaData.length;888for (let _0x2c1832 = 0; _0x2c1832 < this.actions.length; _0x2c1832++) {889_0x17edbf += _0x5a4975(((_0x38dad6 = this.actions[_0x2c1832]).length - 1 << 2) + _0x38dad6.type), _0x38dad6.type === _0x34d681 ? _0x17edbf += _0x38dad6.length : _0x38dad6.type !== _0x4c50e7 && _0x38dad6.type !== _0xf9eeea || (_0x17edbf += _0x5a4975((Math.abs(_0x38dad6.relativeOffset) << 1) + (_0x38dad6.relativeOffset < 0 ? 1 : 0)));890}891let _0x2d1555 = new _0x863031(_0x17edbf += 0xc);892_0x2d1555.fileName = _0x3e1e58 + '.bps', _0x2d1555.littleEndian = true, _0x2d1555.writeVLV = _0x152a53, _0x2d1555.writeString('BPS1'), _0x2d1555.writeVLV(this.sourceSize), _0x2d1555.writeVLV(this.targetSize), _0x2d1555.writeVLV(this.metaData.length), _0x2d1555.writeString(this.metaData, this.metaData.length);893for (_0x2c1832 = 0; _0x2c1832 < this.actions.length; _0x2c1832++) {894let _0x38dad6 = this.actions[_0x2c1832];895_0x2d1555.writeVLV((_0x38dad6.length - 1 << 2) + _0x38dad6.type), _0x38dad6.type === _0x34d681 ? _0x2d1555.writeBytes(_0x38dad6.bytes) : _0x38dad6.type !== _0x4c50e7 && _0x38dad6.type !== _0xf9eeea || _0x2d1555.writeVLV((Math.abs(_0x38dad6.relativeOffset) << 1) + (_0x38dad6.relativeOffset < 0 ? 1 : 0));896}897return _0x2d1555.writeU32(this.sourceChecksum), _0x2d1555.writeU32(this.targetChecksum), _0x2d1555.writeU32(this.patchChecksum), _0x2d1555;898}, _0x562e68.prototype.delete = function() {899this.next && delete this.next;900};901let _0x7a6485 = 'UPS1';902903function _0x42cd9e() {904this.records = [], this.sizeInput = 0, this.sizeOutput = 0, this.checksumInput = 0, this.checksumOutput = 0;905}906907function _0x10dc1d(_0x5d0c48) {908for (;;) {909let _0x17edbf = 0x7f & _0x5d0c48;910if (0x0 === (_0x5d0c48 >>= 0x7)) {911this.writeU8(0x80 | _0x17edbf);912break;913}914this.writeU8(_0x17edbf), _0x5d0c48 -= 1;915}916}917918function _0x454043() {919for (let _0xa88a13 = 0, _0x17edbf = 1;;) {920let _0x2c1832 = this.readU8();921if (-0x1 == _0x2c1832) throw new Error('Can\'t read UPS VLV at 0x' + (this.offset - 1).toString(0x10));922if (_0xa88a13 += (0x7f & _0x2c1832) * _0x17edbf, 0 != (0x80 & _0x2c1832)) break;923_0xa88a13 += _0x17edbf <<= 0x7;924}925return _0xa88a13;926}927928function _0xca245c(_0x459173) {929for (let _0x17edbf = 0;;) {930if (_0x17edbf++, 0 === (_0x459173 >>= 0x7)) break;931_0x459173 -= 1;932}933return _0x17edbf;934}935936function _0xd2202f(_0x5abb5e) {937let _0x17edbf = new _0x42cd9e();938_0x5abb5e.readVLV = _0x454043, _0x5abb5e.seek(_0x7a6485.length), _0x17edbf.sizeInput = _0x5abb5e.readVLV(), _0x17edbf.sizeOutput = _0x5abb5e.readVLV();939for (; _0x5abb5e.offset < _0x5abb5e.fileSize - 0xc;) {940for (let _0x2c1832 = _0x5abb5e.readVLV(), _0x3bca86 = []; _0x5abb5e.readU8();) _0x3bca86.push(_0x5abb5e._lastRead);941_0x17edbf.addRecord(_0x2c1832, _0x3bca86);942}943return _0x5abb5e.littleEndian = true, _0x17edbf.checksumInput = _0x5abb5e.readU32(), _0x17edbf.checksumOutput = _0x5abb5e.readU32(), _0x5abb5e.littleEndian = false, _0x17edbf;944}945_0x42cd9e.prototype.addRecord = function(_0x162ca5, _0x39594d) {946this.records.push({947'offset': _0x162ca5,948'XORdata': _0x39594d949});950}, _0x42cd9e.prototype.toString = function() {951let _0xa88a13 = 'Records: ' + (undefined).records.length;952return _0xa88a13 += '\nInput file size: ' + (undefined).sizeInput, _0xa88a13 += '\nOutput file size: ' + (undefined).sizeOutput, _0xa88a13 += '\nInput file checksum: ' + padZeroes((undefined).checksumInput, 4), _0xa88a13 += '\nOutput file checksum: ' + padZeroes((undefined).checksumOutput, 4);953}, _0x42cd9e.prototype.export = function(_0x1a3e8b) {954let _0x17edbf = _0x7a6485.length;955_0x17edbf += _0xca245c(this.sizeInput), _0x17edbf += _0xca245c(this.sizeOutput);956for (let _0x2c1832 = 0; _0x2c1832 < this.records.length; _0x2c1832++) _0x17edbf += _0xca245c(this.records[_0x2c1832].offset), _0x17edbf += this.records[_0x2c1832].XORdata.length + 1;957_0x17edbf += 0xc, tempFile = new _0x863031(_0x17edbf), tempFile.writeVLV = _0x10dc1d, tempFile.fileName = _0x1a3e8b + '.ups', tempFile.writeString(_0x7a6485), tempFile.writeVLV(this.sizeInput), tempFile.writeVLV(this.sizeOutput);958for (_0x2c1832 = 0; _0x2c1832 < this.records.length; _0x2c1832++) tempFile.writeVLV(this.records[_0x2c1832].offset), tempFile.writeBytes(this.records[_0x2c1832].XORdata), tempFile.writeU8(0);959return tempFile.littleEndian = true, tempFile.writeU32(this.checksumInput), tempFile.writeU32(this.checksumOutput), tempFile.writeU32(_0x2d78e9(tempFile, 0, true)), tempFile;960}, _0x42cd9e.prototype.validateSource = function(_0x25cb26, _0xd0163c) {961return _0x2d78e9(_0x25cb26, _0xd0163c) === this.checksumInput;962}, _0x42cd9e.prototype.apply = function(_0x21d682, _0x41bbac) {963_0x41bbac && this.validateSource(_0x21d682), tempFile = new _0x863031(this.sizeOutput), _0x21d682.copyToFile(tempFile, 0, this.sizeInput), _0x21d682.seek(0);964for (let _0x2c1832 = 0; _0x2c1832 < this.records.length; _0x2c1832++) {965let _0x5ed6c9 = this.records[_0x2c1832];966tempFile.skip(_0x5ed6c9.offset), _0x21d682.skip(_0x5ed6c9.offset);967for (let _0x3faf05 = 0; _0x3faf05 < _0x5ed6c9.XORdata.length; _0x3faf05++) tempFile.writeU8((_0x21d682.isEOF() ? 0 : _0x21d682.readU8()) ^ _0x5ed6c9.XORdata[_0x3faf05]);968tempFile.skip(1), _0x21d682.skip(1);969}970return _0x41bbac && (_0x2d78e9(tempFile), this.checksumOutput), tempFile;971};972var _0x4d7024 = {973'_FS': {974'createFolder': function(parent, name, canRead, canWrite) {975if (! _0x4d7024.FS) return;976if (typeof _0x4d7024.FS.mkdir == 'function' && window.PATH) {977let path = PATH.join2(typeof parent === 'string' ? parent : _0x4d7024.FS.getPath(parent), name);978let mode = _0x4d7024.FS.getMode(canRead, canWrite);979_0x4d7024.FS.mkdir(path, mode);980} else {981_0x4d7024.FS.createFolder(parent, name, canRead, canWrite);982}983}984},985'romdb': null,986'supportBatterySave': false,987'hash': '2b35cacf70ae',988'hash2': 'f5cbb3f38c0bb20e4',989'hash3': '88cc8ad0c350400499a0',990'loading': null,991'gamePatch': null,992'saveFilenames': [],993'FS': null,994'Module': null,995'aspectRatio': 4 / 3,996'memData': null,997'wasmData': null,998'coreFileData': {},999'coreFileName': '',1000'coreFileVersion': '',1001'isMobileDevice': !!/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i .test(navigator.userAgent || ''),1002'create': function() {1003let _this = this;1004window.URL = window.URL || window.webkitURL;1005let _0x17edbf,1006_0x2c1832,1007_0x4ce206,1008_0x528f2b = false,1009_0x547484 = false,1010_0x5e24fa = false,1011_0x468801 = 0,1012_0x31a5b3 = false,1013_0x1e0766 = {1014oldCores: {1015'psx': ['bin', 'iso', 'cue', 'img', 'mdf', 'pbp', 'toc', 'cbn', 'm3u'],1016'nds': ['nds', 'bin'],1017'nes': ['fds', 'nes', 'unif', 'unf'],1018'snes': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],1019'snes2002': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],1020'snes2005': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],1021'snes2010': ['smc', 'fig', 'sfc', 'gd3', 'gd7', 'dx2', 'bsx', 'swc'],1022'gb': ['gb', 'gbc', 'dmg'],1023'gba': ['gb', 'gbc', 'gba'],1024'vbanext': ['gba'],1025'vb': ['vb', 'vboy', 'bin'],1026'3do': ['iso', 'bin', 'cue'],1027'lynx': ['lnx'],1028'jaguar': ['j64', 'jag', 'rom', 'abs', 'cof', 'bin', 'prg'],1029'a7800': ['a78', 'bin'],1030'a2600': ['a26', 'bin'],1031'ngp': ['ngp', 'ngc'],1032'n64': ['n64', 'v64', 'z64', 'bin', 'u1', 'ndd'],1033'pce': ['pce', 'bin', 'iso', 'cue', 'ccd', 'img', 'chd'],1034'sega': ['mdx', 'md', 'smd', 'gen', 'bin', 'iso', 'cue', 'sms', 'gg', 'sg', '68k', 'chd'],1035'segacd': ['mdx', 'md', 'smd', 'gen', 'bin', 'iso', 'cue', 'sms', 'gg', 'sg', '68k', 'chd'],1036'32x': ['32x', 'bin', 'gen', 'smd', 'md', 'cue', 'iso', 'sms'],1037'saturn': ['bin', 'cue', 'iso'],1038'msx': ['rom', 'mx1', 'mx2', 'dsk', 'cas'],1039'bluemsx': ['rom', 'ri', 'mx1', 'mx2', 'col', 'dsk', 'cas', 'sg', 'sc', 'm3u'],1040'ws': ['ws', 'wsc'],1041'arcade': ['zip'],1042'fba0.2.97.29': ['zip'],1043'mame2003': ['zip'],1044'mame': ['zip']1045},1046newCores: {1047'fceumm': ['fds', 'nes', 'unif', 'unf'],1048'snes9x': ['smc', 'sfc', 'swc', 'fig', 'bs', 'st'],1049'a5200': ['a52', 'bin'],1050'gambatte': ['gb', 'gbc', 'dmg'],1051'mgba': ['gb', 'gbc', 'gba'],1052'beetle_vb': ['vb', 'vboy', 'bin'],1053'mupen64plus_next': ['n64', 'v64', 'z64', 'bin', 'u1', 'ndd', 'gb'],1054'fbalpha2012_cps1': ['zip'],1055'fbalpha2012_cps2': ['zip'],1056'mame2003': ['zip'],1057'desmume2015': ['nds', 'bin'],1058'melonds': ['nds'],1059'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],1060'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'],1061'nestopia': ['fds', 'nes', 'unif', 'unf'],1062'opera': ['iso', 'bin', 'chd', 'cue']1063}1064},1065_0x29078e = {1066oldCores: {1067'psx': 'psx',1068'nds': 'nds',1069'nes': 'nes',1070'snes': 'snes',1071'snes2002': 'snes2002',1072'snes2005': 'snes2005',1073'snes2010': 'snes2010',1074'gb': 'gb',1075'gbc': 'gb',1076'gba': 'gba',1077'vbanext': 'vbanext',1078'vb': 'vb',1079'n64': 'n64',1080'3do': '3do',1081'segaMS': 'sega',1082'segaGG': 'sega',1083'segaMD': 'sega',1084'segaCD': 'segacd',1085'sega32x': '32x',1086'segaSaturn': 'saturn',1087'ngp': 'ngp',1088'pce': 'pce',1089'msx': 'bluemsx',1090'atari2600': 'a2600',1091'atari7800': 'a7800',1092'atari5200': 'a5200',1093'lynx': 'lynx',1094'ws': 'ws',1095'arcade': 'arcade',1096'fba0.2.97.29': 'fba0.2.97.29',1097'jaguar': 'jaguar',1098'mame2003': 'mame2003'1099},1100newCores: {1101// The default core to use for each system1102'nes': 'fceumm',1103'snes': 'snes9x',1104'atari5200': 'a5200',1105'gb': 'gambatte',1106'gba': 'mgba',1107'vb': 'beetle_vb',1108'n64': 'mupen64plus_next',1109'nds': 'desmume2015',1110'mame2003': 'mame2003',1111'arcade': 'fbalpha2012_cps1', // I need to find a more compatible arcade core1112'psx': 'mednafen_psx_hw',1113'3do': 'opera'1114}1115},1116newCoreTypes = {1117'fceumm': 'nes',1118'snes9x': 'snes',1119'a5200': 'atari5200',1120'gambatte': 'gb',1121'mgba': 'gba',1122'beetle_vb': 'vb',1123'mupen64plus_next': 'n64',1124'desmume2015': 'nds',1125'mame2003': 'mame2003',1126'fbalpha2012_cps1': 'arcade',1127'fbalpha2012_cps2': 'arcade',1128'mednafen_psx': 'psx',1129'mednafen_psx_hw': 'psx',1130'melonds': 'nds',1131'nestopia': 'nes',1132'opera': '3do'1133},1134getSystem = function(core, notRetroarch) {1135if (notRetroarch === true) {1136return newCoreTypes[core] || core;1137} else if (notRetroarch === 1) {1138return _0x29078e.oldCores[core]; // For when core is set to version 1.1139}1140return _0x29078e.newCores[core] || core;1141},1142_0xc6823 = this,1143_0x1143c5 = _0xc6823.system;1144window.getSystem = getSystem;1145window._0x29078e = _0x29078e;1146window._0x1e0766 = _0x1e0766;1147_0x17edbf = (_0xc6823.customPaths && typeof _0xc6823.customPaths['extract7z.js'] == 'string') ? _0xc6823.customPaths['extract7z.js'] : (_0xc6823.dataPath + 'extract7z.js');1148_0x2c1832 = (_0xc6823.customPaths && typeof _0xc6823.customPaths['extractzip.js'] == 'string') ? _0xc6823.customPaths['extractzip.js'] : (_0xc6823.dataPath + 'extractzip.js?v=1');1149_0x4ce206 = (_0xc6823.customPaths && typeof _0xc6823.customPaths['libunrar.js'] == 'string') ? _0xc6823.customPaths['libunrar.js'] : (_0xc6823.dataPath + 'libunrar.js');1150let _0xb2be2a = _0x428003('canvas', {});1151this.game.appendChild(_0xb2be2a), _0x4d7024.loading = _0x428003('div', {1152'class': this.config.classNames.loading1153}), this.elements.container.appendChild(_0x4d7024.loading);1154let _0x4fce24 = {1155'loading-info': getClass({1156'loading-info': true1157}),1158'ad': getClass({1159'ad': true1160}),1161'close-ad': getClass({1162'close-ad': true1163}),1164'start-game': getClass({1165'start-game': true1166}),1167'on': getClass({1168'on': true1169}),1170'p1': getClass({1171'p1': true1172}),1173'p2': getClass({1174'p2': true1175}),1176'p3': getClass({1177'p3': true1178}),1179'p4': getClass({1180'p4': true1181})1182},1183_0x4e198f = '';1184if (typeof _0xc6823.adUrl === 'string') {1185_0x4d7024.loading.innerHTML = '\n <div>\n <div class="'+_0x4fce24.ad+'" style="display:block !important;width:300px !important">\n <div class="'+_0x4fce24['close-ad']+'" hidden><a href="#" onclick="return false"></a></div>\n <iframe scrolling="no" frameborder="no" style="width:300px !important;height:250px !important;display: block !important;" src="'+_0xc6823.adUrl+'"></iframe>\n </div>\n <div class="'+_0x4fce24['loading-info']+'" style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <div class="'+_0x4fce24.p1+'"></div>\n <div class="'+_0x4fce24.p2+'"></div>\n <div class="'+_0x4fce24.p3+'"></div>\n </div>\n <div style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <a href="#" onclick="return false" class="'+_0x4fce24['start-game']+'">'+(_0xb9b2ff.get('playNow', _0xc6823.config))+'</a>\n </div>\n </div>';1186let _0x2e2264 = _0x428003('iframe', {1187'src': _0xc6823.adUrl,1188'scrolling': 'no',1189'frameborder': 'no',1190'style': 'width:300px !important;height:250px !important;display: block !important;'1191});1192(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)).removeChild(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad, ' iframe'))), _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)).appendChild(_0x2e2264), _0x2d904a.webgl.DETECTED) || (_0x132da7(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['start-game'])), true), _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p3)).innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">Failed to initialize WebGL.</strong>');1193_0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad, ' iframe')).style.setProperty('display', 'block', 'important'), _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad, ' iframe')).style.setProperty('visibility', 'visible', 'important'), _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)).style.setProperty('display', 'block', 'important'), _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)).style.setProperty('visibility', 'visible', 'important')1194} else {1195_0x4d7024.loading.innerHTML = '\n <div>\n <div class="'.concat(_0x4fce24['loading-info'], '" style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <div class="').concat(_0x4fce24.p1, '"></div>\n <div class="').concat(_0x4fce24.p2, '"></div>\n <div class="').concat(_0x4fce24.p3, '"></div>\n </div>\n <div style="position: absolute;bottom: 20px;left: 50%;transform: translateX(-50%);">\n <a href="#" onclick="return false" class="').concat(_0x4fce24['start-game'], '">').concat(_0xb9b2ff.get('playNow', _0xc6823.config), '</a>\n </div>\n </div>');1196if (! _0x2d904a.webgl.DETECTED) {1197_0x132da7(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['start-game'])), true), _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p3)).innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">Failed to initialize WebGL.</strong>';1198}1199}1200let _0x18a437 = window.URL || window.webkitURL;1201let isCompressed = function(data) { //https://www.garykessler.net/library/file_sigs.html1202if ((data[0] === 80 && data[1] === 75) && ((data[2] === 3 && data[3] === 4) || (data[2] === 5 && data[3] === 6) || (data[2] === 7 && data[3] === 8))) {1203return 'zip';1204} else if (data[0] === 55 && data[1] === 122 && data[2] === 188 && data[3] === 175 && data[4] === 39 && data[5] === 28) {1205return '7z';1206} else if ((data[0] === 82 && data[1] === 97 && data[2] === 114 && data[3] === 33 && data[4] === 26 && data[5] === 7) && ((data[6] === 0) || (data[6] === 1 && data[7] == 0))) {1207return 'rar';1208}1209},1210extractFile = async function(url) {1211let fileData = await (await fetch(url)).text(),1212_0x2c1832 = new Blob([fileData], {1213'type': 'application/javascript'1214}),1215_0x501a8e = window.URL.createObjectURL(_0x2c1832);1216return new Worker(_0x501a8e);1217},1218extractRar = async function(url) {1219let fileData = await (await fetch(url)).text();1220let _0x2c1832 = '\nlet dataToPass = [];\nModule = {\n monitorRunDependencies: function(left) {\n if (left == 0) {\n setTimeout(function() {\n unrar(dataToPass, null);\n }, 100);\n }\n },\n onRuntimeInitialized: function() {\n },\n locateFile: function(file) {\n return \''+url+'.mem\';\n }\n};\n'+fileData+'\nlet unrar = function(data, password) {\n let cb = function(fileName, fileSize, progress) {\n postMessage({"t":4,"current":progress,"total":fileSize, "name": fileName});\n };\n\n let rarContent = readRARContent(data.map(function(d) {\n return {\n name: d.name,\n content: new Uint8Array(d.content)\n }\n }), password, cb)\n let rec = function(entry) {\n if (entry.type === \'file\') {\n postMessage({"t":2,"file":entry.fullFileName,"size":entry.fileSize,"data":entry.fileContent});\n } else if (entry.type === \'dir\') {\n Object.keys(entry.ls).forEach(function(k) {\n rec(entry.ls[k]);\n })\n } else {\n throw "Unknown type";\n }\n }\n rec(rarContent);\n postMessage({"t":1});\n return rarContent;\n};\nonmessage = function(data) {\n dataToPass.push({name: \'test.rar\', content: data.data});\n};\n ';1221let _0x22326b = new Blob([_0x2c1832], {1222'type': 'application/javascript'1223}),1224_0x3635b1 = window.URL.createObjectURL(_0x22326b);1225return new Worker(_0x3635b1);1226},1227_0x24de8d = null,1228_0x4e171c = null,1229_0xa884ea = null;1230try {1231_0x24de8d = new IDBStore({1232'dbVersion': 1,1233'storePrefix': 'ejs-',1234'storeName': 'system',1235'keyPath': null,1236'autoIncrement': false,1237'onStoreReady': function() {1238_0x528f2b = true;1239},1240'onError': function() {1241_0x528f2b = true;1242}1243});1244_0x4e171c = new IDBStore({1245'dbVersion': 1,1246'storePrefix': 'ejs-',1247'storeName': 'roms',1248'keyPath': null,1249'autoIncrement': false,1250'onStoreReady': function() {1251_0x547484 = true;1252},1253'onError': function() {1254_0x547484 = true;1255}1256});1257_0xa884ea = new IDBStore({1258'dbVersion': 1,1259'storePrefix': 'ejs-',1260'storeName': 'bios',1261'keyPath': null,1262'autoIncrement': false,1263'onStoreReady': function() {1264_0x5e24fa = true;1265},1266'onError': function() {1267_0x5e24fa = true;1268}1269});1270} catch (_0x4fc9b6) {1271_0x528f2b = true;1272_0x547484 = true;1273_0x5e24fa = true;1274console.log(_0x4fc9b6);1275}1276_0x1093f4.call(_0xc6823, _0xc6823.elements.container, 'start-game', function(_0x3d9f57) {1277_0xc6823.started = true, _0xc6823.playing = true, _0x132da7(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['loading-info'])), true);1278if (_0xdcec2a && (_0xdcec2a.virtualGamepadContainer == 'undefined' || _0xdcec2a.virtualGamepadContainer === null)) {1279_0x5ab74d.toggleControls.call(_0xc6823, true);1280}1281let _0x2c1832 = getClass({1282'ejs__tooltip--visible': true1283}),1284_0x10efa5 = _0xc6823.elements.buttons.gamepad.querySelector('.' .concat(getClass({1285'ejs__tooltip': true1286})));1287_0x3a8e2f(_0x10efa5, _0x2c1832, true), setTimeout(function() {1288_0x3a8e2f(_0x10efa5, _0x2c1832, false);1289}, 0x1388)1290if (typeof _0xc6823.adUrl === 'string') {1291_0x132da7(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['close-ad'])), false);1292if (_0xc6823.config.noAutoAdClose !== true) {1293setTimeout(function() {1294_0xc6823.started && _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)) && _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)).parentNode.removeChild(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)));1295}, 0x2710)1296}1297}1298_0x132da7(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['start-game'])), true);1299let _0x30fd44 = _0x5dc0c0(_0x2593da.defaultCoreOptionsValues.call(_this), _0x2593da.storage.get('core-options') || {});1300'n64' === getSystem(_0xc6823.system, true) && _0x30fd44 && Object.keys(_0x30fd44).forEach(function(_0x3015d2) {1301'glupen64-aspect' === _0x3015d2 && '16:9' === _0x30fd44[_0x3015d2] && (_0xb2be2a.height = _0xb2be2a.width / 0x10 * 0x9, _0x4d7024.aspectRatio = 0x10 / 0x9);1302});1303'arcade' !== getSystem(_this.system, true) && 'fba0.2.97.29' !== getSystem(_this.system, true) || _0x30fd44 && Object.keys(_0x30fd44).forEach(function(_0x490c06) {1304'fba-aspect' === _0x490c06 && 'PAR' === _0x30fd44[_0x490c06] && (_0xb2be2a.height = _0xb2be2a.width / 0x10 * 0x9, _0x4d7024.aspectRatio = 0x10 / 0x9);1305});1306'gba' === getSystem(_0xc6823.system, true) && (_0xb2be2a.height = _0xb2be2a.width / 1.5, _0x4d7024.aspectRatio = 1.5);1307(function() {1308let _0x3d9f57 = _this;1309if ('undefined' != typeof RI) {1310document.removeEventListener('mousemove', RI.eventHandler, false), _0xb2be2a.removeEventListener('mousedown', RI.canvasEventHandler, false), _0xb2be2a.removeEventListener('mouseup', RI.canvasEventHandler, false);1311_0x3d9f57.elements.container.addEventListener('mousemove', function(_0x44f409) {1312let _0x3d9f57 = 0,1313_0x2c1832 = 0,1314_0x2cc8a1 = _0x44f409.offsetX - _0x4d7024.Module.canvas.offsetLeft,1315_0x5744ed = _0x44f409.offsetY - _0x4d7024.Module.canvas.offsetTop;1316switch (_0x44f409.type) {1317case 'mousemove':1318_0x2cc8a1 < 0 ? (_0x2cc8a1 = 0, _0x3d9f57 = -_0x4d7024.Module.canvas.offsetWidth) : _0x2cc8a1 > _0x4d7024.Module.canvas.offsetWidth ? (_0x2cc8a1 = _0x4d7024.Module.canvas.offsetWidth, _0x3d9f57 = _0x4d7024.Module.canvas.offsetWidth) : _0x3d9f57 = _0x2cc8a1 - RI.currentX, _0x5744ed < 0 ? (_0x5744ed = 0, _0x2c1832 = -_0x4d7024.Module.canvas.offsetHeight) : _0x5744ed > _0x4d7024.Module.canvas.offsetHeight ? (_0x5744ed = _0x4d7024.Module.canvas.offsetHeight, _0x2c1832 = _0x4d7024.Module.canvas.offsetHeight) : _0x2c1832 = _0x5744ed - RI.currentY, RI.currentX = _0x2cc8a1, RI.currentY = _0x5744ed;1319for (let _0x3e03cb = 0; _0x3e03cb < RI.contexts.length; _0x3e03cb += 1) HEAP32[RI.contexts[_0x3e03cb].state + 0x20 >> 2] = _0x3d9f57, HEAP32[RI.contexts[_0x3e03cb].state + 0x24 >> 2] = _0x2c1832;1320}1321}, false), _0x3d9f57.elements.container.addEventListener('mousedown', RI.canvasEventHandler, false), _0x3d9f57.elements.container.addEventListener('mouseup', RI.canvasEventHandler, false);1322let _0x2c1832 = function(_0x5d0cbb) {1323if (_0x5d0cbb.targetTouches[0]) {1324let _0x3d9f57, _0x2c1832, _0x19a4e0 = 0,1325_0x2b7b61 = 0,1326_0x1e0f64 = _0x5d0cbb.target.getBoundingClientRect(),1327_0x2c55b8 = _0x5d0cbb.targetTouches[0].clientX - _0x1e0f64.left,1328_0x3a7025 = _0x5d0cbb.targetTouches[0].clientY - _0x1e0f64.top;1329_0x2c55b8 < 0 ? (_0x2c55b8 = 0, _0x19a4e0 = -_0x4d7024.Module.canvas.offsetWidth) : _0x2c55b8 > _0x4d7024.Module.canvas.offsetWidth ? (_0x2c55b8 = _0x4d7024.Module.canvas.offsetWidth, _0x19a4e0 = _0x4d7024.Module.canvas.offsetWidth) : _0x19a4e0 = _0x2c55b8 - RI.currentX, _0x3a7025 < 0 ? (_0x3a7025 = 0, _0x2b7b61 = -_0x4d7024.Module.canvas.offsetHeight) : _0x3a7025 > _0x4d7024.Module.canvas.offsetHeight ? (_0x3a7025 = _0x4d7024.Module.canvas.offsetHeight, _0x2b7b61 = _0x4d7024.Module.canvas.offsetHeight) : _0x2b7b61 = _0x3a7025 - RI.currentY, RI.currentX = _0x2c55b8, RI.currentY = _0x3a7025;1330for (let _0x43b670 = 0; _0x43b670 < RI.contexts.length; _0x43b670 += 1) HEAP32[RI.contexts[_0x43b670].state + 0x20 >> 2] = _0x19a4e0, HEAP32[RI.contexts[_0x43b670].state + 0x24 >> 2] = _0x2b7b61;1331switch (_0x5d0cbb.type) {1332case 'touchend':1333case 'touchstart':1334if (0x0 === _0x5d0cbb.button) _0x2c1832 = 0x28;1335else {1336if (0x2 !== _0x5d0cbb.button) break;1337_0x2c1832 = 0x29;1338}1339_0x3d9f57 = 'touchend' === _0x5d0cbb.type ? 0 : 1;1340for (let _0x443e8b = 0; _0x443e8b < RI.contexts.length; _0x443e8b += 1) HEAP8[RI.contexts[_0x443e8b].state + _0x2c1832 >> 0x0] = _0x3d9f57;1341}1342}1343};1344_0x3d9f57.elements.container.addEventListener('touchstart', _0x2c1832, false), _0x3d9f57.elements.container.addEventListener('touchend', _0x2c1832, false);1345} else {1346let _0x518e5a = function(_0x45d640) {1347let _0x3d9f57 = new MouseEvent(_0x45d640.type, _0x45d640);1348_0x4d7024.Module.canvas.dispatchEvent(_0x3d9f57);1349};1350_0x530042.call(_this, '.' .concat(getClass({1351'ejs__dialogs': true1352}))).addEventListener('mousemove', _0x518e5a, false), _0x530042.call(_this, '.' .concat(getClass({1353'ejs__dialogs': true1354}))).addEventListener('mousedown', _0x518e5a, false), _0x530042.call(_this, '.' .concat(getClass({1355'ejs__dialogs': true1356}))).addEventListener('mouseup', _0x518e5a, false);1357}1358})();1359'msx' === getSystem(_0xc6823.system, true) && function(_0x3c016a) {1360if ('undefined' != typeof RI) {1361document.removeEventListener('keydown', RI.eventHandler, false), document.removeEventListener('keyup', RI.eventHandler, false);1362let _0x3d9f57 = function(_0x97e67b) {1363let _0x3d9f57 = _0x97e67b.keyCode,1364_0x2c1832 = _0x3d9f57 >> 3,1365_0x3340c0 = 1 << (0x7 & _0x3d9f57);1366switch (_0x97e67b.type) {1367case 'keyup':1368case 'keydown':1369if (_0x2c1832 >= 0x20) throw 'key code error! bad code: ' + _0x3d9f57;1370for (let _0x126f58 = 0; _0x126f58 < RI.contexts.length; _0x126f58++) {1371let _0x4ca77a = HEAP8[RI.contexts[_0x126f58].state + _0x2c1832 >> 0x0];1372'keyup' === _0x97e67b.type ? _0x4ca77a &= ~_0x3340c0 : _0x4ca77a |= _0x3340c0, HEAP8[RI.contexts[_0x126f58].state + _0x2c1832 >> 0x0] = _0x4ca77a;1373}1374}1375};1376document.addEventListener('keydown', _0x3d9f57, false), document.addEventListener('keyup', _0x3d9f57, false);1377}1378}();1379setTimeout(function() {1380let _0xa88a13;1381_0xa88a13 = _0x59aa33.info(), null === _0xdcec2a.setVolume && 'undefined' != typeof RA ? (RA.queueAudio = function() {1382let _0x3d9f57, _0x2c1832 = _0xc6823.volume,1383_0x2cbc4 = RA.bufIndex;1384_0x3d9f57 = RA.bufIndex ? RA.buffers[RA.bufIndex - 1].endTime : RA.context.currentTime, RA.buffers[_0x2cbc4].endTime = _0x3d9f57 + RA.buffers[_0x2cbc4].duration;1385let _0x4e7320 = RA.context.createBufferSource();1386if (_0x4e7320.buffer = RA.buffers[_0x2cbc4], _0xc6823.muted && (_0x2c1832 = 0), 1 === _0x2c1832) _0x4e7320.connect(RA.context.destination);1387else {1388let _0x3da8fc = RA.context.createGain();1389_0x4e7320.connect(_0x3da8fc), _0x3da8fc.connect(RA.context.destination), _0x59aa33.isEdge || 'chrome' === _0xa88a13.name && parseInt(_0xa88a13.version, 0xa) <= 0x3c || 'firefox' === _0xa88a13.name && parseInt(_0xa88a13.version, 0xa) <= 0x38 || 'opera' === _0xa88a13.name && parseInt(_0xa88a13.version, 0xa) <= 0x2c ? _0x3da8fc.gain.value = _0x2c1832 : 'firefox' === _0xa88a13.name ? _0x3da8fc.gain.setValueAtTime(_0x2c1832, RA.context.currentTime) : _0x3da8fc.gain.setValueAtTime(_0x2c1832, RA.context.currentTime, 0);1390}1391_0x4e7320.start(_0x3d9f57), RA.bufIndex += 1, RA.bufOffset = 0;1392}, _0x59aa33.isIos && window.addEventListener('touchstart', function() {1393if (RA.context) {1394RA.context.resume();1395let _0xa88a13 = RA.context.createBufferSource();1396_0xa88a13.connect(RA.context.destination), _0xa88a13.start();1397}1398}, false)) : _0xdcec2a.setVolume();1399}, 0x1f4);1400setTimeout(function() {1401_0xc6823.elements.container.focus();1402}, 0x1e);1403void 0 === window.addRunDependency && (window.Module = undefined);1404})1405if (typeof _0xc6823.adUrl === 'string') {1406_0x1093f4.call(_0xc6823, _0x4d7024.loading.querySelector('.' .concat(_0x4fce24['close-ad'])), 'click', function(_0x96b13f) {1407_0x96b13f instanceof MouseEvent && _0xc6823.started && _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)) && _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad)).parentNode.removeChild(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24.ad))), _0xc6823.elements.container.focus();1408});1409}1410let _0x5f3757 = function(_0x2bd107) {1411if (_0x4d7024.gamePatch) {1412let startName = _0x4d7024.getStartName(true);1413let _0x17edbf = startName.split('/'),1414_0x2c1832 = _0x17edbf.pop().split('.').pop(),1415_0x11dc72 = (_0x4d7024.gamePatch.split('.').pop(), _0x4d7024.gamePatch.split('/').pop().split('.').shift()),1416_0x453ec0 = '' .concat(_0x17edbf.join('/'), '/').concat(_0x11dc72, '.').concat(_0x2c1832);1417_0x453ec0 = _0x453ec0.replace(/\#/g, '');1418if (_0x4d7024.gamePatch.startsWith('blob:')) {1419_0x453ec0 = startName;1420}1421let _0x5438db = _0x4d7024.gamePatch;1422_0x4d7024.FS.rename(startName, _0x453ec0);1423_0x2bd107.startName = _0x453ec0;1424startName = _0x4d7024.getStartName(true);1425if ('snes' === getSystem(_0x2bd107.system, true) || ['snes2002', 'snes2005', 'snes2010'].includes(getSystem(_0x2bd107.system, true))) {1426let _0x4758bc, _0x4b4000, _0x4aa31e, _0x2d9175 = new _0x863031(_0x4d7024.FS.readFile(startName)),1427_0x567355 = _0x2d78e9(_0x2d9175),1428_0x3d2ad0 = new _0x863031(_0x4d7024.FS.readFile(_0x5438db)),1429_0x4a229b = _0x3d2ad0.readString(0x6),1430_0x20786d = _0x2d9175._u8array.length % 0x400;1431_0x4a229b.startsWith('PATCH') ? (_0x4758bc = _0x288092(_0x3d2ad0), 0 === _0x20786d && 'B19ED489' === _0x567355.toString(0x10).toUpperCase() && ((_0x4b4000 = new Uint8Array(_0x2d9175._u8array.length + 0x200)).set(new Uint8Array(0x200), 0), _0x4b4000.set(_0x2d9175._u8array, 0x200), _0x2d9175 = new _0x863031(_0x4b4000))) : _0x4a229b.startsWith(_0x7a6485) ? _0x4758bc = _0xd2202f(_0x3d2ad0) : _0x4a229b.startsWith('BPS1') && (_0x4758bc = _0x356089(_0x3d2ad0), _0x20786d > 0 && 'A31BEAD4' === _0x567355.toString(0x10).toUpperCase() && (_0x4b4000 = _0x2d9175._u8array.slice ? _0x2d9175._u8array.slice(_0x20786d) : _0x2d9175._u8array.subarray(_0x20786d), _0x2d9175 = new _0x863031(_0x4b4000)));1432try {1433if (_0x4aa31e = _0x4758bc.apply(_0x2d9175, false)) {1434let _0x1ffde3 = _0x4aa31e._u8array.length % 0x400;1435_0x1ffde3 > 0 && (_0x4b4000 = _0x4aa31e._u8array.slice ? _0x4aa31e._u8array.slice(_0x1ffde3) : _0x4aa31e._u8array.subarray(_0x1ffde3), _0x4aa31e = new _0x863031(_0x4b4000)), _0x4d7024.FS.unlink(_0x5438db), _0x4d7024.FS.unlink(startName), _0x4d7024.FS.writeFile(startName, _0x4aa31e._u8array);1436}1437} catch (_0x2ef20f) {}1438} else {1439let _0x4108d8, _0x5e086b, _0x454a20 = new _0x863031(_0x4d7024.FS.readFile(startName)),1440_0x4991ea = new _0x863031(_0x4d7024.FS.readFile(_0x5438db)),1441_0x130f1f = _0x4991ea.readString(0x6);1442_0x130f1f.startsWith('PATCH') ? _0x4108d8 = _0x288092(_0x4991ea) : _0x130f1f.startsWith(_0x7a6485) ? _0x4108d8 = _0xd2202f(_0x4991ea) : _0x130f1f.startsWith('BPS1') && (_0x4108d8 = _0x356089(_0x4991ea));1443try {1444(_0x5e086b = _0x4108d8.apply(_0x454a20, false)) && (_0x4d7024.FS.unlink(_0x5438db), _0x4d7024.FS.unlink(startName), _0x4d7024.FS.writeFile(startName, _0x5e086b._u8array));1445} catch (_0x3ed519) {}1446}1447}1448},1449_0x4bd781 = function() {1450let key = (_this.coreVer===2)?"INITIAL_MEMORY":"TOTAL_MEMORY"1451const system = getSystem(_this.system, true);1452_0x31a5b3 ? (window.Module[key] = 0x10000000, ['jaguar'].includes(system) && (window.Module[key] = 0x10000000), ['nds', 'nes', 'snes', 'arcade', 'mame'].includes(system) && (window.Module[key] = 0), ['snes2002', 'snes2005', 'snes2010'].includes(system) && (window.Module[key] = 0), 'gba' == system && (window.Module[key] = 0), '3do' == system && (window.Module[key] = 0), 'n64' == system && (window.Module[key] = 0)) : ('nes' === system && (window.Module[key] = 0x8000000), window.Module[key] = _0x468801 + 0x4000000, ['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(system) && (window.Module[key] = _0x468801 + 0x10000000, _0x4d7024.isMobileDevice && (window.Module[key] = 0x12c00000)), ['n64', 'nds', 'jaguar'].includes(system) && (window.Module[key] = _0x468801 + 0x10000000, _0x4d7024.isMobileDevice && (window.Module[key] = 0x12c00000)), 'gba' == system && (window.Module[key] = 0x10000000)), 'undefined' != typeof EJS_MEMORY && (window.Module[key] = EJS_MEMORY);1453},1454_0x3512e9 = function(_0x1bc287, _0x1844e3) {1455let _0x55627a = _this,1456_0x1cfda7 = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p3)),1457_0xb0c5d8 = -1,1458_0x429d6b = getSystem(_0x1143c5, _this.coreVer),1459_0x567717 = function() {1460if (_0x55627a.coreVer === 2) {1461_0x55627a.elements.settings.panels.home.querySelector('[role="menu"]').innerHTML = "";1462_0x7f9f36.setNormalOptionsMenu.call(_0x55627a);1463_0x7f9f36.setCoreOptionsMenu.call(_0x55627a);1464let mainLoop = _0x4d7024.Module.cwrap('toggleMainLoop', 'null', ['number']);1465_0x4d7024.Module.resumeMainLoop = function() {1466mainLoop(1);1467}1468_0x4d7024.Module.pauseMainLoop = function() {1469mainLoop(0);1470}1471}14721473if (typeof _0x55627a.loadStateOnStart == 'string') {1474fetch(_0x55627a.loadStateOnStart).then(function(response) {1475response.arrayBuffer().then(function(ab) {1476let a = new Uint8Array(ab);1477EJS_loadState(a);1478})1479})1480}1481};1482window.EJS_terminate = function() {1483_0x4d7024.Module.pauseMainLoop();1484if (_0x55627a && _0x55627a.eventListeners) {1485for (let k in _0x55627a) {1486for (let i=0; i<_0x55627a.eventListeners.length; i++) {1487let a = _0x55627a.eventListeners[i];1488a.element.removeEventListener(a.type, a.callback, a.capture);1489}1490}1491}1492if (window.EJS_RESET_VARS) {1493let a = [];1494let b = [];1495for (let k in window) {1496a.push(k);1497}1498for (let i=0; i<a.length; i++) {1499if (! window.EJS_RESET_VARS.includes(a[i])) {1500b.push(a[i]);1501}1502}1503for (let i=0; i<b.length; i++) {1504if (window[b[i]]) {1505delete window[b[i]];1506}1507}1508}1509}1510let start = function(startName) {1511_0x1cfda7.innerHTML = 'Game Data ready';1512if (!startName) {1513_0x1cfda7.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">Invalid Rom</strong>';1514return;1515}1516try {1517_0x4bd781();1518_0x5f3757(_0x55627a);1519let _0x2c1832 = [startName,1520[_0x4d7024.hash, _0x4d7024.hash2, _0x4d7024.hash3].join('')1521];1522'undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX && _0x2c1832.unshift('-v');1523_0x4d7024.Module.callMain(_0x2c1832);1524if (_0xc6823.coreVer === 2) {1525_0x4d7024.Module.resumeMainLoop();1526_0x4d7024.Module.setCanvasSize(800, 600);1527let i=0;1528let j = setInterval(function() { // some cores have a messed up screen size on load (for example - gba)1529if (i>20) clearInterval(j);1530i++;1531_0x4d7024.Module.setCanvasSize(800, 600);1532}, 100)1533}1534_0xbae705.call(_0x55627a, _0x55627a.elements.container, 'start-game');1535try{_0x567717();}catch(e){}1536} catch (e) {1537console.log(e);1538_0x1cfda7.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">Failed to start game</strong>';1539}1540}1541let _0x567713 = '';1542let _0x99321 = function(_0x52e6f3) {1543if (_0x52e6f3.data) {1544if (1 === _0x52e6f3.data.t) {1545!_0x55627a.startName && _0x567713 && (_0x55627a.startName = _0x567713);1546_0x52e6f3.target.terminate();1547start(_0x55627a.startName);1548}1549if (2 === _0x52e6f3.data.t) {1550const extensions = (_0x55627a.coreVer === 2) ? _0x1e0766.newCores[_0x429d6b.toLowerCase()] : _0x1e0766.oldCores[_0x429d6b.toLowerCase()];1551let _0x25aae3 = _0x52e6f3.data.file.split('/'),1552_0x1bc287 = _0x25aae3.pop(),1553_0x1844e3 = _0x1bc287.split('.').pop();1554_0x1bc287 = _0x1bc287.replace(/\#/g, ''), _0x4d7024.FS.createPath('/', _0x25aae3.join('/'), true, true);1555for (let _0x36bace = extensions.length - 1; _0x36bace >= 0; _0x36bace -= 1) extensions[_0x36bace] === _0x1844e3.toLowerCase() && _0x36bace > _0xb0c5d8 && (_0xb0c5d8 = _0x36bace, _0x55627a.startName = ['', _0x25aae3.join('/'), _0x1bc287].join('/'), _0x55627a.startName = _0x55627a.startName.replace(/\/+/, '/'));1556_0x1bc287 && (_0x4d7024.FS.createDataFile('/' .concat(_0x25aae3.join('/')), _0x1bc287, _0x52e6f3.data.data, true, false), _0x468801 += _0x52e6f3.data.data.length), _0x567713 = '/' .concat(_0x25aae3.join('/'), '/').concat(_0x1bc287);1557}1558if (4 === _0x52e6f3.data.t && _0x52e6f3.data.total > 0) {1559let _0x163fc4 = Math.floor(_0x52e6f3.data.current / _0x52e6f3.data.total * 100),1560_0x5448a3 = _0x52e6f3.data.name || '';1561if (_0x163fc4 <= 100 && _0x163fc4 > 0) {1562_0x1cfda7.innerHTML = _this.localization('Decompress Game Data')+_0x5448a3+' '+_0x163fc4+'%';1563}1564}1565}1566},1567_0x1e67c4 = false;1568if (!['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(getSystem(_0x55627a.system, true))) {1569let _0x20a78c = _0x1844e3.slice ? _0x1844e3.slice(0, 10) : _0x1844e3.subarray(0, 10),1570_0x1761cf = isCompressed(_0x20a78c);1571if (_0x1761cf === "7z") {1572extractFile(_0x17edbf).then(function(_0xea623e) {1573_0xea623e.onmessage = _0x99321;1574_0xea623e.postMessage(_0x1844e3);1575})1576_0x1e67c4 = true;1577} else if (_0x1761cf === 'zip') {1578extractFile(_0x2c1832).then(function(_0x5a81e4) {1579_0x5a81e4.onmessage = _0x99321;1580_0x5a81e4.postMessage(_0x1844e3);1581})1582_0x1e67c4 = true;1583} else if (_0x1761cf === 'rar') {1584extractRar(_0x4ce206).then(function(_0x5f204f) {1585_0x5f204f.onmessage = _0x99321;1586_0x5f204f.postMessage(_0x1844e3);1587})1588_0x1e67c4 = true;1589}1590}1591if (!_0x1e67c4) {1592_0x55627a.startName = _0x55627a.getStartName();1593if (!_0x55627a.startName) {1594_0x55627a.startName = 'rom';1595}1596try {1597_0x468801 += _0x1844e3.length;1598_0x4d7024.FS.createDataFile('/', _0x55627a.startName, _0x1844e3, true, false);1599} catch (_0x210043) {1600console.log(_0x210043);1601}1602start(_0x55627a.startName);1603}1604},1605_0x5048db = function() {1606let _0x17edbf = _this,1607_0x2c1832 = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p3)),1608_0x50eb85 = _this.config,1609_0x3cf3cf = _0x50eb85.gameUrl,1610_0x594488 = _0x50eb85.system;1611'vbanext' == _0x594488 && (_0x594488 = 'gba');1612let _0x154dc5 = (typeof _0x3cf3cf == 'string') ? _0x3cf3cf.split('/') : "ga.me",1613_0x139f1c = _0x154dc5[_0x154dc5.length - 1];1614_0x139f1c.indexOf('?') > -0x1 && (_0x139f1c = _0x139f1c.substr(0, _0x139f1c.indexOf('?')));1615_0x139f1c.split('.').pop();1616_0x2c1832.innerHTML = _this.localization('Download Game Data');1617if (['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(getSystem(_0x17edbf.system, true)) && _0x17edbf.config.gameParentUrl) {1618_0x2c1832.innerHTML += ' (2/2)';1619}1620if (_0x17edbf.config.gamePatchUrl) {1621_0x2c1832.innerHTML += ' (2/2)';1622}1623if (typeof _0x3cf3cf != 'string') {1624if (_0x3cf3cf.toString() === "[object Blob]") {1625_0x3cf3cf.arrayBuffer().then(function(data) {1626_0x3512e9(_0x139f1c, new Uint8Array(data));1627})1628} else if (_0x3cf3cf.toString() === "[object ArrayBuffer]") {1629_0x3512e9(_0x139f1c, new Uint8Array(_0x3cf3cf));1630} else {1631_0x3512e9(_0x139f1c, Uint8Array.from(_0x3cf3cf));1632}1633return;1634}1635_0x550f17.a.head(_0x3cf3cf, {}).then(function(_0x3d703e) {1636let _0x21b526 = _0x3d703e.headers['content-length'],1637_0x7e8d4c = _0x3d703e.headers['content-type'],1638_0x107e8a = ('' .concat(_0x594488, '-').concat(_0x139f1c)),1639_0x43a689 = function() {1640_0x550f17.a.get(_0x3cf3cf, {1641'onDownloadProgress': function(e) {1642const progress = e.total ? ' '+Math.floor(e.loaded / e.total * 100).toString()+'%' : ' '+(e.loaded/1048576).toFixed(2)+'MB';1643if (['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(getSystem(_0x17edbf.system, true)) && _0x17edbf.config.gameParentUrl) {1644_0x2c1832.innerHTML = _this.localization('Download Game Data')+' (2/2)'+progress;1645} else if (_0x17edbf.config.gamePatchUrl) {1646_0x2c1832.innerHTML = _this.localization('Download Game Data')+' (2/2)'+progress;1647} else {1648_0x2c1832.innerHTML = _this.localization('Download Game Data')+progress;1649}1650},1651'responseType': 'arraybuffer'1652}).then(function(_0x22a1f4) {1653let _0x17edbf = new Uint8Array(_0x22a1f4.data);1654if (typeof _this.config.gameUrl != 'string' || (typeof _this.config.gameUrl == 'string' && (_this.config.gameUrl.startsWith('blob:') || _this.config.gameUrl.startsWith('file:') || _this.config.gameUrl.startsWith('chrome-extension:') || window.location.protocol === 'file:' || window.location.protocol === 'chrome-extension:'))) {1655_0x3512e9(_0x139f1c, _0x17edbf);1656return;1657};1658if ((_this.cacheLimit && _this.cacheLimit < _0x17edbf.byteLength) ||1659(!_this.cacheLimit && 1073741824 < _0x17edbf.byteLength)) {1660_0x3512e9(_0x139f1c, _0x17edbf);1661return;1662}1663if (_0x107e8a && _0x4e171c.db)1664_0x4d7024.saveFilenames.push(_0x107e8a), _0x4e171c.put(_0x107e8a, {1665'filename': _0x139f1c,1666'filesize': _0x17edbf.length,1667'filetype': _0x7e8d4c,1668'key': _0x107e8a,1669'lastaccess': new Date().valueOf()1670});1671_0x4e171c.db && _0x4e171c.put(_0x107e8a, {1672'filename': _0x139f1c,1673'filesize': _0x17edbf.length,1674'filetype': _0x7e8d4c,1675'key': _0x107e8a,1676'data': _0x17edbf1677});1678_0x3512e9(_0x139f1c, _0x17edbf);1679}).catch(function(_0x2e4d62) {1680renderErrorPage(_0x2e4d62, _0x2c1832, _this);1681});1682};1683_0x4e171c.db ? _0x4e171c.get(_0x107e8a, function(_0x5afc4a) {1684if (_0x5afc4a && _0x5afc4a.filename === _0x139f1c && _0x5afc4a.filesize - _0x21b526 == 0 && _0x5afc4a.filetype === _0x7e8d4c && _0x5afc4a.key)1685_0x3512e9(_0x5afc4a.filename, _0x5afc4a.data);1686else _0x43a689();1687}) : _0x43a689();1688}).catch(function(_0x5ec6be) {1689renderErrorPage(_0x5ec6be, _0x2c1832, _this);1690});1691},1692_0x139f68 = function() {1693let _0x2591d9 = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p3)),1694_0x5c896f = _this.config.gamePatchUrl;1695if (_0x5c896f) {1696let _0x227b23 = _0x5c896f.split('/'),1697_0x179b43 = _0x227b23[_0x227b23.length - 1];1698_0x179b43.indexOf('?') > -0x1 && (_0x179b43 = _0x179b43.substr(0, _0x179b43.indexOf('?')));1699_0x179b43.split('.').pop();1700_0x2591d9.innerHTML = _this.localization('Download Game Data')+' (1/2)';1701_0x550f17.a.get(_0x5c896f, {1702'onDownloadProgress': function(e) {1703let progress = e.total ? ' '+Math.floor(e.loaded / e.total * 100).toString()+'%' : ' '+(e.loaded/1048576).toFixed(2)+'MB';1704_0x2591d9.innerHTML = _this.localization('Download Game Data')+' (1/2)'+progress;1705},1706'responseType': 'arraybuffer'1707}).then(function(_0x159ae9) {1708let _0x1097ca = new Uint8Array(_0x159ae9.data),1709_0xe531f0 = _0x179b43.split('.').pop(),1710_0xf6806b = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p3)),1711_0x59c7c1 = function(_0x36004e) {1712if (_0x36004e.data) {1713if (0x1 === _0x36004e.data.t && (_0x36004e.target.terminate(), _0x5048db()), 2 === _0x36004e.data.t) {1714let _0x17edbf = _0x36004e.data.file.split('/'),1715_0x2c1832 = _0x17edbf.pop(),1716_0x2b320e = _0x2c1832.split('.').pop();1717_0x4d7024.FS.createPath('/', _0x17edbf.join('/'), true, true), _0x4d7024.FS.createDataFile('/' + _0x17edbf.join('/'), _0x2c1832, _0x36004e.data.data, true, false), _0x468801 += _0x36004e.data.data.length, ['ips', 'bps', 'ups'].includes(_0x2b320e) && !_0x4d7024.gamePatch && (_0x4d7024.gamePatch = '/' + _0x17edbf.join('/') + '/' + _0x2c1832);1718}1719if (0x4 === _0x36004e.data.t && _0x36004e.data.total > 0) {1720let _0x1097ca = Math.floor(_0x36004e.data.current / _0x36004e.data.total * 0x64),1721_0x95ac83 = _0x36004e.data.name || '';1722_0x1097ca <= 0x64 && _0x1097ca > 0 && (_0xf6806b.innerHTML = _this.localization('Decompress Game Patch')+' ' .concat(_0x95ac83, ' ').concat(_0x1097ca, '%'));1723}1724}1725},1726_0x3de3e4 = _0x1097ca.slice ? _0x1097ca.slice(0, 10) : _0x1097ca.subarray(0, 10),1727_0x17f736 = isCompressed(_0x3de3e4);1728if (_0x17f736 === '7z') {1729extractFile(_0x17edbf).then(function(_0x20601d) {1730_0x20601d.onmessage = _0x59c7c1;1731_0x20601d.postMessage(_0x1097ca);1732})1733} else if (_0x17f736 === 'zip') {1734extractFile(_0x2c1832).then(function(_0x46622d) {1735_0x46622d.onmessage = _0x59c7c1;1736_0x46622d.postMessage(_0x1097ca);1737})1738} else if (_0x17f736 === 'rar') {1739extractRar(_0x4ce206).then(function(_0x2ecd24) {1740_0x2ecd24.onmessage = _0x59c7c1;1741_0x2ecd24.postMessage(_0x1097ca);1742})1743} else {1744_0x468801 += _0x1097ca.length;1745_0x4d7024.gamePatch = '/'+_0xe531f0;1746_0x4d7024.FS.createDataFile('/', _0xe531f0, _0x1097ca, true, false);1747_0x5048db();1748}1749}).catch(function(_0x314293) {1750renderErrorPage(_0x314293, _0x2c1832, _this);1751});1752} else _0x5048db();1753},1754_0x452592 = function() {1755let _0x17edbf = _this,1756_0x2c1832 = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p3)),1757_0x5a21f7 = _this.config.gameParentUrl;1758if (_0x5a21f7 && ['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(getSystem(_0x17edbf.system, true))) {1759let _0x71bb4d = _0x5a21f7.split('/'),1760_0xa1889f = _0x71bb4d[_0x71bb4d.length - 1];1761_0xa1889f.indexOf('?') > -0x1 && (_0xa1889f = _0xa1889f.substr(0, _0xa1889f.indexOf('?')));1762_0xa1889f.split('.').pop();1763_0x2c1832.innerHTML = _this.localization('Download Game Data')+' (1/2)', _0x17edbf.config.gamePatchUrl && (_0x2c1832.innerHTML = _this.localization('Download Game Data')+' (1/3)'), _0x550f17.a.head(_0x5a21f7, {}).then(function(_0x35c23a) {1764let _0x17edbf = _0x35c23a.headers['content-length'],1765_0x500ba1 = _0x35c23a.headers['content-type'],1766_0x316472 = (_0x35c23a.headers['last-modified'], '' .concat(_0x1143c5, '-').concat(_0xa1889f)),1767_0x31f098 = function() {1768_0x550f17.a.get(_0x5a21f7, {1769'onDownloadProgress': function(e) {1770let progress = e.total ? ' '+Math.floor(e.loaded / e.total * 100).toString()+'%' : ' '+(e.loaded/1048576).toFixed(2)+'MB';1771_0x2c1832.innerHTML = _this.localization('Download Game Data')+' (1/2)'+progress;1772},1773'responseType': 'arraybuffer'1774}).then(function(_0x191007) {1775let _0x17edbf = new Uint8Array(_0x191007.data);1776if (_0x316472 && _0x4e171c.db) {1777_0x4d7024.saveFilenames.push(_0x316472);1778_0x4e171c.put(_0x316472, {1779'filename': _0xa1889f,1780'filesize': _0x17edbf.length,1781'filetype': _0x500ba1,1782'key': _0x316472,1783'lastaccess': new Date().valueOf()1784}), _0x4e171c.db && _0x4e171c.put(_0x316472, {1785'filename': _0xa1889f,1786'filesize': _0x17edbf.length,1787'filetype': _0x500ba1,1788'key': _0x316472,1789'data': _0x17edbf1790});1791}1792let _0x54d79 = _0xa1889f.replace(/\#/g, '');1793try {1794_0x468801 += _0x17edbf.length, _0x4d7024.FS.createDataFile('/', _0x54d79, _0x17edbf, true, false);1795_0x139f68();1796} catch (_0x125736) {1797console.log(_0x125736);1798}1799}).catch(function(_0x516cc3) {1800renderErrorPage(_0x516cc3, _0x2c1832, _this);1801});1802};1803_0x4e171c.db ? _0x4e171c.get(_0x316472, function(_0x3e612b) {1804if (_0x3e612b && _0x3e612b.filename === _0xa1889f && _0x3e612b.filesize - _0x17edbf == 0 && _0x3e612b.filetype === _0x500ba1 && _0x3e612b.key) {1805_0x4d7024.FS.createDataFile('/', _0x3e612b.filename, _0x3e612b.data, true, false);1806_0x139f68();1807} else _0x31f098();1808}) : _0x31f098();1809}).catch(function(_0x20f2e3) {1810renderErrorPage(_0x20f2e3, _0x2c1832, _this);1811});1812} else _0x139f68();1813},1814_0x57d85d = function(_0x5e7c8b, _0x3cff36) {1815let _0x3ea97 = _this,1816_0x50119 = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p2)),1817_0x19a43e = (_0x5e7c8b.split('.').pop(), function(_0x1e8643) {1818if (_0x1e8643.data) {1819if (1 === _0x1e8643.data.t) {1820_0x50119.innerHTML = 'BIOS ready';1821_0x1e8643.target.terminate();1822_0x452592();1823}1824if (2 === _0x1e8643.data.t) {1825let _0x17edbf = _0x1e8643.data.file.split('/'),1826_0x2c1832 = _0x17edbf.pop();1827_0x2c1832.split('.').pop();1828_0x4d7024.FS.createPath('/', _0x17edbf.join('/'), true, true);1829_0x4d7024.FS.createDataFile('/' + _0x17edbf.join('/'), _0x2c1832, _0x1e8643.data.data, true, false);1830_0x468801 += _0x1e8643.data.data.length;1831}1832if (4 === _0x1e8643.data.t && _0x1e8643.data.total > 0) {1833let _0x149f09 = Math.floor(_0x1e8643.data.current / _0x1e8643.data.total * 0x64),1834_0x5e7c8b = _0x1e8643.data.name || '';1835_0x149f09 <= 0x64 && _0x149f09 > 0 && (_0x50119.innerHTML = 'Decompress BIOS ' .concat(_0x5e7c8b, ' ').concat(_0x149f09, '%'));1836}1837}1838}),1839_0x12e229 = _0x3cff36.slice ? _0x3cff36.slice(0, 0xa) : _0x3cff36.subarray(0, 0xa),1840_0x80852b = isCompressed(_0x12e229);1841if (_0x80852b === '7z') {1842extractFile(_0x17edbf).then(function(_0x1b6a80) {1843_0x1b6a80.onmessage = _0x19a43e;1844_0x1b6a80.postMessage(_0x3cff36);1845});1846} else if (_0x80852b === 'rar') {1847extractRar(_0x4ce206).then(function(_0x259be0) {1848_0x259be0.onmessage = _0x19a43e;1849_0x259be0.postMessage(_0x3cff36);1850});1851} else if (_0x80852b === 'zip' && !['arcade', 'mame', 'mame2003', 'fba0.2.97.29'].includes(getSystem(_0x3ea97.system, true))) {1852extractFile(_0x2c1832).then(function(_0x31c70d) {1853_0x31c70d.onmessage = _0x19a43e;1854_0x31c70d.postMessage(_0x3cff36);1855});1856} else {1857_0x468801 += _0x3cff36.length;1858_0x50119.innerHTML = 'BIOS ready';1859_0x4d7024.FS.createDataFile('/', _0x5e7c8b, _0x3cff36, true, false);1860_0x452592();1861}1862},1863_0x10b71a = function() {1864_0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p1)).innerHTML = 'Game Core ready';1865_0x4d7024.Module._supports_states && (_0x378b5c.statesSupported = _0x4d7024.Module.cwrap('supports_states', 'number', []));1866if (_0x378b5c.statesSupported) {1867try {1868_this.statesSupported = !!_0x378b5c.statesSupported();1869_0x1e2c68.element(_this.elements.buttons.netplay) && _0x132da7(_this.elements.buttons.netplay, !_0x7f9f36.supportNetPlay.call(_this));1870_0x1e2c68.element(_this.elements.buttons.saveState) && _0x132da7(_this.elements.buttons.saveState, !_this.statesSupported);1871_0x1e2c68.element(_this.elements.buttons.loadState) && _0x132da7(_this.elements.buttons.loadState, !_this.statesSupported);1872_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(2), !_this.statesSupported);1873_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(3), !_this.statesSupported);1874}catch(e){}1875}1876let _0x17edbf = _this.config.biosUrl;1877_0xdcec2a.bindFunction.call(_this);1878_0xdcec2a.setGamepadDialog.call(_this);1879_0xdcec2a.setMessageDialog.call(_this);1880_0xdcec2a.setCacheDialog.call(_this);1881_0xdcec2a.setLoadingDialog.call(_this);1882_0xdcec2a.setNetplayDialog.call(_this);1883_0xdcec2a.setCheatDialog.call(_this);1884_0xdcec2a.initGamepad.call(_this);1885_0xdcec2a.initKeyboard.call(_this);1886_0xdcec2a.listeners.call(_this);1887_0x4d7024._FS.createFolder('/', 'etc', true, true);1888_0x4d7024.FS.mkdir('/data');1889_0x4d7024.FS.mkdir('/data/saves');1890'undefined' != typeof IDBFS ? _0x4d7024.FS.mount(IDBFS, {}, '/data/saves') : _0x4d7024.FS.mount(_0x4d7024.FS.filesystems.IDBFS, {}, '/data/saves');1891_0x4d7024.FS.mkdir('/shader');1892_0x4d7024.FS.syncfs(true, function(_0x1a8f12) {});1893_0xdcec2a.initShaders();1894let _0x14d39f = '';1895_0x14d39f += 'savefile_directory = /data/saves\n';1896_0x14d39f += 'video_vsync = true\n';1897_0x14d39f += 'screenshot_directory = /\n';1898_0x14d39f += 'video_shader = /shader/shader.glslp\n';1899_0x14d39f += 'video_shader_enable = true\n';1900_0x14d39f += 'video_font_enable = false\n';1901_0x14d39f += 'video_scale = 1.0\n';1902_0x14d39f += 'video_gpu_screenshot = false\n';1903_0x14d39f += 'audio_latency = 96\n';1904const system = getSystem(_this.system, true);1905let _0x36edb7 = _0x2593da.defaultCoreOptionsValues.call(_this);1906_this.lightgun && ('nes' === system && (_0x14d39f += 'input_libretro_device_p2 = "258"\n'), 'segaMS' !== system && 'segaMD' !== system && 'segaCD' !== system || (_0x36edb7.genesis_plus_gx_gun_cursor = 'yes', _0x36edb7.genesis_plus_gx_invert_mouse = 'yes', _0x36edb7.genesis_plus_gx_bram = 'per game', _0x14d39f += 'input_libretro_device_p2 = "260"\n'), 'snes' === system && (_0x14d39f += 'input_libretro_device_p2 = "260"\n'), ['snes2002', 'snes2005', 'snes2010', 'snesnext'].includes(system) && (_0x14d39f += 'input_libretro_device_p2 = "260"\n'));1907_this.mouse && ('snes' === system && (_0x14d39f += 'input_libretro_device_p1 = 2\n'), ['snes2002', 'snes2005', 'snes2010', 'snesnext'].includes(system) && (_0x14d39f += 'input_libretro_device_p1 = 2\n'));1908_this.multitap && (['snes2002', 'snes2005', 'snes2010', 'snesnext', 'snes'].includes(system) && (_0x14d39f += 'input_libretro_device_p2 = 257\n'));1909'n64' === system && (_0x14d39f += 'input_libretro_device_p1 = 5\n');1910_0x14d39f += 'fastforward_ratio = 1.0\n';1911_0x14d39f += 'video_smooth = false\n';1912let _0x55117c = _0x5dc0c0(_0x36edb7, _0x2593da.storage.get('core-options') || {}),1913_0x32dd27 = '';1914if (_this.coreVer === 2) {1915_0x4d7024.FS.createDataFile('/etc', 'retroarch.cfg', _0x14d39f, true, true);1916_0x4d7024._FS.createFolder('/home/web_user', 'retroarch', true, true);1917_0x4d7024._FS.createFolder('/home/web_user/retroarch', 'userdata', true, true);1918_0x4d7024.FS.createDataFile('/home/web_user/retroarch/userdata', 'retroarch.cfg', _0x32dd27, true, true);1919} else {1920_0x4d7024.FS.createDataFile('/etc', 'retroarch.cfg', _0x14d39f, true, true);1921_0x4d7024._FS.createFolder('/home/web_user', '.config', true, true);1922_0x4d7024._FS.createFolder('/home/web_user/.config', 'retroarch', true, true);1923_0x4d7024.FS.createDataFile('/home/web_user/.config/retroarch', 'retroarch-core-options.cfg', _0x32dd27, true, true);1924}1925if (_0x55117c && Object.keys(_0x55117c).forEach(function(_0x2950d3) {1926if (_this.lightgun && 'nes' === getSystem(_this.system, true) && 'system_type' === _0x2950d3) return false;1927_0x32dd27 += '' .concat(_0x2950d3, ' = "').concat(_0x55117c[_0x2950d3], '"\n'), _0x1093f4.call(_this, _this.elements.container, 'start-game', function(_0x362c5c) {1928_0xdcec2a.setVariable(_0x2950d3, _0x55117c[_0x2950d3]);1929});1930}), _0x17edbf) {1931let _0x12e137 = _0x17edbf.split('/'),1932_0x103241 = _0x12e137[_0x12e137.length - 1];1933_0x103241.indexOf('?') > -0x1 && (_0x103241 = _0x103241.substr(0, _0x103241.indexOf('?')));1934_0x103241.split('.').pop();1935let _0x1f8424 = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p2));1936_0x550f17.a.head(_0x17edbf, {}).then(function(_0x4bd3bd) {1937let _0x8e30bf = _0x4bd3bd.headers['content-length'],1938_0x14309b = _0x4bd3bd.headers['content-type'],1939_0x51bfef = (_0x4bd3bd.headers['last-modified'], _this.system),1940_0x574747 = function() {1941_0x550f17.a.get(_0x17edbf, {1942'onDownloadProgress': function(e) {1943let progress = e.total ? ' '+Math.floor(e.loaded / e.total * 100).toString()+'%' : ' '+(e.loaded/1048576).toFixed(2)+'MB';1944_0x1f8424.innerHTML = _this.localization('Download BIOS')+progress;1945},1946'responseType': 'arraybuffer'1947}).then(function(_0x4b0c1d) {1948let _0x17edbf = new Uint8Array(_0x4b0c1d.data);1949_0xa884ea.db && _0xa884ea.put(_0x1143c5, {1950'filename': _0x103241,1951'filesize': _0x17edbf.length,1952'filetype': _0x14309b,1953'data': _0x17edbf1954}), _0x57d85d(_0x103241, _0x17edbf);1955}).catch(function(_0x58e374) {1956renderErrorPage(_0x58e374, _0x1f8424, _this);1957});1958};1959_0xa884ea.db ? _0xa884ea.get(_0x51bfef, function(_0x5cac21) {1960_0x5cac21 && _0x5cac21.filename === _0x103241 && _0x5cac21.filesize - _0x8e30bf == 0 && _0x5cac21.filetype === _0x14309b ? _0x57d85d(_0x5cac21.filename, _0x5cac21.data) : _0x574747();1961}) : _0x574747();1962}).catch(function(_0x4f39c1) {1963renderErrorPage(_0x4f39c1, _0x1f8424, _this);1964});1965} else _0x452592();1966},1967_0x29b999 = function(_0x172278) {1968let _0x17edbf;1969_0x17edbf = _0x172278.byteLength ? new Uint8Array(_0x172278) : _0x172278, 'undefined' != typeof GLOBAL_BASE ? _0x4d7024.Module.HEAPU8.set(_0x17edbf, GLOBAL_BASE) : 'undefined' != typeof Runtime && Runtime.GLOBAL_BASE ? _0x4d7024.Module.HEAPU8.set(_0x17edbf, Runtime.GLOBAL_BASE) : _0x4d7024.Module.HEAPU8.set(_0x17edbf, 0x8);1970},1971_0x4f0fcc = function(_0x18cb26) {1972let _0x2c1832 = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p1)),1973_0x247459 = '',1974_0x54d695 = function() {1975null !== _0x4d7024.wasmData ? (window.Module.wasmBinary = _0x4d7024.wasmData, _0x4bd781(), window.Module.monitorRunDependencies = function(_0x59580a) {19760 === _0x59580a && _0x10b71a();1977}, window.Module.onRuntimeInitialized = function() {}) : (_0x4bd781(), window.Module.monitorRunDependencies = function(_0x55a24a) {1978console.log('monitorRunDependencies, ', _0x55a24a);1979}, window.Module.onRuntimeInitialized = function() {1980_0x4d7024.Module || (_0x4d7024.Module = window.Module), _0x4d7024.Module && _0x4d7024.Module.FS ? _0x4d7024.FS = _0x4d7024.Module.FS : _0x4d7024.FS = window.FS, console.log('onRuntimeInitialized'), _0x10b71a();1981});1982let _0x18cb26 = window.Module;1983if (null !== _0x4d7024.wasmData && (_0x18cb26.wasmBinary = _0x4d7024.wasmData), _0x59aa33.isIos && null !== _0x4d7024.wasmData) {1984let _0x17edbf = new Blob([_0x247459], {1985'type': 'text/javascript'1986}),1987_0x2c1832 = _0x428003('script', {1988'src': _0x18a437.createObjectURL(_0x17edbf)1989});1990document.body.appendChild(_0x2c1832), _0x2c1832.onload = function() {1991void 0 === window.addRunDependency && 'undefined' != typeof EmulatorJS && (_0x4d7024.Module = EmulatorJS(_0x18cb26), EmulatorJS = undefined);1992null !== _0x4d7024.memData && (_0xc6823.coreVer !== 2) && _0x29b999(_0x4d7024.memData);1993_0x4d7024.Module || (_0x4d7024.Module = window.Module);1994_0x4d7024.Module && _0x4d7024.Module.FS ? _0x4d7024.FS = _0x4d7024.Module.FS : _0x4d7024.FS = window.FS;1995};1996} else {1997_0x247459 = function(_0x3df03e) {1998let _0x17edbf = [];1999for (let _0x2c1832 = 0; _0x2c1832 < _0x3df03e.length; _0x2c1832 += 1) {2000let _0xcf0289 = _0x3df03e[_0x2c1832];2001_0xcf0289 > 0xff && (_0xcf0289 &= 0xff), _0x17edbf.push(String.fromCharCode(_0xcf0289));2002}2003return _0x17edbf.join('');2004}(_0x247459);2005window.eval(_0x247459);2006void 0 === window.addRunDependency && 'undefined' != typeof EmulatorJS && (_0x4d7024.Module = EmulatorJS(_0x18cb26), EmulatorJS = undefined);2007null !== _0x4d7024.memData && (_0xc6823.coreVer !== 2) && _0x29b999(_0x4d7024.memData);2008_0x4d7024.Module || (_0x4d7024.Module = window.Module);2009_0x4d7024.Module && _0x4d7024.Module.FS ? _0x4d7024.FS = _0x4d7024.Module.FS : _0x4d7024.FS = window.FS;2010window.EJS_MODULE = _0x4d7024.Module;2011window.ejs_loader = _0x4d7024;2012window.ejs_media = _0xdcec2a;2013}2014_0x247459 = null;2015};2016_0x1093f4.call(_0xc6823, _0xc6823.elements.container, 'script-loaded', function(_0x467eee) {2017_0x54d695();2018});2019let _0x21d6a1 = function(_0x3f49ec) {2020if (_0x3f49ec.data) {2021if (0x1 === _0x3f49ec.data.t && (_0xbae705.call(_0xc6823, _0xc6823.elements.container, 'script-loaded'), _0x3f49ec.target.terminate()), 2 === _0x3f49ec.data.t) {2022let _0x17edbf = _0x3f49ec.data.file.split('/').pop(),2023_0x58b5a7 = _0x17edbf.split('.').pop();2024_0x4d7024.coreFileData[_0x17edbf] = _0x3f49ec.data.data, 'js' !== _0x58b5a7 || _0x17edbf.includes('.worker.js') || (_0x247459 = _0x3f49ec.data.data), 'mem' === _0x58b5a7 && (_0x4d7024.memData = _0x3f49ec.data.data), 'wasm' === _0x58b5a7 && (_0x4d7024.wasmData = _0x3f49ec.data.data);2025}20264 === _0x3f49ec.data.t && _0x3f49ec.data.total > 0 && (_0x2c1832.innerHTML = _this.localization('Decompress Game Core')+' ' .concat(Math.floor(_0x3f49ec.data.current / _0x3f49ec.data.total * 0x64), '%'));2027}2028};2029extractFile(_0x17edbf).then(function(_0x48c633) {2030_0x48c633.onmessage = _0x21d6a1;2031_0x48c633.postMessage(_0x18cb26);2032});2033},2034_0x26d6a1 = function(_0x3787ba) {2035_0x132da7(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['start-game'])), true);2036let status = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p1));2037status.innerHTML = _this.localization('Loading')+'...';20382039if (!(true === _0x528f2b && true === _0x547484 && true === _0x5e24fa)) {2040setTimeout(_0x26d6a1, 50);2041return;2042}2043window.Module = {2044'TOTAL_MEMORY': 0x10000000,2045'noInitialRun': true,2046'arguments': [],2047'preRun': [],2048'postRun': [],2049'canvas': _0xb2be2a,2050'print': function(msg) {2051if (window.EJS_DEBUG_XX === true) {2052console.log(msg);2053}2054},2055'printErr': function(msg) {2056if (window.EJS_DEBUG_XX === true) {2057console.log(msg);2058}2059},2060'totalDependencies': 0,2061'monitorRunDependencies': function(_0x5d4b07) {},2062'locateFile': function(_0x3fe7ca) {2063let _0x3787ba = null;2064if (_0x3fe7ca.includes('.worker.js')) {2065Object.keys(_0x4d7024.coreFileData).includes(_0x3fe7ca) && (_0x3787ba = _0x4d7024.coreFileData[_0x3fe7ca]);2066let _0x2c1832 = new Blob([''], {2067'type': 'application/javascript'2068});2069return window.URL.createObjectURL(_0x2c1832);2070}2071if (_0x3fe7ca.includes('.js.mem') && Object.keys(_0x4d7024.coreFileData).includes(_0x3fe7ca)) {2072_0x3787ba = _0x4d7024.coreFileData[_0x3fe7ca];2073return URL.createObjectURL(new Blob([_0x3787ba.buffer]));2074}2075return null;2076},2077'readAsync': function(_0x20d016, _0x9d2de4, _0x1425ee) {2078if (_0x20d016 instanceof ArrayBuffer) setTimeout(function() {2079_0x9d2de4(_0x20d016);2080}, 500);2081else {2082let _0x164012 = new XMLHttpRequest();2083_0x164012.open('GET', _0x20d016, true);2084_0x164012.responseType = 'arraybuffer';2085_0x164012.onload = function() {2086if (200 == _0x164012.status || 0 == _0x164012.status && _0x164012.response) {2087_0x9d2de4(_0x164012.response);2088} else {2089_0x1425ee();2090}2091};2092_0x164012.onerror = _0x1425ee;2093_0x164012.send();2094}2095}2096};2097let _0x3641d6 = function(_0x16049b, _0x55a075) {2098let path = (_this.customPaths && typeof _this.customPaths[_0x16049b] == 'string') ? _this.customPaths[_0x16049b] : ((_this.coreVer === 2) ? (_this.dataPath+'cores/'+_0x16049b+'?v='+_0x55a075) : (_this.dataPath+'old/'+_0x16049b+'?v='+_0x55a075));2099_0x550f17.a.get(path, {2100'onDownloadProgress': function(e) {2101let progress = e.total ? ' '+Math.floor(e.loaded / e.total * 100).toString()+'%' : ' '+(e.loaded/1048576).toFixed(2)+'MB';2102status.innerHTML = _this.localization('Download Game Core')+progress;2103},2104'responseType': 'arraybuffer'2105}).then(function(e) {2106let data = new Uint8Array(e.data);2107_0x24de8d.db && _0x24de8d.put(_0x16049b, {2108'version': _0x55a075,2109'data': data2110});2111if (_this.coreVer === 2) {2112_0x4f0fcc(data);2113} else {2114let data1 = data.slice ? data.slice(12) : data.subarray(12);2115data1.set([55, 122, 188, 175, 39, 28, 0, 3], 0);2116data = null;2117_0x4f0fcc(data1);2118}21192120}).catch(function(e) {2121renderErrorPage(e, status, _this);2122});2123};2124let vJson = (_this.customPaths && typeof _this.customPaths['v.json'] == 'string') ? _this.customPaths['v.json'] : (_this.dataPath + 'v.json');2125_0x550f17.a.get(vJson, {}).then(function(e) {2126let _0x2458d5,2127_0x5d075f = _0x29078e,2128_0x28ee7f = e.data;21292130let status = _0x4d7024.loading.querySelector('.' .concat(_0x4fce24.p1));2131if (!(_this.config.oldCores === true && _0x28ee7f.oldCores[_this.system]) && _0x28ee7f.newCores[getSystem(_this.system)] && (_0x2d904a.wasm || Boolean(_0x28ee7f.newCores[getSystem(_this.system)].asmjs)) && !_0x59aa33.isIos) {2132_this.coreVer = 2;2133delete Module.readAsync;2134Module.INITIAL_MEMORY = Module.TOTAL_MEMORY;2135delete Module.TOTAL_MEMORY;2136_this.elements.settings.panels.home.querySelector('[role="menu"]').innerHTML = "";2137_0x7f9f36.setNormalOptionsMenu.call(_this);2138_0x7f9f36.setCoreOptionsMenu.call(_this);2139_0x28ee7f = _0x28ee7f.newCores[getSystem(_this.system)];2140_0x5d075f = getSystem(_this.system);2141} else {2142_0x28ee7f = _0x28ee7f.oldCores[_this.system];2143_0x5d075f = _0x5d075f.oldCores[_this.system];2144}2145if (!_0x28ee7f) {2146status.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_this.localization('Invalid System')+'</strong>';2147return;2148}21492150let _0x124167 = _0x28ee7f.version ? _0x28ee7f.version : 1,2151_0x254bc2 = Boolean(_0x28ee7f.netplay),2152_0x5b1dcd = Boolean(_0x28ee7f.state),2153_0x9a1f1 = Boolean(_0x28ee7f.asmjs),2154_0x3e4345 = Boolean(_0x28ee7f.wasm);21552156if ('nds' === _this.system && !_0x2d904a.wasm && _this.coreVer !== 2) {2157_0x5b1dcd = false;2158};2159if (_this.statesSupported === false) {2160_0x5b1dcd = false;2161};2162_0x4d7024.coreFileVersion = _0x124167;2163_0x4d7024.coreFileName = _0x5d075f;2164let _0x2eb141 = false;2165['webgl2', 'experimental-webgl2'].includes(_0x2d904a.webgl.WEBGL_CONTEXT) && (_0x2eb141 = true);2166'undefined' != typeof EJS_N64_LEGACY && 1 == EJS_N64_LEGACY && (_0x2eb141 = false);2167if ('mame' == _this.system) {2168let data = _this.mameCore;2169if (! data || data === null || data.split('|').length !== 2) {2170status.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_this.localization('Missing mame config')+'</strong>';2171return;2172}2173let _0x3787ba = data.split('|');2174_0x4d7024.coreFileName = ''.concat(_this.system, '-').concat(_0x3787ba[0]);2175_0x5b1dcd = '1' === _0x3787ba[1];2176_0x1e2c68.element(_this.elements.buttons.saveState) && _0x132da7(_this.elements.buttons.saveState, !_0x5b1dcd);2177_0x1e2c68.element(_this.elements.buttons.loadState) && _0x132da7(_this.elements.buttons.loadState, !_0x5b1dcd);2178_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(2), !_0x5b1dcd);2179_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(3), !_0x5b1dcd);2180if (_this.coreVer === 2) {2181_0x2458d5 = '';2182} else {2183_0x2458d5 = _this.system.concat('-old-').concat(_0x3787ba[0], '-wasm.data');2184}2185_0x3787ba[0] ? (_0x2d904a.wasm && _0x3e4345 ? (_0x31a5b3 = true) : (status.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_this.localization('Webassembly support is not detected in this browser')+'</strong>', _0x2458d5 = ''), _0x2458d5 && (_0x24de8d.db ? _0x24de8d.get(_0x2458d5, function(_0x655c87) {2186if (_0x655c87 && _0x655c87.version === _0x124167) {2187if (_0xc6823.coreVer === 2) {2188_0x4f0fcc(_0x655c87.data);2189} else {2190let _0x3787ba = _0x655c87.data.slice ? _0x655c87.data.slice(0xc) : _0x655c87.data.subarray(0xc);2191_0x3787ba.set([55, 122, 188, 175, 39, 28, 0, 3], 0);2192_0x4f0fcc(_0x3787ba);2193}2194} else _0x3641d6(_0x2458d5, _0x124167);2195}) : _0x3641d6(_0x2458d5, _0x124167))) : status.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_this.localization('Unsupported Game')+'</strong>';2196} else {2197_0x2458d5 = false;2198let type;2199if (_0x2d904a.wasm && _0x3e4345) {2200type = 'wasm';2201_0x2458d5 = true;2202if ('n64' === _this.system && !_0x2eb141 && _this.coreVer !== 2) {2203type = 'legacy-wasm';2204}2205_0x31a5b3 = true;2206} else if (_0x9a1f1) {2207_0x2458d5 = true;2208type = 'asmjs';2209if ('n64' === _this.system && !_0x2eb141 && _this.coreVer !== 2) {2210type = 'legacy-asmjs';2211}2212}2213if (_0x2458d5 !== true) {2214status.innerHTML = '<strong style="color:#f00;text-shadow: 0px 0px 3px;">'+_this.localization('Please upgrade your browser to the latest version')+'</strong>';2215return;2216}2217if (_this.coreVer === 2) {2218_0x2458d5 = _0x5d075f + '-' + type + '.data';2219} else {2220_0x2458d5 = _0x5d075f + '-old-' + type + '.data';2221}2222'undefined' != typeof EJS_CUSTOM_COREFILE && (_0x2458d5 = EJS_CUSTOM_COREFILE);2223_0x24de8d.db ? _0x24de8d.get(_0x2458d5, function(_0x47a6fd) {2224if (_0x47a6fd && _0x47a6fd.version === _0x124167 && !('undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX)) {2225if (_0xc6823.coreVer === 2) {2226_0x4f0fcc(_0x47a6fd.data);2227} else {2228let _0x3787ba = _0x47a6fd.data.slice ? _0x47a6fd.data.slice(12) : _0x47a6fd.data.subarray(12);2229_0x3787ba.set([55, 122, 188, 175, 39, 28, 0, 3], 0);2230_0x4f0fcc(_0x3787ba);2231}2232} else _0x3641d6(_0x2458d5, _0x124167);2233}) : _0x3641d6(_0x2458d5, _0x124167);2234}2235_0x254bc2 || _0x1e2c68.element(_this.elements.buttons.netplay) && _0x132da7(_this.elements.buttons.netplay, true);2236_0x1e2c68.element(_this.elements.buttons.saveState) && _0x132da7(_this.elements.buttons.saveState, !_0x5b1dcd);2237_0x1e2c68.element(_this.elements.buttons.loadState) && _0x132da7(_this.elements.buttons.loadState, !_0x5b1dcd);2238_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(2), !_0x5b1dcd);2239_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(3), !_0x5b1dcd);2240_this.statesSupported = _0x5b1dcd;2241if (window.innerWidth < 400) {2242_0x1e2c68.element(_this.elements.inputs.volume) && _0x132da7(_this.elements.inputs.volume, true);2243_0x1e2c68.element(_this.elements.buttons.mute) && _0x132da7(_this.elements.buttons.mute, true);2244_0x1e2c68.element(_this.elements.buttons.cheat) && _0x132da7(_this.elements.buttons.cheat, true);2245}22462247if (_this.config.buttons) {2248if (_this.config.buttons.playPause === false) {2249_0x1e2c68.element(_this.elements.buttons.play[0]) && _0x132da7(_this.elements.buttons.play[0], true);2250}2251if (_this.config.buttons.restart === false) {2252_0x1e2c68.element(_this.elements.buttons.restart) && _0x132da7(_this.elements.buttons.restart, true);2253}2254if (_this.config.buttons.mute === false) {2255_0x1e2c68.element(_this.elements.buttons.mute) && _0x132da7(_this.elements.buttons.mute, true);2256}2257if (_this.config.buttons.settings === false) {2258_0x1e2c68.element(_this.elements.buttons.settings) && _0x132da7(_this.elements.buttons.settings, true);2259}2260if (_this.config.buttons.fullscreen === false) {2261_0x1e2c68.element(_this.elements.buttons.fullscreen) && _0x132da7(_this.elements.buttons.fullscreen, true);2262}2263if (_this.config.buttons.saveState === false) {2264_0x1e2c68.element(_this.elements.buttons.saveState) && _0x132da7(_this.elements.buttons.saveState, true);2265}2266if (_this.config.buttons.loadState === false) {2267_0x1e2c68.element(_this.elements.buttons.loadState) && _0x132da7(_this.elements.buttons.loadState, true);2268}2269if (_this.config.buttons.screenRecord === false) {2270_0x1e2c68.element(_this.elements.buttons.screenRecord) && _0x132da7(_this.elements.buttons.screenRecord, true);2271}2272if (_this.config.buttons.cacheManager === false) {2273_0x1e2c68.element(_this.elements.buttons.cacheManager) && _0x132da7(_this.elements.buttons.cacheManager, true);2274}2275if (_this.config.buttons.gamepad === false) {2276_0x1e2c68.element(_this.elements.buttons.gamepad) && _0x132da7(_this.elements.buttons.gamepad, true);2277}2278if (_this.config.buttons.cheat === false) {2279_0x1e2c68.element(_this.elements.buttons.cheat) && _0x132da7(_this.elements.buttons.cheat, true);2280}2281if (_this.config.buttons.volume === false) {2282_0x1e2c68.element(_this.elements.inputs.volume) && _0x132da7(_this.elements.inputs.volume, true);2283}2284if (_this.config.buttons.screenshot === false) {2285_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0), true);2286}2287if (_this.config.buttons.quickSave === false) {2288_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(2), true);2289}2290if (_this.config.buttons.quickLoad === false) {2291_0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(3), true);2292}2293}2294}).catch(function(e) {2295renderErrorPage(e, _0x3787ba, _0xc6823);2296});2297_0x4d7024.romdb = _0x4e171c;2298return false;2299};2300_0x455c85(_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['start-game'])), 'click touchstart', _0x26d6a1);2301if (_0xc6823.startOnLoad === true) {2302_0x4d7024.loading.querySelector('.' .concat(_0x4fce24['start-game'])).click();2303}2304}2305}2306let _0x27f4c4 = _0x4d7024;2307const _0x4a2390 = _0x2c1832(0xa1);23082309function _0x3c0613(_0x3eef01) {2310return function(_0x3d9b1e) {2311if (Array.isArray(_0x3d9b1e)) {2312for (let _0x17edbf = 0, _0x2c1832 = new Array(_0x3d9b1e.length); _0x17edbf < _0x3d9b1e.length; _0x17edbf++) _0x2c1832[_0x17edbf] = _0x3d9b1e[_0x17edbf];2313return _0x2c1832;2314}2315}(_0x3eef01) || function(_0x425c1a) {2316if (Symbol.iterator in Object(_0x425c1a) || '[object Arguments]' === Object.prototype.toString.call(_0x425c1a)) return Array.from(_0x425c1a);2317}(_0x3eef01) || function() {2318throw new TypeError('Invalid attempt to spread non-iterable instance');2319}();2320}23212322function _0xa08ac0(_0x514af5, _0x4089be) {2323for (let _0x2c1832 = 0; _0x2c1832 < _0x4089be.length; _0x2c1832++) {2324let _0x3347c8 = _0x4089be[_0x2c1832];2325_0x3347c8.enumerable = _0x3347c8.enumerable || false, _0x3347c8.configurable = true, 'value' in _0x3347c8 && (_0x3347c8.writable = true), Object.defineProperty(_0x514af5, _0x3347c8.key, _0x3347c8);2326}2327}2328let _0x1eda08, _0x4fc27f, _0xf43a92, _0x214f42, _0x3a9bfc, _0x4d8495 = (_0x1eda08 = ['a[href]', 'area[href]', 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^="-"])'], _0x4fc27f = function() {2329function _0x5566a2(_0x1fcb21) {2330let _0x2c1832 = _0x1fcb21.targetModal,2331_0x29e6ab = _0x1fcb21.triggers,2332_0x114128 = void 0 === _0x29e6ab ? [] : _0x29e6ab,2333_0x5211ae = _0x1fcb21.onShow,2334_0x402faa = void 0 === _0x5211ae ? function() {} : _0x5211ae,2335_0x120cc3 = _0x1fcb21.onClose,2336_0x48ad1c = void 0 === _0x120cc3 ? function() {} : _0x120cc3,2337_0x6a1522 = _0x1fcb21.openTrigger,2338_0x306932 = void 0 === _0x6a1522 ? 'data-micromodal-trigger' : _0x6a1522,2339_0x446302 = _0x1fcb21.closeTrigger,2340_0x2f0676 = void 0 === _0x446302 ? 'data-micromodal-close' : _0x446302,2341_0x2a4c0e = _0x1fcb21.disableScroll,2342_0x2297fa = void 0 !== _0x2a4c0e && _0x2a4c0e,2343_0x5a3f47 = _0x1fcb21.disableFocus,2344_0x4a8131 = void 0 !== _0x5a3f47 && _0x5a3f47,2345_0x42179f = _0x1fcb21.awaitCloseAnimation,2346_0x27da4d = void 0 !== _0x42179f && _0x42179f,2347_0x1b535e = _0x1fcb21.debugMode,2348_0x33d8ca = void 0 !== _0x1b535e && _0x1b535e,2349_0xee6cb0 = _0x1fcb21.closeByEsckey,2350_0x54de6a = void 0 === _0xee6cb0 || _0xee6cb0;2351! function(_0x27e736, _0x56010c) {2352if (!(_0x27e736 instanceof _0x56010c)) throw new TypeError('Cannot call a class as a function');2353}(this, _0x5566a2), this.modal = document.getElementById(_0x2c1832), this.config = {2354'debugMode': _0x33d8ca,2355'disableScroll': _0x2297fa,2356'openTrigger': _0x306932,2357'closeTrigger': _0x2f0676,2358'onShow': _0x402faa,2359'onClose': _0x48ad1c,2360'awaitCloseAnimation': _0x27da4d,2361'disableFocus': _0x4a8131,2362'closeByEsckey': _0x54de6a2363}, _0x114128.length > 0 && this.registerTriggers.apply(this, _0x3c0613(_0x114128)), this.onClick = this.onClick.bind(this), this.onKeydown = this.onKeydown.bind(this);2364}2365let _0x17edbf, _0x2c1832, _0x5021cc;2366return _0x17edbf = _0x5566a2, (_0x2c1832 = [{2367'key': 'registerTriggers',2368'value': function() {2369for (let _0x5566a2 = this, _0x17edbf = arguments.length, _0x2c1832 = new Array(_0x17edbf), _0x4e24fa = 0; _0x4e24fa < _0x17edbf; _0x4e24fa++) _0x2c1832[_0x4e24fa] = arguments[_0x4e24fa];2370_0x2c1832.forEach(function(_0x511ded) {2371_0x511ded.addEventListener('click', function() {2372return _0x5566a2.showModal();2373});2374});2375}2376}, {2377'key': 'showModal',2378'value': function() {2379this.activeElement = document.activeElement, this.modal.setAttribute('aria-hidden', 'false'), this.modal.classList.add(getClass({2380'is-open': true2381})), this.setFocusToFirstNode(), this.addEventListeners(), this.config.onShow(this.modal);2382}2383}, {2384'key': 'closeModal',2385'value': function() {2386let _0x5566a2 = this.modal;2387this.modal.setAttribute('aria-hidden', 'true'), this.removeEventListeners(), this.config.onClose(this.modal), this.config.awaitCloseAnimation ? this.modal.addEventListener('animationend', function _0x17edbf() {2388_0x5566a2.classList.remove(getClass({2389'is-open': true2390})), _0x5566a2.removeEventListener('animationend', _0x17edbf, false);2391}, false) : _0x5566a2.classList.remove(getClass({2392'is-open': true2393}));2394}2395}, {2396'key': 'addEventListeners',2397'value': function() {2398this.modal.addEventListener('touchstart', this.onClick), this.modal.addEventListener('click', this.onClick), document.addEventListener('keydown', this.onKeydown);2399}2400}, {2401'key': 'removeEventListeners',2402'value': function() {2403this.modal.removeEventListener('touchstart', this.onClick), this.modal.removeEventListener('click', this.onClick), document.removeEventListener('keydown', this.onKeydown);2404}2405}, {2406'key': 'onClick',2407'value': function(_0x6c9df3) {2408_0x6c9df3.target.hasAttribute(this.config.closeTrigger) && (this.closeModal(), _0x6c9df3.preventDefault());2409}2410}, {2411'key': 'onKeydown',2412'value': function(_0xe2d057) {2413this.config.closeByEsckey && 0x1b === _0xe2d057.keyCode && this.closeModal(_0xe2d057), 0x9 === _0xe2d057.keyCode && this.maintainFocus(_0xe2d057);2414}2415}, {2416'key': 'getFocusableNodes',2417'value': function() {2418let _0x5566a2 = this.modal.querySelectorAll(_0x1eda08);2419return Object.keys(_0x5566a2).map(function(_0x1bd160) {2420return _0x5566a2[_0x1bd160];2421});2422}2423}, {2424'key': 'setFocusToFirstNode',2425'value': function() {2426if (!this.config.disableFocus) {2427let _0x5566a2 = this.getFocusableNodes();2428_0x5566a2.length && _0x5566a2[0].focus();2429}2430}2431}, {2432'key': 'maintainFocus',2433'value': function(_0x15092b) {2434let _0x17edbf = this.getFocusableNodes();2435if (this.modal.contains(document.activeElement)) {2436let _0x2c1832 = _0x17edbf.indexOf(document.activeElement);2437_0x15092b.shiftKey && 0 === _0x2c1832 && (_0x17edbf[_0x17edbf.length - 1].focus(), _0x15092b.preventDefault()), _0x15092b.shiftKey || _0x2c1832 !== _0x17edbf.length - 1 || (_0x17edbf[0].focus(), _0x15092b.preventDefault());2438} else _0x17edbf[0].focus();2439}2440}]) && _0xa08ac0(_0x17edbf.prototype, _0x2c1832), _0x5021cc && _0xa08ac0(_0x17edbf, _0x5021cc), _0x5566a2;2441}(), _0xf43a92 = null, _0x214f42 = function(_0x31caa5) {2442if (!document.getElementById(_0x31caa5)) return false;2443}, _0x3a9bfc = function(_0x48c135, _0x61240d) {2444if (function(_0x28b4fb) {2445_0x28b4fb.length <= 0 && (console.warn('MicroModal v' .concat(version, ': ❗Please specify at least one %c\'micromodal-trigger\''), 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', 'data attribute.'), console.warn('%cExample:', 'background-color: #f8f9fa;color: #50596c;font-weight: bold;', '<a href="#" data-micromodal-trigger="my-modal"></a>'));2446}(_0x48c135), !_0x61240d) return true;2447for (let _0x2c1832 in _0x61240d) _0x214f42(_0x2c1832);2448return true;2449}, {2450'init': function(_0x3f1b32) {2451let _0x17edbf = Object.assign({}, {2452'openTrigger': 'data-micromodal-trigger'2453}, _0x3f1b32),2454_0x2c1832 = _0x3c0613(document.querySelectorAll('[' .concat(_0x17edbf.openTrigger, ']'))),2455_0x537e55 = function(_0x5e363a, _0x9390ce) {2456let _0x2c1832 = [];2457return _0x5e363a.forEach(function(_0x305145) {2458let _0x13d441 = _0x305145.attributes[_0x9390ce].value;2459void 0 === _0x2c1832[_0x13d441] && (_0x2c1832[_0x13d441] = []), _0x2c1832[_0x13d441].push(_0x305145);2460}), _0x2c1832;2461}(_0x2c1832, _0x17edbf.openTrigger);2462if (true !== _0x17edbf.debugMode || false !== _0x3a9bfc(_0x2c1832, _0x537e55))2463for (let _0x383dff in _0x537e55) {2464let _0x34a8e0 = _0x537e55[_0x383dff];2465_0x17edbf.targetModal = _0x383dff, _0x17edbf.triggers = _0x3c0613(_0x34a8e0), new _0x4fc27f(_0x17edbf);2466}2467},2468'show': function(_0x2a3fcf, _0x472cd6) {2469let _0x2c1832 = _0x472cd6 || {};2470return _0x2c1832.targetModal = _0x2a3fcf, true === _0x2c1832.debugMode && false === _0x214f42(_0x2a3fcf) ? _0xf43a92 = null : (_0xf43a92 = new _0x4fc27f(_0x2c1832)).showModal(), _0xf43a92;2471},2472'close': function() {2473_0xf43a92.closeModal();2474}2475});2476const _0x378b5c = {2477'defaultControllers': {24780: {24790: {2480'value': '88'2481},24821: {2483'value': '83'2484},24852: {2486'value': '16'2487},24883: {2489'value': '13'2490},24914: {2492'value': '38'2493},24945: {2495'value': '40'2496},24976: {2498'value': '37'2499},25007: {2501'value': '39'2502},25038: {2504'value': '90'2505},25069: {2507'value': '65'2508},250910: {2510'value': '81'2511},251211: {2513'value': '69'2514},251512: {2516'value': '82'2517},251813: {2519'value': '87'2520},252114: {},252215: {},252316: {2524'value': '72'2525},252617: {2527'value': '70'2528},252918: {2530'value': '71'2531},253219: {2533'value': '84'2534},253520: {'value': '76'},253621: {'value': '74'},253722: {'value': '75'},253823: {'value': '73'},253924: {},254025: {},254126: {}2542},25431: {},25442: {},25453: {}2546},2547'controllers': {},2548'virtualGamepadContainer': null,2549'keyMap': {25508: 'backspace',25519: 'tab',255213: 'enter',255316: 'shift',255417: 'ctrl',255518: 'alt',255619: 'pause/break',255720: 'caps lock',255827: 'escape',255932: 'space',256033: 'page up',256134: 'page down',256235: 'end',256336: 'home',256437: 'left arrow',256538: 'up arrow',256639: 'right arrow',256740: 'down arrow',256845: 'insert',256946: 'delete',257048: '0',257149: '1',257250: '2',257351: '3',257452: '4',257553: '5',257654: '6',257755: '7',257856: '8',257957: '9',258065: 'a',258166: 'b',258267: 'c',258368: 'd',258469: 'e',258570: 'f',258671: 'g',258772: 'h',258873: 'i',258974: 'j',259075: 'k',259176: 'l',259277: 'm',259378: 'n',259479: 'o',259580: 'p',259681: 'q',259782: 'r',259883: 's',259984: 't',260085: 'u',260186: 'v',260287: 'w',260388: 'x',260489: 'y',260590: 'z',260691: 'left window key',260792: 'right window key',260893: 'select key',260996: 'numpad 0',261097: 'numpad 1',261198: 'numpad 2',261299: 'numpad 3',2613100: 'numpad 4',2614101: 'numpad 5',2615102: 'numpad 6',2616103: 'numpad 7',2617104: 'numpad 8',2618105: 'numpad 9',2619106: 'multiply',2620107: 'add',2621109: 'subtract',2622110: 'decimal point',2623111: 'divide',2624112: 'f1',2625113: 'f2',2626114: 'f3',2627115: 'f4',2628116: 'f5',2629117: 'f6',2630118: 'f7',2631119: 'f8',2632120: 'f9',2633121: 'f10',2634122: 'f11',2635123: 'f12',2636144: 'num lock',2637145: 'scroll lock',2638186: 'semi-colon',2639187: 'equal sign',2640188: 'comma',2641189: 'dash',2642190: 'period',2643191: 'forward slash',2644192: 'grave accent',2645219: 'open bracket',2646220: 'back slash',2647221: 'close braket',2648222: 'single quote'2649},2650'saveLoaddbDB': function() {2651try {2652return new IDBStore({2653'dbVersion': 1,2654'storePrefix': 'ejs-',2655'storeName': 'states',2656'keyPath': null,2657'autoIncrement': false,2658'onStoreReady': function() {},2659'onError': function() {}2660});2661} catch(e) {2662console.log(e);2663}2664}(),2665'saveLoadDB': function(type) {2666try {2667if (!_0x378b5c.saveLoaddbDB.db) return false;2668if (_0x2593da && typeof _0x2593da.getCoreOptionsValue === 'function') {2669let location = _0x2593da.getCoreOptionsValue('save-state-location');2670if (!location || location === 'download') {2671return false;2672}2673if (!this.getStartName()) return false;2674let slot = _0x2593da.getCoreOptionsValue('save-state-slot');2675if (!slot) return false;2676let game = this.getStartName();2677let key = game + '-' + slot;2678(async function() {2679if (type === 'save') {2680try {2681let data = await _0x378b5c.saveState();2682_0x378b5c.saveLoaddbDB.put(key, data);2683} catch(e) {return false;};2684} else {2685_0x378b5c.saveLoaddbDB.get(key, function(data) {2686EJS_loadState(data);2687});2688}2689})();2690return true;2691} else {2692return false;2693}2694} catch(e) {2695return false;2696}2697},2698'disableInput': false,2699'disableControl': function(control) {2700if (control) {2701for (var _0x17edbf = 0x0; _0x17edbf < 0x18; _0x17edbf += 0x1) _0x378b5c.simulateInputFn(0x0, _0x17edbf, 0x0), _0x378b5c.simulateInputFn(0x1, _0x17edbf, 0x0), _0x378b5c.simulateInputFn(0x2, _0x17edbf, 0x0), _0x378b5c.simulateInputFn(0x3, _0x17edbf, 0x0);2702_0x378b5c.disableInput = true;2703} else _0x378b5c.disableInput = false;2704},2705'loadRoomsListTimer': null,2706'loadRoomsList': function() {},2707'stopLoadRooms': function() {2708_0x378b5c.loadRoomsListTimer && clearTimeout(_0x378b5c.loadRoomsListTimer);2709},2710'openRoom': function() {},2711'gamepad': null,2712'allowCheat': true,2713'connection': null,2714'connected': false,2715'playerName': '',2716'players': [],2717'waitingList': {},2718'roomMaster': null,2719'inputsData': {},2720'coreOptionData': {},2721'currentFrame': 0,2722'wait': false,2723'progressHelper': {},2724'icons': {2725'lock': '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="lock" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-lock fa-w-14 fa-3x"><path fill="currentColor" d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" class=""></path></svg>'2726},2727'isPaused': null,2728'setVolume': null,2729'setVariable': null,2730'simulateInput': null,2731'simulateInputFn': null,2732'toggleShader': null,2733'saveState': null,2734'screenRecord': null,2735'cacheManager': null,2736'loadState': null,2737'quickSaveState': null,2738'quickLoadState': null,2739'changeStateSlot': null,2740'getScreenData': null,2741'getStateInfo': null,2742'setCheat': null,2743'resetCheat': null,2744'getGameCoreOptions': null,2745'classNames': {2746'dialog-container': getClass({2747'dialog-container': true2748}),2749'tabs': getClass({2750'tabs': true2751}),2752'dialog-title': getClass({2753'dialog-title': true2754}),2755'dialog-content': getClass({2756'dialog-content': true2757}),2758'dialog-buttons': getClass({2759'dialog-buttons': true2760}),2761'overlay': getClass({2762'overlay': true2763}),2764'key-setting-popup': getClass({2765'key-setting-popup': true2766}),2767'tabs-panel': getClass({2768'tabs-panel': true2769}),2770'tabs-content': getClass({2771'tabs-content': true2772}),2773'button-container': getClass({2774'button-container': true2775}),2776'set': getClass({2777'set': true2778}),2779'active': getClass({2780'active': true2781}),2782'btn-cancel': getClass({2783'btn-cancel': true2784}),2785'btn-reset': getClass({2786'btn-reset': true2787}),2788'btn-clear': getClass({2789'btn-clear': true2790}),2791'btn-create': getClass({2792'btn-create': true2793}),2794'btn-submit': getClass({2795'btn-submit': true2796}),2797'btn-join-room': getClass({2798'btn-join-room': true2799}),2800'btn-quit': getClass({2801'btn-quit': true2802}),2803'btn-create-room': getClass({2804'btn-create-room': true2805}),2806'netplay-player-name': getClass({2807'netplay-player-name': true2808}),2809'netplay-roomlist': getClass({2810'netplay-roomlist': true2811}),2812'netplay-room-name-input': getClass({2813'netplay-room-name-input': true2814}),2815'netplay-room-password-input': getClass({2816'netplay-room-password-input': true2817}),2818'netplay-create-room-set': getClass({2819'netplay-create-room-set': true2820}),2821'netplay-room': getClass({2822'netplay-room': true2823}),2824'modal': getClass({2825'modal': true2826}),2827'modal__overlay': getClass({2828'modal__overlay': true2829}),2830'modal__container': getClass({2831'modal__container': true2832}),2833'modal__header': getClass({2834'modal__header': true2835}),2836'modal__title': getClass({2837'modal__title': true2838}),2839'modal__close': getClass({2840'modal__close': true2841}),2842'modal__content': getClass({2843'modal__content': true2844}),2845'modal__btn': getClass({2846'modal__btn': true2847}),2848'modal__btn-primary': getClass({2849'modal__btn-primary': true2850}),2851'micromodal-slide': getClass({2852'micromodal-slide': true2853}),2854'modal__errmsg': getClass({2855'modal__errmsg': true2856}),2857'modal__footer': getClass({2858'modal__footer': true2859}),2860'cheats-add': getClass({2861'cheats-add': true2862}),2863'cheats-list': getClass({2864'cheats-list': true2865}),2866'cheat-code-input': getClass({2867'cheat-code-input': true2868}),2869'cheat-name-input': getClass({2870'cheat-name-input': true2871}),2872'ejs-switch': getClass({2873'ejs-switch': true2874}),2875'ejs-delete-cheat': getClass({2876'ejs-delete-cheat': true2877})2878},2879'initShaders': function() {2880const _0xa88a13 = shaders;2881for (let _0x17edbf = Object.keys(_0xa88a13), _0x2c1832 = '', _0x26fb6a = 0; _0x26fb6a < _0x17edbf.length; _0x26fb6a += 1) _0x2c1832 = _0xa88a13[_0x17edbf[_0x26fb6a]], _0x27f4c4.FS.writeFile('/shader/' .concat(_0x17edbf[_0x26fb6a]), _0x2c1832), _0x2593da.storage.get('shader') === _0x17edbf[_0x26fb6a] && _0x27f4c4.FS.writeFile('/shader/shader.glslp', _0x2c1832);2882},2883'setMessageDialog': function() {2884this.elements.dialogs.message.innerHTML = '<div class="' + _0x378b5c.classNames['dialog-container'] + '"><div class="' + _0x378b5c.classNames['dialog-title'] + '"><h2>'+this.localization('Drop to load save state')+'</h2></div></div>';2885},2886'setGamepadDialog': function() {2887let _this = this;2888_this.elements.dialogs.gamepad.innerHTML = '\n <div class="' + _0x378b5c.classNames['dialog-container'] + '">\n <div class="' + _0x378b5c.classNames['dialog-title'] + '">\n <h4>'+_this.localization('Control Settings')+'</h4>\n </div>\n \n <ul class="' + _0x378b5c.classNames.tabs + '" id="controls-tabs">\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-0" aria-selected="false" id="controls-0-label">'+_this.localization('Player 1')+'</a></li>\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-1" aria-selected="false" id="controls-1-label">'+_this.localization('Player 2')+'</a></li>\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-2" aria-selected="false" id="controls-2-label">'+_this.localization('Player 3')+'</a></li>\n <li class="tabs-title" role="presentation"><a href="#" onclick="return false" role="tab" aria-controls="controls-3" aria-selected="false" id="controls-3-label">'+_this.localization('Player 4')+'</a></li>\n </ul>\n <div class="' + _0x378b5c.classNames['dialog-content'] + '">\n <div class="' + _0x378b5c.classNames['tabs-content'] + ' controls">\n \n </div>\n </div>\n <div class="' + _0x378b5c.classNames['dialog-buttons'] + '">\n <a href="#" onclick="return false" class="' + _0x378b5c.classNames['btn-reset'] + '">'+_this.localization('Reset')+'</a>\n <a href="#" onclick="return false" class="' + _0x378b5c.classNames['btn-clear'] + '">'+_this.localization('Clear')+'</a>\n <a href="#" onclick="return false" style="background-color:#929292;" class="' + _0x378b5c.classNames['btn-close'] + '">'+_this.localization('Close')+'</a>\n </div>\n <div class="' + _0x378b5c.classNames.overlay + '" hidden>\n <div class="' + _0x378b5c.classNames['key-setting-popup'] + '">\n <span>[Select]</span><br />\n <div style="color:#fff !important">'+_this.localization('Press keyboard or gamepad')+'</div>\n </div>\n </div>\n </div>\n ';28892890let _0x17edbf = '\n <div class="' .concat(_0x378b5c.classNames['tabs-panel'], '" id="controls-{index}" hidden>\n <div>\n <div style="">\n <div class="gamepad" style="font-size:12px">Connected gamepad: <span class="gamepad-name">n/a</span></div>\n </div>\n <div style="width:25%;float:left"> </div>\n <div style="font-size:12px;width:50%;float:left">\n <div class="row">\n <div style="text-align:center;width:50%;float:left">'+_this.localization('Gamepad')+'</div>\n <div style="text-align:center;width:50%;float:left">'+_this.localization('Keyboard')+'</div>\n </div>\n </div>\n <div style="clear:both"></div>\n </div>\n </div>'),2891_0x2c1832 = '\n <div class="' .concat(_0x378b5c.classNames['button-container'], '" data-id="{id}" data-index="{index}" data-label="{label}" style="margin-bottom:10px">\n <div style="width:25%;float:left;font-size:12px">\n <label>{label}:</label>\n </div>\n <div style="width:50%;float:left">\n <div>\n <div style="width:50%;float:left;padding: 0 5px;">\n <input style="text-align:center;height:25px;width: 100%;" type="text" data-id="{id}" data-value="" data-type="2" data-index="{index}" readonly="" placeholder="">\n </div>\n <div style="width:50%;float:left;padding: 0 5px;">\n <input style="text-align:center;height:25px;width: 100%;" type="text" data-id="{id}" data-value="" data-type="1" data-index="{index}" readonly="" placeholder="">\n </div>\n <div style="clear:both"></div>\n </div>\n </div>\n <div style="width:25%;float:left">\n <a class="').concat(_0x378b5c.classNames.set, '" href="#" onclick="return false">'+_this.localization('Set')+'</a>\n </div>\n <div style="clear:both"></div>\n </div>')2892let _0x48ee51;2893if ('nes' === getSystem(_this.system, true)) {2894_0x48ee51 = {28950: 'B',28962: 'SELECT',28973: 'START',28984: 'UP',28995: 'DOWN',29006: 'LEFT',29017: 'RIGHT',29028: 'A',290324: _this.localization('QUICK SAVE STATE'),290425: _this.localization('QUICK LOAD STATE'),290526: _this.localization('CHANGE STATE SLOT')2906}2907} else if ('snes' === getSystem(_this.system, true)) {2908_0x48ee51 = {29090: 'B',29101: 'Y',29112: 'SELECT',29123: 'START',29134: 'UP',29145: 'DOWN',29156: 'LEFT',29167: 'RIGHT',29178: 'A',29189: 'X',291910: 'L',292011: 'R',292124: _this.localization('QUICK SAVE STATE'),292225: _this.localization('QUICK LOAD STATE'),292326: _this.localization('CHANGE STATE SLOT')2924};2925} else if ('n64' === getSystem(_this.system, true)) {2926_0x48ee51 = {29270: 'B',29283: 'START',29294: 'UP',29305: 'DOWN',29316: 'LEFT',29327: 'RIGHT',29338: 'A',293410: 'L',293511: 'R',293612: 'Z',293719: 'L STICK UP',293818: 'L STICK DOWN',293917: 'L STICK LEFT',294016: 'L STICK RIGHT',294123: 'R STICK UP',294222: 'R STICK DOWN',294321: 'R STICK LEFT',294420: 'R STICK RIGHT',294524: _this.localization('QUICK SAVE STATE'),294625: _this.localization('QUICK LOAD STATE'),294726: _this.localization('CHANGE STATE SLOT')2948};2949// The new nintendo 64 core has new default buttons2950if (_this.coreVer === 2) {2951_0x48ee51[0] = 'A';2952_0x48ee51[1] = 'B';2953delete _0x48ee51[8];2954}2955} else if ('nds' === getSystem(_this.system, true)) {2956_0x48ee51 = {29570: 'B',29581: 'Y',29592: 'SELECT',29603: 'START',29614: 'UP',29625: 'DOWN',29636: 'LEFT',29647: 'RIGHT',29658: 'A',29669: 'X',296710: 'L',296811: 'R',296914: 'Microphone',297024: _this.localization('QUICK SAVE STATE'),297125: _this.localization('QUICK LOAD STATE'),297226: _this.localization('CHANGE STATE SLOT')2973};2974} else {2975_0x48ee51 = {29760: 'B',29771: 'Y',29782: 'SELECT',29793: 'START',29804: 'UP',29815: 'DOWN',29826: 'LEFT',29837: 'RIGHT',29848: 'A',29859: 'X',298610: 'L',298711: 'R',298812: 'L2',298913: 'R2',299014: 'L3',299115: 'R3',299219: 'L STICK UP',299318: 'L STICK DOWN',299417: 'L STICK LEFT',299516: 'L STICK RIGHT',299623: 'R STICK UP',299722: 'R STICK DOWN',299821: 'R STICK LEFT',299920: 'R STICK RIGHT',300024: _this.localization('QUICK SAVE STATE'),300125: _this.localization('QUICK LOAD STATE'),300226: _this.localization('CHANGE STATE SLOT')3003};3004}3005if (['arcade', 'mame'].includes(getSystem(_this.system, true))) {3006_0x48ee51[2] = _this.localization('INSERT COIN');3007}3008if (_this.statesSupported === false) {3009delete _0x48ee51[24];3010delete _0x48ee51[25];3011delete _0x48ee51[26];3012}30133014for (let _0x501790 = [2, 3, 4, 5, 6, 7, 8, 0, 9, 1, 10, 11, 12, 13, 14, 15, 19, 18, 17, 16, 23, 22, 21, 20, 24, 25, 26], _0x50fd12 = function(_0x88827f) {3015_this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames['tabs-content'])).innerHTML += _0x17edbf.replace(/{index}/g, _0x88827f), _0x501790.forEach(function(_0x1bf162) {3016_0x48ee51[_0x1bf162] && (_this.elements.dialogs.gamepad.querySelector('#controls-' .concat(_0x88827f)).innerHTML += _0x2c1832.replace(/{index}/g, _0x88827f).replace(/{id}/g, _0x1bf162).replace(/{label}/g, _0x48ee51[_0x1bf162]));3017}), _this.elements.dialogs.gamepad.querySelector('[data-id="16"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="16"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc'), _this.elements.dialogs.gamepad.querySelector('[data-id="17"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="17"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc'), _this.elements.dialogs.gamepad.querySelector('[data-id="18"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="18"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc'), _this.elements.dialogs.gamepad.querySelector('[data-id="19"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="19"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc'), _this.elements.dialogs.gamepad.querySelector('[data-id="20"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="20"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc'), _this.elements.dialogs.gamepad.querySelector('[data-id="21"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="21"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc'), _this.elements.dialogs.gamepad.querySelector('[data-id="22"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="22"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc'), _this.elements.dialogs.gamepad.querySelector('[data-id="23"][data-index="' .concat(_0x88827f, '"][data-type="2"]')) && (_this.elements.dialogs.gamepad.querySelector('[data-id="23"][data-index="' .concat(_0x88827f, '"][data-type="2"]')).style.backgroundColor = '#ccc');3018}, _0x3f0824 = 0; _0x3f0824 <= 3; _0x3f0824 += 1) _0x50fd12(_0x3f0824);3019Object.keys(_0x378b5c.controllers).forEach(function(_0x23d419) {3020_0x378b5c.controllers[_0x23d419] && Object.keys(_0x378b5c.controllers[_0x23d419]).forEach(function(_0x21e62d) {3021let _0x294e35 = _this.elements.dialogs.gamepad.querySelector('[data-id="' .concat(_0x21e62d, '"][data-index="').concat(_0x23d419, '"][data-type="1"]')),3022_0x1849bc = _this.elements.dialogs.gamepad.querySelector('[data-id="' .concat(_0x21e62d, '"][data-index="').concat(_0x23d419, '"][data-type="2"]'));3023if (!_0x294e35 || !_0x1849bc) return false;3024let _0x19d43b = _0x378b5c.controllers[_0x23d419][_0x21e62d];3025_0x19d43b && (_0x19d43b.type && 1 !== parseInt(_0x19d43b.type, 0xa) ? _0x1849bc.value = '' : _0x19d43b.value && (_0x294e35.value = _0x378b5c.keyMap[_0x19d43b.value] || '', _0x294e35.setAttribute('data-value', _0x19d43b.value)), _0x19d43b.value2 && (_0x1849bc.value = isNaN(_0x19d43b.value2) ? (_0x19d43b.value2) : ('button ' .concat(parseInt(_0x19d43b.value2, 0xa) + 1)), _0x1849bc.setAttribute('data-value', _0x19d43b.value2)));3026});3027}), _0x1093f4.call(this, _this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames['btn-close'])), 'click', function(_0x5f19bd) {3028let _0x2c1832 = _this.elements.dialogs.gamepad.querySelectorAll('input'),3029_0x2844f7 = {};3030return Array.from(_0x2c1832).forEach(function(_0x33c024) {3031let _0x5f19bd, _0x2c1832 = _0x33c024.getAttribute('data-index'),3032_0x124d0a = _0x33c024.getAttribute('data-value');30332 === parseInt(_0x33c024.getAttribute('data-type'), 0xa) && (_0x5f19bd = _0x33c024.getAttribute('data-value'));3034let _0x54b9af = _0x33c024.getAttribute('data-id');3035_0x2844f7[_0x2c1832] || (_0x2844f7[_0x2c1832] = {}), _0x2844f7[_0x2c1832][_0x54b9af] || (_0x2844f7[_0x2c1832][_0x54b9af] = {}), _0x124d0a && (_0x2844f7[_0x2c1832][_0x54b9af].value = _0x124d0a), _0x5f19bd && (_0x2844f7[_0x2c1832][_0x54b9af].value2 = _0x5f19bd);3036}), _0x2593da.storage.set({3037'controllers': _0x2844f73038}), _0x378b5c.controllers = _0x2844f7, _0x132da7(_this.elements.dialogs.gamepad, true), _this.elements.container.focus(), _0x5f19bd.stopPropagation(), false;3039}), _0x1093f4.call(this, _this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames['btn-reset'])), 'click', function(_0x5f19bd) {3040_0x378b5c.controllers = JSON.parse(JSON.stringify(_0x378b5c.defaultControllers))3041localStorage.removeItem(_0x2593da.storage.key)3042let _0x2c1832 = _this.elements.dialogs.gamepad.querySelectorAll('input')3043for (let i=0; i<_0x2c1832.length; i++) {3044let player = _0x2c1832[i].getAttribute('data-index')3045let controlOrGamepad = _0x2c1832[i].getAttribute('data-type')3046let buttonId = _0x2c1832[i].getAttribute('data-id')3047let a = (controlOrGamepad == 1) ? 'value' : 'value2'3048if (_0x378b5c.defaultControllers[player] && _0x378b5c.defaultControllers[player][buttonId] && _0x378b5c.defaultControllers[player][buttonId][a]) {3049if (controlOrGamepad == 1) {3050_0x2c1832[i].value = _0x378b5c.keyMap[_0x378b5c.defaultControllers[player][buttonId][a]]3051} else {3052_0x2c1832[i].value = 'button ' + (parseInt(_0x378b5c.defaultControllers[player][buttonId][a])+1)3053}3054_0x2c1832[i].setAttribute('data-value', _0x378b5c.defaultControllers[player][buttonId][a])3055} else {3056_0x2c1832[i].value = ''3057_0x2c1832[i].setAttribute('data-value', '')3058}3059}3060}), _0x1093f4.call(this, _this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames['btn-clear'])), 'click', function(_0x5f19bd) {3061let c = {0:{}, 1:{}, 2:{}, 3:{}};3062for (let k in _0x48ee51) {3063c[0][k] = {};3064c[1][k] = {};3065c[2][k] = {};3066c[3][k] = {};3067}3068_0x378b5c.controllers = c3069localStorage.setItem(_0x2593da.storage.key, JSON.stringify({controllers: _0x378b5c.controllers}))3070let _0x2c1832 = _this.elements.dialogs.gamepad.querySelectorAll('input')3071for (let i=0; i<_0x2c1832.length; i++) {3072_0x2c1832[i].value = '';3073_0x2c1832[i].setAttribute('data-value', '');3074}3075}), Array.from(_this.elements.dialogs.gamepad.querySelectorAll('.' .concat(_0x378b5c.classNames.tabs, ' li'))).forEach(function(_0x523f7b) {3076_0x1093f4.call(_this, _0x523f7b, 'mousedown', function(_0xa99a78) {3077_0x3a8e2f(_this.elements.dialogs.gamepad.querySelectorAll('.' .concat(_0x378b5c.classNames.tabs, ' li')), _0x378b5c.classNames.active, false);3078_0x3a8e2f(_0x523f7b, _0x378b5c.classNames.active, true);3079let _0xb8a227 = _0x523f7b.querySelector('a').getAttribute('aria-controls');3080Array.from(_this.elements.dialogs.gamepad.querySelectorAll('.' .concat(_0x378b5c.classNames['tabs-content'], ' .').concat(_0x378b5c.classNames['tabs-panel']))).forEach(function(_0x1c29a4) {3081_0x132da7(_0x1c29a4, true);3082});3083_0x132da7(_this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames['tabs-content'], ' #').concat(_0xb8a227)), false);3084_0xa99a78.stopPropagation();3085return false;3086});3087}), _0xbae705.call(_this, _this.elements.dialogs.gamepad.querySelector('[aria-controls="controls-0"]').parentNode, 'mousedown');3088let _0x11b11a = _this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames.overlay));3089_0x1093f4.call(_this, _0x11b11a, 'mousedown', function(_0x15c7de) {3090_0x132da7(_0x11b11a, true), _0x15c7de.stopPropagation();3091}), Array.from(_this.elements.dialogs.gamepad.querySelectorAll('.' .concat(_0x378b5c.classNames['button-container']))).forEach(function(_0x16f092) {3092_0x1093f4.call(_this, _0x16f092, 'mousedown', function(_0xdb1c93) {3093_0xbae705.call(_this, _0x16f092.querySelector('a.' .concat(_0x378b5c.classNames.set)), _0xdb1c93.type, true, {});3094});3095}), Array.from(_this.elements.dialogs.gamepad.querySelectorAll('.' .concat(_0x378b5c.classNames['tabs-panel'], ' a.').concat(_0x378b5c.classNames.set))).forEach(function(_0x397818) {3096_0x1093f4.call(_this, _0x397818, 'mousedown', function(_0x1e1d79) {3097let _0x2c1832 = _0x397818.parentNode.parentNode,3098_0x4e649c = _0x2c1832.getAttribute('data-id'),3099_0x431719 = _0x2c1832.getAttribute('data-index'),3100_0x4a6f6f = _0x2c1832.getAttribute('data-label');3101_0x132da7(_0x11b11a, false), _0x11b11a.setAttribute('data-id', _0x4e649c);3102_0x11b11a.setAttribute('data-index', _0x431719);3103let _0x179623 = '[ ' .concat(_0x4a6f6f, ' ]');3104_0x378b5c.gamepad.gamepads[_0x431719] && _0x4e649c < 16 ? _0x179623 += '<br /><span style="font-size:12px">Gamepad:' .concat(_0x378b5c.gamepad.gamepads[_0x431719].id, '</span><br />'+_this.localization('Press keyboard or gamepad')+'<br/>'+_this.localization('Press escape (esc) to clear')) : _0x179623 += '<br />Press keyboard<br/>'+_this.localization('Press escape (esc) to clear'), _0x11b11a.querySelector('.' .concat(_0x378b5c.classNames['key-setting-popup'])).innerHTML = _0x179623, _0x1e1d79.stopPropagation();3105});3106});3107},3108'setCacheDialog': function() {3109let _this = this;3110_this.elements.dialogs.cache.innerHTML = '\n <div class="'+_0x378b5c.classNames['dialog-container']+'">\n <div class="'+_0x378b5c.classNames['dialog-title']+'">\n <h4>'+_this.localization('Cache Manager')+'</h4>\n </div>\n <div class="'+_0x378b5c.classNames['dialog-content']+'">\n\n </div>\n <div class="'+_0x378b5c.classNames['dialog-buttons']+'">\n <a href="#" onclick="return false" class="'+_0x378b5c.classNames['btn-clear-all']+'">'+_this.localization('Clear All')+'</a>\n <a href="#" onclick="return false" class="'+_0x378b5c.classNames['btn-cancel']+'">'+_this.localization('Close')+'</a>\n </div>\n </div>\n ';31113112_0x1093f4.call(this, _this.elements.dialogs.cache.querySelector('.' .concat(_0x378b5c.classNames['btn-cancel'])), 'click', function(_0x5d6721) {3113return _0x132da7(_this.elements.dialogs.cache, true), _this.elements.container.focus(), _0x5d6721.stopPropagation(), false;3114})3115_0x1093f4.call(this, _this.elements.dialogs.cache.querySelector('.' .concat(_0x378b5c.classNames['btn-clear-all'])), 'click', function(_0x5d6721) {3116return _0x27f4c4.romdb && (_0x27f4c4.romdb.clear(), _this.elements.dialogs.cache.querySelector('.' .concat(_0x378b5c.classNames['dialog-content'])).innerHTML = '<div style="text-align:center">'+_this.localization('Empty')+'</div>'), _0x46992d.stopPropagation(), false;3117})3118_0x1093f4.call(this, _this.elements.dialogs.cache.querySelector('.' .concat(_0x378b5c.classNames['dialog-title'], ' a')), 'click', function(_0x46992d) {3119return _0x27f4c4.romdb && (_0x27f4c4.romdb.clear(), _this.elements.dialogs.cache.querySelector('.' .concat(_0x378b5c.classNames['dialog-content'])).innerHTML = '<div style="text-align:center">'+_this.localization('Empty')+'</div>'), _0x46992d.stopPropagation(), false;3120})3121},3122'showLoading': function(_0x108b55) {3123_0x4d8495.show('modal-6ed698f3d04061f5', {3124'closeByEsckey': false3125}), _0x108b55 && console.log(''), _0x132da7(this.elements.dialogs.loading, false);3126},3127'hideLoading': function() {3128_0x4d8495.close(), _0x132da7(this.elements.dialogs.loading, true);3129},3130'setLoadingDialog': function() {3131this.elements.dialogs.loading && (this.elements.dialogs.loading.innerHTML = '\n <div class="' .concat(_0x378b5c.classNames.modal, ' ').concat(_0x378b5c.classNames['micromodal-slide'], '" id="modal-6ed698f3d04061f5" aria-hidden="true">\n <div class="').concat(_0x378b5c.classNames.modal__overlay, '" tabindex="-1">\n <div class="').concat(_0x378b5c.classNames.modal__container, '" role="dialog" aria-modal="true" aria-labelledby="modal-6ed698f3d04061f5-title">\n '+this.localization('Loading')+'...\n </div>\n </div>\n </div>'));3132},3133'setCheatDialog': function() {3134let _this = this;3135if (_this.elements.dialogs.cheat) {3136_this.elements.dialogs.cheat.innerHTML = '\n <div class="' .concat(_0x378b5c.classNames['dialog-container'], '">\n <div class="').concat(_0x378b5c.classNames['dialog-title'], '">\n <h4>Cheats</h4>\n </div>\n <div class="').concat(_0x378b5c.classNames['dialog-content'], '">\n <div class="').concat(_0x378b5c.classNames['cheats-list'], '">\n \n </div>\n </div>\n <div class="').concat(_0x378b5c.classNames['dialog-buttons'], '">\n <a href="#" onclick="return false" class="').concat(_0x378b5c.classNames['cheats-add'], '">'+_this.localization('Add Cheat')+'</a>\n <a href="#" onclick="return false" class="').concat(_0x378b5c.classNames['btn-cancel'], '">Close</a>\n </div>\n </div>\n\n \n\n <div class="').concat(_0x378b5c.classNames.modal, ' ').concat(_0x378b5c.classNames['micromodal-slide'], '" id="modal-85cd7a1c543a484b" aria-hidden="true">\n <div class="').concat(_0x378b5c.classNames.modal__overlay, '" tabindex="-1" data-modal-close>\n <div class="').concat(_0x378b5c.classNames.modal__container, '" style="width:100%" role="dialog" aria-modal="true" aria-labelledby="modal-85cd7a1c543a484b-title">\n <div class="').concat(_0x378b5c.classNames.modal__header, '">\n <h2 class="').concat(_0x378b5c.classNames.modal__title, '" id="modal-85cd7a1c543a484b-title">\n '+_this.localization('Add Cheat Code')+'\n </h2>\n <button class="').concat(_0x378b5c.classNames.modal__close, '" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(_0x378b5c.classNames.modal__content, '" id="modal-85cd7a1c543a484b-content">\n\n <div class="').concat(_0x378b5c.classNames.modal__errmsg, '"></div>\n <strong>'+_this.localization('Code')+'</strong><br />\n <textarea style="width:100%;height:80px;" class="').concat(_0x378b5c.classNames['cheat-code-input'], '"></textarea><br />\n <strong>'+_this.localization('Description')+'</strong><br />\n <input type="text" class="').concat(_0x378b5c.classNames['cheat-name-input'], '" /><br />\n\n </main>\n <footer class="').concat(_0x378b5c.classNames.modal__footer, '">\n <button class="').concat(_0x378b5c.classNames.modal__btn, ' ').concat(_0x378b5c.classNames['modal__btn-primary'], '">'+_this.localization('Submit')+'</button>\n <button class="').concat(_0x378b5c.classNames.modal__btn, '" data-modal-close aria-label="Close">'+_this.localization('Close')+'</button>\n </footer>\n </div>\n </div>\n </div>\n ');3137let _0x17edbf = _this.elements.dialogs.cheat.querySelector('#modal-85cd7a1c543a484b');3138_0x1093f4.call(this, _this.elements.dialogs.cheat.querySelector('.' .concat(_0x378b5c.classNames['cheats-add'])), 'click', function(_0x2a74b5) {3139return _0x4d8495.show('modal-85cd7a1c543a484b', {3140'closeTrigger': 'data-modal-close'3141}), false;3142});3143let _0x2c1832 = _this.elements.dialogs.cheat.querySelector('.' .concat(_0x378b5c.classNames['cheats-list']));3144_0x1093f4.call(this, _0x17edbf.querySelector('.' .concat(_0x378b5c.classNames['modal__btn-primary'])), 'click', function(_0x1c01ce) {3145let _0x184e2c = _0x17edbf.querySelector('.' .concat(_0x378b5c.classNames['cheat-name-input'])).value,3146_0x15ccbb = _0x17edbf.querySelector('.' .concat(_0x378b5c.classNames['cheat-code-input'])).value;3147if (_0x184e2c && _0x15ccbb) {3148let _0x2c3108 = _0x2c1832.querySelectorAll('input:checked');3149_0x17edbf.querySelector('.' .concat(_0x378b5c.classNames['cheat-name-input'])).value = '', _0x17edbf.querySelector('.' .concat(_0x378b5c.classNames['cheat-code-input'])).value = '', _0x4d8495.close();3150let _0x5b2cff = _this.cheats.length;3151_this.cheats.push([_0x184e2c, _0x15ccbb]), _0x2c1832.innerHTML += '<div class="' .concat(_0x378b5c.classNames['ejs-switch'], '">\n <input type="checkbox" value="').concat(_0x5b2cff, '" id="ejs-cheat-switch-').concat(_0x5b2cff, '">\n <label for="ejs-cheat-switch-').concat(_0x5b2cff, '">').concat(_0x184e2c, '</label>\n <a href="#" data-idx="').concat(_0x5b2cff, '" onclick="return false" class="').concat(_0x378b5c.classNames['ejs-delete-cheat'], '">×</a>\n </div>'), _0x2c3108.forEach(function(_0x1fb248, _0x7bb84b) {3152_0x2c1832.querySelector('#ejs-cheat-switch-' .concat(_0x7bb84b)).setAttribute('checked', 'checked');3153});3154}3155if ('localStorage' in window && _this.getStartName()) {3156localStorage.setItem('' .concat(_this.system, '-').concat(_this.getStartName(), '-cheats'), JSON.stringify(_this.cheats));3157_0x1c01ce.stopPropagation();3158}3159return false;3160});3161let _0x257001 = function() {3162if ('localStorage' in window && _this.getStartName()) {3163let _0x17edbf = localStorage.getItem('' .concat(_this.system, '-').concat(_this.getStartName(), '-cheats'));3164try {3165_0x17edbf = JSON.parse(_0x17edbf);3166} catch (_0x101b3e) {}3167_0x17edbf && (_this.cheats = _0x17edbf);3168}3169_0x2c1832.innerHTML = '';3170if (_this.cheats && Array.isArray(_this.cheats)) {3171_this.cheats.forEach(function(_0x245035, _0x116996) {3172let _0x4ac35a = _0x245035[0];3173_0x245035[1];3174_0x2c1832.innerHTML += '<div class="' .concat(_0x378b5c.classNames['ejs-switch'], '">\n <input type="checkbox" value="').concat(_0x116996, '" id="ejs-cheat-switch-').concat(_0x116996, '">\n <label for="ejs-cheat-switch-').concat(_0x116996, '">').concat(_0x4ac35a, '</label>\n <a href="#" data-idx="').concat(_0x116996, '" onclick="return false" class="').concat(_0x378b5c.classNames['ejs-delete-cheat'], '">×</a>\n </div>');3175});3176}3177};3178_0x1093f4.call(_this, _0x2c1832, 'click', function(_0x576733) {3179if (_0x576733.target && _0x576733.target.classList.contains(_0x378b5c.classNames['ejs-delete-cheat']) && _0x576733.target.getAttribute('data-idx')) {3180let _0x5b10b7 = _0x576733.target.getAttribute('data-idx');3181_this.cheats.splice(_0x5b10b7, 1);3182if ('localStorage' in window && _this.getStartName()) {3183localStorage.setItem('' .concat(_this.system, '-').concat(_this.getStartName(), '-cheats'), JSON.stringify(_this.cheats));3184}3185let _0x557895 = [];3186_0x2c1832.querySelectorAll('input').forEach(function(_0xab0ba8, _0x1f3597) {3187_0x557895[_0x1f3597] = !!_0x2c1832.querySelector('#ejs-cheat-switch-' .concat(_0x1f3597, ':checked'));3188}), _0x557895.splice(_0x5b10b7, 1), _0x257001(), _0x557895.forEach(function(_0x2e22be, _0x2247c4) {3189_0x2e22be && _0x2c1832.querySelector('#ejs-cheat-switch-' .concat(_0x2247c4)).setAttribute('checked', 'checked');3190});3191}3192return _0x576733.stopPropagation(), false;3193}), _0x1093f4.call(_this, _this.elements.container, 'start-game', function(_0x4c266e) {3194_0x257001();3195}), _0x1093f4.call(this, _this.elements.dialogs.cheat.querySelector('.' .concat(_0x378b5c.classNames['btn-cancel'])), 'click', function(_0x5785f6) {3196_0x378b5c.resetCheat();3197_0x2c1832.querySelectorAll('input:checked').forEach(function(_0xeb7426, _0x45b02d) {3198let _0x27e2c1 = _this.cheats[_0xeb7426.value];3199_0x27e2c1 && _0x378b5c.setCheat(_0x45b02d, 1, _0x27e2c1[1]);3200});3201_0x132da7(_this.elements.dialogs.cheat, true);3202_this.elements.container.focus();3203return false;3204}), 'arcade' !== getSystem(_this.system, true) && 'mame' !== getSystem(_this.system, true) && 'mame2003' !== getSystem(_this.system, true) && 'mame2010' !== getSystem(_this.system, true) || (_0x1e2c68.element(_this.elements.buttons.cheat) && _0x132da7(_this.elements.buttons.cheat, true), _0x378b5c.allowCheat = false), _0x378b5c.setCheat || (_0x132da7(_this.elements.buttons.cheat, true), _0x378b5c.allowCheat = false);3205}3206},3207'setNetplayDialog': function() {3208var _0xa88a13 = this,3209_0x17edbf = this;3210if (_0x17edbf.elements.dialogs.netplay) {3211_0x17edbf.elements.dialogs.netplay.innerHTML = '\n <div class="' .concat(_0x378b5c.classNames['dialog-container'], '">\n <div class="').concat(_0x378b5c.classNames['dialog-title'], '">\n <h4>'+_0x17edbf.localization('Netplay')+'</h4>\n </div>\n <div class="').concat(_0x378b5c.classNames['dialog-content'], '">\n <div class="').concat(_0x378b5c.classNames['netplay-roomlist'], '" hidden>\n <strong>'+_0x17edbf.localization('Rooms')+'</strong>\n <table style="width:100%" cellspacing=0>\n <thead>\n <tr>\n <td>'+_0x17edbf.localization('Room Name')+'</td>\n <td>'+_0x17edbf.localization('Players')+'</td>\n <td></td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <div class="').concat(_0x378b5c.classNames['netplay-room'], '" hidden>\n <strong>'+_0x17edbf.localization('Room Name')+'</strong>\n <div data-room-password>'+_0x17edbf.localization('Password')+': <span></span></div>\n <table style="width:100%" cellspacing="0">\n <thead>\n <tr>\n <td>'+_0x17edbf.localization('Player')+'</td>\n <td>'+_0x17edbf.localization('Name')+'</td>\n <td></td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>1</td>\n <td>'+_0x17edbf.localization('Name')+' 1</td>\n <td></td>\n </tr>\n <tr>\n <td>2</td>\n <td>'+_0x17edbf.localization('Name')+' 2</td>\n <td></td>\n </tr>\n <tr>\n <td>3</td>\n <td>'+_0x17edbf.localization('Name')+' 3</td>\n <td></td>\n </tr>\n <tr>\n <td>4</td>\n <td>'+_0x17edbf.localization('Name')+' 4</td>\n <td></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div class="').concat(_0x378b5c.classNames['dialog-buttons'], '">\n <a href="#" onclick="return false" class="').concat(_0x378b5c.classNames['btn-quit'], '">'+_0x17edbf.localization('Quit Room')+'</a>\n <a href="#" onclick="return false" class="').concat(_0x378b5c.classNames['btn-create-room'], '">'+_0x17edbf.localization('Create a Room')+'</a>\n <a href="#" onclick="return false" class="').concat(_0x378b5c.classNames['btn-cancel'], '">'+_0x17edbf.localization('Close')+'</a>\n </div>\n </div>\n\n \n <div class="').concat(_0x378b5c.classNames.modal, ' ').concat(_0x378b5c.classNames['micromodal-slide'], '" id="modal-9de6c4e9ce2b9361" aria-hidden="true">\n <div class="').concat(_0x378b5c.classNames.modal__overlay, '" tabindex="-1">\n <div class="').concat(_0x378b5c.classNames.modal__container, '" role="dialog" aria-modal="true" aria-labelledby="modal-9de6c4e9ce2b9361-title">\n <div class="').concat(_0x378b5c.classNames.modal__header, '">\n <h2 class="').concat(_0x378b5c.classNames.modal__title, '" id="modal-9de6c4e9ce2b9361-title">\n '+_0x17edbf.localization('Set Player Name')+'\n </h2>\n </div>\n <main class="').concat(_0x378b5c.classNames.modal__content, '" id="modal-9de6c4e9ce2b9361-content">\n\n <div class="').concat(_0x378b5c.classNames.modal__errmsg, '"></div>\n <strong>'+_0x17edbf.localization('Player Name')+'</strong><br />\n <input type="text" maxlength="10" class="').concat(_0x378b5c.classNames['netplay-player-name'], '" /><br />\n\n </main>\n <footer class="').concat(_0x378b5c.classNames.modal__footer, '">\n <button class="').concat(_0x378b5c.classNames.modal__btn, ' ').concat(_0x378b5c.classNames['modal__btn-primary'], '">'+_0x17edbf.localization('Submit')+'</button>\n </footer>\n </div>\n </div>\n </div>\n \n <div class="').concat(_0x378b5c.classNames.modal, ' ').concat(_0x378b5c.classNames['micromodal-slide'], '" id="modal-85cd7a1c543a484a" aria-hidden="true">\n <div class="').concat(_0x378b5c.classNames.modal__overlay, '" tabindex="-1" data-modal-close>\n <div class="').concat(_0x378b5c.classNames.modal__container, '" role="dialog" aria-modal="true" aria-labelledby="modal-85cd7a1c543a484a-title">\n <div class="').concat(_0x378b5c.classNames.modal__header, '">\n <h2 class="').concat(_0x378b5c.classNames.modal__title, '" id="modal-85cd7a1c543a484a-title">\n '+_0x17edbf.localization('Create a Room')+'\n </h2>\n <button class="').concat(_0x378b5c.classNames.modal__close, '" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(_0x378b5c.classNames.modal__content, '" id="modal-85cd7a1c543a484a-content">\n\n <div class="').concat(_0x378b5c.classNames.modal__errmsg, '"></div>\n <strong>'+_0x17edbf.localization('Room Name')+'</strong><br />\n <input type="text" maxlength="10" class="').concat(_0x378b5c.classNames['netplay-room-name-input'], '" /><br />\n <strong>Max Players</strong><br />\n <select data-max-players>\n <option value="2">2</option>\n <option value="3">3</option>\n <option value="4">4</option>\n </select>\n <br />\n <strong>'+_0x17edbf.localization('Password (optional)')+'</strong><br />\n <input type="text" maxlength="10" class="').concat(_0x378b5c.classNames['netplay-room-password-input'], '" /><br />\n\n </main>\n <footer class="').concat(_0x378b5c.classNames.modal__footer, '">\n <button class="').concat(_0x378b5c.classNames.modal__btn, ' ').concat(_0x378b5c.classNames['modal__btn-primary'], '">'+_0x17edbf.localization('Submit')+'</button>\n <button class="').concat(_0x378b5c.classNames.modal__btn, '" data-modal-close aria-label="Close">'+_0x17edbf.localization('Close')+'</button>\n </footer>\n </div>\n </div>\n </div>\n \n <div class="').concat(_0x378b5c.classNames.modal, ' ').concat(_0x378b5c.classNames['micromodal-slide'], '" id="modal-5aa765d61d8327de" aria-hidden="true">\n <div class="').concat(_0x378b5c.classNames.modal__overlay, '" tabindex="-1" data-modal-close>\n <div class="').concat(_0x378b5c.classNames.modal__container, '" role="dialog" aria-modal="true" aria-labelledby="modal-5aa765d61d8327de-title">\n <div class="').concat(_0x378b5c.classNames.modal__header, '">\n <h2 class="').concat(_0x378b5c.classNames.modal__title, '" id="modal-5aa765d61d8327de-title">\n '+_0x17edbf.localization('Password')+'\n </h2>\n <button class="').concat(_0x378b5c.classNames.modal__close, '" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(_0x378b5c.classNames.modal__content, '" id="modal-5aa765d61d8327de-content">\n\n <div class="').concat(_0x378b5c.classNames.modal__errmsg, '"></div>\n <input type="text" maxlength="10" class="').concat(_0x378b5c.classNames['netplay-room-password-input'], '" /><br />\n\n </main>\n <footer class="').concat(_0x378b5c.classNames.modal__footer, '">\n <button class="').concat(_0x378b5c.classNames.modal__btn, ' ').concat(_0x378b5c.classNames['modal__btn-primary'], '">'+_0x17edbf.localization('Submit')+'</button>\n <button class="').concat(_0x378b5c.classNames.modal__btn, '" data-modal-close aria-label="Close">'+_0x17edbf.localization('Close')+'</button>\n </footer>\n </div>\n </div>\n </div>\n \n \n <div class="').concat(_0x378b5c.classNames.modal, ' ').concat(_0x378b5c.classNames['micromodal-slide'], '" id="modal-7d8fd50ed642340b" aria-hidden="true">\n <div class="').concat(_0x378b5c.classNames.modal__overlay, '" tabindex="-1" data-modal-close>\n <div class="').concat(_0x378b5c.classNames.modal__container, '" role="dialog" aria-modal="true" aria-labelledby="modal-7d8fd50ed642340b-title">\n <div class="').concat(_0x378b5c.classNames.modal__header, '">\n <h2 class="').concat(_0x378b5c.classNames.modal__title, '" id="modal-7d8fd50ed642340b-title"></h2>\n <button class="').concat(_0x378b5c.classNames.modal__close, '" aria-label="Close modal" data-modal-close></button>\n </div>\n <main class="').concat(_0x378b5c.classNames.modal__content, '" id="modal-7d8fd50ed642340b-content">\n \n </main>\n <footer class="').concat(_0x378b5c.classNames.modal__footer, '">\n <button class="').concat(_0x378b5c.classNames.modal__btn, ' ').concat(_0x378b5c.classNames['modal__btn-primary'], '" data-modal-close>OK</button>\n </footer>\n </div>\n </div>\n </div>\n \n '), _0x1093f4.call(this, _0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['btn-cancel'])), 'click', function(_0x3d4554) {3212return _0x132da7(_0x17edbf.elements.dialogs.netplay, true), _0x378b5c.disableControl(!0x1), _0x378b5c.stopLoadRooms(), _0x3d4554.stopPropagation(), _0x17edbf.elements.container.focus(), !0x1;3213}), window.setInterval(function() {3214var _0xa88a13 = '<ul>';3215_0x378b5c.players.forEach(function(_0x20c45e, _0x14d0b2) {3216var _0x57ec9c = null;3217_0x20c45e ? (_0x378b5c.connection.peers[_0x20c45e] ? _0x57ec9c = _0x378b5c.connection.peers[_0x20c45e].extra : _0x378b5c.connection.userid === _0x20c45e && (_0x57ec9c = _0x378b5c.connection.extra), _0xa88a13 += '<li>' .concat(_0x14d0b2 + 0x1, '. ').concat(_0x57ec9c.name, '</li>')) : _0xa88a13 += '<li>' .concat(_0x14d0b2 + 0x1, '. </li>');3218}), _0xa88a13 += '</ul>', _0x17edbf.elements.widgets.netplay.innerHTML = _0xa88a13;3219}, 0x1f4);3220var _0x2c1832 = _0x17edbf.elements.dialogs.netplay.querySelector('#modal-9de6c4e9ce2b9361'),3221_0x36bde0 = _0x17edbf.elements.dialogs.netplay.querySelector('#modal-85cd7a1c543a484a'),3222_0x5289c1 = _0x17edbf.elements.dialogs.netplay.querySelector('#modal-7d8fd50ed642340b'),3223_0x325651 = _0x17edbf.elements.dialogs.netplay.querySelector('#modal-5aa765d61d8327de'),3224_0x3d0d28 = {};32253226_0x378b5c.connection = new _0x4a2390.a();3227var _0x10d51e = _0xa88a13.socketUrl;3228if (! _0x10d51e.endsWith('/')) {3229_0x10d51e += '/';3230};3231_0x378b5c.connection.socketURL = '/', _0x378b5c.connection.socketURL = _0x10d51e, _0x378b5c.connection.socketMessageEvent = 'emulatorjs-message', _0x378b5c.connection.socketCustomEvent = 'emulatorjs-custom-message';3232var _0xda20e9 = _0x59aa33.info();3233_0x378b5c.connection.extra = {3234'name': _0x378b5c.playerName,3235'game_id': _0x17edbf.config.gameId,3236'browser_name': _0xda20e9.name,3237'room_name': ' ',3238'domain': document.domain3239}3240_0x378b5c.connection.socketMessageEvent = 'netplay';3241_0x378b5c.connection.enableFileSharing = true;3242_0x378b5c.connection.enableLogs = true;3243_0x378b5c.connection.session = {3244'data': true3245};3246_0x378b5c.connection.coreVer = _0x17edbf.coreVer;3247_0x378b5c.connection.sdpConstraints.mandatory = {3248'OfferToReceiveAudio': false,3249'OfferToReceiveVideo': false3250}3251_0x378b5c.connection.onclose = function() {};32523253_0x378b5c.connection.iceServers = window.EJS_TURN_URLS;3254_0x378b5c.connection.maxParticipantsAllowed = 4;3255_0x378b5c.netPlayInitFrame = 0;3256var _0x1eb137 = 0,3257_0x52eb7d = false;3258Module.postMainLoop = function() {3259var _0xa88a13;3260if (_0x378b5c.currentFrame = parseInt(_0x378b5c.currentFrameNum(), 0xa), _0x378b5c.connected) {3261if (_0x1eb137 += 0x1, _0x378b5c.connection.isInitiator) _0x1eb137 >= 0x1 && function() {3262for (var _0xa88a13 = [], _0x17edbf = _0x378b5c.currentFrame - 0x1; _0x17edbf < _0x378b5c.currentFrame; _0x17edbf += 0x1) _0x378b5c.inputsData[_0x17edbf] ? _0x378b5c.inputsData[_0x17edbf].forEach(function(_0x2a02da, _0x1b2066) {3263_0xa88a13.push('' .concat(_0x2a02da.index, '|').concat(_0x2a02da.key, '|').concat(_0x2a02da.status, '|').concat(_0x2a02da.frame));3264}) : _0xa88a13.push('-1|||' .concat(_0x17edbf));3265_0x378b5c.connection.send(JSON.stringify({3266'act': 'sync-control',3267'value': _0xa88a133268})), _0x1eb137 = 0x0, _0x378b5c.currentFrame % 0x64 == 0x0 && Object.keys(_0x378b5c.inputsData).forEach(function(_0x3125e4, _0x31ea67) {3269_0x3125e4 < _0x378b5c.currentFrame - 0x32 && (_0x378b5c.inputsData[_0x3125e4] = null, delete _0x378b5c.inputsData[_0x3125e4]);3270});3271}();3272else {3273if (_0x378b5c.coreOptionData[_0x378b5c.currentFrame]) {3274var _0x2c1832 = _0x378b5c.coreOptionData[_0x378b5c.currentFrame].key,3275_0x4fd0cc = _0x378b5c.coreOptionData[_0x378b5c.currentFrame].value;3276_0x2593da.updateCoreOptions.call(_0x17edbf, _0x2c1832, _0x4fd0cc), delete _0x378b5c.coreOptionData[_0x378b5c.currentFrame];3277}3278if (_0x378b5c.currentFrame <= 0x0 || _0x378b5c.inputsData[_0x378b5c.currentFrame]) _0x378b5c.wait = !0x1, _0x378b5c.systemPause(0x0), _0x27f4c4.Module.resumeMainLoop(), _0xa88a13 = _0x378b5c.inputsData[_0x378b5c.currentFrame], _0x378b5c.inputsData[_0x378b5c.currentFrame] = null, delete _0x378b5c.inputsData[_0x378b5c.currentFrame], _0xa88a13 || (_0xa88a13 = []), _0xa88a13.forEach(function(_0x4bb42f, _0x28928a) {3279_0x4bb42f.index >= 0x0 && _0x378b5c.simulateInputFn(_0x4bb42f.index, _0x4bb42f.key, _0x4bb42f.status);3280});3281else {3282_0x378b5c.wait = true, _0x378b5c.systemPause(0x1), _0x27f4c4.Module.pauseMainLoop();3283var _0x3a10d1 = !0x1,3284_0x42763c = Object.keys(_0x378b5c.inputsData);32850x0 == _0x42763c.length && (_0x3a10d1 = true);3286for (var _0x58af15 = 0x0; _0x58af15 < _0x42763c.length; _0x58af15 += 0x1) {3287if (_0x42763c[_0x58af15] > _0x378b5c.currentFrame) {3288console.log('lost', _0x378b5c.currentFrame), _0x3a10d1 = true;3289break;3290}3291}3292_0x3a10d1 ? _0x378b5c.wait || (!_0x52eb7d || _0x52eb7d < new Date().valueOf() - 0xbb8) && (_0x378b5c.inputsData = {}, _0x52eb7d = new Date().valueOf(), _0x378b5c.connection.send(JSON.stringify({3293'act': 'sync-mem',3294'value': _0x378b5c.connection.userid3295}), _0x378b5c.roomMaster)) : (_0x378b5c.wait = true, _0x378b5c.systemPause(0x1), _0x27f4c4.Module.pauseMainLoop());3296}3297_0x378b5c.currentFrame % 0x64 == 0x0 && Object.keys(_0x378b5c.inputsData).forEach(function(_0x3aa393, _0x3a7829) {3298_0x3aa393 < _0x378b5c.currentFrame - 0x32 && (_0x378b5c.inputsData[_0x3aa393] = null, delete _0x378b5c.inputsData[_0x3aa393]);3299});3300}3301}3302}3303_0x378b5c.connection.onopen = function(_0x4b10d6) {3304_0x378b5c.connected = true, _0x378b5c.connection.isInitiator && (-0x1 === _0x378b5c.players.indexOf(_0x4b10d6.userid) && (_0x378b5c.players.filter(function(_0x3eafb3, _0xabd7b7) {3305return null == _0x3eafb3;3306}).length > 0x0 ? _0x378b5c.players.forEach(function(_0xbf0f19, _0xa9d540) {3307null != _0xbf0f19 || _0x378b5c.players.includes(_0x4b10d6.userid) || (_0x378b5c.players[_0xa9d540] = _0x4b10d6.userid);3308}) : _0x378b5c.players.push(_0x4b10d6.userid)), _0x378b5c.connection.send(JSON.stringify({3309'act': 'get-players-result',3310'value': _0x378b5c.players,3311'coreOptions': _0x2593da.coreOptionsValues,3312'newuser': _0x4b10d6.userid,3313'master': _0x378b5c.connection.userid3314}))), _0x2593da.updateCoreOptionMenuItems.call(_0x17edbf);3315}3316_0x378b5c.connection.onFileStart = function(_0x50eb3a) {3317var _0x2c1832 = _0x50eb3a.name.split('-');3318'reset' !== _0x2c1832[0x0] && 0x0 != _0x2c1832[0x0] || (_0x378b5c.inputsData = {}, _0x378b5c.disableControl(true)), _0x378b5c.progressHelper[_0x50eb3a.remoteUserId] = {}, _0x378b5c.progressHelper[_0x50eb3a.remoteUserId].max = _0x50eb3a.maxChunks, _0x378b5c.showLoading.call(_0x17edbf), _0x378b5c.connection.isInitiator ? (_0x378b5c.wait = true, _0x378b5c.systemPause(0x1), _0x27f4c4.Module.pauseMainLoop()) : _0x378b5c.inputsData = {};3319}3320_0x378b5c.connection.onFileProgress = function(_0x44a04b) {3321var _0x17edbf = _0x378b5c.progressHelper[_0x44a04b.remoteUserId];3322_0x17edbf.current = _0x44a04b.currentPosition || _0x44a04b.maxChunks || _0x17edbf.max;3323}3324_0x378b5c.connection.onFileEnd = function(_0x45d454) {3325_0x378b5c.hideLoading.call(_0x17edbf);3326var _0x2c1832 = _0x45d454.name.split('-'),3327_0x3795d9 = _0x2c1832[0x0] >> 0x0;3328'reset' === _0x2c1832[0x0] ? (_0x3795d9 = 0x0, _0x378b5c.connection.isInitiator ? (_0x378b5c.systemPause(0x0), _0x378b5c.disableControl(!0x1), _0x17edbf.playing = true, _0x27f4c4.Module.resumeMainLoop()) : _0x550f17.a.get(_0x45d454.url, {3329'responseType': 'arraybuffer'3330}).then(function(_0x37db4c) {3331_0x378b5c.inputsData = {};3332var _0x2c1832 = new Uint8Array(_0x37db4c.data);3333_0x378b5c.loadState(_0x2c1832, _0x3795d9), _0x378b5c.wait = !0x1, _0x378b5c.systemPause(0x0), _0x378b5c.disableInput = !0x1, _0x17edbf.playing = true, _0x27f4c4.Module.resumeMainLoop();3334})) : 'game.state' === _0x2c1832[0x1] && (_0x378b5c.connection.isInitiator ? (_0x378b5c.openRoom(_0x17edbf), _0x378b5c.wait = !0x1, _0x378b5c.systemPause(0x0), _0x27f4c4.Module.resumeMainLoop()) : (_0x378b5c.netPlayInitFrame = _0x3795d9, _0x550f17.a.get(_0x45d454.url, {3335'responseType': 'arraybuffer'3336}).then(function(_0x4d241b) {3337var _0x2c1832 = new Uint8Array(_0x4d241b.data);3338_0x378b5c.loadState(_0x2c1832, _0x3795d9), _0x378b5c.wait = !0x1, _0x378b5c.disableInput = !0x1, _0x378b5c.connection.send(JSON.stringify({3339'act': 'wait-end',3340'value': _0x378b5c.connection.userid3341})), _0x378b5c.hideLoading.call(_0x17edbf), _0x17edbf.playing = true, _0x27f4c4.Module.resumeMainLoop();3342}))), _0x378b5c.connection.isInitiator || console.log('recv mem end', _0x378b5c.currentFrame, _0x45d454.name);3343};3344var _0x3bdb35 = !0x1;3345_0x378b5c.connection.onmessage = function(_0x32e81a) {3346var _0x2c1832, _0x2dca58 = _0x32e81a.data || _0x32e81a;3347try {3348_0x2c1832 = JSON.parse(_0x2dca58);3349} catch (_0x3fb9cc) {3350_0x2c1832 = null;3351}3352if (_0x2c1832) {3353if ('room-master' === _0x2c1832.act && (_0x378b5c.roomMaster = _0x2c1832.value), _0x2c1832.act, 'short-pause' === _0x2c1832.act && (_0x3bdb35 || (_0x378b5c.systemPause(0x1), _0x27f4c4.Module.pauseMainLoop(), _0x3bdb35 = true, _0x378b5c.wait = true, setTimeout(function() {3354_0x378b5c.systemPause(0x0), _0x27f4c4.Module.resumeMainLoop(), _0x378b5c.wait = !0x1, _0x3bdb35 = !0x1;3355}, 0x30))), 'sync-control' === _0x2c1832.act) {3356var _0xb051c1 = _0x2c1832.value;3357_0x17edbf.playing || _0x378b5c.wait;3358var _0x2ef644 = _0x378b5c.connection.userid;3359_0x378b5c.players.indexOf(_0x2ef644);3360_0x378b5c.connection.isInitiator, _0xb051c1.forEach(function(_0x308105, _0x383237) {3361var _0x2c1832 = _0x308105.split('|'),3362_0x25a5c4 = _0x2c1832[0x0] >> 0x0,3363_0x2b3afd = _0x2c1832[0x1] >> 0x0,3364_0x4f5761 = _0x2c1832[0x2] >> 0x0,3365_0x249303 = _0x2c1832[0x3] >> 0x0,3366_0x54e0fd = _0x378b5c.currentFrame;3367_0x378b5c.inputsData[_0x249303] || (_0x378b5c.inputsData[_0x249303] = []), -0x1 !== _0x25a5c4 && _0x249303 === _0x54e0fd && _0x378b5c.simulateInputFn(_0x25a5c4, _0x2b3afd, _0x4f5761), _0x378b5c.connection.isInitiator ? _0x25a5c4 >= 0x0 && (_0x378b5c.inputsData[_0x54e0fd] || (_0x378b5c.inputsData[_0x54e0fd] = []), -0x2 != _0x2b3afd && (_0x378b5c.inputsData[_0x54e0fd].push({3368'index': _0x25a5c4,3369'key': _0x2b3afd,3370'status': _0x4f5761,3371'frame': _0x54e0fd3372}), _0x378b5c.simulateInputFn(_0x25a5c4, _0x2b3afd, _0x4f5761)), _0x3bdb35 || _0x54e0fd - 0xa >= _0x249303 && (_0x378b5c.systemPause(0x1), _0x27f4c4.Module.pauseMainLoop(), _0x3bdb35 = true, _0x378b5c.wait = true, setTimeout(function() {3373_0x378b5c.systemPause(0x0), _0x27f4c4.Module.resumeMainLoop(), _0x378b5c.wait = !0x1, _0x3bdb35 = !0x1;3374}, 0x30))) : ('' !== _0x25a5c4 && _0x378b5c.inputsData[_0x249303].push({3375'index': _0x25a5c4,3376'key': _0x2b3afd,3377'status': _0x4f5761,3378'frame': _0x2493033379}), _0x378b5c.inputsData[_0x378b5c.currentFrame] && _0x27f4c4.Module.resumeMainLoop(), _0x54e0fd + 0xa <= _0x249303 && _0x249303 > _0x378b5c.netPlayInitFrame + 0x64 && _0x378b5c.connection.send(JSON.stringify({3380'act': 'short-pause',3381'value': _0x2ef6443382}), _0x378b5c.roomMaster));3383});3384}3385if (_0x2c1832.act, _0x2c1832.act, 'update-core-option' === _0x2c1832.act && (_0x378b5c.connection.isInitiator || (_0x378b5c.coreOptionData[_0x2c1832.frame] = {3386'key': _0x2c1832.key,3387'value': _0x2c1832.value3388})), 'restart-game' === _0x2c1832.act && (_0x378b5c.inputsData = {}, _0x378b5c.connection.send(JSON.stringify({3389'act': 'sync-mem',3390'value': _0x378b5c.connection.userid3391}), _0x378b5c.roomMaster)), 'pause' === _0x2c1832.act && _0x27f4c4.Module.pauseMainLoop(), 'resume' === _0x2c1832.act && _0x27f4c4.Module.resumeMainLoop(), 'wait' === _0x2c1832.act && (_0x378b5c.wait = true, _0x378b5c.systemPause(0x1), _0x2c1832.value !== _0x378b5c.connection.userid && (_0x378b5c.waitingList[_0x2c1832.value] = 0x1), _0x378b5c.disableControl(true)), 'wait-end' === _0x2c1832.act && (_0x378b5c.waitingList[_0x2c1832.value] && delete _0x378b5c.waitingList[_0x2c1832.value], 0x0 === Object.keys(_0x378b5c.waitingList).length && (_0x378b5c.wait = !0x1, _0x378b5c.systemPause(0x0), _0x378b5c.disableInput = !0x1)), 'sync-mem' === _0x2c1832.act) {3392_0x378b5c.wait = true, _0x378b5c.systemPause(0x1);3393var _0x2a5bce = _0x2c1832.value;3394_0x378b5c.disableControl(true), _0x378b5c.connection.send(JSON.stringify({3395'act': 'wait',3396'value': _0x2a5bce3397}));3398(async () => {3399const state = await _0x378b5c.saveState();3400_0x27f4c4.FS.createDataFile('/', 'game.state', state, true, true);3401_0x27f4c4.Module.cwrap('load_state', 'number', ['string', 'number'])('game.state', 0);3402//_0x27f4c4.FS.unlink('game.state');3403_0x378b5c.inputsData = {};3404const file = new File([state], '0-game.state', {3405'type': '',3406'lastModified': new Date()3407});3408_0x378b5c.connection.shareFile(file, _0x2a5bce);3409})()3410}3411if (_0x2c1832.act, 'get-players-result' === _0x2c1832.act && (_0x378b5c.players = _0x2c1832.value, _0x378b5c.roomMaster = _0x2c1832.master, _0x2c1832.newuser === _0x378b5c.connection.userid)) {3412var _0x418ccb = _0x2593da.coreOptionsValues;3413_0x2c1832.coreOptions && Object.keys(_0x2c1832.coreOptions).forEach(function(_0x3f4c8f) {3414_0x418ccb[_0x3f4c8f] !== _0x2c1832.coreOptions[_0x3f4c8f] && _0x2593da.updateCoreOptions.call(_0x17edbf, _0x3f4c8f, _0x2c1832.coreOptions[_0x3f4c8f]);3415}), _0x378b5c.showLoading.call(_0x17edbf), _0x378b5c.disableControl(true), setTimeout(function() {3416_0x378b5c.connection.send(JSON.stringify({3417'act': 'sync-mem',3418'value': _0x378b5c.connection.userid3419}), _0x378b5c.roomMaster);3420}, 0x1), _0x378b5c.roomMaster && _0x378b5c.connection.peers[_0x378b5c.roomMaster] && (_0x378b5c.connection.extra.room_name = _0x378b5c.connection.peers[_0x378b5c.roomMaster].extra.room_name, _0x378b5c.connection.updateExtraData()), _0x378b5c.connection.peers[_0x378b5c.roomMaster] && (_0x3d0d28 = _0x378b5c.connection.peers[_0x378b5c.roomMaster].extra), _0x378b5c.openRoom(_0x17edbf);3421}3422}3423}, _0x378b5c.connection.onUserStatusChanged = function(_0x4188ba) {3424if ('offline' === _0x4188ba.status) {3425var _0x17edbf = _0x378b5c.players.indexOf(_0x4188ba.userid);3426_0x17edbf >= 0x0 && (_0x378b5c.players[_0x17edbf] = null);3427}3428_0x4188ba.status;3429}, _0x378b5c.connection.onExtraDataUpdated = function(_0x20ce61) {3430_0x20ce61.userid === _0x378b5c.connection.userid && (_0x378b5c.connection.extra = _0x20ce61.extra);3431}, _0x378b5c.connection.onleave = function(_0x30ebc6) {3432if (_0x30ebc6.userid) {3433var _0x2c1832 = _0x378b5c.players.indexOf(_0x30ebc6.userid);3434_0x2c1832 >= 0x0 && (_0x378b5c.players[_0x2c1832] = null);3435}3436_0x378b5c.waitingList[_0x30ebc6.userid] && delete _0x378b5c.waitingList[_0x30ebc6.userid], _0x378b5c.connection.isInitiator && 0x0 === Object.keys(_0x378b5c.waitingList).length && _0x378b5c.wait && (_0x378b5c.wait = !0x1, _0x378b5c.systemPause(0x0), _0x378b5c.disableInput = !0x1, _0x378b5c.connection.send(JSON.stringify({3437'act': 'wait-end',3438'value': _0x378b5c.connection.userid3439}))), _0x378b5c.openRoom(_0x17edbf), _0x378b5c.inputsData = {}, _0x378b5c.hideLoading.call(_0x17edbf);3440};3441var _0x2fba43 = function() {3442try {3443_0x378b5c.connection.onbeforeunload();3444} catch (_0xac619d) {}3445_0x378b5c.connected = !0x1, _0x378b5c.connection.password = null, _0x378b5c.players = [], _0x378b5c.connection.peersBackup = [], _0x378b5c.waitingList = {}, _0x378b5c.inputsData = {}, _0x378b5c.hideLoading.call(_0x17edbf), _0x132da7(_0x17edbf.elements.buttons.restart, !0x1), _0x132da7(_0x17edbf.elements.buttons.loadState, !0x1), _0x132da7(_0x17edbf.elements.buttons.saveState, !0x1), _0x378b5c.allowCheat && _0x132da7(_0x17edbf.elements.buttons.cheat, !0x1), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x2), !0x1), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x3), !0x1), Array.from(_0x17edbf.elements.buttons.play).forEach(function(_0x3d296d) {3446_0x132da7(_0x3d296d, !0x1);3447}), _0x2593da.updateCoreOptionMenuItems.call(_0x17edbf);3448};3449_0x378b5c.connection.close = _0x2fba43, _0x378b5c.connection.disconnect = _0x2fba43, _0x378b5c.connection.leave = _0x2fba43;3450var _0x3f9c57, _0x10c0ad = function(_0x42ff74, _0x306f0b, _0x345d4d) {3451_0x378b5c.hideLoading.call(_0x17edbf), _0x42ff74 ? (_0x378b5c.stopLoadRooms(), _0x132da7(_0x17edbf.elements.buttons.restart, true), _0x132da7(_0x17edbf.elements.buttons.loadState, true), _0x132da7(_0x17edbf.elements.buttons.saveState, true), _0x378b5c.resetCheat(), _0x132da7(_0x17edbf.elements.buttons.cheat, true), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x2), true), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x3), true), Array.from(_0x17edbf.elements.buttons.play).forEach(function(_0x2911fb) {3452_0x132da7(_0x2911fb, true);3453}), _0x378b5c.connection.socket && _0x378b5c.connection.socket.on('set-isInitiator-true', function(_0x31da46) {3454_0x31da46 === _0x378b5c.connection.sessionid && (_0x378b5c.connection.socket.emit('extra-data-updated', _0x378b5c.connection.extra), _0x378b5c.connection.send(JSON.stringify({3455'act': 'room-master',3456'value': _0x378b5c.connection.userid3457})), _0x378b5c.roomMaster = _0x378b5c.connection.userid, _0x378b5c.systemPause(0x0), _0x27f4c4.Module.resumeMainLoop(), _0x2593da.updateCoreOptionMenuItems.call(_0x17edbf), _0x132da7(_0x17edbf.elements.buttons.restart, !0x1), _0x132da7(_0x17edbf.elements.buttons.loadState, !0x1), _0x132da7(_0x17edbf.elements.buttons.saveState, !0x1), Array.from(_0x17edbf.elements.buttons.play).forEach(function(_0x132034) {3458_0x132da7(_0x132034, !0x1);3459}));3460})) : (_0x4d8495.close(), _0x5289c1.querySelector('#modal-7d8fd50ed642340b-content').innerHTML = _0x345d4d, _0x4d8495.show('modal-7d8fd50ed642340b', {3461'closeTrigger': 'data-modal-close'3462}));3463},3464_0x1e0cdb = function(_0x5b3f13) {3465if (window.EJS_TURN_URLS === null || !window.EJS_TURN_URLS || window.EJS_TURN_URLS.length === 0) {3466_0x5289c1.querySelector('#modal-7d8fd50ed642340b-content').innerHTML = (window.EJS_TURN_URLS === null || window.EJS_TURN_URLS.length === 0) ? 'Netplay Currently Unavailable' : 'Netplay initializing';3467_0x4d8495.show('modal-7d8fd50ed642340b', {3468'closeTrigger': 'data-modal-close'3469});3470return;3471}3472_0x378b5c.connection.iceServers = window.EJS_TURN_URLS;3473var _0x2c1832 = _0x5b3f13.target.getAttribute('data-id');3474if ('Y' === _0x5b3f13.target.getAttribute('data-password')) _0x4d8495.show('modal-5aa765d61d8327de', {3475'closeTrigger': 'data-modal-close'3476}), _0x325651.setAttribute('data-id', _0x2c1832);3477else {3478_0x378b5c.showLoading.call(_0x17edbf), _0x378b5c.connection.userid = _0x378b5c.connection.token();3479try {3480_0x378b5c.connection.join(_0x2c1832, _0x10c0ad);3481} catch (_0x2767b9) {3482_0x378b5c.hideLoading.call(_0x17edbf), _0x5289c1.querySelector('#modal-7d8fd50ed642340b-content').innerHTML = 'Error', _0x4d8495.show('modal-7d8fd50ed642340b', {3483'closeTrigger': 'data-modal-close'3484});3485}3486}3487return _0x5b3f13.stopPropagation(), !0x1;3488};3489_0x378b5c.loadRoomsList = function() {3490_0x132da7(_0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['netplay-roomlist'])), !0x1), _0x132da7(_0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['netplay-room'])), true), _0x132da7(_0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['btn-create-room'])), !0x1), _0x132da7(_0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['btn-quit'])), true);3491var listUrl = _0x17edbf.listUrl3492if (! listUrl.endsWith('/')) {3493listUrl += '/';3494};3495var _0x2c1832 = _0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['netplay-roomlist'])).querySelector('tbody'),3496_0x5cf2be = [listUrl, 'list?game_id=', _0x17edbf.config.gameId, '&domain=', window.location.hostname, '&coreVer=', _0x17edbf.coreVer].join('');3497_0x550f17.a.get(_0x5cf2be, {}).then(function(_0x37c60b) {3498if (_0x37c60b.data) {3499var _0x4782da = [],3500_0x28e87d = [];3501_0x2c1832.querySelectorAll('tr').forEach(function(_0x1e5a22) {3502_0x28e87d.push(_0x1e5a22.getAttribute('id'));3503}), Object.keys(_0x37c60b.data).forEach(function(_0x47ae0e) {3504var _0x4a8f4c = _0x37c60b.data[_0x47ae0e];3505if (_0x4782da.push(_0x47ae0e), _0x28e87d.includes(_0x47ae0e)) {3506var _0x2d672f = _0x2c1832.querySelector('tr[id="' .concat(_0x47ae0e, '"]'));3507_0x2c1832.removeChild(_0x2d672f);3508}3509var _0x295f41 = document.createElement('tr');3510_0x295f41.setAttribute('id', _0x47ae0e);3511var _0xa2ea61 = _0x4a8f4c.password ? _0x378b5c.icons.lock : '',3512_0x5452b6 = _0x4a8f4c.password ? 'Y' : 'N',3513_0xb3121d = _0x4a8f4c.current < _0x4a8f4c.max ? '<span data-id="' .concat(_0x47ae0e, '" data-password="').concat(_0x5452b6, '" class="').concat(_0x378b5c.classNames['btn-join-room'], '">Join</span>') : '',3514_0x5c8146 = _0x4a8f4c.country ? _0x4a8f4c.country : '?';3515_0x295f41.innerHTML = '<td>[' .concat(_0x5c8146, '] ').concat(_0xa2ea61, ' ').concat(_0x4a8f4c.room_name, '</td><td>').concat(_0x4a8f4c.current, '/').concat(_0x4a8f4c.max, '</td><td>').concat(_0xb3121d, '</td>'), _0x1093f4.call(_0xa88a13, _0x295f41.querySelector('.' .concat(_0x378b5c.classNames['btn-join-room'])), 'click', _0x1e0cdb), _0x2c1832.appendChild(_0x295f41);3516}), _0x2c1832.querySelectorAll('tr').forEach(function(_0x24dcf7) {3517_0x4782da.includes(_0x24dcf7.id) || _0x2c1832.removeChild(_0x24dcf7);3518});3519}3520_0x378b5c.loadRoomsListTimer = setTimeout(_0x378b5c.loadRoomsList, 0x7d0);3521}).catch(function(_0x227055) {3522console.log('Network Error', _0x227055), _0x378b5c.loadRoomsListTimer = setTimeout(_0x378b5c.loadRoomsList, 0x7d0);3523});3524}, _0x378b5c.openRoom = function(_0x10625f) {3525_0x378b5c.stopLoadRooms();3526_0x132da7(_0x10625f.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['netplay-roomlist'])), true);3527_0x132da7(_0x10625f.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['netplay-room'])), !0x1);3528_0x132da7(_0x10625f.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['btn-create-room'])), true);3529_0x132da7(_0x10625f.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['btn-quit'])), !0x1);3530_0x378b5c.resetCheat();3531_0x132da7(_0x10625f.elements.buttons.cheat, true);3532var _0x17edbf = _0x10625f.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['netplay-room'])),3533_0x2c1832 = _0x17edbf.querySelector('[data-room-password]');3534null === _0x378b5c.connection.password ? _0x132da7(_0x2c1832, true) : (_0x132da7(_0x2c1832, !0x1), _0x2c1832.querySelector('span').innerText = _0x378b5c.connection.password);3535var _0x18c1cb = _0x17edbf.querySelector('tbody');3536_0x18c1cb.innerHTML = '', _0x17edbf.querySelector('strong').innerText = _0x3d0d28.room_name, _0x378b5c.players.forEach(function(_0x938d55, _0xf3d39a) {3537var _0x2c1832 = null;3538if (_0x938d55 && (_0x378b5c.connection.peers[_0x938d55] ? _0x2c1832 = _0x378b5c.connection.peers[_0x938d55].extra : _0x378b5c.connection.userid === _0x938d55 && (_0x2c1832 = _0x378b5c.connection.extra), _0x2c1832 && _0x2c1832.name)) {3539var _0x564064 = document.createElement('tr');3540_0x564064.innerHTML = '<td>' .concat(_0xf3d39a + 0x1, '</td><td>').concat(_0x2c1832.name, '</td><td></td>'), _0x18c1cb.appendChild(_0x564064);3541}3542});3543}, _0x1093f4.call(this, _0x325651.querySelector('.' .concat(_0x378b5c.classNames['modal__btn-primary'])), 'click', function(_0x9ac969) {3544var _0x2c1832 = _0x325651.querySelector('.' .concat(_0x378b5c.classNames['netplay-room-password-input'])).value;3545_0x378b5c.showLoading.call(_0x17edbf), _0x378b5c.connection.password = _0x2c1832;3546var _0xcf7207 = _0x325651.getAttribute('data-id');3547_0x378b5c.connection.join(_0xcf7207, function(_0x1a0deb, _0x1ef6c8, _0x1ad18e) {3548_0x10c0ad(_0x1a0deb, 0x0, _0x1ad18e), _0x1a0deb && _0x325651.classList.remove(_0x449eac({3549'is-open': true3550}));3551}), _0x9ac969.stopPropagation();3552}), _0x1093f4.call(this, _0x2c1832.querySelector('.' .concat(_0x378b5c.classNames['modal__btn-primary'])), 'click', function(_0x43f795) {3553var _0x17edbf = _0x2c1832.querySelector('.' .concat(_0x378b5c.classNames['netplay-player-name'])).value;3554_0x17edbf = _0x17edbf.replace(/<|>/g, ''), _0x2c1832.querySelector('.' .concat(_0x378b5c.classNames.modal__errmsg)).innerHTML = '', _0x17edbf.trim() && (_0x378b5c.playerName = _0x17edbf.trim(), _0x378b5c.connection.extra.name = _0x17edbf.trim(), _0x4d8495.close()), _0x43f795.stopPropagation();3555}), _0x1093f4.call(this, _0x36bde0.querySelector('.' .concat(_0x378b5c.classNames['modal__btn-primary'])), 'click', function(_0x202cf6) {3556var _0x2c1832 = _0x36bde0.querySelector('.' .concat(_0x378b5c.classNames['netplay-room-name-input'])).value;3557_0x2c1832 = _0x2c1832.replace(/<|>/g, '');3558var _0x3510ed = _0x36bde0.querySelector('select[data-max-players] option:checked').value;3559_0x3510ed < 0x2 && (_0x3510ed = 0x2), _0x3510ed > 0x4 && (_0x3510ed = 0x4);3560for (var _0x1264b2 = 0x0; _0x1264b2 < _0x3510ed; _0x1264b2++) _0x378b5c.players[_0x1264b2] = null;3561_0x378b5c.connection.maxParticipantsAllowed = _0x3510ed;3562var _0x140bcf = _0x36bde0.querySelector('.' .concat(_0x378b5c.classNames['netplay-room-password-input'])).value;3563_0x36bde0.querySelector('.' .concat(_0x378b5c.classNames.modal__errmsg)).innerHTML = '', _0x2c1832.trim() ? (_0x378b5c.connection.extra.room_name = _0x2c1832.trim(), '' !== _0x140bcf.trim() && (_0x378b5c.connection.password = _0x140bcf.trim()), _0x378b5c.showLoading.call(_0x17edbf), _0x378b5c.connection.open(_0x378b5c.connection.token(), function(_0x3c6c26, _0x203288, _0x210547) {3564_0x378b5c.hideLoading.call(_0x17edbf), _0x3c6c26 ? (_0x378b5c.players[0x0] = _0x378b5c.connection.userid, _0x378b5c.roomMaster = _0x378b5c.connection.userid, _0x3f9c57.closeModal(), _0x378b5c.stopLoadRooms(), _0x3d0d28 = _0x378b5c.connection.extra, _0x378b5c.openRoom(_0x17edbf), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x2), true), _0x132da7(_0x2593da.contextMenu.querySelectorAll('ul li').item(0x3), true)) : _0x36bde0.querySelector('.' .concat(_0x378b5c.classNames.modal__errmsg)).innerHTML = _0x210547;3565})) : _0x3f9c57.closeModal(), _0x202cf6.stopPropagation();3566}), _0x1093f4.call(this, _0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['btn-create-room'])), 'click', function(_0x48cb26) {3567if (window.EJS_TURN_URLS === null || !window.EJS_TURN_URLS || window.EJS_TURN_URLS.length === 0) {3568_0x5289c1.querySelector('#modal-7d8fd50ed642340b-content').innerHTML = (window.EJS_TURN_URLS === null || window.EJS_TURN_URLS.length === 0) ? 'Netplay Currently Unavailable' : 'Netplay initializing';3569_0x4d8495.show('modal-7d8fd50ed642340b', {3570'closeTrigger': 'data-modal-close'3571});3572return;3573}3574_0x378b5c.connection.iceServers = window.EJS_TURN_URLS;3575return _0x3f9c57 = _0x4d8495.show('modal-85cd7a1c543a484a', {3576'closeTrigger': 'data-modal-close',3577'onClose': function() {3578_0x17edbf.elements.container.focus();3579}3580}), _0x48cb26.stopPropagation(), !0x1;3581}), _0x1093f4.call(this, _0x17edbf.elements.dialogs.netplay.querySelector('.' .concat(_0x378b5c.classNames['btn-quit'])), 'click', function(_0x68459d) {3582return _0x378b5c.connection.close(), _0x378b5c.stopLoadRooms(), _0x378b5c.loadRoomsList(), _0x378b5c.inputsData = {}, _0x68459d.stopPropagation(), !0x1;3583});3584}3585window._0x378b5c = _0x378b5c;3586},3587'initKeyboard': function() {3588let _this = this,3589_0x17edbf = this,3590_0x2c1832 = this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames.overlay));3591_0x1093f4.call(this, document.body, 'keydown keyup', function(_0x459b32) {3592if (_0x459b32.which >= 0x70 && _0x459b32.which <= 0x7b);3593else {3594let _0x335c01 = !_this.elements.dialogs.gamepad.hidden && !_0x2c1832.hidden,3595_0x2eb03e = 'keydown' === _0x459b32.type;3596if (_0x2eb03e && _0x335c01) {3597let _0x1a3a47 = _0x2c1832.getAttribute('data-index'),3598_0x1394cb = _0x2c1832.getAttribute('data-id'),3599_0x2c8fd1 = null;3600if (_0x459b32.key && _0x378b5c.keyMap[_0x459b32.keyCode] === 'escape') {3601(_0x2c8fd1 = _0x17edbf.elements.dialogs.gamepad.querySelector('[data-id="' .concat(_0x1394cb, '"][data-index="').concat(_0x1a3a47, '"][data-type="1"]'))).setAttribute('data-value', '')3602_0x2c8fd1.value = ''3603(_0x2c8fd1 = _0x17edbf.elements.dialogs.gamepad.querySelector('[data-id="' .concat(_0x1394cb, '"][data-index="').concat(_0x1a3a47, '"][data-type="2"]'))).setAttribute('data-value', '')3604_0x2c8fd1.value = ''3605_0x132da7(_0x2c1832, true);3606return;3607};3608_0x1a3a47 = _0x2c1832.getAttribute('data-index');3609_0x1394cb = _0x2c1832.getAttribute('data-id');3610_0x2c8fd1 = null;3611_0x459b32.key && ((_0x2c8fd1 = _0x17edbf.elements.dialogs.gamepad.querySelector('[data-id="' .concat(_0x1394cb, '"][data-index="').concat(_0x1a3a47, '"][data-type="1"]'))).setAttribute('data-value', _0x459b32.keyCode), _0x2c8fd1.value = _0x378b5c.keyMap[_0x459b32.keyCode]), _0x132da7(_0x2c1832, true);3612} else Object.keys(_0x378b5c.controllers).forEach(function(_0x3863d2) {3613Object.keys(_0x378b5c.controllers[_0x3863d2]).forEach(function(_0x509939) {3614if (parseInt(_0x378b5c.controllers[_0x3863d2][_0x509939].value, 0xa) === _0x459b32.keyCode && ['24', '25', '26'].includes(_0x509939) && _0x459b32.type == 'keydown' && ! _0x459b32.repeat) {3615if (_0x509939 == '24') {//save3616_0x378b5c.quickSaveState()3617} else if (_0x509939 == '25') {//load3618_0x378b5c.quickLoadState()3619} else if (_0x509939 == '26') {//load3620_0x378b5c.changeStateSlot()3621}3622// quick save/load button3623}3624parseInt(_0x378b5c.controllers[_0x3863d2][_0x509939].value, 0xa) === _0x459b32.keyCode && (_0x2eb03e ? _0x509939 >= 0x10 && _0x509939 <= 0x17 ? _0x378b5c.simulateInput(_0x3863d2, _0x509939, 0x7fff) : _0x378b5c.simulateInput(_0x3863d2, _0x509939, 1) : _0x378b5c.simulateInput(_0x3863d2, _0x509939, 0));3625});3626});3627}3628}), document.body.addEventListener('keydown', function(_0x14d612) {3629let _0x2c1832 = _0x14d612.keyCode ? _0x14d612.keyCode : _0x14d612.which;3630[0x20, 0x25, 0x26, 0x27, 0x28, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b].includes(_0x2c1832) && _0x14d612.srcElement === _0x17edbf.elements.container && _0x14d612.preventDefault(), _0x14d612.srcElement.className.split(/ +/).includes(_0x378b5c.classNames.set) && _0x14d612.preventDefault();3631});3632},3633'initGamepad': function() {3634let _this = this,3635_0x17edbf = this,3636_0x2c1832 = this.elements.dialogs.gamepad.querySelector('.' .concat(_0x378b5c.classNames.overlay));3637let gamepad;3638try {3639gamepad = new _0x4ad1c6();3640} catch(e) {3641console.warn('gamepad not supported');3642return;3643}3644_0x378b5c.gamepad = gamepad;3645gamepad.on('buttondown', function(event) {3646if (!_this.elements.dialogs.gamepad.hidden && !_0x2c1832.hidden) {3647let _0x387018, _0xdd4205 = parseInt(_0x2c1832.getAttribute('data-index'), 0xa),3648_0x1f4ee2 = _0x2c1832.getAttribute('data-id');3649if (event.gamepadIndex === parseInt(_0xdd4205, 0xa)) {3650let _0x126d2d = null;3651(_0x126d2d = _0x17edbf.elements.dialogs.gamepad.querySelector('[data-id="' .concat(_0x1f4ee2, '"][data-index="').concat(_0xdd4205, '"][data-type="2"]'))).setAttribute('data-value', event.index), _0x126d2d.value = 'button ' .concat(event.index + 1), _0x132da7(_0x2c1832, true);3652}3653} else Object.keys(_0x378b5c.controllers[event.gamepadIndex.toString()]).forEach(function(_0x3cf4d3) {3654let _0x5cf388 = event.gamepadIndex.toString();3655if (parseInt(_0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2, 0xa) === parseInt(event.index, 0xa) && ['24', '25', '26'].includes(_0x3cf4d3)) {3656if (_0x3cf4d3 == '24') {//save3657_0x378b5c.quickSaveState()3658} else if (_0x3cf4d3 == '25') {//load3659_0x378b5c.quickLoadState()3660} else if (_0x3cf4d3 == '26') {//load3661_0x378b5c.changeStateSlot()3662}3663}3664parseInt(_0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2, 0xa) === parseInt(event.index, 0xa) && parseInt(_0x5cf388, 0xa) === parseInt(event.gamepadIndex, 0xa) && _0x378b5c.simulateInput(_0x5cf388, _0x3cf4d3, 1);3665});3666});3667gamepad.on('buttonup', function(event) {3668Object.keys(_0x378b5c.controllers).forEach(function(_0x302c3e) {3669Object.keys(_0x378b5c.controllers[_0x302c3e]).forEach(function(_0x14eb8a) {3670parseInt(_0x378b5c.controllers[_0x302c3e][_0x14eb8a].value2, 0xa) === parseInt(event.index, 0xa) && parseInt(_0x302c3e, 0xa) === parseInt(event.gamepadIndex, 0xa) && _0x378b5c.simulateInput(_0x302c3e, _0x14eb8a, 0);3671});3672});3673});3674gamepad.on('axischanged', function(event) {3675let value = function(value) {3676if (value > 0.5 || value < -0.5) {3677return (value > 0) ? 1 : -1;3678} else {3679return 0;3680}3681}(event.value);3682if (!_this.elements.dialogs.gamepad.hidden && !_0x2c1832.hidden) {3683if (value !== 0) {3684let _0x1f4ee2 = _0x2c1832.getAttribute('data-id'),3685_0xdd4205 = parseInt(_0x2c1832.getAttribute('data-index'), 0xa);3686let _0x126d2d = _this.elements.dialogs.gamepad.querySelector('[data-id="' .concat(_0x1f4ee2, '"][data-index="').concat(_0xdd4205, '"][data-type="2"]'))3687_0x126d2d.setAttribute('data-value', event.axis + ':' + value)3688_0x126d2d.value = event.axis + ':' + value3689_0x132da7(_0x2c1832, true)3690}3691} else {3692if (! _0x378b5c.prevButtons) {3693_0x378b5c.prevButtons = {}3694}3695let quit = false3696let _0x5cf388 = event.gamepadIndex.toString();3697if (! _0x378b5c.prevButtons[_0x5cf388]) {3698_0x378b5c.prevButtons[_0x5cf388] = {}3699}3700if (! _0x378b5c.prevButtons[_0x5cf388][event.axis]) {3701_0x378b5c.prevButtons[_0x5cf388][event.axis] = 03702}3703if (! _0x378b5c.prevButtons[_0x5cf388].buttonID) {3704_0x378b5c.prevButtons[_0x5cf388].buttonID = 03705}3706for (let w=0; w<Object.keys(_0x378b5c.controllers[_0x5cf388]).length; w++) {3707let _0x3cf4d3 = Object.keys(_0x378b5c.controllers[_0x5cf388])[w]3708if (! _0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2) {3709continue3710}3711if (_0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2.split(':')[0] === event.axis && parseInt(_0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2.split(':')[1]) === value && ['24', '25', '26'].includes(_0x3cf4d3)) {3712if (_0x3cf4d3 == '24') {//save3713quit = true3714_0x378b5c.quickSaveState()3715} else if (_0x3cf4d3 == '25') {//load3716quit = true3717_0x378b5c.quickLoadState()3718} else if (_0x3cf4d3 == '26') {//load3719_0x378b5c.changeStateSlot()3720}3721}3722if (value === 0) {3723// button up3724if (_0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2.split(':')[0] === event.axis) {3725_0x378b5c.prevButtons[_0x5cf388][event.axis] = value3726_0x378b5c.prevButtons[_0x5cf388].buttonID = _0x3cf4d33727_0x378b5c.simulateInput(_0x5cf388, _0x3cf4d3, 0)3728}3729} else {3730//button down3731if ((1 === _0x378b5c.prevButtons[_0x5cf388][event.axis] && value === -1) ||3732(-1 === _0x378b5c.prevButtons[_0x5cf388][event.axis] && value === 1)) {3733_0x378b5c.simulateInput(_0x5cf388, _0x378b5c.prevButtons[_0x5cf388].buttonID, 0)3734}3735if (_0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2.split(':')[0] === event.axis && parseInt(_0x378b5c.controllers[_0x5cf388][_0x3cf4d3].value2.split(':')[1]) === value) {3736_0x378b5c.prevButtons[_0x5cf388][event.axis] = value3737_0x378b5c.prevButtons[_0x5cf388].buttonID = _0x3cf4d33738quit = true3739_0x378b5c.simulateInput(_0x5cf388, _0x3cf4d3, 1)3740}3741}3742};3743if (quit) {3744return3745}3746if (! _this.elements.dialogs.gamepad.hidden && !_0x2c1832.hidden) {3747return3748}3749}3750Math.abs(event.value) <= 0.1 && (event.value = 0);3751let _0x17edbf = event.gamepadIndex;3752let coreVer = _this.coreVer;3753if (event.axis === 'LEFT_STICK_X') {3754if (event.value > 0) {3755_0x378b5c.simulateInput(_0x17edbf, 16, 0x7fff * event.value);3756_0x378b5c.simulateInput(_0x17edbf, 17, 0);3757} else {3758_0x378b5c.simulateInput(_0x17edbf, 17, -0x7fff * event.value);3759_0x378b5c.simulateInput(_0x17edbf, 16, 0);3760}3761} else if (event.axis === 'LEFT_STICK_Y') {3762if (event.value > 0) {3763_0x378b5c.simulateInput(_0x17edbf, 18, 0x7fff * event.value);3764_0x378b5c.simulateInput(_0x17edbf, 19, 0);3765} else {3766_0x378b5c.simulateInput(_0x17edbf, 19, -0x7fff * event.value);3767_0x378b5c.simulateInput(_0x17edbf, 18, 0);3768}3769} else if (event.axis === 'RIGHT_STICK_X') {3770if (event.value > 0) {3771_0x378b5c.simulateInput(_0x17edbf, 20, 0x7fff * event.value);3772_0x378b5c.simulateInput(_0x17edbf, 21, 0);3773} else {3774_0x378b5c.simulateInput(_0x17edbf, 21, -0x7fff * event.value);3775_0x378b5c.simulateInput(_0x17edbf, 20, 0);3776}3777} else if (event.axis === 'RIGHT_STICK_Y') {3778if (event.value > 0) {3779_0x378b5c.simulateInput(_0x17edbf, 22, 0x7fff * event.value);3780_0x378b5c.simulateInput(_0x17edbf, 23, 0);3781} else {3782_0x378b5c.simulateInput(_0x17edbf, 23, 0x7fff * event.value);3783_0x378b5c.simulateInput(_0x17edbf, 22, 0);3784}3785}3786});3787gamepad.on('disconnected', function(event) {3788[0, 1, 2, 3].forEach(function(_0x429f30) {3789let _0x2c1832 = gamepad.gamepads[_0x429f30];3790_0x17edbf.elements.dialogs.gamepad.querySelector('#controls-' .concat(_0x429f30, ' .gamepad-name')).innerHTML = _0x2c1832 ? _0x2c1832.id : 'n/a';3791});3792});3793gamepad.on('connected', function(event) {3794Object.keys(gamepad.gamepads).forEach(function(_0x327c74) {3795let _0x2c1832 = gamepad.gamepads[_0x327c74];3796_0x17edbf.elements.dialogs.gamepad.querySelector('#controls-' .concat(_0x327c74, ' .gamepad-name')).innerHTML = _0x2c1832 ? _0x2c1832.id : 'n/a';3797});3798});3799},3800'setShader': function(_0x4cbec3) {3801if ('disabled' === _0x4cbec3) _0x27f4c4.FS.unlink('/shader/shader.glslp', ''), _0x378b5c.toggleShader && _0x378b5c.toggleShader(0);3802else {3803_0x378b5c.toggleShader && _0x378b5c.toggleShader(0);3804let _0x17edbf = '/shader/' .concat(_0x4cbec3);3805_0x27f4c4.FS.writeFile('/shader/shader.glslp', _0x27f4c4.FS.readFile(_0x17edbf));3806_0x378b5c.toggleShader && _0x378b5c.toggleShader(1);3807}3808},3809'toggleVirtualGamepad': function(_0x1ed80b, forceUpdateHTML) {3810let _this = this;3811if (_0x378b5c.virtualGamepadContainer && !forceUpdateHTML) {3812_0x132da7(_0x378b5c.virtualGamepadContainer, !_0x1ed80b);3813return3814}3815if (!_0x378b5c.virtualGamepadContainer) {3816_0x378b5c.virtualGamepadContainer = _0x428003('div', {3817'class': getClass({3818'ejs-virtual-gamepad': true3819}),3820'hidden': ''3821});3822this.elements.container.appendChild(_0x378b5c.virtualGamepadContainer);3823}3824let blockCSS = 'height:31px;text-align:center;border:1px solid #ccc;border-radius:5px;line-height:31px;';3825let html = '';3826let info;38273828if (_this.config.VirtualGamepadSettings && function(set) {3829if (!Array.isArray(set)) {3830console.warn("Vritual gamepad settings is not array! Using default gamepad settings");3831return false;3832}3833if (!set.length) {3834console.warn("Vritual gamepad settings is empty! Using default gamepad settings");3835return false;3836}3837for (let i=0; i<set.length; i++) {3838if (!set[i].type) continue;3839try {3840if (set[i].type === 'zone' || set[i].type === 'dpad') {3841if (!set[i].location) {3842console.warn("Missing location value for "+set[i].type+"! Using default gamepad settings");3843return false;3844} else if (!set[i].inputValues) {3845console.warn("Missing inputValues for "+set[i].type+"! Using default gamepad settings");3846return false;3847}3848continue;3849}3850if (!set[i].location) {3851console.warn("Missing location value for button "+set[i].text+"! Using default gamepad settings");3852return false;3853} else if (!set[i].type) {3854console.warn("Missing type value for button "+set[i].text+"! Using default gamepad settings");3855return false;3856} else if (!set[i].id.toString()) {3857console.warn("Missing id value for button "+set[i].text+"! Using default gamepad settings");3858return false;3859} else if (!set[i].input_value.toString()) {3860console.warn("Missing input_value for button "+set[i].text+"! Using default gamepad settings");3861return false;3862}3863} catch(e) {3864console.warn("Error checking values! Using default gamepad settings");3865return false;3866}3867}3868return true;3869}(_this.config.VirtualGamepadSettings)) {3870info = _this.config.VirtualGamepadSettings;3871} else if (['gba', 'gb', 'vb', 'nes'].includes(getSystem(_this.system, true))) {3872info = [{"type":"button","text":"B","id":"b","location":"right","right":-10,"top":70,"bold":true,"input_value":0},{"type":"button","text":"A","id":"a","location":"right","right":60,"top":70,"bold":true,"input_value":8},{"type":"dpad","location":"left","left":"50%","right":"50%","joystickInput":false,"inputValues":[4,5,6,7]},{"type":"button","text":"Start","id":"start","location":"center","left":60,"fontSize":15,"block":true,"input_value":3},{"type":"button","text":"Select","id":"select","location":"center","left":-5,"fontSize":15,"block":true,"input_value":2}];3873if (getSystem(_this.system, true) === 'gba') {3874info.push({"type":"button","text":"L","id":"l","block":true,"location":"top","left":10,"top":-40,"bold":true,"input_value":10});3875info.push({"type":"button","text":"R","id":"r","block":true,"location":"top","right":10,"top":-40,"bold":true,"input_value":11});3876}3877} else if (getSystem(_this.system, true) === 'n64') {3878info = [{"type":"button","text":"B","id":"b","location":"right","left":-10,"top":95,"input_value":0,"bold":true,"input_new_cores":1},{"type":"button","text":"A","id":"a","location":"right","left":40,"top":150,"input_value":8,"bold":true,"input_new_cores":0},{"type":"zone","location":"left","left":"50%","top":"100%","joystickInput":true,"inputValues":[16, 17, 18, 19]},{"type":"zone","location":"left","left":"50%","top":"0%","joystickInput":false,"inputValues":[4,5,6,7]},{"type":"button","text":"Start","id":"start","location":"center","left":30,"top":-10,"fontSize":15,"block":true,"input_value":3},{"type":"button","text":"L","id":"l","block":true,"location":"top","left":10,"top":-40,"bold":true,"input_value":10},{"type":"button","text":"R","id":"r","block":true,"location":"top","right":10,"top":-40,"bold":true,"input_value":11},{"type":"button","text":"Z","id":"z","block":true,"location":"top","left":10,"bold":true,"input_value":12},{"fontSize":20,"type":"button","text":"CU","id":"cu","location":"right","left":25,"top":-65,"input_value":23},{"fontSize":20,"type":"button","text":"CD","id":"cd","location":"right","left":25,"top":15,"input_value":22},{"fontSize":20,"type":"button","text":"CL","id":"cl","location":"right","left":-15,"top":-25,"input_value":21},{"fontSize":20,"type":"button","text":"CR","id":"cr","location":"right","left":65,"top":-25,"input_value":20}];3879} else if (['snes', 'nds'].includes(getSystem(_this.system, true))) {3880info = [{"type":"button","text":"X","id":"x","location":"right","left":40,"bold":true,"input_value":9},{"type":"button","text":"Y","id":"y","location":"right","top":40,"bold":true,"input_value":1},{"type":"button","text":"A","id":"a","location":"right","left":81,"top":40,"bold":true,"input_value":8},{"type":"button","text":"B","id":"b","location":"right","left":40,"top":80,"bold":true,"input_value":0},{"type":"zone","location":"left","left":"50%","top":"50%","joystickInput":false,"inputValues":[4,5,6,7]},{"type":"button","text":"Start","id":"start","location":"center","left":60,"fontSize":15,"block":true,"input_value":3},{"type":"button","text":"Select","id":"select","location":"center","left":-5,"fontSize":15,"block":true,"input_value":2}];3881} else {3882info = [{"type":"button","text":"Y","id":"y","location":"right","left":40,"bold":true,"input_value":9},{"type":"button","text":"X","id":"X","location":"right","top":40,"bold":true,"input_value":1},{"type":"button","text":"B","id":"b","location":"right","left":81,"top":40,"bold":true,"input_value":8},{"type":"button","text":"A","id":"a","location":"right","left":40,"top":80,"bold":true,"input_value":0},{"type":"zone","location":"left","left":"50%","top":"50%","joystickInput":false,"inputValues":[4,5,6,7]},{"type":"button","text":"Start","id":"start","location":"center","left":60,"fontSize":15,"block":true,"input_value":3},{"type":"button","text":"Select","id":"select","location":"center","left":-5,"fontSize":15,"block":true,"input_value":2}];3883}3884info = JSON.parse(JSON.stringify(info));388538863887let dataHTML = {3888top: '',3889left: '',3890center: '',3891right: ''3892}3893let leftHandedMode = false;3894if (_0x2593da && typeof _0x2593da.getCoreOptionsValue === 'function') {3895leftHandedMode = _0x2593da.getCoreOptionsValue('left-handed-mode')==='on';3896}3897for (let i=0; i<info.length; i++) {3898if (info[i].type !== 'button') continue;3899let opts = {'buttons': true};3900if (leftHandedMode && ['left', 'right'].includes(info[i].location)) {3901info[i].location = (info[i].location==='left') ? 'right' : 'left';3902const amnt = JSON.parse(JSON.stringify(info[i]));3903if (amnt.left) {3904info[i].right = amnt.left;3905}3906if (amnt.right) {3907info[i].left = amnt.right;3908}3909}3910opts['b_'+info[i].id.toLowerCase()] = true;3911let style = '';3912if (info[i].left) {3913style += 'left:'+info[i].left+(typeof info[i].left === 'number'?'px':'')+';';3914}3915if (info[i].right) {3916style += 'right:'+info[i].right+(typeof info[i].right === 'number'?'px':'')+';';3917}3918if (info[i].top) {3919style += 'top:'+info[i].top+(typeof info[i].top === 'number'?'px':'')+';';3920}3921if (!info[i].bold) {3922style += 'font-weight:normal;';3923} else if (info[i].bold) {3924style += 'font-weight:bold;';3925}3926info[i].fontSize = info[i].fontSize || 30;3927style += 'font-size:'+info[i].fontSize+'px;';3928if (info[i].block) {3929style += blockCSS;3930}3931if (['top', 'center', 'left', 'right'].includes(info[i].location)) {3932dataHTML[info[i].location] += '<div class="'+getClass(opts)+'" style="'+style+'">'+info[i].text+'</div>';3933}3934}3935html += '<div class="'+getClass({'virtual-gamepad': true})+'" style="display: block;">';3936html += '<div class="'+getClass({'top': true})+'">';3937html += dataHTML.top;3938html += '</div>';3939html += '<div class="'+getClass({'left': true})+'">';3940html += dataHTML.left;3941html += '</div>';3942html += '<div class="'+getClass({'center': true})+'">';3943html += dataHTML.center;3944html += '</div>';3945html += '<div class="'+getClass({'right': true})+'">';3946html += dataHTML.right;3947html += '</div></div>';3948_0x378b5c.virtualGamepadContainer.innerHTML = html;3949_0x132da7(_0x378b5c.virtualGamepadContainer, !_0x1ed80b);39503951let _0x2c1832 = getClass({3952'virtual-gamepad': true3953}),3954_0x2ec721 = getClass({3955'touch': true3956});3957if (! _0x59aa33.isIos) {3958_0x1093f4.call(this, _0x530042.call(this, '.' .concat(_0x2c1832)), 'touchmove', function(event) {3959event.stopPropagation();3960});3961}3962function createDPad(config) {3963let _0xb30294 = config.container,3964_0x46ee07 = config.event;3965if (typeof _0x46ee07 !== 'function') (_0x46ee07 = function () {});3966let _0x2af034 = _0x428003('div', {class: getClass({"dpad-bg": true})}),3967_0x573eda = _0x428003('div', {class: getClass({"dpad-front": true})});39683969function _0x12b76b(event) {3970let _0x243fd0 = event.targetTouches[0];3971if (_0x243fd0) {3972let _0x30ad4f = _0x573eda.getBoundingClientRect(),3973_0x3f2d89 = _0x243fd0.clientX - _0x30ad4f.left - _0x573eda.clientWidth / 2,3974_0x23d024 = _0x243fd0.clientY - _0x30ad4f.top - _0x573eda.clientHeight / 2,3975_0x10098e = 0,3976_0x419bd0 = 0,3977_0x21a1ad = 0,3978_0x1f5439 = 0,3979_0x4fda8c = Math.atan(_0x3f2d89 / _0x23d024) / (Math.PI / 180);39803981_0x23d024 <= -10 && (_0x10098e = 1);3982_0x23d024 >= 10 && (_0x419bd0 = 1);3983_0x3f2d89 >= 10 && (_0x1f5439 = 1, _0x21a1ad = 0, (_0x4fda8c < 0 && _0x4fda8c >= -35 || _0x4fda8c > 0 && _0x4fda8c <= 35) && (_0x1f5439 = 0), _0x10098e = _0x4fda8c < 0 && _0x4fda8c >= -55 ? 1 : 0, _0x419bd0 = _0x4fda8c > 0 && _0x4fda8c <= 55 ? 1 : 0);3984_0x3f2d89 <= -10 && (_0x1f5439 = 0, _0x21a1ad = 1, (_0x4fda8c < 0 && _0x4fda8c >= -35 || _0x4fda8c > 0 && _0x4fda8c <= 35) && (_0x21a1ad = 0), _0x10098e = _0x4fda8c > 0 && _0x4fda8c <= 55 ? 1 : 0, _0x419bd0 = _0x4fda8c < 0 && _0x4fda8c >= -55 ? 1 : 0);3985_0x2af034.classList.toggle(getClass({"dpad-right": true}), _0x1f5439);3986_0x2af034.classList.toggle(getClass({"dpad-left": true}), _0x21a1ad);3987_0x2af034.classList.toggle(getClass({"dpad-up": true}), _0x10098e);3988_0x2af034.classList.toggle(getClass({"dpad-down": true}), _0x419bd0);3989_0x46ee07(_0x10098e, _0x419bd0, _0x21a1ad, _0x1f5439);3990}3991event.stopPropagation();3992}3993function _0x320749(event) {3994_0x46ee07(0, 0, 0, 0);3995_0x2af034.classList.toggle(getClass({"dpad-up": true}), false);3996_0x2af034.classList.toggle(getClass({"dpad-down": true}), false);3997_0x2af034.classList.toggle(getClass({"dpad-right": true}), false);3998_0x2af034.classList.toggle(getClass({"dpad-left": true}), false);3999event.stopPropagation();4000}40014002_0x2af034.innerHTML = '<div class="'.concat(getClass({"dpad-1": true}), '"><div class="').concat(getClass({"dpad-1-bg": true}), '"></div></div>\n <div class="').concat(getClass({"dpad-2": true}), '"><div class="').concat(getClass({"dpad-2-bg": true}), '"></div></div>');4003_0xb30294.append(_0x2af034);4004_0xb30294.append(_0x573eda);4005_0x1093f4.call(_this, _0x573eda, 'touchstart touchmove', _0x12b76b);4006_0x1093f4.call(_this, _0x573eda, 'touchend touchcancel', _0x320749);4007}4008info.forEach((dpad, index) => {4009if (dpad.type !== 'dpad') return;4010let opts = {};4011if (leftHandedMode && ['left', 'right'].includes(dpad.location)) {4012dpad.location = (dpad.location==='left') ? 'right' : 'left';4013const amnt = JSON.parse(JSON.stringify(dpad));4014if (amnt.left) {4015dpad.right = amnt.left;4016}4017if (amnt.right) {4018dpad.left = amnt.right;4019}4020}4021opts[dpad.location.toLowerCase()] = true;4022const parent = _0x530042.call(this, '.'.concat(getClass({4023'ejs-virtual-gamepad': true4024}), ' .').concat(getClass(opts)));4025opts['dpad_'+index] = true;4026const elem = _0x428003('div', {4027'class': '.'.concat(getClass({4028'ejs-virtual-gamepad': true,4029'dpad-container': true4030}), ' .').concat(getClass(opts))4031});4032let style = '';4033if (dpad.left) {4034style += 'left:'+dpad.left+';';4035}4036if (dpad.right) {4037style += 'right:'+dpad.right+';';4038}4039if (dpad.top) {4040style += 'top:'+dpad.top+';';4041}4042elem.style = style;4043parent.appendChild(elem);4044createDPad({container: elem, event: function(up, down, left, right) {4045if (dpad.joystickInput) {4046if (up === 1) up=0x7fff;4047if (down === 1) up=0x7fff;4048if (left === 1) up=0x7fff;4049if (right === 1) up=0x7fff;4050}4051_0x378b5c.syncInput(0, dpad.inputValues[0], up);4052_0x378b5c.syncInput(0, dpad.inputValues[1], down);4053_0x378b5c.syncInput(0, dpad.inputValues[2], left);4054_0x378b5c.syncInput(0, dpad.inputValues[3], right);4055}});4056})405740584059if (this.zoneObj) {4060this.zoneObj.forEach((zone) => {4061zone.destroy();4062})4063}4064this.zoneObj = [];4065let zone;4066info.forEach((zone, index) => {4067if (zone.type !== 'zone') return;4068let opts = {};4069if (leftHandedMode && ['left', 'right'].includes(zone.location)) {4070zone.location = (zone.location==='left') ? 'right' : 'left';4071const amnt = JSON.parse(JSON.stringify(zone));4072if (amnt.left) {4073zone.right = amnt.left;4074}4075if (amnt.right) {4076zone.left = amnt.right;4077}4078}4079opts[zone.location.toLowerCase()] = true;4080const parent = _0x530042.call(this, '.'.concat(getClass({4081'ejs-virtual-gamepad': true,4082}), ' .').concat(getClass(opts)));4083opts['zone_'+index] = true;4084const elem = _0x428003('div', {4085'class': '.'.concat(getClass({4086'ejs-virtual-gamepad': true,4087}), ' .').concat(getClass(opts))4088});4089parent.appendChild(elem);4090const zoneObj = _0x3a58c8.a.create({4091'zone': elem,4092'mode': 'static',4093'position': {4094'left': zone.left,4095'top': zone.top4096},4097'color': 'red'4098});4099zoneObj.on('end', function(_0x27f006, _0x1fb527) {4100_0x378b5c.syncInput(0, zone.inputValues[0], 0);4101_0x378b5c.syncInput(0, zone.inputValues[1], 0);4102_0x378b5c.syncInput(0, zone.inputValues[2], 0);4103_0x378b5c.syncInput(0, zone.inputValues[3], 0);4104});4105zoneObj.on('move', function(_0x1b060e, _0x4ae7d6) {4106const degree = _0x4ae7d6.angle.degree;4107const distance = _0x4ae7d6.distance;4108if (zone.joystickInput === true) {4109let _0x4773fe = 0, _0x4c3bc7 = 0;4110if (degree > 0 && degree <= 45) {4111_0x4773fe = distance / 50;4112_0x4c3bc7 = -0.022222222222222223 * degree * distance / 50;4113}4114if (degree > 45 && degree <= 90) {4115_0x4773fe = 0.022222222222222223 * (90 - degree) * distance / 50;4116_0x4c3bc7 = -distance / 50;4117}4118if (degree > 90 && degree <= 135) {4119_0x4773fe = 0.022222222222222223 * (90 - degree) * distance / 50;4120_0x4c3bc7 = -distance / 50;4121}4122if (degree > 135 && degree <= 180) {4123_0x4773fe = -distance / 50;4124_0x4c3bc7 = -0.022222222222222223 * (180 - degree) * distance / 50;4125}4126if (degree > 135 && degree <= 225) {4127_0x4773fe = -distance / 50;4128_0x4c3bc7 = -0.022222222222222223 * (180 - degree) * distance / 50;4129}4130if (degree > 225 && degree <= 270) {4131_0x4773fe = -0.022222222222222223 * (270 - degree) * distance / 50;4132_0x4c3bc7 = distance / 50;4133}4134if (degree > 270 && degree <= 315) {4135_0x4773fe = -0.022222222222222223 * (270 - degree) * distance / 50;4136_0x4c3bc7 = distance / 50;4137}4138if (degree > 315 && degree <= 359.9) {4139_0x4773fe = distance / 50;4140_0x4c3bc7 = 0.022222222222222223 * (360 - degree) * distance / 50;4141}4142if (_0x4773fe > 0) {4143_0x378b5c.syncInput(0, zone.inputValues[0], 0x7fff * _0x4773fe);4144_0x378b5c.syncInput(0, zone.inputValues[1], 0);4145} else {4146_0x378b5c.syncInput(0, zone.inputValues[1], 0x7fff * -_0x4773fe);4147_0x378b5c.syncInput(0, zone.inputValues[0], 0);4148}4149if (_0x4c3bc7 > 0) {4150_0x378b5c.syncInput(0, zone.inputValues[2], 0x7fff * _0x4c3bc7);4151_0x378b5c.syncInput(0, zone.inputValues[3], 0);4152} else {4153_0x378b5c.syncInput(0, zone.inputValues[3], 0x7fff * -_0x4c3bc7);4154_0x378b5c.syncInput(0, zone.inputValues[2], 0);4155}41564157} else {4158if (degree >= 30 && degree < 150) {4159_0x378b5c.syncInput(0, zone.inputValues[0], 1);4160} else {4161window.setTimeout(function() {4162_0x378b5c.syncInput(0, zone.inputValues[0], 0);4163}, 30);4164}4165if (degree >= 210 && degree < 330) {4166_0x378b5c.syncInput(0, zone.inputValues[1], 1);4167} else {4168window.setTimeout(function() {4169_0x378b5c.syncInput(0, zone.inputValues[1], 0);4170}, 30);4171}4172if (degree >= 120 && degree < 240) {4173_0x378b5c.syncInput(0, zone.inputValues[2], 1);4174} else {4175window.setTimeout(function() {4176_0x378b5c.syncInput(0, zone.inputValues[2], 0);4177}, 30);4178}4179if (degree >= 300 || degree >= 0 && degree < 60) {4180_0x378b5c.syncInput(0, zone.inputValues[3], 1);4181} else {4182window.setTimeout(function() {4183_0x378b5c.syncInput(0, zone.inputValues[3], 0);4184}, 30);4185}4186}4187});4188this.zoneObj.push(zoneObj);4189})41904191let keys = [];4192for (let i=0; i<info.length; i++) {4193if (info[i].type !== 'button') continue;4194let opts = {};4195opts['b_'+info[i].id.toLowerCase()] = true;4196let value;4197if (_this.newCores === 2 && info[i].input_new_cores) {4198value = info[i].input_new_cores;4199} else {4200value = info[i].input_value;4201}4202keys.push({id: opts, number: value});4203}4204keys.forEach((a) => {4205let element = _0x530042.call(_this, '.'.concat(_0x2c1832, ' .').concat(getClass(a.id)));4206if (!element) return;4207_0x1093f4.call(_this, element, 'touchstart touchend touchcancel', function(e) {4208if (e.type === 'touchend' || e.type === 'touchcancel') {4209_0x3a8e2f(e.target, _0x2ec721, false);4210window.setTimeout(function() {4211_0x378b5c.syncInput(0, a.number, 0);4212}, 30)4213} else {4214_0x3a8e2f(e.target, _0x2ec721, true);4215_0x378b5c.syncInput(0, a.number, 1)4216}4217e.preventDefault();4218})4219});42204221if (!forceUpdateHTML) {4222const menuButton = _0x428003('div', {4223'class': getClass({4224'ejs__widget': true,4225'ejs__widget_controls_toggle': true4226})4227}, '');4228menuButton.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M0 96C0 78.33 14.33 64 32 64H416C433.7 64 448 78.33 448 96C448 113.7 433.7 128 416 128H32C14.33 128 0 113.7 0 96zM0 256C0 238.3 14.33 224 32 224H416C433.7 224 448 238.3 448 256C448 273.7 433.7 288 416 288H32C14.33 288 0 273.7 0 256zM416 448H32C14.33 448 0 433.7 0 416C0 398.3 14.33 384 32 384H416C433.7 384 448 398.3 448 416C448 433.7 433.7 448 416 448z"/></svg>';4229_0x530042.call(this, ".".concat(getClass({ejs__widgets: true}))).appendChild(menuButton);4230let hideTimeout;4231_0x1093f4.call(this, menuButton, 'mousedown touchstart', function(e) {4232_0x3a8e2f(e.target, _0x2ec721, true);4233clearTimeout(hideTimeout);4234_0x5ab74d.toggleControls.call(_this, true);4235hideTimeout = setTimeout(function() {4236_0x5ab74d.toggleControls.call(_this, false);4237}, 5000)4238});4239}4240},4241'setup': function() {4242let _this = this;4243if (!this.game) {4244console.warn('No game element found!');4245return;4246}4247_0x378b5c.playerName = _this.config.playerName;4248_0x3a8e2f(this.elements.container, this.config.classNames.type, true);4249this.elements.container.setAttribute('tabindex', '0');4250if (this.color) {4251let _0x17edbf = function(_0x175d8e) {4252let _0x17edbf = _0x175d8e.toLowerCase();4253if (_0x17edbf && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/ .test(_0x17edbf)) {4254if (0x4 === _0x17edbf.length) {4255for (let _0x2c1832 = '#', _0x4c881f = 1; _0x4c881f < 0x4; _0x4c881f += 1) _0x2c1832 += _0x17edbf.slice(_0x4c881f, _0x4c881f + 1).concat(_0x17edbf.slice(_0x4c881f, _0x4c881f + 1));4256_0x17edbf = _0x2c1832;4257}4258let _0x5ac4ff = [];4259for (let _0x324169 = 1; _0x324169 < 0x7; _0x324169 += 2) _0x5ac4ff.push(parseInt('0x' .concat(_0x17edbf.slice(_0x324169, _0x324169 + 2)), 0x10));4260return _0x5ac4ff;4261}4262return null;4263}(this.color);4264_0x17edbf && this.elements.container.setAttribute('style', '--ejs-primary-color: ' .concat(_0x17edbf[0], ', ').concat(_0x17edbf[1], ', ').concat(_0x17edbf[2]));4265}4266this.elements.wrapper = _0x428003('div', {4267'class': this.config.classNames.video4268});4269_0x580edd(this.game, this.elements.wrapper);4270if ('video' !== _this.game.tagName.toLocaleLowerCase()) {4271let _0x2c1832 = this.config.volume;4272Object.defineProperty(_this.game, 'volume', {4273'get': function() {4274return _0x2c1832;4275},4276'set': function(_0x4cca18) {4277_0x2c1832 = _0x4cca18, _0xbae705.call(_this, _this.game, 'volumechange');4278}4279});4280let _0x541fe1 = _this.storage.get('muted');4281Object.defineProperty(_this.game, 'muted', {4282'get': function() {4283return _0x541fe1;4284},4285'set': function(_0x54b6e0) {4286let _0x2c1832 = !!_0x1e2c68.boolean(_0x54b6e0) && _0x54b6e0;4287_0x541fe1 = _0x2c1832, _0xbae705.call(_this, _this.game, 'volumechange');4288}4289});4290}4291window.addEventListener('beforeunload', function(_0x34b11a) {4292if (_this.started && _this.getStartName()) {4293_0x27f4c4.FS.syncfs(function() {});4294_0x378b5c.saveSavFiles();4295_0x27f4c4.FS.syncfs(function() {});4296}4297}, true);4298//Wille save savefiles to indexeddb4299window.saveSaveFiles = function() {4300if (!_this.getStartName()) return;4301console.log('saving save files');4302_0x378b5c.saveSavFiles();4303_0x27f4c4.FS.syncfs(false, function() {});4304}4305setInterval(function() {4306if (_this.started) {4307saveSaveFiles();4308}4309}, 60000) //60000 = 1 minute4310},4311'listeners': function() {4312let _this = this;4313const elem = _0x530042.call(_this, '.' .concat(getClass({4314'ejs__dialogs': true4315})));4316let counter = 0;4317_0x1093f4.call(_this, elem, 'dragenter', function(e) {4318e.preventDefault();4319counter++;4320_0x132da7(_this.elements.dialogs.message, false);4321});4322_0x1093f4.call(_this, elem, 'dragover', function(e) {4323e.preventDefault();4324});4325_0x1093f4.call(_this, elem, 'dragleave', function(e) {4326e.preventDefault();4327counter--;4328if (counter === 0) {4329_0x132da7(_this.elements.dialogs.message, true);4330}4331});4332_0x1093f4.call(_this, elem, 'dragend', function(e) {4333e.preventDefault();4334counter = 0;4335_0x132da7(_this.elements.dialogs.message, true);4336});4337_0x1093f4.call(_this, elem, 'drop', function(e) {4338e.preventDefault();4339_0x132da7(_this.elements.dialogs.message, true);4340counter = 0;4341const items = e.dataTransfer.items;4342let file;4343for (let i=0; i<items.length; i++) {4344if (items[i].kind !== 'file') continue;4345file = items[i];4346break;4347}4348if (!file) return;4349const fileHandle = file.getAsFile();4350fileHandle.arrayBuffer().then(data => {4351_0x378b5c.loadState(new Uint8Array(data), 0);4352})4353});4354_this.elements.buttons.restart && _0x1093f4.call(_this, _this.elements.buttons.restart, 'click', function(_0x5cfc51) {4355_0x378b5c.restartGame();4356_0x378b5c.inputsData = {};4357if (_0x378b5c.connected && _0x378b5c.connection.isInitiator) {4358(async () => {4359const state = await _0x378b5c.saveState();4360const file = new File([state], '0-game.state', {4361'type': '',4362'lastModified': new Date()4363});4364_0x378b5c.connection.shareFile(file);4365_0x378b5c.inputsData = {};4366_0x378b5c.wait = true;4367_0x378b5c.systemPause(1);4368_0x27f4c4.Module.pauseMainLoop();4369_0x378b5c.disableControl(true);4370})();4371}4372saveSaveFiles();4373});4374_this.elements.buttons.screenRecord && _0x1093f4.call(_this, _this.elements.buttons.screenRecord, 'click', function(_0x5cfc51) {4375if (! _this.recordData) {4376_this.recordData = {started:false, data:[], stopped: false};4377}4378if (! _this.recordData.started) { //start recording4379let options;4380if (MediaRecorder.isTypeSupported('video/webm; codecs=h264')) {4381options = {mimeType: 'video/webm; codecs=h264'};4382} else if (MediaRecorder.isTypeSupported('video/webm; codecs=H264')) {4383options = {mimeType: 'video/webm; codecs=H264'};4384} else if (MediaRecorder.isTypeSupported('video/webm; codecs=vp9')) {4385options = {mimeType: 'video/webm; codecs=vp9'};4386} else if (MediaRecorder.isTypeSupported('video/webm; codecs=vp8')) {4387options = {mimeType: 'video/webm; codecs=vp8'};4388} else if (MediaRecorder.isTypeSupported('video/webm; codecs=avc1')) {4389options = {mimeType: 'video/webm; codecs=avc1'};4390} else if (MediaRecorder.isTypeSupported('video/webm; codecs=vp9.0')) {4391options = {mimeType: 'video/webm; codecs=vp9.0'};4392} else if (MediaRecorder.isTypeSupported('video/webm; codecs=vp8.0')) {4393options = {mimeType: 'video/webm; codecs=vp8.0'};4394} else {4395options = {};4396}4397function gotStreams(stream) {4398_this.elements.buttons.screenRecord.querySelector('.'.concat(getClass({4399'ejs__tooltip': true4400}))).innerHTML = _this.localization('Stop Screen Recording');4401_this.recordData.stream = stream;4402_this.recordData.recorder = new MediaRecorder(_this.recordData.stream, options);4403_this.recordData.recorder.ondataavailable = function(e) {4404if (e.data.size > 0) {4405_this.recordData.data.push(e.data)4406}4407if (_this.recordData.stopped) {4408let a = document.createElement("a")4409a.href = window.URL.createObjectURL(new Blob(_this.recordData.data, {type: "video/webm"}))4410let aname;4411if (typeof _this.gameName == 'string') {4412aname = _this.gameName4413}4414a.download = aname ? '' .concat(aname, '-recording.webm') : 'record.webm';4415a.click()4416window.URL.revokeObjectURL(a.href)4417delete _this.recordData4418_this.elements.buttons.screenRecord.querySelector('.'.concat(getClass({4419'ejs__tooltip': true4420}))).innerHTML = _this.localization('Start Screen Recording');4421}4422}4423_this.recordData.recorder.start()4424_this.recordData.started = true4425}4426if (window.navigator && navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia === 'function') {4427_0x27f4c4.Module.pauseMainLoop();4428_this.playing = false;4429alert('Please check "share system audio" to have audio in the recording. We only need the audio stream so your entire screen will not be recorded');4430let time = setTimeout(function() {4431_this.playing = true;4432_0x27f4c4.Module.resumeMainLoop();4433}, 20000);4434navigator.mediaDevices.getDisplayMedia({4435audio: true, //we only need the audio, we dont use the video stream at all4436video: {mediaSource: "screen"}4437}).then(function(stream) {4438let canvasStream = _0x27f4c4.Module.canvas.captureStream(30);4439try {4440clearTimeout(time);4441}catch(e){}4442let audio = stream.getAudioTracks();4443for (let i=0; i<audio.length; i++) {4444canvasStream.addTrack(audio[i]);4445}4446gotStreams(canvasStream);4447_this.playing = true;4448_0x27f4c4.Module.resumeMainLoop();4449})4450} else {4451let canvasStream = _0x27f4c4.Module.canvas.captureStream(30);4452gotStreams(canvasStream);4453}4454} else if (_this.recordData.started) { //stop recording4455_this.recordData.recorder.stop()4456_this.recordData.stopped = true4457}44584459});4460_this.elements.buttons.cacheManager && _0x1093f4.call(_this, _this.elements.buttons.cacheManager, 'click', function(_0x5cfc51) {4461if (_0x27f4c4.romdb) {4462_0x132da7(_this.elements.dialogs.cache, false);4463let _0x3360eb = _this.elements.dialogs.cache.querySelector('.' .concat(_0x378b5c.classNames['dialog-content']));4464_0x3360eb.innerHTML = '<div>'+_this.localization('Loading')+'</div>';4465_0x27f4c4.romdb.getAll(function(_0x43586d) {4466if (_0x43586d) {4467let _0x275730 = _0x428003('table', {4468'style': 'width:100%;padding-left:10px;text-align:left'4469}),4470_0x1ab9e9 = _0x428003('tbody');4471_0x43586d.length > 0 ? (_0x3360eb.innerHTML = '', _0x43586d.forEach(function(_0x32b0b7, _0x2d0e11) {4472if (_0x32b0b7.key && !/-part-\d+$/ .test(_0x32b0b7.key)) {4473let _0x277c67 = [_0x32b0b7.key];4474for (let _0x3360eb = Math.ceil(_0x32b0b7.filesize / 0x6400000), _0x3edb35 = 1; _0x3edb35 < _0x3360eb; _0x3edb35 += 1) _0x277c67.push('' .concat(_0x32b0b7.key, '-part-').concat(_0x3edb35));4475let _0x3e31f6 = _0x428003('tr'),4476_0x5b75bd = _0x428003('td'),4477_0x227405 = _0x428003('td'),4478_0xac150b = _0x428003('td');4479_0x5b75bd.innerHTML = _0x32b0b7.filename, _0x227405.innerHTML = function(_0x1858c1) {4480let _0x2d0e11 = -1;4481do {4482_0x1858c1 /= 0x400, _0x2d0e11++;4483} while (_0x1858c1 > 0x400);4484return Math.max(_0x1858c1, 0.1).toFixed(1) + [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'][_0x2d0e11];4485}(_0x32b0b7.filesize), _0xac150b.innerHTML = '<a href="#" onclick="return false">Remove</a>', _0x3e31f6.appendChild(_0x5b75bd), _0x3e31f6.appendChild(_0x227405), _0x3e31f6.appendChild(_0xac150b), _0x1ab9e9.appendChild(_0x3e31f6), _0xac150b.querySelector('a').onclick = function(_0x16f22a) {4486_0x27f4c4.romdb.removeBatch(_0x277c67);4487try {4488_0x1ab9e9.removeChild(_0x3e31f6);4489} catch (_0x353628) {}4490return _0x16f22a.stopPropagation(), false;4491};4492}4493}), _0x275730.appendChild(_0x1ab9e9), _0x3360eb.appendChild(_0x275730)) : _0x3360eb.innerHTML = '<div style="text-align:center">'+_this.localization('Empty')+'</div>';4494} else _0x3360eb.innerHTML = '<div style="text-align:center">'+_this.localization('Empty')+'</div>';4495}, function() {});4496}4497return false;4498})4499_this.elements.buttons.play && Array.from(_this.elements.buttons.play).forEach(function(_0x24495b) {4500_0x1093f4.call(_this, _0x24495b, 'click', function(_0x966382) {4501if (_this.playing) {4502_this.playing = false;4503_0x27f4c4.Module.pauseMainLoop();4504if (_0x378b5c.connected && _0x378b5c.connection.isInitiator) {4505_0x378b5c.connection.send(JSON.stringify({4506'act': 'pause'4507}))4508}4509_0xbae705.call(_this, _this.elements.container, 'pause', false, {4510'pause': true4511})4512} else {4513_this.playing = true;4514_0x27f4c4.Module.resumeMainLoop();4515if (_0x378b5c.connected && _0x378b5c.connection.isInitiator) {4516_0x378b5c.connection.send(JSON.stringify({4517'act': 'resume'4518}))4519}4520_0xbae705.call(_this, _this.elements.container, 'pause', false, {4521'pause': false4522});4523}4524});4525}), _this.elements.buttons.netplay && _0x1093f4.call(_this, _this.elements.buttons.netplay, 'click', function(_0x2317b9) {4526if (window.EJS_TURN_URLS !== null && !window.EJS_TURN_URLS) {4527(async function(server) {4528try {4529let resp = await fetch(server + 'webrtc');4530window.EJS_TURN_URLS = JSON.parse(await resp.text());4531} catch(e) {4532window.EJS_TURN_URLS = null;4533console.warn("Could not contact netplay server", e);4534}4535})(_this.listUrl);4536}4537_0x378b5c.disableControl(true);4538_0x132da7(_this.elements.dialogs.netplay, false);4539if (_0x378b5c.players.length > 0) {4540_0x378b5c.openRoom(_0xa88a13);4541} else {4542_0x378b5c.stopLoadRooms();4543_0x378b5c.loadRoomsList();4544}4545if (!_0x378b5c.playerName) {4546_0x4d8495.show('modal-9de6c4e9ce2b9361', {4547'closeByEsckey': false4548});4549}4550}), _this.elements.buttons.cheat && _0x1093f4.call(_this, _this.elements.buttons.cheat, 'click', function(_0x44b01a) {4551_0x132da7(_this.elements.dialogs.cheat, false);4552});4553_this.game.stateloadField = _0x428003('input');4554_this.game.stateloadField.type = 'file';4555_this.game.stateloadField.onchange = function _0x17edbf(_0xcd4599) {4556let _0xfd246e, _0x3fdd71 = _0xcd4599.target.files;4557_0x3fdd71.length > 0 && ((_0xfd246e = new FileReader()).file_name = _0x3fdd71[0].name, _0xfd246e.onload = function() {4558EJS_loadState(new Uint8Array(_0xfd246e.result));4559}, _0xfd246e.readAsArrayBuffer(_0x3fdd71[0])), _this.game.stateloadField = _0x428003('input'), _this.game.stateloadField.type = 'file', _this.game.stateloadField.onchange = _0x17edbf;4560};4561_0x1093f4.call(_this, _this.elements.container, 'loadstate', function(_0x13504c) {4562if (_0x378b5c.saveLoadDB.call(_this, 'load')) {4563return;4564}4565_0x1e2c68.function(_this.config.onloadstate) ? _this.config.onloadstate.call(null, _this.loadState) : _this.game.stateloadField.click(), _this.elements.container.focus();4566});4567document.addEventListener('visibilitychange', function() {4568'hidden' === document.visibilityState ? console.log('hidden') : console.log('active');4569});4570},4571'bindFunction': function() {4572let _this = this,4573_0x17edbf = getSystem(_this.system, true);4574if (_0x27f4c4.Module && _0x27f4c4.Module._set_volume) {4575let _0x2c1832 = _0x27f4c4.Module.cwrap('set_volume', 'null', ['number']);4576_0x378b5c.setVolume = function() {4577let _0x17edbf = 0;4578_this.volume < 1 && (_0x17edbf = 0 === _this.volume ? -0x50 : 0x1e * _this.volume - 0x1e, _0x2c1832(_0x17edbf)), _this.muted && (_0x17edbf = -0x50), _0x2c1832(_0x17edbf);4579};4580}4581if (_0x27f4c4.Module._save_file_path) {4582_0x378b5c.getSaveFilePath = _0x27f4c4.Module.cwrap('save_file_path', 'string', []);4583} else {4584_0x378b5c.getSaveFilePath = () => null;4585}4586// Returns a Uint8Array of the save file4587_0x378b5c.readSaveFile = function() {4588return FS.readFile(_0x378b5c.getSaveFilePath());4589}4590_0x378b5c.setVariable = _0x27f4c4.Module.cwrap('set_variable', 'null', ['string', 'string']);4591_0x378b5c.simulateInputFn = _0x27f4c4.Module.cwrap('simulate_input', 'null', ['number', 'number', 'number']);4592let _0x2c63cc = {45930: null,45941: null,45952: null,45963: null,45974: null,45985: null,45996: null,46007: null,46018: null,46029: null,460310: null,460411: null,460512: null,460613: null,460714: null,460815: null,460916: null,461017: null,461118: null,461219: null,461320: null,461421: null,461522: null,461623: null,461724: null,461825: null,461926: null,462027: null,462128: null,462229: null,462330: null,462431: null4625};4626_0x378b5c.simulateInput = function(player, index, value) {4627if (_0x378b5c.connected) {4628if (_this.playing && !_0x378b5c.disableInput) {4629var _0x35b9c1 = _0x378b5c.connection.userid,4630_0x4d96ad = _0x378b5c.roomMaster === _0x35b9c1,4631_0xf1bb97 = _0x378b5c.players.indexOf(_0x35b9c1),4632_0x52e1f4 = _0x378b5c.currentFrameNum();4633player >> 0x0 == 0x0 && (_0x2c63cc[index] !== value && (_0x4d96ad ? (_0x378b5c.inputsData[_0x52e1f4] || (_0x378b5c.inputsData[_0x52e1f4] = []), _0x378b5c.inputsData[_0x52e1f4].push({4634'index': _0xf1bb97,4635'key': index,4636'status': value,4637'frame': _0x52e1f44638}),_0x378b5c.simulateInputFn(_0xf1bb97, index, value)) : _0x378b5c.connection.send(JSON.stringify({4639'act': 'sync-control',4640'value': ['' .concat(_0xf1bb97, '|').concat(index, '|').concat(value, '|').concat(_0x52e1f4)]4641}), _0x378b5c.roomMaster)), _0x2c63cc[index] = value);4642}4643} else _0x378b5c.disableInput || _0x378b5c.simulateInputFn(player, index, value);4644};4645_0x378b5c.syncInput = _0x378b5c.simulateInput;4646window.simulateInput = _0x378b5c.simulateInput;4647_0x378b5c.toggleShader = _0x27f4c4.Module.cwrap('shader_enable', 'null', ['number']);4648if (_this.coreVer !== 2) {4649_0x378b5c.getStateInfo = _0x27f4c4.Module.cwrap('get_state_info', 'string', []);4650} else {4651_0x378b5c.getInfoOfState = _0x27f4c4.Module.cwrap('get_state_info', 'string', []);4652_0x378b5c.getStateInfo1 = _0x27f4c4.Module.cwrap('save_state_info', 'null', []);4653_0x378b5c.getStateInfo = function() {4654_0x378b5c.getStateInfo1();4655return new Promise(function(resolve, reject) {4656let a = _0x378b5c.getInfoOfState();4657if (a) {4658resolve(a);4659return;4660}4661let b = setInterval(function() {4662a = _0x378b5c.getInfoOfState();4663if (a) {4664clearInterval(b);4665resolve(a);4666}4667}, 50)4668});4669}4670}4671_0x378b5c.saveState = async function() {4672let _0xa88a14;4673let _0x17edbf;4674if (_this.coreVer !== 2) {4675_0x17edbf = _0x378b5c.getStateInfo().split('|');4676} else {4677_0x17edbf = (await _0x378b5c.getStateInfo()).split('|');4678}4679let _0x2c1832 = _0x17edbf[0] >> 0;4680if (_0x2c1832 > 0) {4681_0xa88a14 = new Uint8Array(_0x2c1832);4682for (let _0x2ef6be = _0x17edbf[1] >> 0, _0x3cc34b = 0; _0x3cc34b < _0x2c1832; _0x3cc34b++) _0xa88a14[_0x3cc34b] = _0x27f4c4.Module.getValue(_0x2ef6be + _0x3cc34b);4683}4684return _0xa88a14;4685};4686let _0x25a7a2 = _0x27f4c4.Module.cwrap('load_state', 'number', ['string', 'number']);4687_0x378b5c.loadState = function(_0x4389ae, _0x1d4918) {4688let _0x91cd69;4689_0x91cd69 = _0x4389ae;4690try {4691_0x27f4c4.FS.unlink('game.state');4692} catch(e){}4693_0x27f4c4.FS.createDataFile('/', 'game.state', _0x91cd69, true, true);4694null === _0x1d4918 && (_0x1d4918 = 0);4695if ('arcade' === _0x17edbf) {4696setTimeout(function() {4697_0x378b5c.getStateInfo();4698_0x25a7a2('game.state', _0x1d4918);4699_0x27f4c4.FS.unlink('game.state');4700}, 0xa)4701} else {4702_0x25a7a2('game.state', _0x1d4918);4703setTimeout(function() {4704_0x27f4c4.FS.unlink('game.state');4705}, 100)4706}4707if (_0x378b5c.connected && _0x378b5c.connection.isInitiator) {4708(async () => {4709const state = await _0x378b5c.saveState();4710const file = new File([state], '0-game.state', {4711'type': '',4712'lastModified': new Date()4713});4714_0x378b5c.connection.shareFile(file);4715_0x378b5c.inputsData = {};4716_0x378b5c.wait = true;4717_0x378b5c.systemPause(1);4718_0x27f4c4.Module.pauseMainLoop();4719_0x378b5c.disableControl(true);4720})();4721}4722_this.elements.container.focus();4723};4724_0x27f4c4.Module._set_cheat && (_0x378b5c.setCheat = _0x27f4c4.Module.cwrap('set_cheat', 'number', ['number', 'number', 'string']));4725_0x27f4c4.Module._reset_cheat && (_0x378b5c.resetCheat = _0x27f4c4.Module._reset_cheat);4726_0x378b5c.quickSaveState = async function() {4727if (_this.started && !_0x378b5c.connected) {4728if (_this.statesSupported === false) {4729_0x378b5c.doMessageTransition('CANNOT CURRENTLY LOAD STATE');4730return;4731}4732let slot;4733if (_0x2593da && typeof _0x2593da.getCoreOptionsValue == 'function') {4734slot = _0x2593da.getCoreOptionsValue('save-state-slot');4735if (! slot) {4736slot = 1;4737}4738} else {4739slot = 1;4740}4741let name = slot + '-quick.state';4742try {4743_0x27f4c4.FS.unlink(name);4744} catch (_0x4b4d4c) {}4745try {4746let _0x17edbf = await _0x378b5c.saveState();4747_0x27f4c4.FS.createDataFile('/', name, _0x17edbf, true, true);4748_0x378b5c.doMessageTransition('STATE SAVED TO SLOT ' + slot);4749} catch(e) {4750console.warn(e);4751_0x378b5c.doMessageTransition('FAILED TO SAVE STATE TO SLOT ' + slot);4752}4753saveSaveFiles();4754}4755};4756_0x378b5c.saveMsgTransitions = null;4757_0x378b5c.doMessageTransition = function(message) {4758_this.elements.widgets.stateInfoDiv.innerText = message;4759clearTimeout(_0x378b5c.saveMsgTransitions);4760_0x378b5c.saveMsgTransitions = setTimeout(function() {4761_this.elements.widgets.stateInfoDiv.innerText = '';4762}, 1500)4763}4764_0x378b5c.quickLoadState = function() {4765if (_this.started && !_0x378b5c.connected) {4766if (_this.statesSupported === false) {4767_0x378b5c.doMessageTransition('CANNOT CURRENTLY LOAD STATE');4768return;4769}4770let slot;4771if (_0x2593da && typeof _0x2593da.getCoreOptionsValue == 'function') {4772slot = _0x2593da.getCoreOptionsValue('save-state-slot');4773if (! slot) {4774slot = 1;4775}4776} else {4777slot = 1;4778}4779let name = slot + '-quick.state';4780let success = true;4781try {4782_0x25a7a2(name, 0);4783if ('arcade' === _0x17edbf) {4784setTimeout(function() {4785_0x378b5c.getStateInfo();4786_0x25a7a2(name, 0);4787}, 0xa);4788}4789} catch (_0x4ee386) {4790success = false;4791}4792if (! success) {4793_0x378b5c.doMessageTransition('FAILED TO LOAD STATE FROM SLOT ' + slot);4794} else {4795_0x378b5c.doMessageTransition('LOADED STATE FROM SLOT ' + slot);4796}4797saveSaveFiles();4798}4799};4800_0x378b5c.changeStateSlot = function(e) {4801let slot;4802if (_0x2593da && typeof _0x2593da.getCoreOptionsValue == 'function') {4803slot = _0x2593da.getCoreOptionsValue('save-state-slot');4804}4805if (!slot) {4806slot = 1;4807}4808let newSlot;4809if (typeof e != 'number') {4810newSlot = slot + 1;4811} else {4812newSlot = e;4813}4814if (newSlot > 9) {4815newSlot = 1;4816}4817_0x7f9f36.updateCoreOptions.call(_this, 'save-state-slot', newSlot);4818_0x378b5c.doMessageTransition('SET SAVE STATE SLOT TO ' + newSlot);4819};4820window.EJS_loadState = function(data) {4821_0x378b5c.loadState(data, 0);4822setTimeout(() => {4823if (_0x378b5c.connected) {4824var file = new File([data], '0-game.state', {4825'type': '',4826'lastModified': new Date()4827});4828_0x378b5c.connection.shareFile(file);4829_0x378b5c.inputsData = {};4830_0x378b5c.wait = true;4831_0x378b5c.systemPause(1);4832_0x27f4c4.Module.pauseMainLoop();4833_0x378b5c.disableControl(true);4834}4835}, 0x1e);4836};4837window.EJS_saveState = function() {4838return _0x378b5c.saveState();4839}4840let _0x840cf4 = _0x27f4c4.Module.cwrap('cmd_take_screenshot', '', []);4841_0x378b5c.getScreenData = function() {4842_0x840cf4();4843return _0x27f4c4.FS.readFile('screenshot.png');4844};4845_0x378b5c.restartGame = _0x27f4c4.Module.cwrap('system_restart', '', []);4846_0x378b5c.currentFrameNum = _0x27f4c4.Module.cwrap('get_current_frame_count', '', []);4847_0x378b5c.saveSavFiles = _0x27f4c4.Module.cwrap('cmd_savefiles', '', []);4848_0x27f4c4.Module._get_core_options && (_0x378b5c.getGameCoreOptions = _0x27f4c4.Module.cwrap('get_core_options', 'string', []));4849_0x378b5c.systemPause = function(e) {4850return false;4851};4852_0x378b5c.controllers = _0x2593da.storage.get('controllers');4853_0x378b5c.controllers || (_0x378b5c.controllers = JSON.parse(JSON.stringify(_0x378b5c.defaultControllers)));4854}4855}4856let _0xdcec2a = _0x378b5c;48574858function _0x5005e6(_0x7f3270, _0x477158) {4859return function(_0x20890f) {4860if (Array.isArray(_0x20890f)) return _0x20890f;4861}(_0x7f3270) || function(_0x557107, _0x409476) {4862let _0x2c1832 = [],4863_0x488a47 = true,4864_0x34f76e = false,4865_0x19606f = undefined;4866try {4867for (let _0x328f4d, _0x4d9086 = _0x557107[Symbol.iterator](); !(_0x488a47 = (_0x328f4d = _0x4d9086.next()).done) && (_0x2c1832.push(_0x328f4d.value), !_0x409476 || _0x2c1832.length !== _0x409476); _0x488a47 = true);4868} catch (_0x13c09a) {4869_0x34f76e = true, _0x19606f = _0x13c09a;4870} finally {4871try {4872_0x488a47 || null == _0x4d9086.return || _0x4d9086.return();4873} finally {4874if (_0x34f76e) throw _0x19606f;4875}4876}4877return _0x2c1832;4878}(_0x7f3270, _0x477158) || function() {4879throw new TypeError('Invalid attempt to destructure non-iterable instance');4880}();4881}4882const _0x7f9f36 = {4883'storage': null,4884'coreOptionsValues': {},4885'contextMenu': null,4886'normalOptions': {4887'shader': {4888'label': 'Shader',4889'options': {4890'disabled': 'Disabled',4891'2xScaleHQ.glslp': '2xScaleHQ',4892'4xScaleHQ.glslp': '4xScaleHQ',4893'crt-easymode.glslp': 'CRT easymode',4894'crt-aperture.glslp': 'CRT aperture',4895'crt-geom.glslp': 'CRT geom',4896'crt-mattias.glslp': 'CRT mattias'4897},4898'default': 'disabled'4899},4900'virtual-gamepad': {4901'label': 'Virtual Gamepad',4902'options': {4903'disabled': 'Disabled',4904'enabled': 'Enabled'4905},4906'default': 'enabled'4907}4908},4909'defaultCoreOptionsValues': function() {4910let _0xa88a13 = {};4911if (this.coreVer === 2) {4912return {};4913}4914switch (this.system) {4915case 'pce':4916_0xa88a13 = {4917'pce_nospritelimit': 'enabled'4918};4919break;4920case 'jaguar':4921_0xa88a13 = {4922'virtualjaguar_doom_res_hack': 'enabled'4923};4924break;4925case 'psx':4926_0xa88a13 = {4927'pcsx_rearmed_memcard2': 'enabled'4928};4929break;4930case 'nds':4931_0xa88a13 = {};4932}4933return _0xa88a13;4934},4935'getCoreOptionsValues': function() {4936if (_0x7f9f36.coreOptionsValues) {4937return JSON.parse(JSON.stringify(_0x7f9f36.coreOptionsValues));4938}4939let _0xa88a13 = _0x7f9f36.storage.get('core-options');4940_0x1e2c68.empty(_0xa88a13) && (_0xa88a13 = {});4941return _0xa88a13;4942},4943'getCoreOptionsValue': function(key) {4944if (_0x7f9f36.coreOptionsValues) {4945let rv = JSON.parse(JSON.stringify(_0x7f9f36.coreOptionsValues))[key];4946if (rv) return rv;4947}4948let _0xa88a13 = _0x7f9f36.storage.get('core-options');4949_0x1e2c68.empty(_0xa88a13) && (_0xa88a13 = {});4950return _0xa88a13[key];4951},4952'getCoreOptions': function() {4953let _0xa88a13 = {};4954switch (this.system) {4955case 'nes':4956_0xa88a13.fceumm_palette = {4957'label': this.localization('Color Palette'),4958'options': {4959'default': this.localization('Default'),4960'asqrealc': 'asqrealc',4961'nintendo-vc': 'nintendo-vc',4962'rgb': 'rgb',4963'yuv-v3': 'yuv-v3',4964'unsaturated-final': 'unsaturated-final',4965'sony-cxa2025as-us': 'sony-cxa2025as-us',4966'pal': 'pal',4967'bmf-final2': 'bmf-final2',4968'bmf-final3': 'bmf-final3',4969'smooth-fbx': 'smooth-fbx',4970'composite-direct-fbx': 'composite-direct-fbx',4971'pvm-style-d93-fbx': 'pvm-style-d93-fbx',4972'nescap': 'nescap',4973'ntsc-hardware-fbx': 'ntsc-hardware-fbx',4974'nes-classic-fbx-fs': 'nes-classic-fbx-fs',4975'wavebeam': 'wavebeam'4976},4977'default': 'default'4978}, _0xa88a13.fceumm_nospritelimit = {4979'label': this.localization('No Sprite Limit'),4980'options': {4981'enabled': this.localization('Enabled'),4982'disabled': this.localization('Disabled')4983},4984'default': 'disabled'4985}, _0xa88a13.fceumm_sndquality = {4986'label': this.localization('Sound Quality'),4987'options': {4988'Low': this.localization('Low'),4989'High': this.localization('High'),4990'Very High': this.localization('Very High')4991},4992'default': 'Low'4993}, this.lightgun || (_0xa88a13.system_type = {4994'label': this.localization('4 Players Support'),4995'options': {4996'nes': 'NES',4997'famicom': 'Famicom'4998},4999'default': 'nes'5000}), _0xa88a13.fceumm_turbo_enable = {5001'label': this.localization('Turbo Enable'),5002'options': {5003'None': this.localization('None'),5004'Player 1': this.localization('Player 1'),5005'Player 2': this.localization('Player 2'),5006'Both': this.localization('Both')5007},5008'default': 'None'5009}, _0xa88a13.fceumm_region = {5010'label': this.localization('Region'),5011'options': {5012'Auto': this.localization('Auto'),5013'NTSC': 'NTSC',5014'PAL': 'PAL',5015'Dendy': 'Dendy'},5016'default': 'Auto'5017};5018break;5019case 'snes':5020_0xa88a13 = {5021'snes9x_next_overclock': {5022'label': this.localization('SuperFX Overclock'),5023'options': {5024'disabled': this.localization('Disabled')+'(10MHz)',5025'40MHz': '40MHz',5026'60MHz': '60MHz',5027'80MHz': '80MHz',5028'100MHz': '100MHz'5029},5030'default': 'disabled'5031}5032};5033break;5034case 'snes2002':5035case 'snes2005':5036case 'snes2010':5037_0xa88a13 = {};5038break;5039case 'gb':5040_0xa88a13 = {5041'gambatte_gb_colorization': {5042'label': this.localization('GB Colorization'),5043'options': {5044'disabled': this.localization('Disabled'),5045'auto': this.localization('auto'),5046'internal': this.localization('internal')5047},5048'default': 'disabled'5049},5050'gambatte_gb_internal_palette': {5051'label': this.localization('Internal Palette'),5052'options': {5053'GBC - Blue': this.localization('GBC - Blue'),5054'GBC - Brown': this.localization('GBC - Brown'),5055'GBC - Dark Blue': this.localization('GBC - Dark Blue'),5056'GBC - Dark Brown': this.localization('GBC - Dark Brown'),5057'GBC - Dark Green': this.localization('GBC - Dark Green'),5058'GBC - Grayscale': this.localization('GBC - Grayscale'),5059'GBC - Green': this.localization('GBC - Green'),5060'GBC - Inverted': this.localization('GBC - Inverted'),5061'GBC - Orange': this.localization('GBC - Orange'),5062'GBC - Pastel Mix': this.localization('GBC - Pastel Mix'),5063'GBC - Red': this.localization('GBC - Red'),5064'GBC - Yellow': this.localization('GBC - Yellow')5065},5066'default': 'GBC - Blue'5067}5068};5069break;5070case 'gba':5071_0xa88a13 = {5072'mgba_solar_sensor_level': {5073'label': this.localization('Solar sensor level'),5074'options': ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],5075'default': '0'5076},5077'mgba_frameskip': {5078'label': this.localization('Frameskip'),5079'options': ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],5080'default': '0'5081}5082};5083break;5084case 'vbanext':5085_0xa88a13 = {5086'vbanext_turboenable': {5087'label': this.localization('Enable Turbo Buttons'),5088'options': {5089'disabled': this.localization('disabled'),5090'enabled': this.localization('enabled')5091},5092'default': 'disabled'5093},5094'vbanext_turbodelay': {5095'label': this.localization('Turbo Delay in frames'),5096'options': ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'],5097'default': '2'5098}5099};5100break;5101case 'n64':5102_0xa88a13 = {5103'glupen64-aspect': {5104'label': this.localization('Aspect Ratio (Need to refresh page)'),5105'options': ['4:3', '16:9'],5106'default': '4:3'5107},5108'glupen64-43screensize': {5109'label': this.localization('4:3 Resolution'),5110'options': ['320x240', '640x480', '960x720', '1280x960'],5111'default': '320x240'5112},5113'glupen64-169screensize': {5114'label': this.localization('16:9 Resolution'),5115'options': ['640x360', '960x540', '1280x720'],5116'default': '640x360'5117},5118'glupen64-pak1': {5119'label': this.localization('Player 1 Pak'),5120'options': {5121'none': this.localization('none'),5122'memory': this.localization('memory'),5123'rumble': this.localization('rumble')5124},5125'default': 'none'5126},5127'glupen64-pak2': {5128'label': this.localization('Player 2 Pak'),5129'options': {5130'none': this.localization('none'),5131'memory': this.localization('memory'),5132'rumble': this.localization('rumble')5133},5134'default': 'none'5135},5136'glupen64-pak3': {5137'label': this.localization('Player 3 Pak'),5138'options': {5139'none': this.localization('none'),5140'memory': this.localization('memory'),5141'rumble': this.localization('rumble')5142},5143'default': 'none'5144},5145'glupen64-pak4': {5146'label': this.localization('Player 4 Pak'),5147'options': {5148'none': this.localization('none'),5149'memory': this.localization('memory'),5150'rumble': this.localization('rumble')5151},5152'default': 'none'5153},5154};5155break;5156case 'nds':5157_0xa88a13 = {5158'desmume_screens_layout': {5159'label': this.localization('Screen layout'),5160'options': {5161'top/bottom': this.localization('top/bottom'),5162'bottom/top': this.localization('bottom/top'),5163'left/right': this.localization('left/right'),5164'right/left': this.localization('right/left'),5165'top only': this.localization('top only'),5166'bottom only': this.localization('bottom only'),5167'quick switch': this.localization('quick switch'),5168'hybrid/top': this.localization('hybrid/top'),5169'hybrid/bottom': this.localization('hybrid/bottom')5170},5171'default': 'top/bottom'5172},5173'screen_rotation': {5174'label': this.localization('Screen Rotation'),5175'options': {51760: '0°',517790: '90°',5178180: '180°',5179270: '270°'5180},5181'default': 05182},5183'desmume_frameskip': {5184'label': this.localization('Frameskip'),5185'options': ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],5186'default': '0'5187}5188}, _0x2d904a.wasm || delete _0xa88a13.screen_rotation;5189break;5190case 'vb':5191case 'pce':5192_0xa88a13 = {};5193break;5194case 'segaMS':5195case 'segaGG':5196case 'segaMD':5197case 'segaCD':5198_0xa88a13 = {5199'genesis_plus_gx_no_sprite_limit': {5200'label': this.localization('No Sprite Limit'),5201'options': {5202'disabled': this.localization('disabled'),5203'enabled': this.localization('enabled')5204},5205'default': 'disabled'5206},5207'genesis_plus_gx_overclock': {5208'label': this.localization('CPU speed'),5209'options': ['100%', '125%', '150%', '175%', '200%'],5210'default': '100%'5211},5212'genesis_plus_gx_sound_output': {5213'label': this.localization('Sound output'),5214'options': {5215'stereo': this.localization('stereo'),5216'mono': this.localization('mono')5217},5218'default': 'stereo'5219}5220};5221break;5222case 'sega32x':5223_0xa88a13 = {5224'picodrive_sprlim': {5225'label': this.localization('No sprite limit'),5226'options': {5227'disabled': this.localization('disabled'),5228'enabled': this.localization('enabled')5229},5230'default': 'disabled'5231}5232};5233break;5234case 'segaSaturn':5235_0xa88a13 = {5236'yabause_frameskip': {5237'label': this.localization('Frameskip'),5238'options': {5239'disabled': this.localization('disabled'),5240'enabled': this.localization('enabled')5241},5242'default': 'disabled'5243}5244};5245break;5246case 'msx':5247_0xa88a13 = {5248'bluemsx_nospritelimits': {5249'label': this.localization('No Sprite Limit'),5250'options': {5251'OFF': this.localization('OFF'),5252'ON': this.localization('ON')5253},5254'default': 'OFF'5255}5256};5257break;5258case 'ws':5259case 'ngp':5260_0xa88a13 = {};5261break;5262case 'jaguar':5263_0xa88a13 = {5264'virtualjaguar_usefastblitter': {5265'label': this.localization('Fast Blitter'),5266'options': {5267'disabled': this.localization('disabled'),5268'enabled': this.localization('enabled')5269},5270'default': 'disabled'5271},5272'virtualjaguar_bios': {5273'label': this.localization('Bios'),5274'options': {5275'disabled': this.localization('disabled'),5276'enabled': this.localization('enabled')5277},5278'default': 'disabled'5279}5280};5281break;5282case 'psx':5283_0xa88a13 = {5284'pcsx_rearmed_frameskip': {5285'label': this.localization('Frameskip'),5286'options': [0, 1, 2, 3],5287'default': 05288},5289'pcsx_rearmed_memcard2': {5290'label': this.localization('Enable second memory card'),5291'options': {5292'disabled': this.localization('disabled'),5293'enabled': this.localization('enabled')5294},5295'default': 'enabled'5296},5297'pcsx_rearmed_pad1type': {5298'label': this.localization('Pad 1 Type'),5299'options': {5300'default': this.localization('default'),5301'none': this.localization('none'),5302'standard': this.localization('standard'),5303'analog': this.localization('analog'),5304'negcon': this.localization('negcon')5305},5306'default': 'default'5307},5308'pcsx_rearmed_pad2type': {5309'label': this.localization('Pad 2 Type'),5310'options': {5311'default': this.localization('default'),5312'none': this.localization('none'),5313'standard': this.localization('standard'),5314'analog': this.localization('analog'),5315'negcon': this.localization('negcon')5316},5317'default': 'default'5318},5319'pcsx_rearmed_pad3type': {5320'label': this.localization('Pad 3 Type'),5321'options': {5322'default': this.localization('default'),5323'none': this.localization('none'),5324'standard': this.localization('standard'),5325'analog': this.localization('analog'),5326'negcon': this.localization('negcon')5327},5328'default': 'default'5329},5330'pcsx_rearmed_pad4type': {5331'label': this.localization('Pad 4 Type'),5332'options': {5333'default': this.localization('default'),5334'none': this.localization('none'),5335'standard': this.localization('standard'),5336'analog': this.localization('analog'),5337'negcon': this.localization('negcon')5338},5339'default': 'default'5340},5341'pcsx_rearmed_vibration': {5342'label': this.localization('Enable Vibration'),5343'options': {5344'disabled': this.localization('disabled'),5345'enabled': this.localization('enabled')5346},5347'default': 'enabled'5348},5349'pcsx_rearmed_neon_interlace_enable': {5350'label': this.localization('Enable interlacing mode(s)'),5351'options': {5352'disabled': this.localization('disabled'),5353'enabled': this.localization('enabled')5354},5355'default': 'disabled'5356},5357'pcsx_rearmed_neon_enhancement_enable': {5358'label': this.localization('Enhanced resolution (slow)'),5359'options': {5360'disabled': this.localization('disabled'),5361'enabled': this.localization('enabled')5362},5363'default': 'disabled'5364},5365'pcsx_rearmed_neon_enhancement_no_main': {5366'label': this.localization('Enhanced resolution speed hack'),5367'options': {5368'disabled': this.localization('disabled'),5369'enabled': this.localization('enabled')5370},5371'default': 'disabled'5372}5373};5374break;5375case 'arcade':5376case 'fba0.2.97.29':5377_0xa88a13 = {5378'fba-aspect': {5379'label': this.localization('Aspect ratio'),5380'options': ['DAR', 'PAR'],5381'default': 'DAR'5382},5383'fba-frameskip': {5384'label': this.localization('Frameskip'),5385'options': ['0', '1', '2', '3', '4', '5'],5386'default': '0'5387},5388'fba-cpu-speed-adjust': {5389'label': this.localization('CPU overclock'),5390'options': ['100', '110', '120', '130', '140', '150', '160', '170', '180', '190', '200'],5391'default': '100'5392},5393'fba-diagnostic-input': {5394'label': this.localization('Diagnostic Input'),5395'options': ['None', 'Hold Start', 'Start + A + B', 'Hold Start + A + B', 'Start + L + R', 'Hold Start + L + R', 'Hold Select', 'Select + A + B', 'Hold Select + A + B', 'Select + L + R', 'Hold Select + L + R'],5396'default': 'None'5397},5398'fba-neogeo-mode': {5399'label': this.localization('Force Neo Geo mode'),5400'options': ['MVS', 'AES', 'UNIBIOS', 'DIPSWITCH'],5401'default': 'MVS'5402}5403};5404break;5405case 'mame2003':5406case 'mame2010':5407case 'mame':5408_0xa88a13 = {};5409break;5410case 'dos':5411_0xa88a13 = {};5412break;5413default:5414_0xa88a13 = {};5415}5416const _this = this;5417if (this.coreVer === 2) {5418_0xa88a13 = {};5419_0xa88a13['fps'] = {5420'label': this.localization('FPS'),5421'options': {5422'show': this.localization("show"),5423'hide': this.localization("hide")5424},5425'default': "hide"5426}5427}5428if (_0xdcec2a && (_0xdcec2a.virtualGamepadContainer != 'undefined' || _0xdcec2a.virtualGamepadContainer !== null)) {5429_0xa88a13['left-handed-mode'] = {5430'label': this.localization('Left Handed Mode'),5431'options': {5432'on': this.localization('On'),5433'off': this.localization('Off')5434},5435'default': 'off'5436}5437}5438if (this.statesSupported === true) {5439_0xa88a13['save-state-slot'] = {5440'label': this.localization('Save State Slot'),5441'options': [1, 2, 3, 4, 5, 6, 7, 8, 9],5442'default': 15443}5444}5445if (this.statesSupported === true && window.indexedDB && this.getStartName()) {5446_0xa88a13['save-state-location'] = {5447'label': this.localization('Save State Location'),5448'options': {5449'download': this.localization('download'),5450'keep in browser': this.localization('keep in browser')5451},5452'default': 'download'5453}5454}5455try {5456_0xdcec2a.getGameCoreOptions && _0xdcec2a.getGameCoreOptions().split('\n').forEach(function(_0x2bef5a, _0x49b64b) {5457let _0x5995db = _0x2bef5a.split('; '),5458_0x16274c = _0x5995db[0];5459if (0x0 === _0x16274c.indexOf('fba-dipswitch-') || _this.coreVer === 2) {5460let _0x757776 = _0x5995db[1].split('|'),5461_0x1f895e = _0x16274c.split("|")[0].replace(/_/g, ' ').replace(/.+\-(.+)/, '$1');5462_0x757776.slice(1, -1);5463if (_0x757776.length === 1) return;5464let options = {};5465for (let i=0; i<_0x757776.length; i++) {5466options[_0x757776[i]] = _this.localization(_0x757776[i]);5467}5468_0xa88a13[_0x16274c.split("|")[0]] = {5469'label': _this.localization(_0x1f895e),5470'options': options,5471'default': (_0x16274c.split("|").length > 1) ? _0x16274c.split("|")[1] : _0x757776[0].replace('(Default) ', '')5472};5473}5474});5475} catch(e) {};5476return _0xa88a13;5477},5478'supportNetPlay': function() {5479if (this.coreVer === 2) return false;5480if (!this.listUrl || !this.socketUrl) return false;5481if (this.lightgun || this.mouse) return false;5482let _0xa88a13 = window.RTCPeerConnection || window.webkitPeerConnection00 || window.webkitRTCPeerConnection || window.mozRTCPeerConnection,5483_0x17edbf = window.mozRTCIceCandidate || window.RTCIceCandidate,5484_0x2c1832 = window.mozRTCSessionDescription || window.RTCSessionDescription;5485return !!(_0xa88a13 && _0x17edbf && _0x2c1832) && !!(_0xa88a13 && 'createDataChannel' in _0xa88a13.prototype);5486},5487'isNetPlay': function() {},5488'findElements': function() {5489try {5490return this.elements.controls = _0x530042.call(this, this.config.selectors.controls.wrapper), this.elements.buttons = {5491'play': _0x23ffa1.call(this, this.config.selectors.buttons.play),5492'pause': _0x530042.call(this, this.config.selectors.buttons.pause),5493'restart': _0x530042.call(this, this.config.selectors.buttons.restart),5494'mute': _0x530042.call(this, this.config.selectors.buttons.mute),5495'settings': _0x530042.call(this, this.config.selectors.buttons.settings),5496'fullscreen': _0x530042.call(this, this.config.selectors.buttons.fullscreen),5497'saveState': _0x530042.call(this, this.config.selectors.buttons.saveState),5498'cacheManager': _0x530042.call(this, this.config.selectors.buttons.cacheManager),5499'screenRecord': _0x530042.call(this, this.config.selectors.buttons.screenRecord),5500'loadState': _0x530042.call(this, this.config.selectors.buttons.loadState),5501'gamepad': _0x530042.call(this, this.config.selectors.buttons.gamepad),5502'netplay': _0x530042.call(this, this.config.selectors.buttons.netplay),5503'cheat': _0x530042.call(this, this.config.selectors.buttons.cheat)5504}, this.elements.inputs = {5505'volume': _0x530042.call(this, this.config.selectors.inputs.volume)5506}, true;5507} catch (_0x527381) {5508return this.debug.warn('It looks like there is a problem with your custom controls HTML', _0x527381), false;5509}5510},5511'createIcon': function(_0x43d42f, _0x42a597) {5512let _0x2c1832 = document.createElementNS('http://www.w3.org/2000/svg', 'svg');5513_0x154f99(_0x2c1832, _0x5dc0c0(_0x42a597, {5514'role': 'presentation',5515'focusable': 'false'5516}));5517let _0x50b7a7 = document.createElement('div');5518_0x50b7a7.innerHTML = '<svg>' .concat(this.icons[_0x43d42f], '</svg>');5519for (let _0x373099 = _0x50b7a7.childNodes[0].childNodes, _0x804f4d = 0; _0x804f4d < _0x373099.length; _0x804f4d += 1) _0x2c1832.appendChild(_0x373099[_0x804f4d]);5520return _0x2c1832;5521},5522'createLabel': function(_0x185043) {5523let _0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},5524_0x2c1832 = _0xb9b2ff.get(_0x185043, this.config),5525_0x3d681f = {};5526_0x3d681f[_0x17edbf.class] = true, _0x3d681f[this.config.classNames.hidden] = true;5527let _0x58a1d4 = Object.assign({}, _0x17edbf, {5528'class': [_0x17edbf.class, this.config.classNames.tooltip].filter(Boolean).join(' ')5529});5530return _0x428003('span', _0x58a1d4, _0x2c1832);5531},5532'createBadge': function(_0x415aef) {5533if (_0x1e2c68.empty(_0x415aef)) return null;5534let _0x17edbf = _0x428003('span', {5535'class': this.config.classNames.menu.value5536});5537return _0x17edbf.appendChild(_0x428003('span', {5538'class': this.config.classNames.menu.badge5539}, _0x415aef)), _0x17edbf;5540},5541'createButton': function(_0x427a85, _0x493eb2) {5542let _0x2c1832, _0x325832, _0xcb618b, _0x25c678, _0x58309d = _0x428003('button'),5543_0x183584 = Object.assign({}, _0x493eb2),5544_0x2345d2 = _0x9fdcea(_0x427a85),5545_0x2ca20d = false;5546'type' in _0x183584 || (_0x183584.type = 'button');5547let _0x34225b = getClass({5548'ejs__control': true5549});5550switch ('class' in _0x183584 ? _0x183584.class.includes(_0x34225b) || (_0x183584.class += ' ' .concat(_0x34225b)) : _0x183584.class = _0x34225b, _0x427a85) {5551case 'play':5552_0x2ca20d = true, _0x2c1832 = 'play', _0xcb618b = 'pause', _0x325832 = 'play', _0x25c678 = 'pause';5553break;5554case 'mute':5555_0x2ca20d = true, _0x2c1832 = 'mute', _0xcb618b = 'unmute', _0x325832 = 'volume', _0x25c678 = 'muted';5556break;5557case 'fullscreen':5558_0x2ca20d = true, _0x2c1832 = 'enterFullscreen', _0xcb618b = 'exitFullscreen', _0x325832 = 'enter-fullscreen', _0x25c678 = 'exit-fullscreen';5559break;5560default:5561_0x2c1832 = _0x2345d2, _0x325832 = _0x427a85;5562}5563return _0x2ca20d ? (_0x58309d.appendChild(_0x7f9f36.createIcon.call(this, _0x25c678, {5564'class': getClass({5565'icon--pressed': true5566})5567})), _0x58309d.appendChild(_0x7f9f36.createIcon.call(this, _0x325832, {5568'class': getClass({5569'icon--not-pressed': true5570})5571})), _0x58309d.appendChild(_0x7f9f36.createLabel.call(this, _0xcb618b, {5572'class': getClass({5573'icon--pressed': true5574})5575})), _0x58309d.appendChild(_0x7f9f36.createLabel.call(this, _0x2c1832, {5576'class': getClass({5577'icon--not-pressed': true5578})5579}))) : (_0x58309d.appendChild(_0x7f9f36.createIcon.call(this, _0x325832)), _0x58309d.appendChild(_0x7f9f36.createLabel.call(this, _0x2c1832))), _0x5dc0c0(_0x183584, _0xa949a8(this.config.selectors.buttons[_0x2345d2], _0x183584)), _0x154f99(_0x58309d, _0x183584), 'play' === _0x2345d2 ? (_0x1e2c68.array(this.elements.buttons[_0x2345d2]) || (this.elements.buttons[_0x2345d2] = []), this.elements.buttons[_0x2345d2].push(_0x58309d)) : this.elements.buttons[_0x2345d2] = _0x58309d, _0x58309d;5580},5581'createRange': function(_0x491b4a, _0x5f154a) {5582let _0x2c1832 = _0x428003('input', _0x5dc0c0(_0xa949a8(this.config.selectors.inputs[_0x491b4a]), {5583'type': 'range',5584'min': 0,5585'max': 0x64,5586'step': 0.1,5587'value': 0,5588'autocomplete': 'off',5589'role': 'slider',5590'aria-label': _0xb9b2ff.get(_0x491b4a, this.config),5591'aria-valuemin': 0,5592'aria-valuemax': 0x64,5593'aria-valuenow': 0x05594}, _0x5f154a));5595return this.elements.inputs[_0x491b4a] = _0x2c1832, _0x7f9f36.updateRangeFill.call(this, _0x2c1832), _0x2c1832;5596},5597'bindMenuItemShortcuts': function(_0x1830d1, _0x2770c2) {5598let _0x2c1832 = this;5599_0x1093f4(_0x1830d1, 'keydown keyup', function(_0x4bb9d6) {5600if ([0x20, 0x26, 0x27, 0x28].includes(_0x4bb9d6.which) && (_0x4bb9d6.preventDefault(), _0x4bb9d6.stopPropagation(), 'keydown' !== _0x4bb9d6.type)) {5601let _0x20ac7b, _0x51717d = _0x13f491(_0x1830d1, '[role="menuitemradio"]');5602if (!_0x51717d && [0x20, 0x27].includes(_0x4bb9d6.which)) _0x7f9f36.showMenuPanel.call(_0x2c1832, _0x2770c2, true);5603else 0x20 !== _0x4bb9d6.which && (0x28 === _0x4bb9d6.which || _0x51717d && 0x27 === _0x4bb9d6.which ? (_0x20ac7b = _0x1830d1.nextElementSibling, _0x1e2c68.element(_0x20ac7b) || (_0x20ac7b = _0x1830d1.parentNode.firstElementChild)) : (_0x20ac7b = _0x1830d1.previousElementSibling, _0x1e2c68.element(_0x20ac7b) || (_0x20ac7b = _0x1830d1.parentNode.lastElementChild)), _0x31cc23.call(_0x2c1832, _0x20ac7b, true));5604}5605}, false), _0x1093f4(_0x1830d1, 'keyup', function(_0x3844f5) {56060xd === _0x3844f5.which && _0x7f9f36.focusFirstMenuItem.call(_0x2c1832, null, true);5607});5608},5609'createMenuItem': function(_0x52a95b) {5610let _0x17edbf = this,5611_0x2c1832 = _0x52a95b.value,5612_0x231912 = _0x52a95b.list,5613_0x57313b = _0x52a95b.type,5614_0x19be70 = _0x52a95b.title,5615_0x4ae558 = _0x52a95b.badge,5616_0x34a012 = void 0 === _0x4ae558 ? null : _0x4ae558,5617_0x7dbb2e = _0x52a95b.checked,5618_0x200580 = void 0 !== _0x7dbb2e && _0x7dbb2e,5619_0x4bb1a2 = _0xa949a8(this.config.selectors.inputs[_0x57313b]),5620_0xb8fbbd = _0x428003('button', _0x5dc0c0(_0x4bb1a2, {5621'type': 'button',5622'role': 'menuitemradio',5623'class': '' .concat(this.config.classNames.control, ' ').concat(_0x4bb1a2.class ? _0x4bb1a2.class : '').trim(),5624'aria-checked': _0x200580,5625'value': _0x2c18325626})),5627_0x560073 = _0x428003('span');5628_0x560073.innerHTML = _0x19be70, _0x1e2c68.element(_0x34a012) && _0x560073.appendChild(_0x34a012), _0xb8fbbd.appendChild(_0x560073), Object.defineProperty(_0xb8fbbd, 'checked', {5629'enumerable': true,5630'get': function() {5631return 'true' === _0xb8fbbd.getAttribute('aria-checked');5632},5633'set': function(_0x2da7f0) {5634_0x2da7f0 && Array.from(_0xb8fbbd.parentNode.children).filter(function(_0x480c16) {5635return _0x13f491(_0x480c16, '[role="menuitemradio"]');5636}).forEach(function(_0x363b12) {5637return _0x363b12.setAttribute('aria-checked', 'false');5638}), _0xb8fbbd.setAttribute('aria-checked', _0x2da7f0 ? 'true' : 'false');5639}5640});5641let _0x449ec7 = _0x7f9f36.getCoreOptions.call(this);5642this.listeners.bind(_0xb8fbbd, 'click keyup', function(_0x270d0d) {5643_0x1e2c68.keyboardEvent(_0x270d0d) && 0x20 !== _0x270d0d.which || (_0x270d0d.preventDefault(), _0x270d0d.stopPropagation(), _0xb8fbbd.checked = true, Object.keys(_0x7f9f36.normalOptions).includes(_0x57313b) && _0x7f9f36.updateNormalOptions.call(_0x17edbf, _0x57313b, _0x2c1832), Object.keys(_0x449ec7).includes(_0x57313b) && (_0x449ec7[_0x57313b].netplay && _0xdcec2a.connected ? _0xdcec2a.connection.isInitiator && (_0x7f9f36.updateCoreOptions.call(_0x17edbf, _0x57313b, _0x2c1832), _0xdcec2a.connection.send(JSON.stringify({5644'act': 'update-core-option',5645'key': _0x57313b,5646'value': _0x2c1832,5647'frame': _0xdcec2a.currentFrame5648}))) : _0x7f9f36.updateCoreOptions.call(_0x17edbf, _0x57313b, _0x2c1832)), _0x7f9f36.showMenuPanel.call(_0x17edbf, 'home', _0x1e2c68.keyboardEvent(_0x270d0d)));5649}, _0x57313b, false), _0x7f9f36.bindMenuItemShortcuts.call(this, _0xb8fbbd, _0x57313b), _0x231912.appendChild(_0xb8fbbd);5650},5651'updateVolume': function() {5652_0x1e2c68.element(this.elements.inputs.volume) && _0x7f9f36.setRange.call(this, this.elements.inputs.volume, this.muted ? 0 : this.volume), _0x1e2c68.element(this.elements.buttons.mute) && (this.elements.buttons.mute.pressed = this.muted || 0 === this.volume);5653},5654'setRange': function(_0x1c075b) {5655let _0x17edbf = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;5656_0x1e2c68.element(_0x1c075b) && (_0x1c075b.value = _0x17edbf, _0x7f9f36.updateRangeFill.call(this, _0x1c075b));5657},5658'updateRangeFill': function(_0x2dbde1) {5659let _0x17edbf = _0x1e2c68.event(_0x2dbde1) ? _0x2dbde1.target : _0x2dbde1;5660if (_0x1e2c68.element(_0x17edbf) && 'range' === _0x17edbf.getAttribute('type')) {5661if (_0x13f491(_0x17edbf, this.config.selectors.inputs.volume)) {5662let _0x2c1832 = 0x64 * _0x17edbf.value;5663_0x17edbf.setAttribute('aria-valuenow', _0x2c1832), _0x17edbf.setAttribute('aria-valuetext', '' .concat(_0x2c1832.toFixed(1), '%'));5664} else _0x17edbf.setAttribute('aria-valuenow', _0x17edbf.value);5665_0x59aa33.isWebkit && _0x17edbf.style.setProperty('--value', '' .concat(_0x17edbf.value / _0x17edbf.max * 0x64, '%'));5666}5667},5668'toggleMenuButton': function(_0x249814, _0x2948e9) {5669_0x132da7(this.elements.settings.buttons[_0x249814], !_0x2948e9);5670},5671'updateNormalOptions': function(option, value) {5672this.elements.settings.buttons[option].querySelector('.' .concat(this.config.classNames.menu.value)).innerHTML = _0x7f9f36.normalOptions[option].options[value];5673let _0x2c1832 = {};5674_0x2c1832[option] = value;5675_0x7f9f36.storage.set(_0x2c1832);5676'shader' === option && _0xdcec2a.setShader(value);5677'virtual-gamepad' === option && _0xdcec2a.toggleVirtualGamepad.call(this, 'enabled' === value);5678},5679'updateCoreOptions': function(_0x41c4ad, _0x15823e) {5680if ('nds' === getSystem(this.system, true) && !_0x2d904a.wasm) return true;5681_0x7f9f36.coreOptionsValues[_0x41c4ad] = _0x15823e;5682if ('psx' === getSystem(this.system, true) && _0x27f4c4.Module.pauseMainLoop(), _0xdcec2a.setVariable(_0x41c4ad, _0x15823e), 'psx' === getSystem(this.system, true) && (setTimeout(function() {5683_0x27f4c4.Module.resumeMainLoop();5684}, 0x64), setTimeout(function() {5685_0x27f4c4.Module.resumeMainLoop();5686}, 0xc8)), 'nds' === getSystem(this.system, true) && _0x2d904a.wasm) {5687let _0x2c1832 = this.elements.wrapper.querySelector('canvas');5688if ('screen_rotation' === _0x41c4ad) switch (_0x2c1832.style.transform = 'rotate(' + _0x15823e + 'deg)', _0x15823e) {5689case '0':5690_0xdcec2a.setVariable('desmume_input_rotation', '0');5691break;5692case '90':5693_0xdcec2a.setVariable('desmume_input_rotation', '270');5694break;5695case '180':5696_0xdcec2a.setVariable('desmume_input_rotation', '180');5697break;5698case '270':5699_0xdcec2a.setVariable('desmume_input_rotation', '90');5700}5701}5702if ('arcade' === getSystem(this.system, true) || 'fba0.2.97.29' === getSystem(this.system, true)) {5703let _0x567ccc = this.elements.wrapper.querySelector('canvas');5704_0x567ccc.height = 'fba-aspect' === _0x41c4ad && 'PAR' === _0x15823e ? _0x567ccc.width / 0x10 * 0x9 : _0x567ccc.width / 4 * 3;5705}5706let _0x31bdec = _0x7f9f36.getCoreOptions.call(this),5707_0x3efd0b = _0x7f9f36.storage.get('core-options');5708if (_0x1e2c68.empty(_0x3efd0b) && (_0x3efd0b = {}), _0x3efd0b[_0x41c4ad] = _0x15823e, _0x7f9f36.storage.set({5709'core-options': _0x3efd0b5710}), this.elements.settings.buttons[_0x41c4ad]) {5711let _0xe95e6a = this.elements.settings.buttons[_0x41c4ad].querySelector('.' .concat(this.config.classNames.menu.value));5712_0x1e2c68.object(_0x31bdec[_0x41c4ad].options) ? _0xe95e6a.innerHTML = _0x31bdec[_0x41c4ad].options[_0x15823e] : _0xe95e6a.innerHTML = _0x15823e;5713}5714if (_0x41c4ad === 'left-handed-mode') {5715_0xdcec2a.toggleVirtualGamepad.call(this, true, true);5716}5717},5718'setOptionMenuItem': function(_0x2f0e6a, _0x85969e) {5719let _0x2c1832 = this,5720_0x549dac = this.elements.settings.panels.home.querySelector('[role="menu"]'),5721_0x43777f = this.elements.settings.popup.children[0];5722Object.keys(_0x2f0e6a).forEach(function(_0x4fcbcf) {5723let _0x177975 = _0x4fcbcf,5724_0x5f3e0f = _0x428003('button', _0x5dc0c0(_0xa949a8(_0x2c1832.config.selectors.buttons.settings), {5725'type': 'button',5726'class': getClass({5727'ejs__control': true,5728'ejs__control--forward': true5729}),5730'role': 'menuitem',5731'item': _0x4fcbcf,5732'aria-haspopup': true5733}));5734_0x1093f4(_0x5f3e0f, 'click', function() {5735_0x7f9f36.showMenuPanel.call(_0x2c1832, _0x177975, false);5736});5737let _0x1d5857, _0x1838f9 = _0x428003('span', null, _0x2f0e6a[_0x4fcbcf].label),5738_0x455b20 = _0x428003('span', {5739'class': _0x2c1832.config.classNames.menu.value5740});5741_0x1e2c68.object(_0x85969e) && (_0x1d5857 = _0x85969e[_0x177975]), _0x1e2c68.empty(_0x1d5857) && (_0x1d5857 = _0x2f0e6a[_0x177975].default), _0x1e2c68.object(_0x2f0e6a[_0x177975].options) ? _0x455b20.innerHTML = _0x2f0e6a[_0x177975].options[_0x1d5857] : _0x455b20.innerHTML = _0x1d5857, _0x1838f9.appendChild(_0x455b20), _0x5f3e0f.appendChild(_0x1838f9), _0x549dac.appendChild(_0x5f3e0f);5742let _0x3f3775 = _0x428003('div', {5743'data-pane': escape(_0x177975),5744'hidden': ''5745}),5746_0x288440 = _0x428003('button', {5747'type': 'button',5748'class': getClass({5749'ejs__control': true,5750'ejs__control--back': true5751})5752});5753_0x288440.appendChild(_0x428003('span', {5754'aria-hidden': true5755}, _0x2f0e6a[_0x4fcbcf].label)), _0x288440.appendChild(_0x428003('span', {5756'class': getClass({5757'ejs__sr-only': true5758})5759}, _0xb9b2ff.get('menuBack', _0x2c1832.config))), _0x1093f4(_0x3f3775, 'keydown', function(_0x462a4d) {57600x25 === _0x462a4d.which && (_0x462a4d.preventDefault(), _0x462a4d.stopPropagation(), _0x7f9f36.showMenuPanel.call(_0x2c1832, 'home', true));5761}, false), _0x1093f4(_0x288440, 'click', function() {5762_0x7f9f36.showMenuPanel.call(_0x2c1832, 'home', false);5763}), _0x3f3775.appendChild(_0x288440), _0x3f3775.appendChild(_0x428003('div', {5764'role': 'menu'5765})), _0x43777f.appendChild(_0x3f3775), _0x2c1832.elements.settings.buttons[_0x177975] = _0x5f3e0f, _0x2c1832.elements.settings.panels[_0x177975] = _0x3f3775;5766let _0x2c172f = _0x3f3775.querySelector('[role="menu"]');5767!function(_0x301c01) {5768if (_0x1e2c68.element(_0x301c01))5769for (let _0x85969e = _0x301c01.childNodes.length; _0x85969e > 0;) _0x301c01.removeChild(_0x301c01.lastChild), _0x85969e -= 1;5770}(_0x2c172f);5771_0x1e2c68.object(_0x2f0e6a[_0x4fcbcf].options) ? Object.keys(_0x2f0e6a[_0x4fcbcf].options).forEach(function(_0x281296) {5772_0x7f9f36.createMenuItem.call(_0x2c1832, {5773'value': _0x281296,5774'list': _0x2c172f,5775'type': _0x177975,5776'title': _0x2f0e6a[_0x4fcbcf].options[_0x281296],5777'badge': null,5778'checked': Boolean(_0x1d5857 === _0x281296)5779});5780}) : _0x1e2c68.array(_0x2f0e6a[_0x4fcbcf].options) && _0x2f0e6a[_0x4fcbcf].options.forEach(function(_0x28a341) {5781_0x7f9f36.createMenuItem.call(_0x2c1832, {5782'value': _0x28a341,5783'list': _0x2c172f,5784'type': _0x177975,5785'title': _0x28a341,5786'badge': null,5787'checked': Boolean(_0x1d5857 === _0x28a341)5788});5789});5790});5791},5792'setNormalOptionsMenu': function() {5793let _this = this,5794_0x2c1832 = {};5795if (this.config.defaultMenuOptions && this.config.defaultMenuOptions.length === undefined) {5796_0x2c1832 = this.config.defaultMenuOptions;5797}5798_0x2c1832.orientation = _0x7f9f36.storage.get('orientation');5799_0x2c1832.shader = _0x7f9f36.storage.get('shader') || _0x2c1832.shader;5800if (_this.touch) {5801_0x2c1832['virtual-gamepad'] = _0x7f9f36.storage.get('virtual-gamepad') || _0x2c1832['virtual-gamepad'];5802_0x1093f4.call(_this, _this.elements.container, 'start-game', function() {5803('enabled' === _0x2c1832['virtual-gamepad'] || _0x1e2c68.empty(_0x2c1832['virtual-gamepad'])) && _0xdcec2a.toggleVirtualGamepad.call(_this, true);5804})5805} else {5806delete _0x7f9f36.normalOptions['virtual-gamepad'];5807}5808_0x7f9f36.setOptionMenuItem.call(this, _0x7f9f36.normalOptions, _0x2c1832);5809_0x1093f4.call(_this, _this.elements.container, 'start-game', function() {5810let shader = _0x7f9f36.storage.get('shader');5811if (shader !== 'disabled') {5812_0xdcec2a.setShader(shader);5813}5814let _0x42a7b1 = {};5815_0xdcec2a.getGameCoreOptions && _0xdcec2a.getGameCoreOptions().split('\n').forEach(function(_0x4a987e, _0x10bd7a) {5816let _0x2c1832 = _0x4a987e.split('; '),5817_0x1ddc5f = _0x2c1832[0];5818if (0 === _0x1ddc5f.indexOf('fba-dipswitch-') || _this.coreVer === 2) {5819let _0xbd808 = _0x2c1832[1].split('|'),5820_0x3c4b1a = _0x1ddc5f.split("|")[0].replace(/_/g, ' ').replace(/.+\-(.+)/, '$1');5821_0xbd808.slice(1, -1);5822if (_0xbd808.length === 1) return;5823let options = {};5824for (let i=0; i<_0xbd808.length; i++) {5825options[_0xbd808[i]] = _this.localization(_0xbd808[i]);5826}5827_0x42a7b1[_0x1ddc5f.split("|")[0]] = {5828'label': _this.localization(_0x3c4b1a),5829'options': options,5830'default': (_0x1ddc5f.split("|").length > 1) ? _0x1ddc5f.split("|")[1] : _0xbd808[0].replace('(Default) ', '')5831};5832}5833});5834let _0x27d859 = _0x7f9f36.storage.get('core-options');5835_0x27d859 = _0x27d859 || {};5836_0x7f9f36.coreOptionsValues = _0x27d859;5837_0x7f9f36.setOptionMenuItem.call(_this, _0x42a7b1, _0x7f9f36.coreOptionsValues);5838Object.keys(_0x7f9f36.coreOptionsValues).forEach(function(_0x51fc4e, _0x4b3613) {5839_0x7f9f36.updateCoreOptions.call(_0x2c1832, _0x51fc4e, _0x7f9f36.coreOptionsValues[_0x51fc4e]);5840});5841'nds' == getSystem(_this.system, true) && (_0x27f4c4.Module._fast_forward_2 ? _0x27f4c4.Module._fast_forward_2(1) : _0x27f4c4.Module._fast_forward && _0x27f4c4.Module._fast_forward(1));5842});5843},5844'updateCoreOptionMenuItems': function() {5845let _0xa88a13 = this.elements.settings.panels.home.querySelector('[role="menu"]'),5846_0x17edbf = _0x7f9f36.getCoreOptions.call(this);5847_0xdcec2a.connected && !_0xdcec2a.connection.isInitiator ? Object.keys(_0x17edbf).forEach(function(_0x480587) {5848_0x17edbf[_0x480587].netplay && _0xa88a13.querySelector('[item="' .concat(_0x480587, '"]')).setAttribute('disabled', '');5849}) : Object.keys(_0x17edbf).forEach(function(_0x20e093) {5850_0xa88a13.querySelector('[item="' .concat(_0x20e093, '"]')).removeAttribute('disabled');5851});5852},5853'setCoreOptionsMenu': function() {5854this.elements.settings.panels.home.querySelector('[role="menu"]'), this.elements.settings.popup.children[0];5855let _0xa88a13 = _0x7f9f36.getCoreOptions.call(this),5856_0x17edbf = _0x7f9f36.storage.get('core-options');5857_0x17edbf = _0x17edbf || {}5858if (this.config.defaultMenuOptions && this.config.defaultMenuOptions.length === undefined) {5859for (let k in this.config.defaultMenuOptions) {5860if (!_0x17edbf[k]) {5861_0x17edbf[k] = this.config.defaultMenuOptions[k];5862}5863}5864_0x2c1832 = this.config.defaultMenuOptions;5865}5866if ('undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX) {5867console.log('Available core options: ', _0xa88a13);5868}5869_0x7f9f36.coreOptionsValues = _0x17edbf, _0x7f9f36.setOptionMenuItem.call(this, _0xa88a13, _0x17edbf);5870},5871'checkMenu': function() {5872let _0xa88a13 = this.elements.settings.buttons;5873!_0x1e2c68.empty(_0xa88a13) && Object.values(_0xa88a13).some(function(_0x200331) {5874return !_0x200331.hidden;5875});5876_0x132da7(this.elements.settings.menu, false);5877},5878'focusFirstMenuItem': function(_0x303d68) {5879let _0x17edbf = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];5880if (!this.elements.settings.popup.hidden) {5881let _0x2c1832 = _0x303d68;5882_0x1e2c68.element(_0x2c1832) || (_0x2c1832 = Object.values(this.elements.settings.panels).find(function(_0xe94c5e) {5883return !_0xe94c5e.hidden;5884}));5885let _0x2f3a13 = _0x2c1832.querySelector('[role^="menuitem"]');5886_0x31cc23.call(this, _0x2f3a13, _0x17edbf);5887}5888},5889'toggleMenu': function(_0x28d6c6) {5890let _0x17edbf = this.elements.settings.popup,5891_0x2c1832 = this.elements.buttons.settings;5892if (_0x1e2c68.element(_0x17edbf) && _0x1e2c68.element(_0x2c1832)) {5893let _0x614270 = _0x17edbf.hidden,5894_0x14f1b5 = _0x614270;5895if (_0x1e2c68.boolean(_0x28d6c6)) _0x14f1b5 = _0x28d6c6;5896else if (_0x1e2c68.keyboardEvent(_0x28d6c6) && 0x1b === _0x28d6c6.which) _0x14f1b5 = false;5897else if (_0x1e2c68.event(_0x28d6c6)) {5898let _0xcf75ac = _0x17edbf.contains(_0x28d6c6.target);5899if (_0xcf75ac || !_0xcf75ac && _0x28d6c6.target !== _0x2c1832 && _0x14f1b5) return;5900}5901_0x2c1832.setAttribute('aria-expanded', _0x14f1b5);5902_0x132da7(_0x17edbf, !_0x14f1b5);5903_0x3a8e2f(this.elements.container, this.config.classNames.menu.open, _0x14f1b5);5904_0x14f1b5 && _0x1e2c68.keyboardEvent(_0x28d6c6) ? _0x7f9f36.focusFirstMenuItem.call(this, null, true) : _0x14f1b5 || _0x614270 || _0x31cc23.call(this, _0x2c1832, _0x1e2c68.keyboardEvent(_0x28d6c6));5905}5906},5907'getMenuSize': function(_0x55fe13) {5908let _0x17edbf = _0x55fe13.cloneNode(true);5909_0x17edbf.style.position = 'absolute';5910_0x17edbf.style.opacity = 0;5911_0x17edbf.removeAttribute('hidden');5912_0x55fe13.parentNode.appendChild(_0x17edbf);5913let _0x2c1832 = _0x17edbf.scrollWidth,5914_0x5edd1b = _0x17edbf.scrollHeight;5915return _0x12a55d(_0x17edbf), {5916'width': _0x2c1832,5917'height': _0x5edd1b5918};5919},5920'showLoadStatePanel': function() {},5921'showMenuPanel': function() {5922let _this = this,5923_0x17edbf = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '',5924_0x2c1832 = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],5925_0x7f4281 = _0x530042.call(this, '[data-pane="' .concat(escape(_0x17edbf), '"]'));5926if (_0x1e2c68.element(_0x7f4281)) {5927let _0x3d6729 = _0x7f4281.parentNode,5928_0x381f57 = Array.from(_0x3d6729.children).find(function(_0x57c652) {5929return !_0x57c652.hidden;5930});5931if (_0x2d904a.transitions && !_0x2d904a.reducedMotion) {5932_0x3d6729.style.width = '' .concat(_0x381f57.scrollWidth, 'px');5933_0x3d6729.style.height = '' .concat(_0x381f57.scrollHeight, 'px');5934let _0x29dd37 = _0x7f9f36.getMenuSize.call(this, _0x7f4281),5935_0x37447f = function _0x17edbf(_0x40854f) {5936_0x40854f.target === _0x3d6729 && ['width', 'height'].includes(_0x40854f.propertyName) && (_0x3d6729.style.width = '', _0x3d6729.style.height = '', _0x20109b.call(_this, _0x3d6729, _0x5a2767, _0x17edbf));5937};5938_0x1093f4.call(this, _0x3d6729, _0x5a2767, _0x37447f), _0x3d6729.style.width = '' .concat(_0x29dd37.width, 'px'), _0x3d6729.style.height = '' .concat(_0x29dd37.height, 'px');5939}5940_0x132da7(_0x381f57, true);5941_0x132da7(_0x7f4281, false);5942_0x7f9f36.focusFirstMenuItem.call(this, _0x7f4281, _0x2c1832);5943}5944},5945'setLoadState': function(_0x526828, _0x2ce330) {5946_0x526828.appendChild(_0x7f9f36.createButton.call(this, 'load-state', {5947'aria-haspopup': true,5948'aria-expanded': false5949}));5950let _0x2c1832 = _0x428003('div', {5951'class': getClass({5952'ejs__dialog': true,5953'ejs__load-state__container': true5954}),5955'hidden': ''5956}),5957_0x2e5e96 = _0x428003('div');5958_0x2c1832.appendChild(_0x2e5e96);5959_0x530042.call(this, '.' .concat(getClass({5960'ejs__dialogs': true5961}))).appendChild(_0x2c1832);5962this.elements.dialogs.loadState = _0x2c1832;5963},5964'setScreenRecord': function(_0x4c3fdd, _0x289259) {5965if (!window.MediaRecorder) {5966return;5967};5968let _0x2c1832 = _0x7f9f36.createButton.call(this, 'screen-record', {5969'aria-haspopup': true,5970'aria-expanded': false,5971'style': 'margin-right:auto;'5972});5973_0x4c3fdd.appendChild(_0x2c1832);5974let _0x13c0e4 = _0x428003('div', {5975'class': getClass({5976'ejs__dialog': true,5977'ejs__screenRecord__container': true5978}),5979'hidden': ''5980}),5981_0xe2c02a = _0x428003('div');5982_0x13c0e4.appendChild(_0xe2c02a);5983_0x530042.call(this, '.' .concat(getClass({5984'ejs__dialogs': true5985}))).appendChild(_0x13c0e4);5986this.elements.dialogs.screenRecord = _0x13c0e4;5987},5988'setCacheManager': function(_0x4c3fdd, _0x289259) {5989let _0x2c1832 = _0x7f9f36.createButton.call(this, 'cache-manager', {5990'aria-haspopup': true,5991'aria-expanded': false,5992'style': 'margin-right:auto;'5993});5994_0x4c3fdd.appendChild(_0x2c1832);5995let _0x13c0e4 = _0x428003('div', {5996'class': getClass({5997'ejs__dialog': true,5998'ejs__cacheManager__container': true5999}),6000'hidden': ''6001}),6002_0xe2c02a = _0x428003('div');6003_0x13c0e4.appendChild(_0xe2c02a);6004_0x530042.call(this, '.' .concat(getClass({6005'ejs__dialogs': true6006}))).appendChild(_0x13c0e4);6007this.elements.dialogs.cacheManager = _0x13c0e4;6008},6009'setGamepad': function(_0x4c3fdd, _0x289259) {6010let _0x2c1832 = _0x7f9f36.createButton.call(this, 'gamepad', {6011'aria-haspopup': true,6012'aria-expanded': false,6013'style': 'margin-right:auto;'6014});6015_0x4c3fdd.appendChild(_0x2c1832);6016let _0x13c0e4 = _0x428003('div', {6017'class': getClass({6018'ejs__dialog': true,6019'ejs__gamepad__container': true6020}),6021'hidden': ''6022}),6023_0xe2c02a = _0x428003('div');6024_0x13c0e4.appendChild(_0xe2c02a);6025_0x530042.call(this, '.' .concat(getClass({6026'ejs__dialogs': true6027}))).appendChild(_0x13c0e4);6028this.elements.dialogs.gamepad = _0x13c0e4;6029},6030'setMessage': function(_0x4c3fdd, _0x289259) {6031let _0x13c0e4 = _0x428003('div', {6032'class': getClass({6033'ejs__dialog': true6034}),6035'hidden': ''6036}),6037_0xe2c02a = _0x428003('div');6038_0x13c0e4.appendChild(_0xe2c02a);6039_0x530042.call(this, '.' .concat(getClass({6040'ejs__dialogs': true6041}))).appendChild(_0x13c0e4);6042this.elements.dialogs.message = _0x13c0e4;6043},6044'setCheat': function(_0x328075, _0x21ca37) {6045let _0x2c1832 = _0x7f9f36.createButton.call(this, 'cheat', {6046'aria-haspopup': true,6047'aria-expanded': false,6048'style': 'margin-right:auto;'6049});6050_0x328075.appendChild(_0x2c1832);6051let _0x173db3 = _0x428003('div', {6052'class': getClass({6053'ejs__dialog': true,6054'ejs__cheat__container': true6055}),6056'hidden': ''6057}),6058_0x460961 = _0x428003('div');6059_0x173db3.appendChild(_0x460961);6060_0x530042.call(this, '.' .concat(getClass({6061'ejs__dialogs': true6062}))).appendChild(_0x173db3);6063this.elements.dialogs.cheat = _0x173db3;6064},6065'setStateInfoBarWidget': function() {6066let _0xa88a13 = _0x428003('div', {6067'class': getClass({6068'ejs__widget': true6069})6070}),6071_0x17edbf = _0x428003('div');6072_0x17edbf.style = 'color: red;font-size: 17px;padding:10px;text-align:left;text-shadow:1px 1px 1px #000'6073_0xa88a13.appendChild(_0x17edbf);6074_0x530042.call(this, '.' .concat(getClass({6075'ejs__widgets': true6076}))).appendChild(_0xa88a13);6077this.elements.widgets.stateInfo = _0xa88a13;6078this.elements.widgets.stateInfoDiv = _0x17edbf;6079},6080'setNetplayWidgets': function() {6081let _0xa88a13 = _0x428003('div', {6082'class': getClass({6083'ejs__widget': true,6084'ejs__widget_netplay': true6085})6086}),6087_0x17edbf = _0x428003('div');6088_0xa88a13.appendChild(_0x17edbf);6089_0x530042.call(this, '.' .concat(getClass({6090'ejs__widgets': true6091}))).appendChild(_0xa88a13);6092this.elements.widgets.netplay = _0xa88a13;6093},6094'setNetplay': function(_0x1859f4, _0x50544d) {6095_0x1859f4.appendChild(_0x7f9f36.createButton.call(this, 'netplay', {6096'aria-haspopup': true,6097'aria-expanded': false6098}));6099let _0x2c1832 = _0x428003('div', {6100'class': getClass({6101'ejs__dialog': true,6102'ejs__netplay__container': true6103}),6104'hidden': ''6105}),6106_0x4f63e0 = _0x428003('div');6107_0x2c1832.appendChild(_0x4f63e0);6108_0x530042.call(this, '.' .concat(getClass({6109'ejs__dialogs': true6110}))).appendChild(_0x2c1832);6111this.elements.dialogs.netplay = _0x2c1832;6112_0x7f9f36.setNetplayWidgets.call(this);6113},6114'toggleContextMenu': function(_0x24b1f3, _0x4b9d55) {6115if (_0x350d73(_0x24b1f3.target, getClass({6116'ejs__dialogs': true6117}))) {6118let _0x2c1832 = _0x7f9f36.contextMenu.timer;6119if (this.started) {6120let _0x2a1dda = _0x530042.call(this, '.' .concat(getClass({6121'ejs__contextmenu': true6122}), ' ul'));6123if (_0x4b9d55) {6124_0x7f9f36.contextMenu.style.display = 'block';6125_0x7f9f36.contextMenu.style.left = ''.concat(_0x24b1f3.layerX, 'px');6126_0x7f9f36.contextMenu.style.top = ''.concat(_0x24b1f3.layerY, 'px');6127let _0x1b48e7 = _0x23ffa1.call(this, '.' .concat(getClass({6128'ejs__contextmenu': true6129}), ' ul li'));6130if (null === _0x2a1dda.getAttribute('menu')) {6131let _0x14264d = _0x428003('li', {});6132_0x14264d.appendChild(_0x428003('a', {6133'target': '_blank',6134'href': 'https://github.com/EmulatorJS/EmulatorJS' // Modifying this is against the terms of service6135}, 'EmulatorJS v' .concat(this.version)));6136_0x2a1dda.appendChild(_0x14264d);6137_0x2a1dda.setAttribute('menu', '');6138}6139_0x2c1832 && clearTimeout(_0x2c1832), _0x2c1832 = setTimeout(function() {}, 0xfa0), _0x7f9f36.contextMenu.timer = _0x2c1832;6140} else _0x7f9f36.contextMenu.style.display = 'none';6141}6142}6143},6144'create': function(_0x42e40d) {6145let _this = this;6146_0x7f9f36.storage = new _0x2f61ba(this, 'ejs_' .concat(this.system, '_settings'));6147let _0x17edbf = _0x428003('div', _0xa949a8(this.config.selectors.controls.wrapper));6148_0x7f9f36.contextMenu = _0x428003('div', {6149'class': getClass({6150'ejs__contextmenu': true6151}),6152'style': 'position: absolute; display:none;z-index:9'6153})6154let contextHtml = ['<ul>', '</ul>']6155let contextFunctions = []6156function addContextHtml(title, hidden, functi0n) {6157if (typeof functi0n == 'function') {6158contextFunctions.push(functi0n)6159} else {6160contextFunctions.push(function(){})6161}6162let i = contextHtml.length - 16163if (hidden) {6164contextHtml.splice(i, 0, '<li hidden><a href="#" onclick="return false">'+title+'</a></li>')6165} else {6166contextHtml.splice(i, 0, '<li><a href="#" onclick="return false">'+title+'</a></li>')6167}6168}6169addContextHtml(_this.localization('Take Screenshot'), false, function(_0x20faaa) {6170let _0x4e898a = _0x378b5c.getScreenData();6171let gamep;6172if (typeof _this.gameName == 'string') {6173gamep = _this.gameName6174}6175let gamepng = gamep ? '' .concat(gamep, '-screenshot.png') : 'game.png';6176let a = document.createElement('a');6177a.href = URL.createObjectURL(new Blob([_0x4e898a]));6178a.download = gamepng;6179a.click();6180setTimeout(function() {6181URL.revokeObjectURL(a.src);6182})6183return false;6184})6185addContextHtml(_this.localization('Quick Save')+' (F2)', false, function(_0x395c73) {6186_0x378b5c.quickSaveState();6187_0x2593da.contextMenu.style.display = 'none';6188})6189addContextHtml(_this.localization('Quick Load')+' (F4)', false, function(_0x124f69) {6190_0x378b5c.quickLoadState();6191_0x2593da.contextMenu.style.display = 'none';6192})619361946195_0x7f9f36.contextMenu.innerHTML = contextHtml.join('')6196let a = _0x7f9f36.contextMenu.getElementsByTagName('li')6197for (let i=0; i<a.length; i++) {6198_0x1093f4.call(_this, a[i], 'click', contextFunctions[i])6199}6200this.elements.container.appendChild(_0x7f9f36.contextMenu);620162026203let _0x2c1832 = _0x428003('div', {6204'class': getClass({6205'ejs__dialog': true,6206'ejs__cache__container': true6207}),6208'hidden': ''6209});6210_0x530042.call(this, '.' .concat(getClass({6211'ejs__dialogs': true6212}))).appendChild(_0x2c1832);6213this.elements.dialogs.cache = _0x2c1832;6214let _0x3c66db = _0x428003('div', {6215'class': getClass({6216'ejs__dialog': true,6217'ejs__loading__container': true6218}),6219'hidden': ''6220});6221_0x530042.call(this, '.' .concat(getClass({6222'ejs__dialogs': true6223}))).appendChild(_0x3c66db);6224this.elements.dialogs.loading = _0x3c66db;6225_0x17edbf.appendChild(_0x7f9f36.createButton.call(this, 'restart'));6226_0x17edbf.appendChild(_0x7f9f36.createButton.call(this, 'play'));6227_0x17edbf.appendChild(_0x7f9f36.createButton.call(this, 'save-state', {6228'aria-expanded': false6229}));6230_0x7f9f36.setLoadState.call(this, _0x17edbf, _0x42e40d);6231_0x7f9f36.setScreenRecord.call(this, _0x17edbf, _0x42e40d);6232_0x7f9f36.setCacheManager.call(this, _0x17edbf, _0x42e40d);6233_0x7f9f36.supportNetPlay.call(this, _0x17edbf) && parseInt(this.config.gameId, 0xa) > 0 && _0x7f9f36.setNetplay.call(this, _0x17edbf, _0x42e40d);6234_0x7f9f36.setGamepad.call(this, _0x17edbf, _0x42e40d);6235_0x7f9f36.setMessage.call(this, _0x17edbf, _0x42e40d)6236_0x7f9f36.setStateInfoBarWidget.call(this, _0x17edbf, _0x42e40d);6237_0x7f9f36.setCheat.call(this, _0x17edbf, _0x42e40d);6238_0x17edbf.appendChild(_0x428003('span', {6239'style': 'flex:1'6240}));6241let _0xd299b = _0x428003('div', {6242'class': getClass({6243'ejs__volume': true6244})6245});6246_0xd299b.appendChild(_0x7f9f36.createButton.call(this, 'mute'));6247let _0x4bbcd0 = {6248'max': 1,6249'step': 0.01,6250'value': this.config.volume6251};6252_0xd299b.appendChild(_0x7f9f36.createRange.call(this, 'volume', _0x5dc0c0(_0x4bbcd0, {})));6253this.elements.volume = _0xd299b;6254_0x17edbf.appendChild(_0xd299b);6255let _0x2746ab = _0x428003('div', {6256'class': getClass({6257'ejs__menu': true6258})6259});6260_0x2746ab.appendChild(_0x7f9f36.createButton.call(this, 'settings', {6261'aria-haspopup': true,6262'aria-expanded': false6263}));6264let _0x262fb8 = _0x428003('div', {6265'class': getClass({6266'ejs__menu__container': true6267}),6268'hidden': ''6269}),6270_0x3f3385 = _0x428003('div'),6271_0x174c46 = _0x428003('div', {6272'data-pane': 'home'6273}),6274_0x17f3cb = _0x428003('div', {6275'role': 'menu'6276});6277_0x174c46.appendChild(_0x17f3cb);6278_0x3f3385.appendChild(_0x174c46);6279this.elements.settings.panels.home = _0x174c46;6280_0x262fb8.appendChild(_0x3f3385);6281_0x2746ab.appendChild(_0x262fb8);6282_0x17edbf.appendChild(_0x2746ab);6283this.elements.settings.popup = _0x262fb8;6284this.elements.settings.menu = _0x2746ab;6285_0x17edbf.appendChild(_0x7f9f36.createButton.call(this, 'fullscreen'))6286let _0x19edbf = this;6287_0x17edbf.addEventListener('mousedown', function() {6288_0x19edbf.onButtonDiv = true;6289})6290this.elements.controls = _0x17edbf;6291_0x7f9f36.setNormalOptionsMenu.call(this);6292_0x7f9f36.setCoreOptionsMenu.call(this);6293return _0x17edbf;6294},6295'inject': function() {6296let _this = this;6297this.icons = {6298'enter-fullscreen': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M208 281.4c-12.5-12.5-32.76-12.5-45.26-.002l-78.06 78.07l-30.06-30.06c-6.125-6.125-14.31-9.367-22.63-9.367c-4.125 0-8.279 .7891-12.25 2.43c-11.97 4.953-19.75 16.62-19.75 29.56v135.1C.0013 501.3 10.75 512 24 512h136c12.94 0 24.63-7.797 29.56-19.75c4.969-11.97 2.219-25.72-6.938-34.87l-30.06-30.06l78.06-78.07c12.5-12.49 12.5-32.75 .002-45.25L208 281.4zM487.1 0h-136c-12.94 0-24.63 7.797-29.56 19.75c-4.969 11.97-2.219 25.72 6.938 34.87l30.06 30.06l-78.06 78.07c-12.5 12.5-12.5 32.76 0 45.26l22.62 22.62c12.5 12.5 32.76 12.5 45.26 0l78.06-78.07l30.06 30.06c9.156 9.141 22.87 11.84 34.87 6.937C504.2 184.6 512 172.9 512 159.1V23.1C512 10.74 501.3 0 487.1 0z"/></svg>',6299'exit-fullscreen': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M215.1 272h-136c-12.94 0-24.63 7.797-29.56 19.75C45.47 303.7 48.22 317.5 57.37 326.6l30.06 30.06l-78.06 78.07c-12.5 12.5-12.5 32.75-.0012 45.25l22.62 22.62c12.5 12.5 32.76 12.5 45.26 .0013l78.06-78.07l30.06 30.06c6.125 6.125 14.31 9.367 22.63 9.367c4.125 0 8.279-.7891 12.25-2.43c11.97-4.953 19.75-16.62 19.75-29.56V296C239.1 282.7 229.3 272 215.1 272zM296 240h136c12.94 0 24.63-7.797 29.56-19.75c4.969-11.97 2.219-25.72-6.938-34.87l-30.06-30.06l78.06-78.07c12.5-12.5 12.5-32.76 .0002-45.26l-22.62-22.62c-12.5-12.5-32.76-12.5-45.26-.0003l-78.06 78.07l-30.06-30.06c-9.156-9.141-22.87-11.84-34.87-6.937c-11.97 4.953-19.75 16.62-19.75 29.56v135.1C272 229.3 282.7 240 296 240z"/></svg>',6300'gamepad': '<svg viewBox="0 0 640 512"><path fill="currentColor" d="M480 96H160C71.6 96 0 167.6 0 256s71.6 160 160 160c44.8 0 85.2-18.4 114.2-48h91.5c29 29.6 69.5 48 114.2 48 88.4 0 160-71.6 160-160S568.4 96 480 96zM256 276c0 6.6-5.4 12-12 12h-52v52c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-52H76c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h52v-52c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h52c6.6 0 12 5.4 12 12v40zm184 68c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm80-80c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z"/></svg>',6301'load-state': '<svg viewBox="0 0 576 512"><path fill="currentColor" d="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"/></svg>',6302'muted': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M301.2 34.85c-11.5-5.188-25.02-3.122-34.44 5.253L131.8 160H48c-26.51 0-48 21.49-48 47.1v95.1c0 26.51 21.49 47.1 48 47.1h83.84l134.9 119.9c5.984 5.312 13.58 8.094 21.26 8.094c4.438 0 8.972-.9375 13.17-2.844c11.5-5.156 18.82-16.56 18.82-29.16V64C319.1 51.41 312.7 40 301.2 34.85zM513.9 255.1l47.03-47.03c9.375-9.375 9.375-24.56 0-33.94s-24.56-9.375-33.94 0L480 222.1L432.1 175c-9.375-9.375-24.56-9.375-33.94 0s-9.375 24.56 0 33.94l47.03 47.03l-47.03 47.03c-9.375 9.375-9.375 24.56 0 33.94c9.373 9.373 24.56 9.381 33.94 0L480 289.9l47.03 47.03c9.373 9.373 24.56 9.381 33.94 0c9.375-9.375 9.375-24.56 0-33.94L513.9 255.1z"/></svg>',6303'netplay': '<svg viewBox="0 0 512 512"><path fill="currentColor" d="M364.215 192h131.43c5.439 20.419 8.354 41.868 8.354 64s-2.915 43.581-8.354 64h-131.43c5.154-43.049 4.939-86.746 0-128zM185.214 352c10.678 53.68 33.173 112.514 70.125 151.992.221.001.44.008.661.008s.44-.008.661-.008c37.012-39.543 59.467-98.414 70.125-151.992H185.214zm174.13-192h125.385C452.802 84.024 384.128 27.305 300.95 12.075c30.238 43.12 48.821 96.332 58.394 147.925zm-27.35 32H180.006c-5.339 41.914-5.345 86.037 0 128h151.989c5.339-41.915 5.345-86.037-.001-128zM152.656 352H27.271c31.926 75.976 100.6 132.695 183.778 147.925-30.246-43.136-48.823-96.35-58.393-147.925zm206.688 0c-9.575 51.605-28.163 104.814-58.394 147.925 83.178-15.23 151.852-71.949 183.778-147.925H359.344zm-32.558-192c-10.678-53.68-33.174-112.514-70.125-151.992-.221 0-.44-.008-.661-.008s-.44.008-.661.008C218.327 47.551 195.872 106.422 185.214 160h141.572zM16.355 192C10.915 212.419 8 233.868 8 256s2.915 43.581 8.355 64h131.43c-4.939-41.254-5.154-84.951 0-128H16.355zm136.301-32c9.575-51.602 28.161-104.81 58.394-147.925C127.872 27.305 59.198 84.024 27.271 160h125.385z"/></svg>',6304'pause': '<svg viewBox="0 0 320 512"><path d="M272 63.1l-32 0c-26.51 0-48 21.49-48 47.1v288c0 26.51 21.49 48 48 48L272 448c26.51 0 48-21.49 48-48v-288C320 85.49 298.5 63.1 272 63.1zM80 63.1l-32 0c-26.51 0-48 21.49-48 48v288C0 426.5 21.49 448 48 448l32 0c26.51 0 48-21.49 48-48v-288C128 85.49 106.5 63.1 80 63.1z"/></svg>',6305'play': '<svg viewBox="0 0 320 512"><path d="M361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215z"/></svg>',6306'restart': '<svg viewBox="0 0 512 512"><path d="M496 48V192c0 17.69-14.31 32-32 32H320c-17.69 0-32-14.31-32-32s14.31-32 32-32h63.39c-29.97-39.7-77.25-63.78-127.6-63.78C167.7 96.22 96 167.9 96 256s71.69 159.8 159.8 159.8c34.88 0 68.03-11.03 95.88-31.94c14.22-10.53 34.22-7.75 44.81 6.375c10.59 14.16 7.75 34.22-6.375 44.81c-39.03 29.28-85.36 44.86-134.2 44.86C132.5 479.9 32 379.4 32 256s100.5-223.9 223.9-223.9c69.15 0 134 32.47 176.1 86.12V48c0-17.69 14.31-32 32-32S496 30.31 496 48z"/></svg>',6307'save-state': '<svg viewBox="0 0 448 512"><path fill="currentColor" d="M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"/></svg>',6308'screen-record': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><path fill="currentColor" d="M19.994,0C8.952,0,0,8.952,0,19.995c0,11.043,8.952,19.994,19.994,19.994s19.995-8.952,19.995-19.994,C39.989,8.952,31.037,0,19.994,0z M19.994,27.745c-4.28,0-7.75-3.47-7.75-7.75s3.47-7.75,7.75-7.75s7.75,3.47,7.75,7.75,S24.275,27.745,19.994,27.745z"/></svg>',6309'settings': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M495.9 166.6C499.2 175.2 496.4 184.9 489.6 191.2L446.3 230.6C447.4 238.9 448 247.4 448 256C448 264.6 447.4 273.1 446.3 281.4L489.6 320.8C496.4 327.1 499.2 336.8 495.9 345.4C491.5 357.3 486.2 368.8 480.2 379.7L475.5 387.8C468.9 398.8 461.5 409.2 453.4 419.1C447.4 426.2 437.7 428.7 428.9 425.9L373.2 408.1C359.8 418.4 344.1 427 329.2 433.6L316.7 490.7C314.7 499.7 307.7 506.1 298.5 508.5C284.7 510.8 270.5 512 255.1 512C241.5 512 227.3 510.8 213.5 508.5C204.3 506.1 197.3 499.7 195.3 490.7L182.8 433.6C167 427 152.2 418.4 138.8 408.1L83.14 425.9C74.3 428.7 64.55 426.2 58.63 419.1C50.52 409.2 43.12 398.8 36.52 387.8L31.84 379.7C25.77 368.8 20.49 357.3 16.06 345.4C12.82 336.8 15.55 327.1 22.41 320.8L65.67 281.4C64.57 273.1 64 264.6 64 256C64 247.4 64.57 238.9 65.67 230.6L22.41 191.2C15.55 184.9 12.82 175.3 16.06 166.6C20.49 154.7 25.78 143.2 31.84 132.3L36.51 124.2C43.12 113.2 50.52 102.8 58.63 92.95C64.55 85.8 74.3 83.32 83.14 86.14L138.8 103.9C152.2 93.56 167 84.96 182.8 78.43L195.3 21.33C197.3 12.25 204.3 5.04 213.5 3.51C227.3 1.201 241.5 0 256 0C270.5 0 284.7 1.201 298.5 3.51C307.7 5.04 314.7 12.25 316.7 21.33L329.2 78.43C344.1 84.96 359.8 93.56 373.2 103.9L428.9 86.14C437.7 83.32 447.4 85.8 453.4 92.95C461.5 102.8 468.9 113.2 475.5 124.2L480.2 132.3C486.2 143.2 491.5 154.7 495.9 166.6V166.6zM256 336C300.2 336 336 300.2 336 255.1C336 211.8 300.2 175.1 256 175.1C211.8 175.1 176 211.8 176 255.1C176 300.2 211.8 336 256 336z"/></svg>',6310'volume': '<svg viewBox="0 0 640 512"><path d="M412.6 182c-10.28-8.334-25.41-6.867-33.75 3.402c-8.406 10.24-6.906 25.35 3.375 33.74C393.5 228.4 400 241.8 400 255.1c0 14.17-6.5 27.59-17.81 36.83c-10.28 8.396-11.78 23.5-3.375 33.74c4.719 5.806 11.62 8.802 18.56 8.802c5.344 0 10.75-1.779 15.19-5.399C435.1 311.5 448 284.6 448 255.1S435.1 200.4 412.6 182zM473.1 108.2c-10.22-8.334-25.34-6.898-33.78 3.34c-8.406 10.24-6.906 25.35 3.344 33.74C476.6 172.1 496 213.3 496 255.1s-19.44 82.1-53.31 110.7c-10.25 8.396-11.75 23.5-3.344 33.74c4.75 5.775 11.62 8.771 18.56 8.771c5.375 0 10.75-1.779 15.22-5.431C518.2 366.9 544 313 544 255.1S518.2 145 473.1 108.2zM534.4 33.4c-10.22-8.334-25.34-6.867-33.78 3.34c-8.406 10.24-6.906 25.35 3.344 33.74C559.9 116.3 592 183.9 592 255.1s-32.09 139.7-88.06 185.5c-10.25 8.396-11.75 23.5-3.344 33.74C505.3 481 512.2 484 519.2 484c5.375 0 10.75-1.779 15.22-5.431C601.5 423.6 640 342.5 640 255.1S601.5 88.34 534.4 33.4zM301.2 34.98c-11.5-5.181-25.01-3.076-34.43 5.29L131.8 160.1H48c-26.51 0-48 21.48-48 47.96v95.92c0 26.48 21.49 47.96 48 47.96h83.84l134.9 119.8C272.7 477 280.3 479.8 288 479.8c4.438 0 8.959-.9314 13.16-2.835C312.7 471.8 320 460.4 320 447.9V64.12C320 51.55 312.7 40.13 301.2 34.98z"/></svg>',6311'cheat': '<svg viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z" class=""></path></svg>',6312'cache-manager': '<svg viewBox="0 0 1800 1800"><path d="M896 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5T231 896 128 768V598q119 84 325 127t443 43zm0 768q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128v-170q119 84 325 127t443 43zm0-384q237 0 443-43t325-127v170q0 69-103 128t-280 93.5-385 34.5-385-34.5-280-93.5-103-128V982q119 84 325 127t443 43zM896 0q208 0 385 34.5t280 93.5 103 128v128q0 69-103 128t-280 93.5T896 640t-385-34.5T231 512 128 384V256q0-69 103-128t280-93.5T896 0z"/></svg>'6313}, this.id = Math.floor(0x2710 * Math.random());6314let _0x17edbf = null;6315this.elements.controls = null;6316let _0x2c1832 = {6317'id': this.id6318},6319_0x270a9e = true;6320_0x1e2c68.function(this.config.controls) && (this.config.controls = this.config.controls.call(this.props)), this.config.controls || (this.config.controls = []), _0x1e2c68.element(this.config.controls) || _0x1e2c68.string(this.config.controls) ? _0x17edbf = this.config.controls : (_0x17edbf = _0x7f9f36.create.call(this, {6321'id': this.id,6322'seektime': this.config.seekTime,6323'speed': this.speed,6324'quality': this.quality6325}), _0x270a9e = false);6326let _0x1e6644, _0x3ec218 = function(_0x406126) {6327let _0x17edbf = _0x406126;6328return Object.entries(_0x2c1832).forEach(function(_0x3e992c) {6329let _0x2c1832 = _0x5005e6(_0x3e992c, 2),6330_0x47c2ec = _0x2c1832[0],6331_0x547588 = _0x2c1832[1];6332_0x17edbf = _0x1a0e98(_0x17edbf, '{' .concat(_0x47c2ec, '}'), _0x547588);6333}), _0x17edbf;6334};6335if (_0x270a9e && (_0x1e2c68.string(this.config.controls) ? _0x17edbf = _0x3ec218(_0x17edbf) : _0x1e2c68.element(_0x17edbf) && (_0x17edbf.innerHTML = _0x3ec218(_0x17edbf.innerHTML))), _0x1e2c68.string(this.config.selectors.controls.container) && (_0x1e6644 = document.querySelector(this.config.selectors.controls.container)), _0x1e2c68.element(_0x1e6644) || (_0x1e6644 = this.elements.container), _0x1e6644[_0x1e2c68.element(_0x17edbf) ? 'insertAdjacentElement' : 'insertAdjacentHTML']('afterbegin', _0x17edbf), _0x1e2c68.element(this.elements.controls) || _0x7f9f36.findElements.call(this), !_0x1e2c68.empty(this.elements.buttons)) {6336let _0xe8272c = function(_0x176a3e) {6337let _0x2c1832 = _this.config.classNames.controlPressed;6338Object.defineProperty(_0x176a3e, 'pressed', {6339'enumerable': true,6340'get': function() {6341return _0x350d73(_0x176a3e, _0x2c1832);6342},6343'set': function() {6344let _0xa88a13 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];6345_0x3a8e2f(_0x176a3e, _0x2c1832, _0xa88a13);6346}6347});6348};6349Object.values(this.elements.buttons).filter(Boolean).forEach(function(_0x577b9b) {6350_0x1e2c68.array(_0x577b9b) || _0x1e2c68.nodeList(_0x577b9b) ? Array.from(_0x577b9b).filter(Boolean).forEach(_0xe8272c) : _0xe8272c(_0x577b9b);6351});6352}6353window.navigator.userAgent.includes('Edge') && _0x2b30e0(_0x1e6644);6354}6355},6356_0x2593da = _0x7f9f36;63576358function _0x28bdca(_0x5c50c3, _0x217698) {6359for (let _0x2c1832 = 0; _0x2c1832 < _0x217698.length; _0x2c1832++) {6360let _0x172cdb = _0x217698[_0x2c1832];6361_0x172cdb.enumerable = _0x172cdb.enumerable || false, _0x172cdb.configurable = true, 'value' in _0x172cdb && (_0x172cdb.writable = true), Object.defineProperty(_0x5c50c3, _0x172cdb.key, _0x172cdb);6362}6363}63646365function _0x238270() {6366if (this.enabled) {6367let _0xa88a13 = this.player.elements.buttons.fullscreen;6368_0x1e2c68.element(_0xa88a13) && (_0xa88a13.pressed = this.active), _0xbae705.call(this.player, this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true), _0x59aa33.isIos || _0x5e0c7d.call(this.player, this.target, this.active);6369}6370}63716372function _0x3c983f() {6373let _0xa88a13 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];6374_0xa88a13 ? this.scrollPosition = {6375'x': window.scrollX || 0,6376'y': window.scrollY || 0x06377} : window.scrollTo(this.scrollPosition.x, this.scrollPosition.y), document.body.style.overflow = _0xa88a13 ? 'hidden' : '', _0x3a8e2f(this.target, this.player.config.classNames.fullscreen.fallback, _0xa88a13), _0x238270.call(this);6378}6379let _0x335854 = function() {6380function _0x1339df(_0x5f19c6) {6381let _0x2c1832 = this;6382! function(_0x143a8a, _0x32a0a1) {6383if (!(_0x143a8a instanceof _0x32a0a1)) throw new TypeError('Cannot call a class as a function');6384}(this, _0x1339df), this.player = _0x5f19c6, this.prefix = _0x1339df.prefix, this.property = _0x1339df.property, this.scrollPosition = {6385'x': 0,6386'y': 0x06387}, _0x1093f4.call(this.player, document, 'ms' === this.prefix ? 'MSFullscreenChange' : '' .concat(this.prefix, 'fullscreenchange'), function() {6388_0x238270.call(_0x2c1832);6389}), this.update();6390}63916392let _0x17edbf, _0x2c1832, _0x50d347;63936394_0x17edbf = _0x1339df63956396_0x50d347 = [{6397'key': 'native',6398'get': function() {6399return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);6400}6401}, {6402'key': 'prefix',6403'get': function() {6404if (_0x1e2c68.function(document.exitFullscreen)) return '';6405let _0x1339df = '';6406return ['webkit', 'moz', 'ms'].some(function(_0xc1e0c3) {6407return !(!_0x1e2c68.function(document['' .concat(_0xc1e0c3, 'ExitFullscreen')]) && !_0x1e2c68.function(document['' .concat(_0xc1e0c3, 'CancelFullScreen')]) || (_0x1339df = _0xc1e0c3, 0));6408}), _0x1339df;6409}6410}, {6411'key': 'property',6412'get': function() {6413return 'moz' === this.prefix ? 'FullScreen' : 'Fullscreen';6414}6415}]64166417_0x2c1832 = [{6418'key': 'update',6419'value': function() {6420this.enabled, _0x3a8e2f(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);6421}6422}, {6423'key': 'enter',6424'value': function() {6425this.enabled && (_0x1339df.native ? this.prefix ? _0x1e2c68.empty(this.prefix) || this.target['' .concat(this.prefix, 'Request').concat(this.property)]() : this.target.requestFullscreen() : _0x3c983f.call(this, true));6426}6427}, {6428'key': 'exit',6429'value': function() {6430if (this.enabled)6431if (_0x1339df.native)6432if (this.prefix) {6433if (!_0x1e2c68.empty(this.prefix)) {6434let _0x17edbf = 'moz' === this.prefix ? 'Cancel' : 'Exit';6435document['' .concat(this.prefix).concat(_0x17edbf).concat(this.property)]();6436}6437} else(document.cancelFullScreen || document.exitFullscreen).call(document);6438else _0x3c983f.call(this, false);6439}6440}, {6441'key': 'toggle',6442'value': function() {6443this.active ? this.exit() : this.enter();6444}6445}, {6446'key': 'enabled',6447'get': function() {6448return _0x1339df.native;6449}6450}, {6451'key': 'active',6452'get': function() {6453return !!this.enabled && (_0x1339df.native ? (this.prefix ? document['' .concat(this.prefix).concat(this.property, 'Element')] : document.fullscreenElement) === this.target : _0x350d73(this.target, this.player.config.classNames.fullscreen.fallback));6454}6455}, {6456'key': 'target',6457'get': function() {6458return _0x59aa33.isEdge ? this.player.game : this.player.elements.container;6459}6460}]64616462_0x28bdca(_0x17edbf.prototype, _0x2c1832)6463_0x50d347 && _0x28bdca(_0x17edbf, _0x50d347)6464return _0x1339df;64656466}();64676468function _0x42b437(_0x458e02, _0x5729e1) {6469if (Array.isArray(_0x458e02)) return _0x458e02;6470let _0x2c1832 = [],6471_0x2e7aa7 = true,6472_0x393a5f = false,6473_0x3b4eca = undefined;6474try {6475for (let _0x1aca09, _0x1bb8de = _0x458e02[Symbol.iterator](); !(_0x2e7aa7 = (_0x1aca09 = _0x1bb8de.next()).done) && (_0x2c1832.push(_0x1aca09.value), !_0x5729e1 || _0x2c1832.length !== _0x5729e1); _0x2e7aa7 = true);6476} catch (_0x190997) {6477_0x393a5f = true, _0x3b4eca = _0x190997;6478} finally {6479try {6480_0x2e7aa7 || null == _0x1bb8de.return || _0x1bb8de.return();6481} finally {6482if (_0x393a5f) throw _0x3b4eca;6483}6484}6485return _0x2c1832;6486}6487let _0x37093c = function() {6488function _0x31e271(_0x948a97) {6489! function(_0x3adedc, _0x5952e9) {6490if (!(_0x3adedc instanceof _0x5952e9)) throw new TypeError('Cannot call a class as a function');6491}(this, _0x31e271), this.emulator = _0x948a97, this.lastKey = null, this.focusTimer = null, this.lastKeyDown = null, this.toggleMenu = this.toggleMenu.bind(this), this.setTabFocus = this.setTabFocus.bind(this), this.firstTouch = this.firstTouch.bind(this);6492}6493_0x31e271.prototype = {6494toggleMenu: function(_0x3156ad) {6495_0x2593da.toggleMenu.call(this.emulator, _0x3156ad);6496},6497firstTouch: function() {6498let _0x31e271 = this.emulator,6499_0x17edbf = _0x31e271.elements;6500_0x31e271.touch = true, _0x3a8e2f(_0x17edbf.container, _0x31e271.config.classNames.isTouch, true);6501},6502setTabFocus: function(_0x20bf1f) {6503let _0x17edbf = this.emulator,6504_0x2c1832 = _0x17edbf.elements,6505_0x48d087 = _0x17edbf;6506if (clearTimeout(this.focusTimer), 'keydown' !== _0x20bf1f.type || 0x9 === _0x20bf1f.which) {6507'keydown' === _0x20bf1f.type && (this.lastKeyDown = _0x20bf1f.timeStamp);6508let _0x27d4ad, _0x967a30 = _0x20bf1f.timeStamp - this.lastKeyDown <= 0x14;6509('focus' !== _0x20bf1f.type || _0x967a30) && (_0x27d4ad = _0x48d087.config.classNames.tabFocus, _0x3a8e2f(_0x23ffa1.call(_0x48d087, '.' .concat(_0x27d4ad)), _0x27d4ad, false), this.focusTimer = setTimeout(function() {6510let _0x20bf1f = document.activeElement;6511_0x2c1832.container.contains(_0x20bf1f) && _0x3a8e2f(document.activeElement, _0x48d087.config.classNames.tabFocus, true);6512}, 0xa));6513}6514},6515global: function() {6516let _0x31e271 = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0],6517_0x17edbf = this.emulator,6518_0x2c1832 = _0x17edbf;6519_0x1ef215.call(_0x2c1832, document.body, 'click', this.toggleMenu, _0x31e271), _0x455c85.call(_0x2c1832, document.body, 'touchstart', this.firstTouch), _0x1ef215.call(_0x2c1832, document.body, 'keydown focus blur', this.setTabFocus, _0x31e271, false, true), _0x1093f4.call(_0x2c1832, document.body, 'keyup', function(_0x4e289a) {6520_0x2c1832.started && (0x71 === _0x4e289a.which && (_0x4e289a.shiftKey ? null === _0x2c1832.elements.buttons.saveState.getAttribute('hidden') && _0xbae705.call(_0x2c1832, _0x2c1832.elements.buttons.saveState, 'click') : _0xdcec2a.quickSaveState()), 0x73 === _0x4e289a.which && (_0x4e289a.shiftKey ? null === _0x2c1832.elements.buttons.loadState.getAttribute('hidden') && _0xbae705.call(_0x2c1832, _0x2c1832.elements.buttons.loadState, 'click') : _0xdcec2a.quickLoadState()), 0x78 === _0x4e289a.which && _0xbae705.call(_0x2c1832, _0x2c1832.elements.buttons.mute, 'click'));6521});6522},6523container: function() {6524let _0x31e271, _0x17edbf = this.emulator,6525_0x2c1832 = _0x17edbf.elements,6526_0x45d275 = _0x17edbf,6527setFullscreenInterval = null;6528_0x1093f4.call(_0x45d275, _0x2c1832.container, 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen start-game', function(_0x1ac81c) {6529let _0x3953b5 = _0x2c1832.controls;6530_0x3953b5 && 'enterfullscreen' === _0x1ac81c.type && (_0x3953b5.pressed = false, _0x3953b5.hover = false);6531let _0x2c3de3 = 0;6532if (['touchstart', 'touchmove', 'mousemove', 'start-game'].includes(_0x1ac81c.type)) {6533if (getSystem(_0x17edbf.system, true) === 'nds' && getSystem(_0x17edbf.system, _0x17edbf.coreVer) !== 'melonds' && _0x1ac81c.type == 'mousemove' && _0x27f4c4 && _0x27f4c4.Module && _0x27f4c4.Module.canvas && (document.pointerLockElement === _0x27f4c4.Module.canvas || document.mozPointerLockElement === _0x27f4c4.Module.canvas)) {6534_0x5ab74d.toggleControls.call(_0x45d275, false);6535return;6536}6537if (_0xdcec2a && (_0xdcec2a.virtualGamepadContainer == 'undefined' || _0xdcec2a.virtualGamepadContainer === null)) {6538_0x5ab74d.toggleControls.call(_0x45d275, true);6539_0x2c3de3 = _0x45d275.touch ? 0xbb8 : 0x7d0;6540clearTimeout(_0x31e271);6541_0x31e271 = setTimeout(function() {6542return _0x5ab74d.toggleControls.call(_0x45d275, false);6543}, _0x2c3de3);6544_0x2c1832.controls.setAttribute('data-timer', _0x31e271);6545}6546};6547}), _0x1093f4.call(_0x45d275, window, 'resize', function(_0x3e2cc5) {6548let _0x17edbf = _0x45d275.elements.container.clientHeight,6549_0x2c1832 = _0x23ffa1.call(_0x45d275, '.' .concat(getClass({6550'ejs__menu__container': true6551}), ' [role="menu"]'));6552Array.from(_0x2c1832).forEach(function(_0x43a16d) {6553_0x43a16d.style.maxHeight = '' .concat(_0x17edbf - 0x5f, 'px'), _0x43a16d.style.overflow = 'auto';6554}), _0x27f4c4.Module && _0x27f4c4.Module.canvas, _0x45d275.elements.container.clientWidth / _0x45d275.elements.container.clientHeight < 1.3 ? _0x3a8e2f(_0x45d275.elements.container, getClass({6555'portrait': true6556}), true) : _0x3a8e2f(_0x45d275.elements.container, getClass({6557'portrait': true6558}), false);6559}), _0xbae705.call(_0x45d275, window, 'resize'), _0x1093f4.call(_0x45d275, _0x45d275.elements.container, 'enterfullscreen', function(_0x586586) {6560if (_0x27f4c4.isMobileDevice && window.screen && screen.orientation && typeof screen.orientation.lock == 'function') {6561try {6562screen.orientation.lock("landscape");6563}catch(e){}6564} else if (_0x27f4c4.isMobileDevice && window.ScreenOrientation && typeof ScreenOrientation.lock == 'function') {6565try {6566ScreenOrientation.lock("landscape");6567}catch(e){}6568}6569if (_0x45d275.coreVer === 2 && _0x27f4c4.Module) {6570let repeat = 50;6571clearInterval(setFullscreenInterval);6572setFullscreenInterval = setInterval(function() {6573_0x27f4c4.Module.setCanvasSize(window.innerWidth, window.innerHeight);6574if (repeat < 0) {6575clearInterval(setFullscreenInterval);6576}6577repeat--;6578}, 100)6579}6580setTimeout(function() {6581_0xbae705.call(_0x45d275, window, 'resize');6582}, 0x12c);6583}), _0x1093f4.call(_0x45d275, _0x45d275.elements.container, 'exitfullscreen', function(_0x4de2f3) {6584if (_0x27f4c4.isMobileDevice && window.screen && screen.orientation && typeof screen.orientation.unlock == 'function') {6585try {6586screen.orientation.unlock();6587}catch(e){}6588} else if (_0x27f4c4.isMobileDevice && window.ScreenOrientation && typeof ScreenOrientation.unlock == 'function') {6589try {6590ScreenOrientation.unlock();6591}catch(e){}6592}6593if (_0x45d275.coreVer === 2 && _0x27f4c4.Module) {6594clearInterval(setFullscreenInterval);6595_0x27f4c4.Module.setCanvasSize(800, 600);6596}6597setTimeout(function() {6598_0xbae705.call(_0x45d275, window, 'resize');6599}, 0x12c);6600}), _0x1093f4.call(_0x45d275, _0x45d275.elements.container, 'start-game', function(_0x5b0a00) {6601let _0x17edbf = window.document.createEvent('UIEvents');6602_0x17edbf.initUIEvent('resize', true, false, window, 0), window.dispatchEvent(_0x17edbf), _0x3a8e2f(_0x45d275.elements.container, getClass({6603'game-started': true6604}), true);6605}), _0x1093f4.call(_0x45d275, _0x45d275.elements.container, 'blur', function(_0x893c7a) {6606let _0x17edbf = _0x893c7a.currentTarget;6607setTimeout(function() {6608_0x17edbf.contains(document.activeElement) || _0xbae705.call(_0x45d275, _0x45d275.elements, 'blurgame');6609}, 0);6610}), _0x1093f4.call(_0x45d275, _0x45d275.elements.container, 'focus', function(_0xe0dee3) {6611let _0x17edbf = _0xe0dee3.currentTarget;6612setTimeout(function() {6613_0x17edbf.contains(document.activeElement) && _0xbae705.call(_0x45d275, _0x45d275.elements, 'focusgame');6614}, 0);6615});6616},6617media: function() {6618let _0x31e271 = this.emulator,6619_0x17edbf = _0x31e271.elements,6620_0x2c1832 = _0x31e271;6621_0x1093f4.call(_0x2c1832, _0x2c1832.game, 'volumechange', function(_0x3099fe) {6622return _0x2593da.updateVolume.call(_0x2c1832, _0x3099fe);6623}), _0x1093f4.call(_0x2c1832, _0x17edbf.container, 'contextmenu', function(_0x5c22bc) {6624_0x2c1832.touch || _0x2c1832.lightgun || _0x2593da.toggleContextMenu.call(_0x2c1832, _0x5c22bc, true);6625_0x5c22bc.preventDefault();6626}, false), _0x1093f4.call(_0x2c1832, _0x17edbf.container, 'mousewheel', function(_0x49c974) {6627_0x49c974.stopPropagation();6628}, false), _0x1093f4.call(_0x2c1832, _0x17edbf.container, 'mousedown', function(_0x53ee35) {6629if (getSystem(_0x31e271.system, true) === 'nds' && getSystem(_0x31e271.system, _0x31e271.coreVer) !== 'melonds' && _0x27f4c4 && _0x27f4c4.Module && _0x27f4c4.Module.canvas && ! _0x27f4c4.isMobileDevice && !(document.pointerLockElement === _0x27f4c4.Module.canvas || document.mozPointerLockElement === _0x27f4c4.Module.canvas) && _0x31e271.started && !_0x31e271.connected) {6630setTimeout(function() {6631if (_0x31e271.onButtonDiv !== true) {6632_0x27f4c4.Module.canvas.requestPointerLock = _0x27f4c4.Module.canvas.requestPointerLock || _0x27f4c4.Module.canvas.mozRequestPointerLock;6633_0x27f4c4.Module.canvas.requestPointerLock()6634}6635_0x31e271.onButtonDiv = false6636}, 100)6637}6638_0x2c1832.touch || _0x2593da.toggleContextMenu.call(_0x2c1832, _0x53ee35, false);6639}, false), _0x1093f4.call(_0x2c1832, _0x2c1832.game, 'volumechange', function() {6640_0x2c1832.storage.set({6641'volume': _0x2c1832.volume,6642'muted': _0x2c1832.muted6643}), _0xdcec2a.setVolume && _0xdcec2a.setVolume();6644});6645let _0x38e17f = _0x2c1832.config.events.concat(['keyup', 'keydown']).join(' ');6646_0x1093f4.call(_0x2c1832, _0x2c1832.game, _0x38e17f, function(_0x38e438) {6647let _0x2b4804 = _0x38e438.detail,6648_0x1bfeb2 = void 0 === _0x2b4804 ? {} : _0x2b4804;6649'error' === _0x38e438.type && (_0x1bfeb2 = _0x2c1832.game.error), _0xbae705.call(_0x2c1832, _0x17edbf.container, _0x38e438.type, true, _0x1bfeb2);6650});6651},6652proxy: function(_0x52d0c2, _0x500f90, _0x175ce5) {6653let _0x4bb44e = this.emulator,6654_0x584a64 = _0x4bb44e.config.listeners[_0x175ce5],6655_0x5269fd = true;6656_0x1e2c68.function(_0x584a64) && (_0x5269fd = _0x584a64.call(_0x4bb44e, _0x52d0c2)), _0x5269fd && _0x1e2c68.function(_0x500f90) && _0x500f90.call(_0x4bb44e, _0x52d0c2);6657},6658bind: function(_0x4a8d46, _0x8f91ad, _0x2affda, _0x41dfb1) {6659let _0x1363b1 = this,6660_0x53b9a1 = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4],6661_0x5209a5 = this.emulator,6662_0x27b738 = _0x5209a5,6663_0x5d89ff = _0x27b738.config.listeners[_0x41dfb1],6664_0x100c9f = _0x1e2c68.function(_0x5d89ff);6665_0x1093f4.call(_0x27b738, _0x4a8d46, _0x8f91ad, function(_0x5a03ac) {6666return _0x1363b1.proxy(_0x5a03ac, _0x2affda, _0x41dfb1);6667}, _0x53b9a1 && !_0x100c9f);6668},6669controls: function() {6670let _0x31e271 = this,6671_0x17edbf = this.emulator,6672_0x2c1832 = _0x17edbf.elements,6673_0x127f22 = _0x59aa33.isIE ? 'change' : 'input';6674if (this.bind(_0x2c1832.buttons.mute, 'click', function() {6675_0x17edbf.muted = !_0x17edbf.muted;6676}, 'mute'), this.bind(_0x2c1832.buttons.fullscreen, 'click', function() {6677_0x17edbf.fullscreen.toggle();6678}, 'fullscreen'), this.bind(_0x2c1832.buttons.gamepad, 'click', function() {6679_0x5ab74d.toggleControls.call(_0x17edbf, false), _0x132da7(_0x2c1832.dialogs.gamepad, false);6680}, 'mute'), this.bind(_0x2c1832.buttons.saveState, 'click', function() {6681(async function() {6682_0xbae705.call(_0x17edbf, _0x17edbf.elements.container, 'savestate-start', false, {});6683let _0x31e271 = await _0xdcec2a.saveState(),6684_0x2c1832 = _0xdcec2a.getScreenData();66856686if (_0x378b5c.saveLoadDB.call(_0x17edbf, 'save')) {6687return;6688}6689if (_0x1e2c68.function(_0x17edbf.config.onsavestate)) _0x17edbf.config.onsavestate.call(null, {6690'screenshot': _0x2c1832,6691'state': _0x31e2716692});6693else {6694let name = _0x17edbf.getStartName(true).split('/').pop();6695let data = new Blob([_0x31e271]);6696if (name.includes('.')) {6697name = name.substring(0, name.length-name.split('.').pop().length-1);6698}6699if (typeof _0x17edbf.gameName == 'string') {6700name = _0x17edbf.gameName6701}6702let _0x49f6b6 = name ? '' .concat(name, '.state') : 'game.state';6703let a = document.createElement('a');6704a.download = _0x49f6b6;6705a.href = URL.createObjectURL(data);6706a.click();6707setTimeout(function() {6708URL.revokeObjectURL(a.href);6709}, 2000);6710}6711_0x17edbf.elements.container.focus();6712})();6713saveSaveFiles();6714}, 'mute'), this.bind(_0x2c1832.buttons.loadState, 'click', function() {6715_0xbae705.call(_0x17edbf, _0x17edbf.elements.container, 'loadstate', false, {});6716}, 'mute'), this.bind(_0x2c1832.buttons.settings, 'click', function(_0x1396ee) {6717_0x1396ee.stopPropagation(), _0x2593da.toggleMenu.call(_0x17edbf, _0x1396ee);6718}), this.bind(_0x2c1832.buttons.settings, 'keyup', function(_0x454936) {6719let _0x2c1832 = _0x454936.which;6720[0xd, 0x20].includes(_0x2c1832) && (0xd !== _0x2c1832 ? (_0x454936.preventDefault(), _0x454936.stopPropagation(), _0x2593da.toggleMenu.call(_0x17edbf, _0x454936)) : _0x2593da.focusFirstMenuItem.call(_0x17edbf, null, true));6721}, null, false), this.bind(_0x2c1832.settings.menu, 'keydown', function(_0x40072c) {67220x1b === _0x40072c.which && _0x2593da.toggleMenu.call(_0x17edbf, _0x40072c);6723}), _0x59aa33.isIos) {6724let _0x4bd188 = _0x23ffa1.call(_0x17edbf, 'input[type="range"]');6725Array.from(_0x4bd188).forEach(function(_0x345e4c) {6726return _0x31e271.bind(_0x345e4c, _0x127f22, function(_0x58e6a9) {6727return _0x2b30e0(_0x58e6a9.target);6728});6729});6730}6731_0x59aa33.isWebkit && Array.from(_0x23ffa1.call(_0x17edbf, 'input[type="range"]')).forEach(function(_0x45c503) {6732_0x31e271.bind(_0x45c503, 'input', function(_0x436691) {6733return _0x2593da.updateRangeFill.call(_0x17edbf, _0x436691.target);6734});6735}), this.bind(_0x2c1832.inputs.volume, _0x127f22, function(_0x42307e) {6736_0x17edbf.volume = _0x42307e.target.value;6737}, 'volume'), this.bind(_0x2c1832.controls, 'mouseenter mouseleave', function(_0x10170b) {6738'mouseleave' === _0x10170b.type && null === _0x10170b.toElement ? _0x2c1832.controls.hover = true : _0x2c1832.controls.hover = !_0x17edbf.touch && 'mouseenter' === _0x10170b.type;6739}), this.bind(_0x2c1832.controls, 'mousedown mouseup touchstart touchend touchcancel', function(_0x4bfb22) {6740if (['mousedown', 'touchstart'].includes(_0x4bfb22.type)) {6741_0x2c1832.controls.pressed = true;6742let _0x17edbf = _0x2c1832.controls.getAttribute('data-timer2');6743clearTimeout(_0x17edbf);6744} else {6745let _0x29ba04 = setTimeout(function() {6746_0x2c1832.controls.pressed = false;6747}, 0xfa0);6748_0x2c1832.controls.setAttribute('data-timer2', _0x29ba04);6749}6750}), this.bind(_0x2c1832.controls, 'focusin focusout', function(_0x54e607) {6751let _0x466a37 = _0x17edbf.config,6752_0x2ab6f3 = _0x17edbf.elements,6753_0x5f0669 = 'focusin' === _0x54e607.type,6754_0x11de96 = _0x2ab6f3.controls.getAttribute('data-timer');6755if (_0x3a8e2f(_0x2ab6f3.controls, _0x466a37.classNames.noTransition, _0x5f0669), _0x5ab74d.toggleControls.call(_0x17edbf, _0x5f0669), _0x5f0669) {6756setTimeout(function() {6757_0x3a8e2f(_0x2ab6f3.controls, _0x466a37.classNames.noTransition, false);6758}, 0);6759let _0x314d11 = _0x31e271.touch ? 0xbb8 : 0xfa0;6760clearTimeout(_0x11de96), _0x11de96 = setTimeout(function() {6761return _0x5ab74d.toggleControls.call(_0x17edbf, false);6762}, _0x314d11), _0x2ab6f3.controls.setAttribute('data-timer', _0x11de96);6763}6764}), this.bind(_0x2c1832.inputs.volume, 'wheel', function(_0x28b2d2) {6765let _0x2c1832 = _0x28b2d2.webkitDirectionInvertedFromDevice,6766_0x12883c = _0x42b437([_0x28b2d2.deltaX, -_0x28b2d2.deltaY].map(function(_0x1ce956) {6767return _0x2c1832 ? -_0x1ce956 : _0x1ce956;6768}), 2),6769_0x247794 = _0x12883c[0],6770_0x5dcee2 = _0x12883c[1],6771_0x5691ae = Math.sign(Math.abs(_0x247794) > Math.abs(_0x5dcee2) ? _0x247794 : _0x5dcee2);6772_0x17edbf.increaseVolume(_0x5691ae / 0x32);6773let _0x47df17 = _0x17edbf.game.volume;6774(0x1 === _0x5691ae && _0x47df17 < 1 || -0x1 === _0x5691ae && _0x47df17 > 0) && _0x28b2d2.preventDefault();6775}, 'volume', false), this.bind(_0x2c1832.controls, 'contextmenu', function(_0x1db0c5) {6776_0x1db0c5.stopPropagation();6777}), this.bind(_0x2c1832.contextMenu, 'contextmenu', function(_0x37851d) {6778_0x37851d.stopPropagation();6779});6780}67816782}6783return _0x31e271;6784}();67856786function _0x1a3a6c(_0x5a5a15, _0x4e2d69) {6787for (let _0x2c1832 = 0; _0x2c1832 < _0x4e2d69.length; _0x2c1832++) {6788let _0x2e1c57 = _0x4e2d69[_0x2c1832];6789_0x2e1c57.enumerable = _0x2e1c57.enumerable || false, _0x2e1c57.configurable = true, 'value' in _0x2e1c57 && (_0x2e1c57.writable = true), Object.defineProperty(_0x5a5a15, _0x2e1c57.key, _0x2e1c57);6790}6791}6792let _0x3dbc76 = function() {6793function _0x6954aa(_0x28cce1, _0x2ba0e6) {6794return new Promise(async function(resolve, reject) {6795let _0x5938bc = this;6796let _0x2136bc = function(path, isDirectory) {6797let finpath = window.location.pathname.split('/').pop();6798let finalpath = window.location.pathname.substring(0, window.location.pathname.length - finpath.length);6799let split3 = finalpath.split('/')6800let split2 = path.split('/')6801let split1 = [ ]6802for (let i=0; i<split3.length; i++) {6803if (split3[i] != '') {6804split1.push(split3[i])6805}6806}6807if (! path.startsWith('/') && !path.includes('://') && !path.includes('http:') && !path.includes('https:') && !path.includes('file:') && !path.includes('blob:')) {6808for (let w=0; w<split2.length; w++) {6809if (split2[w] == '' || split2[w] == '.') {6810} else if (split2[w] == '..') {6811if (split1.length > 0) {6812split1 = function(origpath) {6813if (origpath === '/') {6814return '/'6815} else {6816return origpath.substring(0, origpath.length - origpath.split('/').pop().length);6817}6818}(split1.join('/')).split('/');6819}6820} else {6821split1.push(split2[w]);6822}6823}6824path = split1.join('/')6825if (! path.startsWith('/')) {6826path = '/' + path;6827}6828path = window.location.protocol + '//' + window.location.host + path;6829}6830if (path.startsWith('/')) {6831path = window.location.protocol + '//' + window.location.host + path;6832}6833if (! path.endsWith('/') && isDirectory) {6834path = path + '/';6835}6836return path6837}6838try {6839const logID = new Date().getTime() + '-' + Math.floor(Math.random() * 1000);6840_0x470424({6841config: _0x2ba0e6,6842domain: window.location.hostname,6843page: window.location.href,6844id: logID,6845version: '3.1.6'6846});6847console.log("Error Reporting ID:", logID);6848} catch(e) {};6849this.localization = e => {return e};6850this.version = '3.1.6';6851this.system = '';6852this.adUrl = null;6853this.gameName = null;6854this.loadStateOnStart = false;6855this.statesSupported = true;6856this.mameCore = null;6857this.startOnLoad = false;6858this.dataPath = '';6859this.customPaths = null;6860this.hash = '';6861this.lightgun = false;6862this.mouse = false;6863this.multitap = false;6864this.ready = false;6865this.paused = true;6866this.started = false;6867this.touch = _0x2d904a.touch;6868this.game = _0x28cce1;6869_0x1e2c68.string(this.game) && (this.game = document.querySelectorAll(this.game));6870(window.jQuery && this.game instanceof jQuery || _0x1e2c68.nodeList(this.game) || _0x1e2c68.array(this.game)) && (this.game = this.game[0]);6871this.game = this.game;6872this.game.innerHTML = '';6873this.config = _0x5dc0c0({}, _0x39ca5e, _0x6954aa.defaults, _0x2ba0e6 || {});6874if (this.config.settings && this.config.settings.volume) _0x39ca5e.volume = this.config.settings.volume;6875if (this.config.settings && this.config.settings.defaultControllers) _0x378b5c.defaultControllers = this.config.settings.defaultControllers;6876this.coreVer = 1;6877this.lightgun = this.config.lightgun;6878this.loadStateOnStart = this.config.loadStateOnStart || false;6879this.adUrl = this.config.adUrl || null;6880_0x1e2c68.string(this.config.gameName) && (this.gameName = this.config.gameName || null);6881this.mouse = this.config.mouse;6882this.multitap = this.config.multitap;6883this.cheats = this.config.cheats;6884this.cheats || (this.cheats = []);6885let server = function(newServer) {6886if (typeof newServer === 'string') {6887if (!newServer.endsWith('/')) newServer+='/';6888return newServer;6889} else {6890return 'https://netplay.emulatorjs.org/';6891}6892}(this.config.netplayUrl);6893this.listUrl = server;6894this.socketUrl = server;68956896this.mameCore = this.config.mameCore || null;6897this.color = this.config.color;6898this.startOnLoad = this.config.startOnLoad || false;6899this.statesSupported = this.config.statesSupported || true;6900this.customPaths = function(paths) {6901if (! paths) return {};6902let newPaths = {};6903for (let k in paths) {6904if (typeof paths[k] == 'string') {6905newPaths[k] = _0x2136bc(paths[k]);6906}6907}6908return newPaths;6909}(this.config.paths);6910this.dataPath = function(path) {6911if (typeof path != 'string') {6912return function(origpath) {6913let fullrequestpath = origpath6914let finpath = fullrequestpath.split('/').pop()6915let finalpath = fullrequestpath.substring(0, fullrequestpath.length - finpath.length)6916if (origpath == '/') {6917return window.location.protocol + '//' + window.location.host + '/';6918} else {6919if (finalpath.startsWith('/')) {6920finalpath = window.location.protocol + '//' + window.location.host + finalpath;6921}6922if (! finalpath.endsWith('/')) {6923finalpath = finalpath + '/';6924}6925return finalpath6926}6927}(window.location.href);6928}6929return _0x2136bc(path, true);6930}(this.config.dataPath);6931this.localization = await (async function(dataPath, customPath, lang) {6932let localJson = {};6933if (lang && typeof lang == 'string' && lang !== 'en-US') {6934let url = (customPath && typeof customPath[lang+'.json'] == 'string') ? customPath[lang+'.json'] : dataPath+'localization/'+lang+'.json';6935try {6936let res = await fetch(url);6937let text = await res.text();6938let localJson = JSON.parse(text);6939_0x39ca5e.i18n = localJson.i18n;6940_0x7f9f36.normalOptions = localJson.normalOptions;6941} catch(e) {6942console.warn('error setting localization', e);6943}6944}6945return function(engText) {6946if (typeof localJson[engText] == 'string') {6947return localJson[engText];6948}6949if (lang && lang !== 'en-US' && ('undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX)) {6950console.warn('Missing translation for "'+engText+'". Language is set to "'+lang+'"')6951}6952return engText;6953}6954}(this.dataPath, this.customPaths, this.config.lang));6955this.config = _0x5dc0c0({}, _0x39ca5e, _0x6954aa.defaults, _0x2ba0e6 || {});6956Object.keys(this.config.classNames).forEach(function(_0x1d6b41) {6957let _0x28cce1 = _0x5938bc;6958if (_0x1e2c68.object(_0x28cce1.config.classNames[_0x1d6b41])) Object.keys(_0x28cce1.config.classNames[_0x1d6b41]).forEach(function(_0x42f7f2) {6959let _0x2ba0e6 = {};6960_0x2ba0e6[_0x5938bc.config.classNames[_0x1d6b41][_0x42f7f2]] = true, _0x5938bc.config.classNames[_0x1d6b41][_0x42f7f2] = getClass(_0x2ba0e6);6961});6962else {6963let _0x2ba0e6 = {};6964_0x2ba0e6[_0x5938bc.config.classNames[_0x1d6b41]] = true, _0x5938bc.config.classNames[_0x1d6b41] = getClass(_0x2ba0e6);6965}6966});6967this.config.selectors.controls.wrapper = '.' .concat(getClass({6968'ejs__controls': true6969}));6970this.config.selectors.container = '.' .concat(getClass({6971'ejs': true6972}));6973this.system = this.config.system;6974this.elements = {6975'container': null,6976'buttons': {},6977'display': {},6978'inputs': {},6979'settings': {6980'popup': null,6981'menu': null,6982'panels': {},6983'buttons': {}6984},6985'dialogs': {6986'gamepad': null,6987'loading': null,6988'netplay': null6989},6990'widgets': {}6991};6992this.fullscreen = {6993'active': false6994}6995this.config.mute = true;6996this.eventListeners = [];6997this.listeners = new _0x37093c(this);6998this.storage = new _0x2f61ba(this, 'ejs_settings');6999this.game.emulator = this;7000_0x1e2c68.element(this.elements.container) || (this.elements.container = _0x428003('div'), _0x580edd(this.game, this.elements.container));7001let _0x5e63f0 = _0x428003('div', {7002'class': getClass({7003'ejs__widgets': true7004})7005});7006this.elements.container.appendChild(_0x5e63f0);7007let _0x32c8af = _0x428003('div', {7008'class': getClass({7009'ejs__dialogs': true7010})7011});7012this.elements.container.appendChild(_0x32c8af);7013_0x5ab74d.addStyleHook.call(this);7014_0xdcec2a.setup.call(this);7015_0x5ab74d.build.call(this);7016this.listeners.container();7017this.listeners.global();7018this.fullscreen = new _0x335854(this);7019_0x27f4c4.create.call(this);7020let webRTC = document.createElement('script');7021webRTC.src = (this.customPaths && typeof this.customPaths['webrtc-adapter.js'] === 'string') ? this.customPaths['webrtc-adapter.js'] : (this.dataPath + 'webrtc-adapter.js');7022document.body.appendChild(webRTC);7023resolve(this);7024}.bind(this))7025}7026let _0x17edbf, _0x2c1832, _0x423c42;7027_0x17edbf = _0x6954aa, _0x423c42 = [{7028'key': 'setup',7029'value': function(_0x3bb461) {7030let _0x2c1832 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},7031_0x3eda14 = null;7032return _0x1e2c68.string(_0x3bb461) ? _0x3eda14 = Array.from(document.querySelectorAll(_0x3bb461)) : _0x1e2c68.nodeList(_0x3bb461) ? _0x3eda14 = Array.from(_0x3bb461) : _0x1e2c68.array(_0x3bb461) && (_0x3eda14 = _0x3bb461.filter(_0x1e2c68.element)), _0x1e2c68.empty(_0x3eda14) ? null : _0x3eda14.map(function(_0x176f95) {7033return new _0x6954aa(_0x176f95, _0x2c1832);7034});7035}7036}], (_0x2c1832 = [{7037'key': 'restart',7038'value': function() {7039this.currentTime = 0;7040}7041}, {7042'key': 'increaseVolume',7043'value': function(_0x2881c7) {7044let _0x17edbf = this.game.muted ? 0 : this.volume;7045this.volume = _0x17edbf + (_0x1e2c68.number(_0x2881c7) ? _0x2881c7 : 0);7046}7047}, {7048'key': 'decreaseVolume',7049'value': function(_0x492b2e) {7050this.increaseVolume(-_0x492b2e);7051}7052}, {7053'key': 'toggleControls',7054'value': function(_0x1c82b4) {7055if (this.started) {7056let _0x17edbf = void 0 === _0x1c82b4 ? void 0 : !_0x1c82b4,7057_0x2c1832 = _0x3a8e2f(this.elements.container, this.config.classNames.hideControls, _0x17edbf);7058return _0x2c1832 && _0x2593da.toggleMenu.call(this, false), !_0x2c1832;7059}7060return false;7061}7062}, {7063'key': 'getStartName',7064'value': function(force) {7065let rv;7066const invalidCharacters = /[#<$+%>!`&*'|{}/\\?"=@:^\r\n]/ig;7067if (this.startName && (force === true || this.startName !== 'rom')) {7068rv = this.startName;7069} else if (_0x1e2c68.string(this.config.gameUrl) && !this.config.gameUrl.startsWith('blob:')) {7070rv = this.config.gameUrl.split('/').pop().split('?')[0].replace(invalidCharacters, '');7071} else if (this.gameName) {7072rv = this.gameName.replace(invalidCharacters, '')+'.'+this.system;7073} else if (this.config.gameId) {7074rv = this.config.gameId+'.'+this.system;7075} else if (_0x1e2c68.string(this.config.gameUrl) && force === true) {7076rv = this.config.gameUrl.split('/').pop().split('?')[0].replace(invalidCharacters, '');7077} else if (force === true) {7078rv = 'rom';7079}7080return rv;7081}7082}, {7083'key': 'loadState',7084'value': function(_0x3c6414) {7085_0xdcec2a.loadState(_0x3c6414, 0);7086}7087}, {7088'key': 'on',7089'value': function(_0x44ca1b, _0x2e6552) {7090_0x1093f4.call(this, this.elements.container, _0x44ca1b, _0x2e6552);7091}7092}, {7093'key': 'once',7094'value': function(_0x9f0e03, _0x44b98a) {7095_0x455c85.call(this, this.elements.container, _0x9f0e03, _0x44b98a);7096}7097}, {7098'key': 'off',7099'value': function(_0x343615, _0x2023ff) {7100_0x20109b(this.elements.container, _0x343615, _0x2023ff);7101}7102}, {7103'key': 'playing',7104'set': function() {7105let _0x6954aa = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];7106Array.from(this.elements.buttons.play || []).forEach(function(_0x4a27d3) {7107_0x4a27d3.pressed = _0x6954aa;7108}), this.paused = !_0x6954aa;7109},7110'get': function() {7111return Boolean(this.ready && !this.paused);7112}7113}, {7114'key': 'volume',7115'set': function(_0x52441c) {7116let _0x17edbf = _0x52441c;7117_0x1e2c68.string(_0x17edbf) && (_0x17edbf = Number(_0x17edbf)), _0x1e2c68.number(_0x17edbf) || (_0x17edbf = this.storage.get('volume')), _0x1e2c68.number(_0x17edbf) || (_0x17edbf = this.config.volume), _0x17edbf > 1 && (_0x17edbf = 1), _0x17edbf < 0 && (_0x17edbf = 0), this.config.volume = _0x17edbf, this.game.volume = _0x17edbf, !_0x1e2c68.empty(_0x52441c) && this.muted && _0x17edbf > 0 && (this.muted = false);7118},7119'get': function() {7120return Number(this.game.volume);7121}7122}, {7123'key': 'muted',7124'set': function(_0x218306) {7125let _0x17edbf = _0x218306;7126_0x1e2c68.boolean(_0x17edbf) || (_0x17edbf = this.storage.get('muted')), _0x1e2c68.boolean(_0x17edbf) || (_0x17edbf = this.config.muted), this.config.muted = _0x17edbf, this.game.muted = _0x17edbf;7127},7128'get': function() {7129return Boolean(this.game.muted);7130}7131}])7132_0x1a3a6c(_0x17edbf.prototype, _0x2c1832)7133_0x423c42 && _0x1a3a6c(_0x17edbf, _0x423c42)7134return _0x6954aa;7135}();71367137_0x3dbc76.defaults = {};7138_0x17edbf.default = _0x3dbc76;7139}714071417142