mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 10:56:30 +00:00
Compile (beta) thread cores
This commit is contained in:
parent
3ad97e7b41
commit
9932460301
10 changed files with 8 additions and 8 deletions
BIN
data/cores/mednafen_psx_hw-thread-wasm.data
Normal file
BIN
data/cores/mednafen_psx_hw-thread-wasm.data
Normal file
Binary file not shown.
BIN
data/cores/melonds-thread-wasm.data
Normal file
BIN
data/cores/melonds-thread-wasm.data
Normal file
Binary file not shown.
BIN
data/cores/mgba-thread-wasm.data
Normal file
BIN
data/cores/mgba-thread-wasm.data
Normal file
Binary file not shown.
BIN
data/cores/mupen64plus_next-thread-wasm.data
Normal file
BIN
data/cores/mupen64plus_next-thread-wasm.data
Normal file
Binary file not shown.
BIN
data/cores/opera-thread-wasm.data
Normal file
BIN
data/cores/opera-thread-wasm.data
Normal file
Binary file not shown.
BIN
data/cores/parallel_n64-thread-wasm.data
Normal file
BIN
data/cores/parallel_n64-thread-wasm.data
Normal file
Binary file not shown.
BIN
data/cores/pcsx_rearmed-thread-wasm.data
Normal file
BIN
data/cores/pcsx_rearmed-thread-wasm.data
Normal file
Binary file not shown.
BIN
data/cores/yabause-thread-wasm.data
Normal file
BIN
data/cores/yabause-thread-wasm.data
Normal file
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
class EmulatorJS {
|
class EmulatorJS {
|
||||||
version = 8; //Increase by 1 when cores are updated
|
version = 9; //Increase by 1 when cores are updated
|
||||||
getCore(generic) {
|
getCore(generic) {
|
||||||
const core = this.config.system;
|
const core = this.config.system;
|
||||||
/*todo:
|
/*todo:
|
||||||
|
@ -589,6 +589,12 @@ class EmulatorJS {
|
||||||
}
|
}
|
||||||
downloadGameCore() {
|
downloadGameCore() {
|
||||||
this.textElem.innerText = this.localization("Download Game Core");
|
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) => {
|
const gotCore = (data) => {
|
||||||
this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Core")).then((data) => {
|
this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Core")).then((data) => {
|
||||||
let js, thread, wasm;
|
let js, thread, wasm;
|
||||||
|
@ -627,12 +633,6 @@ class EmulatorJS {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
initGameCore(js, wasm, thread) {
|
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);
|
this.initModule(wasm, thread);
|
||||||
let script = this.createElement("script");
|
let script = this.createElement("script");
|
||||||
script.src = URL.createObjectURL(new Blob([js], {type: "application/javascript"}));
|
script.src = URL.createObjectURL(new Blob([js], {type: "application/javascript"}));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(async function() {
|
(async function() {
|
||||||
const folderPath = (path) => path.substring(0, path.length - path.split('/').pop().length);
|
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+='/';
|
if (!scriptPath.endsWith('/')) scriptPath+='/';
|
||||||
//console.log(scriptPath);
|
//console.log(scriptPath);
|
||||||
function loadScript(file) {
|
function loadScript(file) {
|
||||||
|
|
Loading…
Reference in a new issue