diff --git a/data/cores/mednafen_psx_hw-thread-wasm.data b/data/cores/mednafen_psx_hw-thread-wasm.data new file mode 100644 index 0000000..bdbd9bc Binary files /dev/null and b/data/cores/mednafen_psx_hw-thread-wasm.data differ diff --git a/data/cores/melonds-thread-wasm.data b/data/cores/melonds-thread-wasm.data new file mode 100644 index 0000000..c233a01 Binary files /dev/null and b/data/cores/melonds-thread-wasm.data differ diff --git a/data/cores/mgba-thread-wasm.data b/data/cores/mgba-thread-wasm.data new file mode 100644 index 0000000..6f91260 Binary files /dev/null and b/data/cores/mgba-thread-wasm.data differ diff --git a/data/cores/mupen64plus_next-thread-wasm.data b/data/cores/mupen64plus_next-thread-wasm.data new file mode 100644 index 0000000..bfa57c8 Binary files /dev/null and b/data/cores/mupen64plus_next-thread-wasm.data differ diff --git a/data/cores/opera-thread-wasm.data b/data/cores/opera-thread-wasm.data new file mode 100644 index 0000000..341be42 Binary files /dev/null and b/data/cores/opera-thread-wasm.data differ diff --git a/data/cores/parallel_n64-thread-wasm.data b/data/cores/parallel_n64-thread-wasm.data new file mode 100644 index 0000000..442831e Binary files /dev/null and b/data/cores/parallel_n64-thread-wasm.data differ diff --git a/data/cores/pcsx_rearmed-thread-wasm.data b/data/cores/pcsx_rearmed-thread-wasm.data new file mode 100644 index 0000000..6c52be6 Binary files /dev/null and b/data/cores/pcsx_rearmed-thread-wasm.data differ diff --git a/data/cores/yabause-thread-wasm.data b/data/cores/yabause-thread-wasm.data new file mode 100644 index 0000000..b594c90 Binary files /dev/null and b/data/cores/yabause-thread-wasm.data differ diff --git a/data/emulator.js b/data/emulator.js index a1c2a3c..8fc33fc 100644 --- a/data/emulator.js +++ b/data/emulator.js @@ -1,5 +1,5 @@ class EmulatorJS { - version = 8; //Increase by 1 when cores are updated + version = 9; //Increase by 1 when cores are updated getCore(generic) { const core = this.config.system; /*todo: @@ -589,6 +589,12 @@ class EmulatorJS { } downloadGameCore() { this.textElem.innerText = this.localization("Download Game Core"); + if (this.config.threads && ((typeof window.SharedArrayBuffer) !== "function")) { + this.textElem.innerText = this.localization('Error for site owner')+"\n"+this.localization("Check console"); + this.textElem.style.color = "red"; + console.warn("Threads is set to true, but the SharedArrayBuffer function is not exposed. Threads requires 2 headers to be set when sending you html page. See https://stackoverflow.com/a/68630724"); + return; + } const gotCore = (data) => { this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Core")).then((data) => { let js, thread, wasm; @@ -627,12 +633,6 @@ class EmulatorJS { }) } initGameCore(js, wasm, thread) { - if (thread && ((typeof window.SharedArrayBuffer) !== "function")) { - this.textElem.innerText = this.localization('Error for site owner')+"\n"+this.localization("Check console"); - this.textElem.style.color = "red"; - console.warn("The "+this.getCore()+" core requires threads, but threads requires 2 headers to be set when sending you html page. See https://stackoverflow.com/a/68630724"); - return; - } this.initModule(wasm, thread); let script = this.createElement("script"); script.src = URL.createObjectURL(new Blob([js], {type: "application/javascript"})); diff --git a/data/loader.js b/data/loader.js index 7750e26..90ae7eb 100644 --- a/data/loader.js +++ b/data/loader.js @@ -1,6 +1,6 @@ (async function() { const folderPath = (path) => path.substring(0, path.length - path.split('/').pop().length); - const scriptPath = (typeof window.EJS_pathtodata === "string") ? window.EJS_pathtodata : folderPath((new URL(document.currentScript.src)).pathname); + let scriptPath = (typeof window.EJS_pathtodata === "string") ? window.EJS_pathtodata : folderPath((new URL(document.currentScript.src)).pathname); if (!scriptPath.endsWith('/')) scriptPath+='/'; //console.log(scriptPath); function loadScript(file) {