Assemble kernel on client
This commit is contained in:
9
emu.js
9
emu.js
@@ -11,6 +11,7 @@ const RXBUF_SIZE = 32;
|
||||
const PERIPHS_SIZE = 81;
|
||||
|
||||
const POLL_INTERVAL_MS = 20;
|
||||
const DOT_INTERVAL_MS = 120;
|
||||
|
||||
const COLS = 80;
|
||||
const TAB_WIDTH = 8;
|
||||
@@ -50,8 +51,14 @@ class Emulator {
|
||||
document.addEventListener('keydown', (e) => this.handle_keydown(e));
|
||||
window.addEventListener('resize', () => this.handle_resize());
|
||||
|
||||
this.worker = new Worker('boot.js');
|
||||
this.print("Assembling kernel ");
|
||||
const dots = setInterval(() => this.print("."), DOT_INTERVAL_MS);
|
||||
this.worker = new Worker('boot.js', { type: 'module' });
|
||||
this.worker.postMessage(this.mem);
|
||||
this.worker.onmessage = (e) => {
|
||||
clearInterval(dots);
|
||||
this.print(" done\n");
|
||||
};
|
||||
|
||||
fetch('prelude.f')
|
||||
.then(res => res.text())
|
||||
|
||||
Reference in New Issue
Block a user