mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
Add call to mount file systems before loading game assets
This commit is contained in:
parent
b2747487d1
commit
627fba2f9c
@ -31,14 +31,9 @@ class EJS_GameManager {
|
||||
getFrameNum: this.Module.cwrap('get_current_frame_count', 'number', ['']),
|
||||
setVSync: this.Module.cwrap('set_vsync', 'null', ['number'])
|
||||
}
|
||||
this.mkdir("/data");
|
||||
this.mkdir("/data/saves");
|
||||
|
||||
this.writeFile("/home/web_user/retroarch/userdata/retroarch.cfg", this.getRetroArchCfg());
|
||||
|
||||
this.FS.mount(this.FS.filesystems.IDBFS, {autoPersist: true}, '/data/saves');
|
||||
//this.FS.syncfs(true, () => {});
|
||||
|
||||
this.writeConfigFile();
|
||||
this.initShaders();
|
||||
|
||||
@ -47,6 +42,7 @@ class EJS_GameManager {
|
||||
this.functions.saveSaveFiles();
|
||||
setTimeout(() => {
|
||||
try {
|
||||
this.FS.unmount('/data/saves');
|
||||
this.Module.abort();
|
||||
} catch(e) {
|
||||
console.warn(e);
|
||||
@ -54,6 +50,14 @@ class EJS_GameManager {
|
||||
}, 1000);
|
||||
})
|
||||
}
|
||||
mountFileSystems() {
|
||||
return new Promise(async resolve => {
|
||||
this.mkdir("/data");
|
||||
this.mkdir("/data/saves");
|
||||
this.FS.mount(this.FS.filesystems.IDBFS, {autoPersist: true}, '/data/saves');
|
||||
this.FS.syncfs(true, resolve);
|
||||
});
|
||||
}
|
||||
writeConfigFile() {
|
||||
if (!this.EJS.defaultCoreOpts.file || !this.EJS.defaultCoreOpts.settings) {
|
||||
return;
|
||||
|
||||
@ -980,6 +980,7 @@ class EmulatorJS {
|
||||
(async () => {
|
||||
this.gameManager = new window.EJS_GameManager(this.Module, this);
|
||||
await this.gameManager.loadExternalFiles();
|
||||
await this.gameManager.mountFileSystems();
|
||||
if (this.getCore() === "ppsspp") {
|
||||
await this.gameManager.loadPpssppAssets();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user