From 33dd1cb809532e18339b896caf05f342a0d0227a Mon Sep 17 00:00:00 2001 From: zongor Date: Sat, 8 Feb 2025 22:50:46 -0500 Subject: [PATCH] add machine docs, add gitignore --- .gitignore | 49 ++++++++++++++++++++++++++++++ README.md | 3 +- docs/MACHINE.MD | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 docs/MACHINE.MD diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d40e865 --- /dev/null +++ b/.gitignore @@ -0,0 +1,49 @@ +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + diff --git a/README.md b/README.md index 5b6359b..c65eb51 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The universe machine is a Virtual Machine that is intended to create 3D environments (Universes) for video games and/or generic 3d modeling jobs -It is inspired by [uxn](https://wiki.xxiivv.com/site/uxn.html), [var'aq](https://web.archive.org/web/20210913164515/https://www.oocities.org/connorbd/varaq/index.html), [TIS-100](https://www.zachtronics.com/tis-100/), [Dusk os](http://duskos.org/), [Inferno](https://www.inferno-os.org/), and [Plan9](https://plan9.io/plan9/). +It is inspired by [uxn](https://wiki.xxiivv.com/site/uxn.html), [var'aq](https://web.archive.org/web/20210913164515/https://www.oocities.org/connorbd/varaq/index.html), [TIS-100](https://www.zachtronics.com/tis-100/), [the kings crook engine by EMMIR](https://github.com/LMP88959/PL3D-KC) [Dusk os](http://duskos.org/), [Inferno](https://www.inferno-os.org/), and [Plan9](https://plan9.io/plan9/). The universe machine works as a series of stack based virtual cpu's (node) and ram as a simple hashmap (hram) that each have a single stack which are able to communicate with each other using message passing. @@ -10,4 +10,3 @@ The machine code of this node is a series of stack operations which act on the i The authors main implementation of ZUM in written in LUA/C and uses the [SDL2](https://www.libsdl.org/) library to do drawing, sound, and other things. -Others \ No newline at end of file diff --git a/docs/MACHINE.MD b/docs/MACHINE.MD new file mode 100644 index 0000000..2e425d9 --- /dev/null +++ b/docs/MACHINE.MD @@ -0,0 +1,79 @@ +# machine + +I like uxn's idea of it being 16 bit because its 0 to 65535 or -32768 to 32767 which fits in your head nicely. + +## memory + +ideas for memory (ram) is going to be a giant hashmap of some kind, or maybe like picolisp? + +picolisp has 64 bit machine words, a cell is 2 words + +## types + +number (fixed point numbers), symbols (string), cons-pairs (lists) + +0000 0000 0000 0000 0000 0000 0000 0000 + +tfff xxxx yyyy zzzz + +0rgb xxxx yyyy zzzz + +mmrr rggg bbbx xxx xxxy yyyy yyzz zzzzz + +rrrx gggy bbbz xxxx yyyy zzzz + +#### 3 bit rgb + +rgba xxxx xxyy yyyy + +#### 3-3-2 bit rgb + +rrrg ggbb xxxx yyyy + +triangles + +textures + +## devices + +### screen + +default screen is a single 2 triangle square face with a single dynamic texture that can be drawn on it + +### keyboard + +ASCII/UTF8 encoded values + +### mouse/joystick + +Theoretically a modern controller could be mapped into 3 mouse/joystick devices + +A nes controller could be mapped onto 1 mouse/joystick device + +x axis -> J1 -> J2 -> Dpad left/right +y axis -> J1 -> J2 -> Dpad up/down +button 1 -> A -> t1 -> select +button 2 -> B -> t2 -> start +button 3 -> X -> b2 -> "meta button like controller start" +button 4 -> Y -> b2 -> unused + +xxxx yyyy 1234 + +x (4 bits) +y (4 bits) +1 is button 1 pressed? +2 is button 2 pressed? +3 is button 3 pressed? +4 is button 4 pressed? + +### sound/music + +This one is going to be the hardest most likely, but its prolly going to be something like the backend dac for ORCA. + +### network/filesystem + +9p filesystem/network by default. + +Have an easy way to network. + +