mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-28 14:05:15 +02:00
add filter options
This commit is contained in:
parent
de6e0ffd4c
commit
27ab01fd1d
4 changed files with 40 additions and 45 deletions
|
|
@ -8,7 +8,7 @@ import { join } from 'path';
|
|||
|
||||
// DO NOT RUN THIS IN ANY PRODUCTION ENVIRONMENT EVER
|
||||
const server = createServer((req, res) => {
|
||||
console.log(`reuqest? ${req.url}`);
|
||||
console.log(`get ${req.url}`);
|
||||
if (req.url === '/') {
|
||||
// https://developer.mozilla.org/en-US/docs/WebAssembly/Guides/Loading_and_running
|
||||
// If your browser doesn't support fetch... HAHA GET FUCKED
|
||||
|
|
@ -22,40 +22,41 @@ const server = createServer((req, res) => {
|
|||
<head>
|
||||
<title>eden-cli</title>
|
||||
</head>
|
||||
<body style="margin:0;padding:0;background-color:black;font-family:Monospace,Tahoma,Arial;">
|
||||
<body style="margin:0;padding:0;background-color:black;font-family:Monospace,Tahoma,Arial;width:100%;height:100%;">
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:2px;width:100%;height:100%;">
|
||||
<canvas id="canvas" oncontextmenu="event.preventDefault()" style="width:100%;height:100%;background-color:gray;"></canvas>
|
||||
<div id="tty-stdout"></div>
|
||||
</div>
|
||||
<script>
|
||||
var Module = { //do not prepend var
|
||||
mainScriptUrlOrBlob: 'eden-cli.js',
|
||||
arguments: ['--null-render', '-F', '*:Trace', 'game.nro'],
|
||||
canvas: document.getElementById('canvas'),
|
||||
print: (e) => {
|
||||
e = e.replace('[1;31m', '<span style="color:red;font-weight:bold;">');
|
||||
e = e.replace('[0;37m', '<span style="color:white;font-weight:bold;">');
|
||||
e = e.replace('[1;35m', '<span style="color:pink;font-weight:bold;">');
|
||||
e = e.replace('[1;33m', '<span style="color:yellow;font-weight:bold;">');
|
||||
e = e.replace('[0m', '</span>');
|
||||
tty_stdout.innerHTML += \`\${e}</br>\`;
|
||||
document.getElementById('tty-stdout').innerHTML += \`\${e}</br>\`;
|
||||
},
|
||||
printErr: (e) => {
|
||||
tty_stdout.innerHTML += \`<span style="color:red">\${e}</span></br>\`;
|
||||
document.getElementById('tty-stdout').innerHTML += \`<span style="color:red">\${e}</span></br>\`;
|
||||
},
|
||||
// not a wasm func but idc
|
||||
printInternal: (e) => {
|
||||
tty_stdout.innerHTML += \`<span style="color:pink">Internal WASM: \${e}</span></br>\`;
|
||||
document.getElementById('tty-stdout').innerHTML += \`<span style="color:white">Internal WASM: \${e}</span></br>\`;
|
||||
},
|
||||
onRuntimeInitialized: () => { Module.printInternal("runtime ok"); },
|
||||
setStatus: (e) => { Module.printInternal(e); },
|
||||
monitorRunDependencies: (e) => { Module.printInternal("monitor deps: " + e); },
|
||||
__wasm_call_ctors: () => { Module.printInternal("ctors beep"); },
|
||||
};
|
||||
var tty_stdout = document.createElement('div');
|
||||
document.body.appendChild(tty_stdout);
|
||||
Module.arguments = ['--null-render', 'game.nro'];
|
||||
|
||||
var gameNroFileBuffer = {};
|
||||
|
||||
Module.printInternal("Atomics: " + window.Atomics);
|
||||
Module.printInternal("SharedArrayBuffer: " + window.SharedArrayBuffer);
|
||||
Module.printInternal(\`Atomics: \${window.Atomics}, SharedArrayBuffer: \${window.SharedArrayBuffer}\`);
|
||||
Module.printInternal("trying to load script (if it hangs here check console)");
|
||||
|
||||
fetch('game.nro').then((resp) => {
|
||||
if (!resp.ok)
|
||||
throw Error(\`\${resp.status}\`);
|
||||
|
|
@ -65,7 +66,7 @@ fetch('game.nro').then((resp) => {
|
|||
Module.printInternal("buffer: " + gameNroFileBuffer);
|
||||
|
||||
// load the thingy AFTER loading the nro
|
||||
Module.printInternal(\`loading from ${build_dir}\${Module.mainScriptUrlOrBlob}\`);
|
||||
Module.printInternal(\`loading from ${build_dir}/\${Module.mainScriptUrlOrBlob}\`);
|
||||
var script = document.createElement('script');
|
||||
script.src = '/eden-cli.js';
|
||||
script.onload = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue