summary refs log tree commit diff
path: root/runtime.ts
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-04-02 21:50:00 +0300
committerWlodekM <[email protected]>2025-04-02 21:50:00 +0300
commit62de41dbc254298fa207fd5649a90de06f7e02f1 (patch)
tree95309deb7cd72f8d58ba8673bb54aa9b54dd059f /runtime.ts
parentbd5c7ca279addd977623242f3a52dbfd6caf42a8 (diff)
i think it's done
Diffstat (limited to 'runtime.ts')
-rw-r--r--runtime.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/runtime.ts b/runtime.ts
index d74e230..2759b6e 100644
--- a/runtime.ts
+++ b/runtime.ts
@@ -53,13 +53,17 @@ cpu.cycle()
 //the cpu reset, pull RESB high and start execution!
 cpu.io.reset.HI()
 
+const debug = Deno.args.includes('-d')
+
 while (!cpu.io.interruptRequest.high) {
     cpu.cycle();
-    const i = new Uint8Array(8);
-    await Deno.stdin.read(i);
-    if (i[0] == 'b'.charCodeAt(0)) {
-        console.log('BREAK!!')
-        break;
+    if (debug) {
+        const i = new Uint8Array(8);
+        await Deno.stdin.read(i);
+        if (i[0] == 'b'.charCodeAt(0)) {
+            console.log('BREAK!!')
+            break;
+        }
     }
 }