Compare commits

..

No commits in common. "469b9fcc4e4bed2301115556d51117e68e97e934" and "2630f81899deb5613f82f11b88ccf5faf9bcd123" have entirely different histories.

3 changed files with 14 additions and 24 deletions

View file

@ -31,6 +31,9 @@ class EJS_GameManager {
getFrameNum: this.Module.cwrap('get_current_frame_count', 'number', ['']), getFrameNum: this.Module.cwrap('get_current_frame_count', 'number', ['']),
setVSync: this.Module.cwrap('set_vsync', 'null', ['number']) setVSync: this.Module.cwrap('set_vsync', 'null', ['number'])
} }
this.writeFile("/home/web_user/retroarch/userdata/config/Beetle PSX HW/Beetle PSX HW.opt", 'beetle_psx_hw_renderer = "software"\n');
this.writeFile("/home/web_user/retroarch/userdata/config/MAME 2003 (0.78)/MAME 2003 (0.78).opt", 'mame2003_skip_disclaimer = "enabled"\nmame2003_skip_warnings = "enabled"\n');
this.mkdir("/data"); this.mkdir("/data");
this.mkdir("/data/saves"); this.mkdir("/data/saves");
@ -39,7 +42,6 @@ class EJS_GameManager {
this.FS.mount(this.FS.filesystems.IDBFS, {autoPersist: true}, '/data/saves'); this.FS.mount(this.FS.filesystems.IDBFS, {autoPersist: true}, '/data/saves');
//this.FS.syncfs(true, () => {}); //this.FS.syncfs(true, () => {});
this.writeConfigFile();
this.initShaders(); this.initShaders();
this.EJS.on("exit", () => { this.EJS.on("exit", () => {
@ -50,17 +52,6 @@ class EJS_GameManager {
}, 1000); }, 1000);
}) })
} }
writeConfigFile() {
if (!this.EJS.defaultCoreOpts.file || !this.EJS.defaultCoreOpts.settings) {
return;
}
let output = "";
for (const k in this.EJS.defaultCoreOpts.settings) {
output += k + ' = "' + this.EJS.defaultCoreOpts.settings[k] +'"\n';
}
this.writeFile("/home/web_user/retroarch/userdata/config/" + this.EJS.defaultCoreOpts.file, output);
}
loadExternalFiles() { loadExternalFiles() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
if (this.EJS.config.externalFiles && this.EJS.config.externalFiles.constructor.name === 'Object') { if (this.EJS.config.externalFiles && this.EJS.config.externalFiles.constructor.name === 'Object') {

View file

@ -210,8 +210,8 @@ class EmulatorJS {
if (response.ok) { if (response.ok) {
response.text().then(body => { response.text().then(body => {
let version = JSON.parse(body); let version = JSON.parse(body);
if (this.versionAsInt(this.ejs_version) < this.versionAsInt(version.version)) { if (this.versionAsInt(this.ejs_version) < this.versionAsInt(version.current_version)) {
console.log('Using EmulatorJS version ' + this.ejs_version + ' but the newest version is ' + version.current_version + '\nopen https://github.com/EmulatorJS/EmulatorJS to update'); console.log('Using EmulatorJS version ' + this.versionAsInt(this.ejs_version) + ' but the newest version is ' + this.versionAsInt(version.current_version) + '\nopen https://github.com/EmulatorJS/EmulatorJS to update');
} }
}) })
} }
@ -496,9 +496,10 @@ class EmulatorJS {
}, fileCbFunc); }, fileCbFunc);
} }
checkCoreCompatibility(version) { checkCoreCompatibility(version) {
// Leave commented until next release - this is ready to go.
if (this.versionAsInt(version.minimumEJSVersion) > this.versionAsInt(this.ejs_version)) { if (this.versionAsInt(version.minimumEJSVersion) > this.versionAsInt(this.ejs_version)) {
this.startGameError(this.localization("Outdated EmulatorJS version")); //this.startGameError(this.localization("Outdated EmulatorJS version"));
throw new Error("Core requires minimum EmulatorJS version of " + version.minimumEJSVersion); //throw new Error("Core requires minimum EmulatorJS version of " + version.minimumEJSVersion);
} }
} }
startGameError(message) { startGameError(message) {
@ -521,7 +522,6 @@ class EmulatorJS {
return; return;
} }
const gotCore = (data) => { const gotCore = (data) => {
this.defaultCoreOpts = {};
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;
for (let k in data) { for (let k in data) {
@ -538,7 +538,6 @@ class EmulatorJS {
this.extensions = core.extensions; this.extensions = core.extensions;
this.coreName = core.name; this.coreName = core.name;
this.repository = core.repo; this.repository = core.repo;
this.defaultCoreOpts = core.options;
} else if (k === "license.txt") { } else if (k === "license.txt") {
this.license = new TextDecoder().decode(data[k]); this.license = new TextDecoder().decode(data[k]);
} }
@ -548,7 +547,7 @@ class EmulatorJS {
} }
const report = "cores/reports/" + this.getCore() + ".json"; const report = "cores/reports/" + this.getCore() + ".json";
this.downloadFile(report, (rep) => { this.downloadFile(report, (rep) => {
if (rep === -1 || typeof report === "string") { if (rep === -1) {
rep = {}; rep = {};
} else { } else {
rep = rep.data; rep = rep.data;
@ -579,7 +578,7 @@ class EmulatorJS {
} }
return; return;
} }
console.warn("File was not found locally, but was found on the emulatorjs cdn.\nIt is recommended to download the stable release from here: https://cdn.emulatorjs.org/releases/"); console.warn("File was not found locally, but was found on the emulatorjs cdn.\nIt is recommended to download the latest release from here: https://cdn.emulatorjs.org/releases/");
gotCore(res.data); gotCore(res.data);
this.storage.core.put(filename, { this.storage.core.put(filename, {
version: rep.buildStart, version: rep.buildStart,
@ -1625,7 +1624,7 @@ class EmulatorJS {
this.gameManager.toggleMainLoop(this.paused ? 0 : 1); this.gameManager.toggleMainLoop(this.paused ? 0 : 1);
//I now realize its not easy to pause it while the cursor is locked, just in case I guess //I now realize its not easy to pause it while the cursor is locked, just in case I guess
if (this.defaultCoreOpts.supportsMouse) { if (this.getCore(true) === "nds") {
if (this.canvas.exitPointerLock) { if (this.canvas.exitPointerLock) {
this.canvas.exitPointerLock(); this.canvas.exitPointerLock();
} else if (this.canvas.mozExitPointerLock) { } else if (this.canvas.mozExitPointerLock) {
@ -1851,7 +1850,7 @@ class EmulatorJS {
this.addEventListener(this.canvas, "click", (e) => { this.addEventListener(this.canvas, "click", (e) => {
if (e.pointerType === "touch") return; if (e.pointerType === "touch") return;
if (this.defaultCoreOpts.supportsMouse && !this.paused) { if (this.getCore(true) === "nds" && !this.paused) {
if (this.canvas.requestPointerLock) { if (this.canvas.requestPointerLock) {
this.canvas.requestPointerLock(); this.canvas.requestPointerLock();
} else if (this.canvas.mozRequestPointerLock) { } else if (this.canvas.mozRequestPointerLock) {
@ -1884,7 +1883,7 @@ class EmulatorJS {
enter.style.display = "none"; enter.style.display = "none";
if (this.isMobile) { if (this.isMobile) {
try { try {
screen.orientation.lock(this.getCore(true) === "nds" ? "portrait" : "landscape").catch(e => {}); screen.orientation.lock(this.getCore(true) === "nds" ? "portrait" : "landscape").catch(e => {});;
} catch(e) {} } catch(e) {}
} }
} else { } else {

View file

@ -1 +1 @@
{ "readme": "CURRENT_VERSION IS NO LONGER UPDATED. USE VERION", "current_version": 999999, "version": "4.0.12" } { "current_version": "4.0.12" }