2021-01-29 19:17:59 +00:00
|
|
|
# Uxn
|
|
|
|
|
2021-05-01 16:59:57 +00:00
|
|
|
An [8-bit stack-based computer](https://wiki.xxiivv.com/site/uxn.html), written in ANSI C.
|
2021-01-29 19:35:59 +00:00
|
|
|
|
2021-03-23 02:04:31 +00:00
|
|
|
## Build
|
2021-02-12 02:48:45 +00:00
|
|
|
|
2021-05-01 16:59:57 +00:00
|
|
|
To build the Uxn emulator, you must have [SDL2](https://wiki.libsdl.org/) and [Portmidi](http://portmedia.sourceforge.net/portmidi/).
|
2021-02-12 02:48:45 +00:00
|
|
|
|
2021-03-23 02:04:31 +00:00
|
|
|
```sh
|
|
|
|
./build.sh
|
|
|
|
--debug # Add debug flags to compiler
|
|
|
|
--cli # Run rom without graphics
|
2021-02-12 02:48:45 +00:00
|
|
|
```
|
|
|
|
|
2021-03-24 16:39:19 +00:00
|
|
|
## Emulator Controls
|
|
|
|
|
|
|
|
- `ctrl+h` toggle debugger
|
|
|
|
- `alt+h` toggle zoom
|
|
|
|
|
2021-03-12 04:41:35 +00:00
|
|
|
## Uxambly
|
2021-01-29 19:35:59 +00:00
|
|
|
|
2021-03-12 04:41:35 +00:00
|
|
|
Read more in the [Uxambly Guide](https://wiki.xxiivv.com/site/uxambly.html).
|
2021-02-06 18:39:13 +00:00
|
|
|
|
2021-01-29 19:35:59 +00:00
|
|
|
```
|
2021-04-21 16:48:04 +00:00
|
|
|
( dev/console )
|
|
|
|
|
2021-03-16 16:27:51 +00:00
|
|
|
%RTN { JMP2r }
|
|
|
|
|
2021-04-21 16:48:04 +00:00
|
|
|
( devices )
|
|
|
|
|
|
|
|
|10 @Console [ &pad $8 &char $1 ]
|
|
|
|
|
|
|
|
( init )
|
2021-03-21 21:37:39 +00:00
|
|
|
|
2021-04-21 16:48:04 +00:00
|
|
|
|0100 ( -> )
|
2021-02-23 21:49:36 +00:00
|
|
|
|
2021-05-13 15:47:18 +00:00
|
|
|
,hello-word
|
2021-02-05 22:01:34 +00:00
|
|
|
|
2021-04-20 18:32:26 +00:00
|
|
|
&loop
|
2021-05-13 15:47:18 +00:00
|
|
|
( send ) LDRk .Console/char DEO
|
|
|
|
( incr ) #01 ADD
|
|
|
|
( loop ) DUP ,&loop JCN
|
|
|
|
POP
|
|
|
|
|
|
|
|
BRK
|
2021-04-20 18:32:26 +00:00
|
|
|
|
2021-04-21 18:12:42 +00:00
|
|
|
@hello-word "hello 20 "World!
|
2021-01-29 19:35:59 +00:00
|
|
|
```
|
|
|
|
|
2021-02-08 22:49:45 +00:00
|
|
|
## TODOs
|
2021-02-01 19:58:47 +00:00
|
|
|
|
2021-04-03 03:40:53 +00:00
|
|
|
- Shortcut to export/import disk state
|
2021-03-11 20:19:59 +00:00
|
|
|
|
2021-03-08 18:30:13 +00:00
|
|
|
## Palettes
|
|
|
|
|
2021-04-13 18:38:22 +00:00
|
|
|
- `#6a03` `#4a0d` `#aa0c`, purple/cyan
|
|
|
|
- `#a1f3` `#a14d` `#a16c`, grey-pink/teal
|
|
|
|
- `#8c4b` `#884b` `#e8bb`, commodore64
|
2021-03-08 18:30:13 +00:00
|
|
|
|
2021-05-03 22:13:12 +00:00
|
|
|
## Convert audio for Unx
|
|
|
|
|
|
|
|
```sox sub202_C.wav -b 8 -c 1 -e signed output.raw```
|
|
|
|
|
2021-01-30 22:25:48 +00:00
|
|
|
## Refs
|
|
|
|
|
|
|
|
https://code.9front.org/hg/plan9front/file/a7f9946e238f/sys/src/games/nes/cpu.c
|
|
|
|
http://www.w3group.de/stable_glossar.html
|
|
|
|
http://www.emulator101.com/6502-addressing-modes.html
|
|
|
|
http://forth.works/8f0c04f616b6c34496eb2141785b4454
|
2021-02-06 04:18:30 +00:00
|
|
|
https://justinmeiners.github.io/lc3-vm/
|