mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
24 lines
826 B
TypeScript
24 lines
826 B
TypeScript
function convertStringVectorToArray(strVector : any) {
|
|
let strArray : string[] = [];
|
|
for(let i = 0; i < strVector.size(); i++) {
|
|
let str = strVector.get(i);
|
|
strArray.push(str);
|
|
}
|
|
strVector.delete();
|
|
return strArray;
|
|
}
|
|
|
|
var main = async function() {
|
|
let factory = require("../../../build_cmake/build_wasm/tools/PsfPlayer/Source/ui_js/PsfPlayer.js");
|
|
let module = await factory();
|
|
module.FS.mkdir("/work");
|
|
module.FS.mount(module.NODEFS, { root: "."}, "/work");
|
|
|
|
let psfArchivePath = "work/psf/Valkyrie Profile (EMU).zophar.zip";
|
|
let psfArchiveFileList = convertStringVectorToArray(module.getPsfArchiveFileList(psfArchivePath));
|
|
|
|
module.ccall("initVm");
|
|
module.loadPsf(psfArchivePath, psfArchiveFileList[0]);
|
|
|
|
console.log("Finished initialization.");
|
|
}();
|