From c01fb72883f697f4c2faff2630c22f9c34876607 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien <77750390+ethanaobrien@users.noreply.github.com> Date: Fri, 21 Jul 2023 10:44:06 -0500 Subject: [PATCH] Fix compressed file on non psx core bug --- data/emulator.js | 13 +++++-------- data/emulator.min.js | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/data/emulator.js b/data/emulator.js index 51799b3..790e410 100644 --- a/data/emulator.js +++ b/data/emulator.js @@ -173,8 +173,7 @@ class EmulatorJS { this.ejs_num_version = 40.4; this.debug = (window.EJS_DEBUG_XX === true); if (this.debug || (window.location && ['localhost', '127.0.0.1'].includes(location.hostname))) this.checkForUpdates(); - this.netplayEnabled = false; //DO NOT ENABLE UNLESS YOU KNOW WHAT YOU'RE DOING - if (!this.debug) this.netplayEnabled = false; + this.netplayEnabled = (window.EJS_DEBUG_XX === true) && (window.EJS_EXPERIMENTAL_NETPLAY === true); this.config = config; this.currentPopup = null; this.touch = false; @@ -782,7 +781,6 @@ class EmulatorJS { let resData = {}; const altName = this.config.gameUrl.startsWith("blob:") ? this.config.gameName || "game" : this.config.gameUrl.split('/').pop().split("#")[0].split("?")[0]; this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Data"), (fileName, fileData) => { - console.log(fileName); if (fileName.includes("/")) { const paths = fileName.split("/"); let cp = ""; @@ -800,7 +798,7 @@ class EmulatorJS { } if (this.getCore(true) === "psx" && ["m3u", "cue"].includes(fileName.split(".").pop().toLowerCase())) { resData[fileName] = fileData; - } else if (this.getCore(true) === "psx" && fileName !== "!!notCompressedData") { + } else if (fileName !== "!!notCompressedData") { resData[fileName] = true; } if (fileName === "!!notCompressedData") { @@ -836,7 +834,6 @@ class EmulatorJS { this.fileName = k; } if (this.getCore(true) === "psx" && execFile === null && ["m3u", "cue"].includes(k.split(".").pop().toLowerCase())) { - console.log(k, resData[k]); FS.writeFile("/"+k, resData[k]); } } @@ -928,9 +925,6 @@ class EmulatorJS { if (this.debug) console.log(args); this.Module.callMain(args); this.Module.resumeMainLoop(); - if (this.touch) { - this.virtualGamepad.style.display = ""; - } this.checkSupportedOpts(); this.setupSettingsMenu(); @@ -946,6 +940,9 @@ class EmulatorJS { this.handleResize(); this.started = true; this.paused = false; + if (this.touch) { + this.virtualGamepad.style.display = ""; + } } catch(e) { console.warn("failed to start game", e); this.textElem.innerText = this.localization("Failed to start game"); diff --git a/data/emulator.min.js b/data/emulator.min.js index 9cb16fd..012919a 100644 --- a/data/emulator.min.js +++ b/data/emulator.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("nipplejs",[],t):"object"==typeof exports?exports.nipplejs=t():e.nipplejs=t()}(window,function(){return n=[function(e,t,n){"use strict";n.r(t);function _(e,t){var n=t.x-e.x,t=t.y-e.y;return Math.sqrt(n*n+t*t)}function T(e){return e*(Math.PI/180)}function o(e){f.has(e)&&clearTimeout(f.get(e)),f.set(e,setTimeout(e,100))}function s(e,t,n){for(var i,o=t.split(/[ ,]+/g),s=0;sthis.options.threshold){var r,l={};for(r in this.direction)this.direction.hasOwnProperty(r)&&(l[r]=this.direction[r]);var c={};for(r in this.direction={x:n,y:i,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:"+i,e),c.angle||this.trigger("dir dir:"+t,e)}else this.resetDirection();return e};var x=w;function E(e,t){this.nipples=[],this.idles=[],this.actives=[],this.ids=[],this.pressureIntervals={},this.manager=e,this.id=E.id,E.id+=1,this.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},this.config(t),"static"!==this.options.mode&&"semi"!==this.options.mode||(this.options.multitouch=!1),this.options.multitouch||(this.options.maxNumberOfNipples=1);e=getComputedStyle(this.options.zone.parentElement);return e&&"flex"===e.display&&(this.parentIsFlex=!0),this.updateBox(),this.prepareNipples(),this.bindings(),this.begin(),this.nipples}E.prototype=new m,(E.constructor=E).id=0,E.prototype.prepareNipples=function(){var i=this.nipples;i.on=this.on.bind(this),i.off=this.off.bind(this),i.options=this.options,i.destroy=this.destroy.bind(this),i.ids=this.ids,i.id=this.id,i.processOnMove=this.processOnMove.bind(this),i.processOnEnd=this.processOnEnd.bind(this),i.get=function(e){if(void 0===e)return i[0];for(var t=0,n=i.length;t