From 3563b34aaa434d6e4d1a3de9fa92804e25bd7fe8 Mon Sep 17 00:00:00 2001 From: Ben Garrett Date: Thu, 17 Jun 2021 18:24:55 +1000 Subject: [PATCH] Fixed Automatically start DOS emulation toggle. --- docs/CHANGES.md | 1 + src/js/dosee-loader.js | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 7c9aa3c..3090874 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -8,6 +8,7 @@ - Renamed Hardware tab headers to improve their clarity. - Replaced two of the sample demos to better show off the variety of emulated hardware. - Fixed broken SVGA Graphic option, `dosmachine=svga`. +- Fixed broken _Automatically start DOS emulation_ option. ### v1.60 diff --git a/src/js/dosee-loader.js b/src/js/dosee-loader.js index 8371c8e..195a5b3 100644 --- a/src/js/dosee-loader.js +++ b/src/js/dosee-loader.js @@ -551,20 +551,28 @@ window.Module = null; fetch({ title: `WASM Binary`, url: gameData.emulatorWASM, - }).then((binary) => { - gameData.wasmBinary = binary; }) + .then((binary) => { + gameData.wasmBinary = binary; + }) + .then(() => { + Promise.all( + gameData.files.map((f) => { + if (!f) return null; + if (!f.file) return null; + if (!f.drive) return null; + return fetch(f.file).then(mountAt(f.drive)); + }) + ).then(resolve, reject); + console.log( + `%cDOSee`, + `color:dimgray;font-weight:bold`, + `loading WASM binary complete` + ); + }) ); }; wasm(); - Promise.all( - gameData.files.map((f) => { - if (!f) return null; - if (!f.file) return null; - if (!f.drive) return null; - return fetch(f.file).then(mountAt(f.drive)); - }) - ).then(resolve, reject); }); }); } @@ -613,6 +621,7 @@ window.Module = null; // so let's map the prefixed versions to the correct function. canvas.requestPointerLock = getPointerLockEnabler(canvas); moveConfigToRoot(gameData.fileSystem); + console.log(gameData); Module = initializeModule( gameData.emulatorArguments, gameData.fileSystem,