From a8dc84b1eb52d329d8b0a1c7039ca97feedb3bbd Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Tue, 7 Jan 2025 07:43:35 -0600 Subject: [PATCH] Write bios/patch/parent files to the same folder as the start filename --- data/src/emulator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/src/emulator.js b/data/src/emulator.js index 90fa917..3b0bad6 100644 --- a/data/src/emulator.js +++ b/data/src/emulator.js @@ -682,12 +682,14 @@ class EmulatorJS { const gotData = async (input) => { const data = await this.checkCompression(new Uint8Array(input), decompressProgressMessage); for (const k in data) { + const coreFilename = "/"+this.fileName; + const coreFilePath = coreFilename.substring(0, coreFilename.length - coreFilename.split("/").pop().length); if (k === "!!notCompressedData") { - this.gameManager.FS.writeFile(assetUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); + this.gameManager.FS.writeFile(coreFilePath + assetUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); break; } if (k.endsWith('/')) continue; - this.gameManager.FS.writeFile("/" + k.split('/').pop(), data[k]); + this.gameManager.FS.writeFile(coreFilePath + k.split('/').pop(), data[k]); } }