mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
Fix compressed file on non psx core bug
This commit is contained in:
parent
6498bd8405
commit
c01fb72883
2 changed files with 6 additions and 9 deletions
|
@ -173,8 +173,7 @@ class EmulatorJS {
|
||||||
this.ejs_num_version = 40.4;
|
this.ejs_num_version = 40.4;
|
||||||
this.debug = (window.EJS_DEBUG_XX === true);
|
this.debug = (window.EJS_DEBUG_XX === true);
|
||||||
if (this.debug || (window.location && ['localhost', '127.0.0.1'].includes(location.hostname))) this.checkForUpdates();
|
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
|
this.netplayEnabled = (window.EJS_DEBUG_XX === true) && (window.EJS_EXPERIMENTAL_NETPLAY === true);
|
||||||
if (!this.debug) this.netplayEnabled = false;
|
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.currentPopup = null;
|
this.currentPopup = null;
|
||||||
this.touch = false;
|
this.touch = false;
|
||||||
|
@ -782,7 +781,6 @@ class EmulatorJS {
|
||||||
let resData = {};
|
let resData = {};
|
||||||
const altName = this.config.gameUrl.startsWith("blob:") ? this.config.gameName || "game" : this.config.gameUrl.split('/').pop().split("#")[0].split("?")[0];
|
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) => {
|
this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Data"), (fileName, fileData) => {
|
||||||
console.log(fileName);
|
|
||||||
if (fileName.includes("/")) {
|
if (fileName.includes("/")) {
|
||||||
const paths = fileName.split("/");
|
const paths = fileName.split("/");
|
||||||
let cp = "";
|
let cp = "";
|
||||||
|
@ -800,7 +798,7 @@ class EmulatorJS {
|
||||||
}
|
}
|
||||||
if (this.getCore(true) === "psx" && ["m3u", "cue"].includes(fileName.split(".").pop().toLowerCase())) {
|
if (this.getCore(true) === "psx" && ["m3u", "cue"].includes(fileName.split(".").pop().toLowerCase())) {
|
||||||
resData[fileName] = fileData;
|
resData[fileName] = fileData;
|
||||||
} else if (this.getCore(true) === "psx" && fileName !== "!!notCompressedData") {
|
} else if (fileName !== "!!notCompressedData") {
|
||||||
resData[fileName] = true;
|
resData[fileName] = true;
|
||||||
}
|
}
|
||||||
if (fileName === "!!notCompressedData") {
|
if (fileName === "!!notCompressedData") {
|
||||||
|
@ -836,7 +834,6 @@ class EmulatorJS {
|
||||||
this.fileName = k;
|
this.fileName = k;
|
||||||
}
|
}
|
||||||
if (this.getCore(true) === "psx" && execFile === null && ["m3u", "cue"].includes(k.split(".").pop().toLowerCase())) {
|
if (this.getCore(true) === "psx" && execFile === null && ["m3u", "cue"].includes(k.split(".").pop().toLowerCase())) {
|
||||||
console.log(k, resData[k]);
|
|
||||||
FS.writeFile("/"+k, resData[k]);
|
FS.writeFile("/"+k, resData[k]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -928,9 +925,6 @@ class EmulatorJS {
|
||||||
if (this.debug) console.log(args);
|
if (this.debug) console.log(args);
|
||||||
this.Module.callMain(args);
|
this.Module.callMain(args);
|
||||||
this.Module.resumeMainLoop();
|
this.Module.resumeMainLoop();
|
||||||
if (this.touch) {
|
|
||||||
this.virtualGamepad.style.display = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
this.checkSupportedOpts();
|
this.checkSupportedOpts();
|
||||||
this.setupSettingsMenu();
|
this.setupSettingsMenu();
|
||||||
|
@ -946,6 +940,9 @@ class EmulatorJS {
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
this.started = true;
|
this.started = true;
|
||||||
this.paused = false;
|
this.paused = false;
|
||||||
|
if (this.touch) {
|
||||||
|
this.virtualGamepad.style.display = "";
|
||||||
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.warn("failed to start game", e);
|
console.warn("failed to start game", e);
|
||||||
this.textElem.innerText = this.localization("Failed to start game");
|
this.textElem.innerText = this.localization("Failed to start game");
|
||||||
|
|
2
data/emulator.min.js
vendored
2
data/emulator.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue