Compare commits
No commits in common. "d583605e06836c64c0dcfecfc4a0dc537f7aa3be" and "363821c0fd26c0512ac2a5b5b329c2e347e943b6" have entirely different histories.
d583605e06
...
363821c0fd
|
@ -1,11 +0,0 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
pub fn alert(s: &str);
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn greet(name: &str) {
|
||||
alert(&format!("Hello, {}!", name));
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
[package]
|
||||
name = "nemu-base"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["Antifallobst <antifallobst@systemausfall.org>", "Eric-Paul Ickhorn <atnx@protonmail.com>"]
|
||||
description = "The base layer of NEMU"
|
||||
license = "MIT"
|
||||
repository = "https://git.nerdcult.net/nerdcult/nerdemu"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
wasm-bindgen = "0.2"
|
|
@ -1,11 +0,0 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
pub fn alert(s: &str);
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn greet(name: &str) {
|
||||
alert(&format!("Hello, {}!", name));
|
||||
}
|
47
index.html
47
index.html
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<title>Web-Test | NerdEMU</title>
|
||||
<link rel="stylesheet" href="test.css">
|
||||
</head>
|
||||
<body>
|
||||
<header id="config-button"s>
|
||||
<div class="hamburger" id="configurator-button">
|
||||
<div class="hamburger-slice"></div>
|
||||
<div class="hamburger-slice"></div>
|
||||
<div class="hamburger-slice"></div>
|
||||
<div>
|
||||
|
||||
</header>
|
||||
|
||||
<div id="configurator-modal">
|
||||
<div id="configurator-modal-background"></div>
|
||||
|
||||
<div id="configurator-modal-foreground">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main>
|
||||
|
||||
<p id="output-title">The NerdEMU Emulator</p>
|
||||
|
||||
<canvas class="pixel-output"></canvas>
|
||||
|
||||
</main>
|
||||
</body>
|
||||
|
||||
<script src="test.js"></script>
|
||||
<script type="module">
|
||||
import init, { greet } from "./base/pkg/nemu_base.js";
|
||||
|
||||
init().then(() => {
|
||||
greet("NerdEMU");
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "i8086",
|
||||
"version": "0.0",
|
||||
|
||||
"architecture": "x86"
|
||||
}
|
134
test.css
134
test.css
|
@ -1,134 +0,0 @@
|
|||
|
||||
* {
|
||||
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
html, body {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: #1a2b40;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
main {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
header {
|
||||
|
||||
position: fixed;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
z-index: 10;
|
||||
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-bottom-left-radius: 12px;
|
||||
|
||||
background-color: #0f141b;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.hamburger {
|
||||
|
||||
margin-bottom: 2px;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hamburger-slice {
|
||||
|
||||
margin: 3px;
|
||||
|
||||
width: 75%;
|
||||
height: 6px;
|
||||
|
||||
background-color: #ffffff;
|
||||
border-radius: 2.5px;
|
||||
}
|
||||
|
||||
.pixel-output {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#config-button {
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
.pixel-output {
|
||||
|
||||
z-index: 2;
|
||||
width: 60vw;
|
||||
max-height: 90vh;
|
||||
|
||||
/*So it's always a 16/9 aspect ratio */
|
||||
height: calc(60vw*0.5625);
|
||||
background-color: #000000;
|
||||
box-shadow: 0px 0px 8px 8px #0f141b55;
|
||||
}
|
||||
|
||||
#output-title {
|
||||
|
||||
padding-bottom: 20px;
|
||||
|
||||
font-size: 32px;
|
||||
font-weight: 1000;
|
||||
}
|
||||
|
||||
#configurator-modal {
|
||||
|
||||
position: fixed;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
display: none;
|
||||
z-index: 4;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#configurator-modal-background {
|
||||
|
||||
position: fixed;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
z-index: 5;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: #0f141bb0;
|
||||
}
|
||||
|
||||
#configurator-modal-foreground {
|
||||
|
||||
position: fixed;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
z-index: 6;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
19
test.js
19
test.js
|
@ -1,19 +0,0 @@
|
|||
|
||||
var configuratorButton = document.getElementById("configurator-button");
|
||||
var configuratorModal = document.getElementById("configurator-modal");
|
||||
configuratorButton.onclick = onConfiguratorButtonClick;
|
||||
|
||||
var isConfiguratorShown = false;
|
||||
function onConfiguratorButtonClick(event) {
|
||||
|
||||
if(isConfiguratorShown == false) {
|
||||
configuratorModal.style.display = "block";
|
||||
isConfiguratorShown = true;
|
||||
console.log("Showing Configurator-Modal!");
|
||||
return;
|
||||
}
|
||||
configuratorModal.style.display = "none";
|
||||
isConfiguratorShown = false;
|
||||
console.log("Hiding Configurator-Modal!");
|
||||
}
|
||||
|
|
@ -1,12 +1,14 @@
|
|||
[package]
|
||||
name = "nemu-arch-x86"
|
||||
name = "nemu"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["Antifallobst <antifallobst@systemausfall.org>", "Eric-Paul Ickhorn <atnx@protonmail.com>"]
|
||||
description = "The x86 implementation of NEMU"
|
||||
description = "A small web emulator for simple architectures"
|
||||
license = "MIT"
|
||||
repository = "https://git.nerdcult.net/nerdcult/nerdemu"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
|
@ -1,14 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
nemu_build() {
|
||||
echo " --> Building nemu-base"
|
||||
wasm-pack build base --target web
|
||||
|
||||
|
||||
echo " --> Building nemu-arch-x86"
|
||||
wasm-pack build architectures/x86 --target web
|
||||
echo " --> Building NerdEMU"
|
||||
wasm-pack build --target web
|
||||
}
|
||||
|
||||
nemu_run(){
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>test</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module">
|
||||
import init, { greet } from "./pkg/nemu.js";
|
||||
init().then(() => {
|
||||
greet("NerdEMU");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,10 @@
|
|||
// The NerdEMU - emulator | This software is protected under the MIT-license
|
||||
// Copyright 2023: [The Original NerdEMU-Authors] as seen on:
|
||||
// (nerdcult.net/projects/nerdemu/ OR git.nerdcult.net/nerdcult/nerdemu)
|
||||
|
||||
// x86/src/i8086.rs: The emulation code for the i8086 - microprocessor
|
||||
// and a basic mainbus which connects it to the memory and other simple
|
||||
// devices.
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
// The NerdEMU - emulator | This software is protected under the MIT-license
|
||||
// Copyright 2023: [The Original NerdEMU-Authors] as seen on:
|
||||
// (nerdcult.net/projects/nerdemu/ OR git.nerdcult.net/nerdcult/nerdemu)
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
pub fn alert(s: &str);
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn greet(name: &str) {
|
||||
alert(&format!("Hello, {}!", name));
|
||||
}
|
||||
|
Reference in New Issue