Skip to content

Commit

Permalink
Merge pull request #11 from hackerspace-ntnu/get-ready-deployment
Browse files Browse the repository at this point in the history
Get ready for deployment
  • Loading branch information
Kurumiiw authored Dec 8, 2024
2 parents 0127869 + 81bf78c commit 31bac14
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
7 changes: 0 additions & 7 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
color: var(--foreground);
background: var(--background);
Expand Down
5 changes: 5 additions & 0 deletions src/app/ui/emulator.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
margin: 1em;
}

.versionInfo {
position: absolute;
right: 10px;
}

.paper {
margin: 5px;
}
Expand Down
26 changes: 18 additions & 8 deletions src/components/emulator/emulator.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
"use client";

import {
AppBar, Breadcrumbs,
Button,
Card,
FormControlLabel,
Link,
Paper,
Switch,
TextField,
TextField, Toolbar,
Tooltip,
Typography
} from "@mui/material";
Expand Down Expand Up @@ -245,9 +246,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

Expand Down Expand Up @@ -425,6 +423,10 @@ export default function Emulator() {
}

PC = didJump ? PC : PC + 1;

if(PC > 65535) {
PC = PC - 65536;
}
}

setReg_PC(PC);
Expand Down Expand Up @@ -721,8 +723,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) => {
Expand Down Expand Up @@ -797,7 +797,6 @@ export default function Emulator() {
immVal = 65536 + immVal;

ram[addr++] = immVal;
byteCount += 2;

break;
}
Expand Down Expand Up @@ -825,7 +824,6 @@ export default function Emulator() {
immVal = 65536 + immVal;

ram[addr++] = immVal;
byteCount += 2;
}

error = false;
Expand Down Expand Up @@ -862,6 +860,18 @@ export default function Emulator() {
}

return <>
<AppBar className={styles.header} position={"static"} color="transparent">
<Toolbar variant="dense">
<Breadcrumbs aria-label="breadcrumb">
<Link href={"https://www.hackerspace-ntnu.no"} underline="hover" color="inherit">Hackerspace NTNU</Link>
<Typography color="inherit">Breadboard Computer</Typography>
<Typography color="inherit" sx={{ color: 'text.primary' }}>Emulator</Typography>
</Breadcrumbs>
<Typography variant={"subtitle2"} sx={{ color: 'text.secondary' }} className={styles.versionInfo}>
{process.env.BUILD_VERSION ? "v" + process.env.BUILD_VERSION : "v1.081224a"}
</Typography>
</Toolbar>
</AppBar>
<Grid container className={styles.grid}>
<Grid size={8}>
<Card className={styles.buttons}>
Expand Down

0 comments on commit 31bac14

Please sign in to comment.