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

Method gotCore

data/src/emulator.js:540–574  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

538 return;
539 }
540 const gotCore = (data) => {
541 this.defaultCoreOpts = {};
542 this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Core")).then((data) => {
543 let js, thread, wasm;
544 for (let k in data) {
545 if (k.endsWith(".wasm")) {
546 wasm = data[k];
547 } else if (k.endsWith(".worker.js")) {
548 thread = data[k];
549 } else if (k.endsWith(".js")) {
550 js = data[k];
551 } else if (k === "build.json") {
552 this.checkCoreCompatibility(JSON.parse(new TextDecoder().decode(data[k])));
553 } else if (k === "core.json") {
554 let core = JSON.parse(new TextDecoder().decode(data[k]));
555 this.extensions = core.extensions;
556 this.coreName = core.name;
557 this.repository = core.repo;
558 this.defaultCoreOpts = core.options;
559 this.enableMouseLock = core.options.supportsMouse;
560 this.retroarchOpts = core.retroarchOpts;
561 this.saveFileExt = core.save;
562 } else if (k === "license.txt") {
563 this.license = new TextDecoder().decode(data[k]);
564 }
565 }
566
567 if (this.saveFileExt === false) {
568 this.elements.bottomBar.saveSavFiles[0].style.display = "none";
569 this.elements.bottomBar.loadSavFiles[0].style.display = "none";
570 }
571
572 this.initGameCore(js, wasm, thread);
573 });
574 }
575 const report = "cores/reports/" + this.getCore() + ".json";
576 this.downloadFile(report, null, false, { responseType: "text", method: "GET" }).then(async rep => {
577 if (rep === -1 || typeof rep === "string" || typeof rep.data === "string") {

Callers

nothing calls this directly

Calls 4

checkCompressionMethod · 0.95
localizationMethod · 0.95
initGameCoreMethod · 0.95

Tested by

no test coverage detected