From 5c32236f2eea307e21a85195ac43be4df9a8ddd7 Mon Sep 17 00:00:00 2001 From: O'Brien Date: Tue, 23 Aug 2022 10:09:13 -0500 Subject: [PATCH] Fix file name bug, remove default controllers for gamepads --- data/emu-main.js | 65 ++++++++++++++++++-------------------------- data/emulator.min.js | 2 +- data/loader.js | 2 +- data/version.json | 2 +- 4 files changed, 30 insertions(+), 41 deletions(-) diff --git a/data/emu-main.js b/data/emu-main.js index d974018..d1bb881 100644 --- a/data/emu-main.js +++ b/data/emu-main.js @@ -2443,64 +2443,50 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) { _0xf43a92.closeModal(); } }); - var _0x378b5c = { + const _0x378b5c = { 'defaultControllers': { 0: { 0: { - 'value': '88', - 'value2': '1' + 'value': '88' }, 1: { - 'value': '83', - 'value2': '3' + 'value': '83' }, 2: { - 'value': '16', - 'value2': '8' + 'value': '16' }, 3: { - 'value': '13', - 'value2': '9' + 'value': '13' }, 4: { - 'value': '38', - 'value2': '12' + 'value': '38' }, 5: { - 'value': '40', - 'value2': '13' + 'value': '40' }, 6: { - 'value': '37', - 'value2': '14' + 'value': '37' }, 7: { - 'value': '39', - 'value2': '15' + 'value': '39' }, 8: { - 'value': '90', - 'value2': '0' + 'value': '90' }, 9: { - 'value': '65', - 'value2': '2' + 'value': '65' }, 10: { - 'value': '81', - 'value2': '4' + 'value': '81' }, 11: { - 'value': '69', - 'value2': '5' + 'value': '69' }, 12: { - 'value': '82', - 'value2': '6' + 'value': '82' }, 13: { - 'value': '87', - 'value2': '7' + 'value': '87' }, 14: {}, 15: {}, @@ -6147,7 +6133,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) { 'state': _0x31e271 }); else { - let name = _0x17edbf.getStartName(true, true).split('/').pop(); + let name = _0x17edbf.getStartName(true).split('/').pop(); let data = new Blob([_0x31e271]); if (name.includes('.')) { name = name.substring(0, name.length-name.split('.').pop().length-1); @@ -6290,7 +6276,7 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) { } return path } - this.version = '2.3.5'; + this.version = '2.3.6'; this.system = ''; this.adUrl = null; this.gameName = null; @@ -6503,19 +6489,22 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) { } }, { 'key': 'getStartName', - 'value': function(force, noSystem) { + 'value': function(force) { let rv; + const invalidCharacters = /[#<$+%>!`&*'|{}/\\?"=@:^\r\n]/ig; if (this.startName && (force === true || this.startName !== 'rom')) { rv = this.startName; - } else if (!this.config.gameUrl.startsWith('blob:')) { - rv = this.config.gameUrl.split('/').pop().replace(/[^a-z0-9 ,.]/ig, ''); + } else if (_0x1e2c68.string(this.config.gameUrl) && !this.config.gameUrl.startsWith('blob:')) { + rv = this.config.gameUrl.split('/').pop().split('?')[0].replace(invalidCharacters, ''); } else if (this.gameName) { - rv = (noSystem===true?'':this.system+'-')+this.gameName.replace(/\#/g, ''); + rv = this.gameName.replace(invalidCharacters, '')+'.'+this.system; } else if (this.config.gameId) { - rv = (noSystem===true?'':this.system+'-')+this.config.gameId; + rv = this.config.gameId+'.'+this.system; + } else if (_0x1e2c68.string(this.config.gameUrl) && force === true) { + rv = this.config.gameUrl.split('/').pop().split('?')[0].replace(invalidCharacters, ''); } else if (force === true) { - rv = this.config.gameUrl.split('/').pop().replace(/[^a-z0-9 ,.]/ig, ''); - } + return 'rom'; + } return rv; } }, { diff --git a/data/emulator.min.js b/data/emulator.min.js index 5df84ce..2d6483c 100644 --- a/data/emulator.min.js +++ b/data/emulator.min.js @@ -1 +1 @@ -var EJS=function(a){window.EJS_MODULES=a;var n={},o=[];function i(e){if(n[e])return n[e].exports;o.push(e);var t=n[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return window.getUsedModules=function(){return o.sort(function(e,t){return t'+n.localization("CORS Error")+"":t.innerHTML=''+n.localization("Network Error")+""}},null,null,null,null,null,function(e){function t(){if(!(navigator.getGamepads||navigator.webkitGetGamepads))throw new Error("get gamepads not found!");if(this.rAF=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame,!this.rAF)throw new Error("request animation frame was not found!");this.loop()}t.prototype={gamepads:[],rAF:null,getGamepads:function(){return navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[]},loop:async function(){this.updateGamepadState(),this.rAF.call(null,this.loop.bind(this))},updateGamepadState:function(){for(var n=this.getGamepads(),a=0;athis.options.threshold){var l={};for(r in this.direction)this.direction.hasOwnProperty(r)&&(l[r]=this.direction[r]);var r,c={};for(r in this.direction={x:n,y:a,angle:t},e.direction=this.direction,l)l[r]===this.direction[r]&&(c[r]=!0);if(c.x&&c.y&&c.angle)return e;c.x&&c.y||this.trigger("plain",e),c.x||this.trigger("plain:"+n,e),c.y||this.trigger("plain:"+a,e),c.angle||this.trigger("dir dir:"+t,e)}return e},a.prototype=new e,(a.constructor=a).id=0,a.prototype.prepareNipples=function(){var e=this,a=e.nipples;a.on=e.on.bind(e),a.off=e.off.bind(e),a.options=e.options,a.destroy=e.destroy.bind(e),a.ids=e.ids,a.id=e.id,a.processOnMove=e.processOnMove.bind(e),a.processOnEnd=e.processOnEnd.bind(e),a.get=function(e){if(void 0===e)return a[0];for(var t=0,n=a.length;t