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

Method loadPpssppAssets

data/src/GameManager.js:344–375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

342 return (fileNames.length === 1) ? baseFileName + "-0.cue" : baseFileName + ".m3u";
343 }
344 loadPpssppAssets() {
345 return new Promise(resolve => {
346 this.EJS.downloadFile("cores/ppsspp-assets.zip", null, false, { responseType: "arraybuffer", method: "GET" }).then((res) => {
347 this.EJS.checkCompression(new Uint8Array(res.data), this.EJS.localization("Decompress Game Data")).then((pspassets) => {
348 if (pspassets === -1) {
349 this.EJS.textElem.innerText = this.localization("Network Error");
350 this.EJS.textElem.style.color = "red";
351 return;
352 }
353 this.mkdir("/PPSSPP");
354
355 for (const file in pspassets) {
356 const data = pspassets[file];
357 const path = "/PPSSPP/" + file;
358 const paths = path.split("/");
359 let cp = "";
360 for (let i = 0; i < paths.length - 1; i++) {
361 if (paths[i] === "") continue;
362 cp += "/" + paths[i];
363 if (!this.FS.analyzePath(cp).exists) {
364 this.FS.mkdir(cp);
365 }
366 }
367 if (!path.endsWith("/")) {
368 this.FS.writeFile(path, data);
369 }
370 }
371 resolve();
372 })
373 });
374 })
375 }
376 setVSync(enabled) {
377 this.functions.setVSync(enabled);
378 }

Callers 1

downloadFilesMethod · 0.80

Calls 5

mkdirMethod · 0.95
downloadFileMethod · 0.80
checkCompressionMethod · 0.80
localizationMethod · 0.80
writeFileMethod · 0.80

Tested by

no test coverage detected