2022-04-05 14:42:50 -04:00
# Uxn11
2022-03-26 20:23:52 -04:00
2022-03-27 00:07:01 -04:00
An emulator for the [Uxn stack-machine ](https://wiki.xxiivv.com/site/uxn.html ), written in ANSI C.
2022-03-26 20:23:52 -04:00
2022-04-05 23:06:42 -04:00
## Building
### Graphical
2022-03-27 00:07:01 -04:00
All you need is X11.
2022-04-05 23:06:42 -04:00
```sh
2023-08-08 20:00:48 -04:00
gcc -Os -DNDEBUG -g0 -s src/uxn.c src/devices/system.c src/devices/console.c src/devices/screen.c src/devices/controller.c src/devices/mouse.c src/devices/file.c src/devices/datetime.c src/uxn11.c -o bin/uxn11 -lX11
2022-03-27 00:07:01 -04:00
```
2022-04-05 23:06:42 -04:00
### Terminal
2022-03-27 00:07:01 -04:00
2022-03-26 21:32:46 -04:00
If you wish to build the emulator without graphics mode:
```sh
2023-08-08 20:00:48 -04:00
gcc -Os -DNDEBUG -g0 -s src/uxn.c src/devices/system.c src/devices/console.c src/devices/file.c src/devices/datetime.c src/uxncli.c -o bin/uxncli
2022-03-26 21:32:46 -04:00
```
2023-06-08 14:17:47 -04:00
If do not wish to build it yourself, you can download linux binaries for [uxnasm ](https://rabbits.srht.site/uxn11/bin/uxnasm ), [uxncli ](https://rabbits.srht.site/uxn11/bin/uxncli ) and [uxn11 ](https://rabbits.srht.site/uxn11/bin/uxn11 ).
2023-06-08 14:11:52 -04:00
[![builds.sr.ht status ](https://builds.sr.ht/~rabbits/uxn11.svg )](https://builds.sr.ht/~rabbits/uxn11?)
2022-04-06 15:38:34 -04:00
## Usage
The first parameter is the rom file, the subsequent arguments will be accessible to the rom, via the [Console vector ](https://wiki.xxiivv.com/site/varvara.html#console ).
2022-04-05 23:06:42 -04:00
```sh
2022-04-06 15:38:34 -04:00
bin/uxnemu bin/polycat.rom arg1 arg2
2022-04-05 23:06:42 -04:00
```
2022-03-27 11:46:50 -04:00
## Devices
2022-06-21 12:04:37 -04:00
The file device is _sandboxed_ , meaning that it should not be able to read or write outside of the working directory.
2022-03-27 11:46:50 -04:00
- `00` system
2022-04-05 22:31:53 -04:00
- `10` console
2022-03-28 12:51:38 -04:00
- `20` screen
2022-03-28 12:39:05 -04:00
- `80` controller
2022-04-05 22:31:53 -04:00
- `90` mouse
2023-08-08 20:00:48 -04:00
- `a0` file
2022-03-27 11:46:50 -04:00
- `c0` datetime
2022-04-05 23:06:42 -04:00
## Emulator Controls
2023-08-08 20:00:48 -04:00
- `F2` toggle on-screen debugger
2022-06-13 14:14:17 -04:00
- `F4` load boot.rom, or reload rom
2022-04-05 23:06:42 -04:00
### Buttons
- `LCTRL` A
- `LALT` B
- `LSHIFT` SEL
- `HOME` START
## Need a hand?
The following resources are a good place to start:
* [XXIIVV — uxntal ](https://wiki.xxiivv.com/site/uxntal.html )
* [XXIIVV — uxntal reference ](https://wiki.xxiivv.com/site/uxntal_reference.html )
* [compudanzas — uxn tutorial ](https://compudanzas.net/uxn_tutorial.html )
2022-03-26 20:23:52 -04:00
## Contributing
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 ).