From 7598f40f3086099e40cf5a777515b1444a7424ce Mon Sep 17 00:00:00 2001 From: neauoire Date: Wed, 25 Aug 2021 15:53:37 -0700 Subject: [PATCH] Improved README --- README.md | 45 +++++++++++++++-------------- projects/examples/devices/audio.tal | 2 +- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 9c510af..e12d91d 100644 --- 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. +### Emulator +To launch a `.rom` in the emulator, point the emulator to the target rom file: + +```sh +bin/uxnemu bin/piano.rom ``` -./build.sh -``` + +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). ### Assembler -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. +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: -``` +```sh bin/uxnasm projects/examples/demos/life.tal bin/life.rom ``` -### Emulator - -To start the rom, point the emulator to the newly created rom: - -``` -bin/uxnemu bin/life.rom -``` - -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` - -``` -cc src/uxn.c -DNDEBUG -Os -g0 -s src/uxncli.c -o bin/uxncli -``` - ### 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 index 86f0bf4..644b99b 100644 --- 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