feat: WIP cube
All checks were successful
/ test (push) Successful in 8s

This commit is contained in:
violette 2025-09-13 02:43:27 -04:00
parent cc29759cf8
commit 6fb0a4d3e2
6 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,30 @@
<canvas id="gbaScreen" width="240" height="160" ></canvas>
{{ with resources.Get "js/mgba.js" }}
{{ $wasm := resources.Get "js/mgba.wasm" }}
{{ $cube := resources.Get "js/vi.gba" }}
{{ $wasm_map := resources.Get "js/mgba.wasm.map" }}
<script type="module" async>
import mGBA from {{ .Permalink }}
var Module = {
canvas: (function () {
return document.getElementById("gbaScreen");
})()
};
console.log({{ $wasm_map.Permalink }})
mGBA(Module).then(async function (Module) {
let mGBAVersion =
Module.version.projectName +
' ' +
Module.version.projectVersion;
console.log(mGBAVersion);
Module.FSInit().then(async () => {
let res = await fetch("{{ $cube.Permalink }}");
res = await res.text();
let file = new File([res], "vi.gba");
Module.uploadRom(file, () => console.log(Module.loadGame("vi.gba", undefined)));
});
});
</script>
{{ end }}