diff --git a/webassembly/main.js b/webassembly/main.js index 1f68c26..7db8d45 100644 --- a/webassembly/main.js +++ b/webassembly/main.js @@ -73,6 +73,10 @@ var manifest_link = url.searchParams.get("manifest"); var ram_val = url.searchParams.get("ram"); var cpu_val = url.searchParams.get("cpu"); var mhz_val = url.searchParams.get("mhz"); +var lang_val = url.searchParams.get("keymap"); +var diag = url.searchParams.get("longpwron"); +var wide = url.searchParams.get("widescreen"); +var capture = url.searchParams.get("capture"); var emuArguments = ['-keymap', lang, '-rtc']; @@ -80,12 +84,25 @@ if (ram_val) { emuArguments.push('-ram', ram_val); } if (cpu_val) { - if (cpu_val == 'c816') + if (cpu_val == 'c816') { emuArguments.push('-c816'); + } } if (mhz_val) { emuArguments.push('-mhz', mhz_val); } +if (lang_val) { + emuArguments.push('-keymap', lang_val); +} +if (diag != null) { + emuArguments.push('-longpwron'); +} +if (wide != null) { + emuArguments.push('-widescreen'); +} +if (capture != null) { + emuArguments.push('-capture'); +} if (manifest_link) { openFs(); @@ -310,6 +327,36 @@ function extractManifestFromBuffer(zip) { console.log("Parsed manifest from zip:") console.log(manifestObject); + if (manifestObject.ram) { + console.log('Found RAM amount: '+manifestObject.ram); + emuArguments.push('-ram', manifestObject.ram); + } + if (manifestObject.cpu) { + console.log('Found CPU type: '+manifestObject.cpu); + if (manifestObject.cpu == 'c816') + emuArguments.push('-c816'); + } + if (manifestObject.mhz) { + console.log('Found mhz variable: '+manifestObject.mhz); + emuArguments.push('-mhz', manifestObject.mhz); + } + if (manifestObject.keymap) { + console.log('Found keymap variable: '+manifestObject.keymap); + emuArguments.push('-keymap', manifestObject.keymap); + } + if (manifestObject.longpwron) { + console.log('Found longpwron variable'); + emuArguments.push('-longpwron'); + } + if (manifestObject.widescreen) { + console.log('Found widescreen variable'); + emuArguments.push('-widescreen'); + } + if (manifestObject.capture) { + console.log('Found capture variable'); + emuArguments.push('-capture'); + } + const promises = []; if (manifestObject.resources) { console.log('Found resources section in manifest.');