From ea96d0dff45f6cc20765e49048b73aa2895a9b08 Mon Sep 17 00:00:00 2001 From: Ola Horg Jacobsen Date: Sun, 8 Dec 2024 17:21:09 +0100 Subject: [PATCH 1/4] Unapply dark mode settings to be added later?? --- src/app/globals.css | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 6b717ad..13eaaf6 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -7,13 +7,6 @@ --foreground: #171717; } -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; - } -} - body { color: var(--foreground); background: var(--background); From 3c11712d28229ff10f5c2e7db6876ca39de0f211 Mon Sep 17 00:00:00 2001 From: Ola Horg Jacobsen Date: Sun, 8 Dec 2024 17:25:44 +0100 Subject: [PATCH 2/4] Fix PC going > 65535 --- src/components/emulator/emulator.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/emulator/emulator.tsx b/src/components/emulator/emulator.tsx index faafcb3..ab700f0 100644 --- a/src/components/emulator/emulator.tsx +++ b/src/components/emulator/emulator.tsx @@ -245,9 +245,6 @@ export default function Emulator() { ] for(let step = 0; step < steps; step++) { - if(PC > 65535) - PC = PC - 65536; - if(PC < 0) PC = 65535 + PC + 1 @@ -425,6 +422,10 @@ export default function Emulator() { } PC = didJump ? PC : PC + 1; + + if(PC > 65535) { + PC = PC - 65536; + } } setReg_PC(PC); @@ -721,8 +722,6 @@ export default function Emulator() { const setRegisterSrcDest = (memoryAddr: number, reg: number, type: number) => { ram[memoryAddr] |= parseInt(('000' + reg.toString(2)).slice(-3).split("").reverse().join(""), 2) << (7 + type * 3); - - byteCount += 2; } const findRegisterTokenOffset = (i: number, token: number) => { @@ -797,7 +796,6 @@ export default function Emulator() { immVal = 65536 + immVal; ram[addr++] = immVal; - byteCount += 2; break; } @@ -825,7 +823,6 @@ export default function Emulator() { immVal = 65536 + immVal; ram[addr++] = immVal; - byteCount += 2; } error = false; From 314acbe19a07cbdf3ce9bf8c75c9f89193e9aa10 Mon Sep 17 00:00:00 2001 From: Ola Horg Jacobsen Date: Sun, 8 Dec 2024 17:53:32 +0100 Subject: [PATCH 3/4] Header with breadcrumbs and version information --- src/app/ui/emulator.module.css | 5 +++++ src/components/emulator/emulator.tsx | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/app/ui/emulator.module.css b/src/app/ui/emulator.module.css index b13d63a..89d94f0 100644 --- a/src/app/ui/emulator.module.css +++ b/src/app/ui/emulator.module.css @@ -2,6 +2,11 @@ margin: 1em; } +.versionInfo { + position: absolute; + right: 10px; +} + .paper { margin: 5px; } diff --git a/src/components/emulator/emulator.tsx b/src/components/emulator/emulator.tsx index ab700f0..6f5d579 100644 --- a/src/components/emulator/emulator.tsx +++ b/src/components/emulator/emulator.tsx @@ -1,13 +1,14 @@ "use client"; import { + AppBar, Breadcrumbs, Button, Card, - FormControlLabel, + FormControlLabel, IconButton, Link, Paper, Switch, - TextField, + TextField, Toolbar, Tooltip, Typography } from "@mui/material"; @@ -859,6 +860,18 @@ export default function Emulator() { } return <> + + + + Hackerspace NTNU + Breadboard Computer + Emulator + + + {process.env.BUILD_VERSION ? "v" + process.env.BUILD_VERSION : "v1.081224a"} + + + From 81bf78c92b15854e15200fbd0c32a33fc210b9da Mon Sep 17 00:00:00 2001 From: Ola Horg Jacobsen Date: Sun, 8 Dec 2024 17:57:02 +0100 Subject: [PATCH 4/4] Fix unused import --- src/components/emulator/emulator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/emulator/emulator.tsx b/src/components/emulator/emulator.tsx index 6f5d579..07bef10 100644 --- a/src/components/emulator/emulator.tsx +++ b/src/components/emulator/emulator.tsx @@ -4,7 +4,7 @@ import { AppBar, Breadcrumbs, Button, Card, - FormControlLabel, IconButton, + FormControlLabel, Link, Paper, Switch,