README.md (3954B)
1 # Uxn 2 3 An assembler and emulator for the [Uxn stack-machine](https://wiki.xxiivv.com/site/uxn.html), written in ANSI C. 4 5 ## Download binaries 6 7 Binaries are available for 64-bit x86 computers running [Linux](https://drive.100r.co/uxn/uxn-essentials-lin64.tar.gz), [Windows](https://drive.100r.co/uxn/uxn-essentials-win64.zip) and [macOS](https://drive.100r.co/uxn/uxn-essentials-mac64.tar.gz). 8 9 ## Build 10 11 ### Linux/OS X 12 13 To build the Uxn emulator, you must install [SDL2](https://wiki.libsdl.org/) for your distro. If you are using a package manager: 14 15 ```sh 16 sudo pacman -Sy sdl2 # Arch 17 sudo apt install libsdl2-dev # Ubuntu 18 sudo xbps-install SDL2-devel # Void Linux 19 brew install sdl2 # OS X 20 ``` 21 22 Build the assembler and emulator by running the `build.sh` script. The assembler(`uxnasm`) and emulator(`uxnemu`) are created in the `./bin` folder. 23 24 ```sh 25 ./build.sh 26 --debug # Add debug flags to compiler 27 --format # Format source code 28 --install # Copy to ~/bin 29 ``` 30 31 If you wish to build the emulator without graphics mode: 32 33 ```sh 34 cc src/devices/datetime.c src/devices/system.c src/devices/console.c src/devices/file.c src/uxn.c -DNDEBUG -Os -g0 -s src/uxncli.c -o bin/uxncli 35 ``` 36 37 ### Plan 9 38 39 To build and install the Uxn emulator on [9front](http://9front.org/), via [npe](https://git.sr.ht/~ft/npe): 40 41 ```rc 42 mk install 43 ``` 44 45 If the build fails on 9front because of missing headers or functions, try again after `rm -r /sys/include/npe`. 46 47 ### Windows 48 49 Uxn can be built on Windows with [MSYS2](https://www.msys2.org/). Install by downloading from their website or with Chocolatey with `choco install msys2`. In the MSYS shell, type: 50 51 ```sh 52 pacman -S git mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-SDL2 53 export PATH="${PATH}:/mingw64/bin" 54 git clone https://git.sr.ht/~rabbits/uxn 55 cd uxn 56 ./build.sh 57 ``` 58 59 If you'd like to work with the Console device in `uxnemu.exe`, run `./build.sh --console` instead: this will bring up an extra window for console I/O unless you run `uxnemu.exe` in Command Prompt or PowerShell. 60 61 ## Getting Started 62 63 ### Emulator 64 65 To launch a `.rom` in the emulator, point the emulator to the target rom file: 66 67 ```sh 68 bin/uxnemu bin/piano.rom 69 ``` 70 71 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). 72 73 ### Assembler 74 75 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: 76 77 ```sh 78 bin/uxnasm projects/examples/demos/life.tal bin/life.rom 79 ``` 80 81 ### I/O 82 83 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). 84 85 ```sh 86 uxnemu orca.rom | shim 87 ``` 88 89 ## GUI Emulator Options 90 91 - `-2x` Force medium scale 92 - `-3x` Force large scale 93 - `-f` Force fullscreen mode 94 - `--` Force next argument to be read as ROM name. (This is useful if your ROM file is named `-v`, `-2x`, and so forth.) 95 96 ## GUI Emulator Controls 97 98 - `F1` toggle zoom 99 - `F2` toggle debug 100 - `F3` capture screen 101 - `F4` reboot 102 - `F5` soft reboot 103 - `F11` toggle fullscreen 104 - `F12` toggle decorations 105 106 ### GUI Buttons 107 108 - `LCTRL` A 109 - `LALT` B 110 - `LSHIFT` SEL 111 - `HOME` START 112 113 ## Need a hand? 114 115 The following resources are a good place to start: 116 117 * [XXIIVV — uxntal](https://wiki.xxiivv.com/site/uxntal.html) 118 * [XXIIVV — uxntal reference](https://wiki.xxiivv.com/site/uxntal_reference.html) 119 * [compudanzas — uxn tutorial](https://compudanzas.net/uxn_tutorial.html) 120 * [Fediverse — #uxn tag](https://merveilles.town/tags/uxn) 121 122 ## Contributing 123 124 Submit patches using [`git send-email`](https://git-send-email.io/) to the [~rabbits/public-inbox mailing list](https://lists.sr.ht/~rabbits/public-inbox).