Making the repl work
This commit is contained in:
+1
-9
@@ -14,14 +14,6 @@ term.loadAddon(rl)
|
|||||||
term.open(document.getElementsByClassName('terminal')[0])
|
term.open(document.getElementsByClassName('terminal')[0])
|
||||||
term.write('Loading...\r\n')
|
term.write('Loading...\r\n')
|
||||||
|
|
||||||
const handleKey = ({key, domEvent: { key: mnemonic }}) => {
|
|
||||||
if (mnemonic === 'Enter') {
|
|
||||||
console.log(mnemonic)
|
|
||||||
} else {
|
|
||||||
term.write(key)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
init().then(async () => {
|
init().then(async () => {
|
||||||
const cpu = new WasmCPU()
|
const cpu = new WasmCPU()
|
||||||
syms = JSON.parse(NovaForth.symbols()) // Grab the symbol table for the ROM so we can poke things by name
|
syms = JSON.parse(NovaForth.symbols()) // Grab the symbol table for the ROM so we can poke things by name
|
||||||
@@ -69,4 +61,4 @@ function eval4th(cpu, line) {
|
|||||||
cpu.poke24(syms.emit_cursor, 0) // Re-clear the output buffer
|
cpu.poke24(syms.emit_cursor, 0) // Re-clear the output buffer
|
||||||
|
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="terminal"></div>
|
<div class="terminal"></div>
|
||||||
|
<div class="reactRoot"></div>
|
||||||
<div class="instructions">
|
<div class="instructions">
|
||||||
<h2>NovaForth Console</h2>
|
<h2>NovaForth Console</h2>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user