From de9ab028b5ad9b943bd0cbbb03ec91d60a46f98a Mon Sep 17 00:00:00 2001 From: zongor Date: Sat, 25 Oct 2025 12:57:14 -0700 Subject: [PATCH] Dark mode for web, documentation updates --- README.org | 10 +- src/arch/emscripten/main.c | 6 +- src/arch/emscripten/shell_minimal.html | 147 +++++++++++++++++++++++++ test/paint.asm.lisp | 4 +- 4 files changed, 157 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index 10f6d5b..266ec69 100644 --- a/README.org +++ b/README.org @@ -25,7 +25,7 @@ It runs on the =Reality Engine=, a VM written in freestanding C89, has a CISC li * Philosophy -Undâr it conforms to permacomputing principles. +Undâr conforms to permacomputing principles. "permacomputing encourages the maximization of hardware lifespan, minimization of energy usage and focuses on the use of already available computational resources. it values maintenance and refactoring of systems to keep them efficient, instead of planned obsolescence, permacomputing practices planned longevity. @@ -34,7 +34,7 @@ it is about using computation only when it has a strengthening effect on ecosyst Undâr is designed to ensure that programs created today will remain executable for a very long time, even through technological collapse. This is achieved through: -- A standardized bytecode format that maps 1:1 to human-readable assembly (Sċieppan) +- A standardized bytecode format that maps 1:1 to human-readable assembly - A VM specification that can be implemented easily - Hardware abstractions for the VM implementation - ROM files that contain all necessary information for execution @@ -125,8 +125,8 @@ values passed to functions must be explicitly returned to propagate. heap values **Core Types** -| Type | Description | -|------+-------------------------------------------| +| Type | Description | +|--------+-------------------------------------------| | =int= | 32-bit signed integer | | =nat= | 32-bit natural number | | =real= | Q16.16 fixed-point real number | @@ -141,7 +141,7 @@ primitive types like int, nat, real, etc. will always be safe to change in child * Roadmap -[[./ROADMAP.org][Coroutines, Compiler, Memory Refactor, Plex, Immidate mode GUI, Constructive solid geometry, tunnels]] +[[./ROADMAP.org][Compiler, Plex, Immidate mode GUI, Constructive solid geometry, Tunnels, Actor model]] * License diff --git a/src/arch/emscripten/main.c b/src/arch/emscripten/main.c index 93aed84..8d454c9 100644 --- a/src/arch/emscripten/main.c +++ b/src/arch/emscripten/main.c @@ -92,7 +92,7 @@ void mainloop() { // Run VM for a fixed number of cycles or a time slice int cycles_this_frame = 0; - int max_cycles_per_frame = 1000; // Adjust this value + int max_cycles_per_frame = 2000; // Adjust this value while (cycles_this_frame < max_cycles_per_frame) { if (!step_vm(&vm)) { emscripten_cancel_main_loop(); @@ -180,9 +180,9 @@ int main(int argc, char **argv) { mouse_data.size = 16; // Register devices - vm_register_device(&vm, "/dev/screen/0", "screen", &screen_data, + vm_register_device(&vm, "/dev/screen/0", "screen", &screen_data, &screen_ops, 16 + screen_data.buffer_size); - vm_register_device(&vm, "/dev/mouse/0", "mouse", &mouse_data, &mouse_ops, + vm_register_device(&vm, "/dev/mouse/0", "mouse", &mouse_data, &mouse_ops, mouse_data.size); vm_register_device(&vm, "/dev/term/0", "terminal", &console_data, &console_device_ops, 4); diff --git a/src/arch/emscripten/shell_minimal.html b/src/arch/emscripten/shell_minimal.html index 988746e..8a8c6db 100644 --- a/src/arch/emscripten/shell_minimal.html +++ b/src/arch/emscripten/shell_minimal.html @@ -44,6 +44,153 @@ to {transform: rotate(360deg);} } + * { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; + line-height: 1.6; + color: #ddd; + background: black; + padding: 0; + margin: 0; + } + + main { + max-width: 700px; + margin: 0 auto; + padding: 1.5rem; + } + + header { + background: #111; + padding: 1rem 1.5rem; + border-bottom: 1px solid #222; + text-align: center; + } + + header h1 { + font-size: 1.5rem; + font-weight: 600; + color: #ddd; + } + + nav a { + color: #ddd; + padding: 12px 15px; + text-decoration: none; + text-align: center; + cursor: pointer; + transition: all 0.3s ease; + flex-grow: 1; + } + + nav a:hover { + background-color: #1b1b1b; + } + + a { + color: #ddd; + } + + textarea { + background: #111; + padding: 1rem 1.5rem; + border-top: 1px solid #222; + text-align: center; + margin-top: 2rem; + font-size: 0.9rem; + color: #ddd; + } + + p { + margin-bottom: 1.25rem; + } + + code { + font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; + background-color: #1a1a1a; + padding: 0.2em 0.4em; + border-radius: 3px; + font-size: 0.9em; + } + + pre { + background: #262620; + color: #f8f8f2; + padding: 1rem; + border-radius: 5px; + overflow-x: auto; + margin: 1.5rem 0; + font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; + font-size: 0.95rem; + line-height: 1.5; + } + + pre code { + background: transparent; + padding: 0; + font-size: 1em; + color: #f8f8f2; + } + + @media (min-width: 768px) { + main { + padding: 2rem; + } + + header h1 { + font-size: 2rem; + } + } + + @media (prefers-color-scheme: light) { + body { + background-color: white; + color: black; + } + + header { + background: #ddd; + color: black; + } + + a { + color: black; + } + + nav a { + color: black; + } + + nav a:hover { + background-color: #eee; + color: black; + } + + main { + background-color: white; + } + + + pre { + background-color: #f5f5f5; + border: 1px solid #ddd; + } + + pre code { + color: #333; + } + + + textarea { + background: #ddd; + } + } + diff --git a/test/paint.asm.lisp b/test/paint.asm.lisp index faf2863..44c617d 100644 --- a/test/paint.asm.lisp +++ b/test/paint.asm.lisp @@ -4,7 +4,7 @@ ; use load immediate because it is a pointer to a string, not a value (load-immediate $0 &screen-namespace) (load-immediate $11 0) - (syscall OPEN $18 $0 $11) ; open(out Plex screen, in namespace, in flags) + (syscall OPEN $18 $0 $11) ; Screen screen = open(namespace, flags) (load-offset-32 $0 $18 4) ; load handle (load-offset-32 $20 $18 8) ; load width @@ -14,7 +14,7 @@ ; open mouse (load-immediate $16 &mouse-namespace) - (syscall OPEN $15 $16 $11) ; open(out Plex mouse, in namespace, in flags) + (syscall OPEN $15 $16 $11) ; Mouse mouse = open(namespace, flags) (load-offset-32 $16 $15 4) ; load handle