MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / gotData

Method gotData

data/src/emulator.js:707–723  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

705 return resolve(assetUrl);
706 }
707 const gotData = async (input) => {
708 if (this.config.dontExtractBIOS === true) {
709 this.gameManager.FS.writeFile(assetUrl, new Uint8Array(input));
710 return resolve(assetUrl);
711 }
712 const data = await this.checkCompression(new Uint8Array(input), decompressProgressMessage);
713 for (const k in data) {
714 const coreFilename = "/" + this.fileName;
715 const coreFilePath = coreFilename.substring(0, coreFilename.length - coreFilename.split("/").pop().length);
716 if (k === "!!notCompressedData") {
717 this.gameManager.FS.writeFile(coreFilePath + assetUrl.split("/").pop().split("#")[0].split("?")[0], data[k]);
718 break;
719 }
720 if (k.endsWith("/")) continue;
721 this.gameManager.FS.writeFile(coreFilePath + k.split("/").pop(), data[k]);
722 }
723 }
724
725 this.textElem.innerText = progressMessage;
726 if (!this.debug) {

Callers

nothing calls this directly

Calls 2

checkCompressionMethod · 0.95
writeFileMethod · 0.80

Tested by

no test coverage detected