uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 7598f40f3086099e40cf5a777515b1444a7424ce
parent 61b8750baed6c7da1740de3f3de3005458d871cd
Author: neauoire <aliceffekt@gmail.com>
Date:   Wed, 25 Aug 2021 15:53:37 -0700

Improved README

Diffstat:
MREADME.md | 45++++++++++++++++++++++++---------------------
Mprojects/examples/devices/audio.tal | 2+-
2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/README.md b/README.md @@ -6,13 +6,26 @@ An assembler and emulator for the [Uxn stack-machine](https://wiki.xxiivv.com/si ### Linux -To build the Uxn emulator, you must have [SDL2](https://wiki.libsdl.org/). +To build the Uxn emulator, you must install [SDL2](https://wiki.libsdl.org/) for your distro. For example: + +```sh +sudo pacman -Sy sdl2 # Arch +sudo apt install libsdl2-dev # Ubuntu +``` + +Build the assembler and emulator by running the `build.sh` script. The assembler(`uxnasm`) and emulator(`uxnemu`) are created in the `/bin` folder. ```sh ./build.sh --debug # Add debug flags to compiler ``` +If you only wish to simply build the `uxncli` cli tool: + +```sh +cc src/uxn.c -DNDEBUG -Os -g0 -s src/uxncli.c -o bin/uxncli +``` + ### Plan 9 To build the Uxn emulator on [9front](http://9front.org/), via [npe](https://git.sr.ht/~ft/npe): @@ -37,39 +50,29 @@ cd uxn ## Getting Started -Begin by building the assembler and emulator by running the build script. The assembler(`uxnasm`) and emulator(`uxnemu`) are created in the `/bin` folder. - -``` -./build.sh -``` - -### Assembler +### Emulator -The following command will create an Uxn-compatible rom from an [uxntal file](https://wiki.xxiivv.com/site/uxntal.html). Point the assembler to a .tal file in `/projects` to assemble a rom. +To launch a `.rom` in the emulator, point the emulator to the target rom file: -``` -bin/uxnasm projects/examples/demos/life.tal bin/life.rom +```sh +bin/uxnemu bin/piano.rom ``` -### Emulator - -To start the rom, point the emulator to the newly created rom: +You can also use the emulator without graphics by using `uxncli`. You can find additional roms [here](https://sr.ht/~rabbits/uxn/sources), you can find prebuilt rom files [here](https://itch.io/c/248074/uxn-roms). -``` -bin/uxnemu bin/life.rom -``` +### Assembler -You can also use the emulator without graphics by using `uxncli`. You can find additional roms [here](https://sr.ht/~rabbits/uxn/sources). If you only wish to build `uxncli` +The following command will create an Uxn-compatible rom from an [uxntal file](https://wiki.xxiivv.com/site/uxntal.html). Point the assembler to a `.tal` file, followed by and the rom name: -``` -cc src/uxn.c -DNDEBUG -Os -g0 -s src/uxncli.c -o bin/uxncli +```sh +bin/uxnasm projects/examples/demos/life.tal bin/life.rom ``` ### I/O You can send events from Uxn to another application, or another instance of uxn, with the Unix pipe. For a companion application that translates notes data into midi, see the [shim](https://git.sr.ht/~rabbits/shim). -``` +```sh uxnemu orca.rom | shim ``` diff --git a/projects/examples/devices/audio.tal b/projects/examples/devices/audio.tal @@ -58,7 +58,7 @@ BRK [ #01 ] NEQk NIP ,&no-up JCN .selection LDZ STHk #00 ;draw-note JSR2 - [ STHkr GET-NOTE #01 ADD ] #00 STHkr ;melody ADD2 STA + [ STHkr GET-NOTE INC ] #00 STHkr ;melody ADD2 STA STHr #01 ;draw-note JSR2 #02 ;draw-selector JSR2 &no-up