2021-01-29 14:17:59 -05:00
|
|
|
# Uxn
|
|
|
|
|
2021-05-01 12:59:57 -04:00
|
|
|
An [8-bit stack-based computer](https://wiki.xxiivv.com/site/uxn.html), written in ANSI C.
|
2021-01-29 14:35:59 -05:00
|
|
|
|
2021-03-22 22:04:31 -04:00
|
|
|
## Build
|
2021-02-11 21:48:45 -05:00
|
|
|
|
2021-05-01 12:59:57 -04:00
|
|
|
To build the Uxn emulator, you must have [SDL2](https://wiki.libsdl.org/) and [Portmidi](http://portmedia.sourceforge.net/portmidi/).
|
2021-02-11 21:48:45 -05:00
|
|
|
|
2021-03-22 22:04:31 -04:00
|
|
|
```sh
|
|
|
|
./build.sh
|
|
|
|
--debug # Add debug flags to compiler
|
|
|
|
--cli # Run rom without graphics
|
2021-02-11 21:48:45 -05:00
|
|
|
```
|
|
|
|
|
2021-03-24 12:39:19 -04:00
|
|
|
## Emulator Controls
|
|
|
|
|
|
|
|
- `ctrl+h` toggle debugger
|
|
|
|
- `alt+h` toggle zoom
|
|
|
|
|
2021-03-11 23:41:35 -05:00
|
|
|
## Uxambly
|
2021-01-29 14:35:59 -05:00
|
|
|
|
2021-03-11 23:41:35 -05:00
|
|
|
Read more in the [Uxambly Guide](https://wiki.xxiivv.com/site/uxambly.html).
|
2021-02-06 13:39:13 -05:00
|
|
|
|
2021-01-29 14:35:59 -05:00
|
|
|
```
|
2021-04-21 12:48:04 -04:00
|
|
|
( dev/console )
|
|
|
|
|
2021-03-16 12:27:51 -04:00
|
|
|
%RTN { JMP2r }
|
|
|
|
|
2021-04-21 12:48:04 -04:00
|
|
|
( devices )
|
|
|
|
|
|
|
|
|10 @Console [ &pad $8 &char $1 ]
|
|
|
|
|
|
|
|
( init )
|
2021-03-21 17:37:39 -04:00
|
|
|
|
2021-04-21 12:48:04 -04:00
|
|
|
|0100 ( -> )
|
2021-02-23 16:49:36 -05:00
|
|
|
|
2021-05-01 12:59:57 -04:00
|
|
|
;hello-word ,print JSR
|
2021-04-20 14:32:26 -04:00
|
|
|
|
2021-02-13 16:21:05 -05:00
|
|
|
BRK
|
2021-02-05 17:01:34 -05:00
|
|
|
|
2021-04-29 00:00:39 -04:00
|
|
|
@print ( addr* -- )
|
2021-03-11 15:19:59 -05:00
|
|
|
|
2021-04-20 14:32:26 -04:00
|
|
|
&loop
|
2021-04-21 14:12:42 -04:00
|
|
|
( send ) DUP2 GET .Console/char DEO
|
2021-03-11 18:47:28 -05:00
|
|
|
( incr ) #0001 ADD2
|
2021-04-21 13:23:58 -04:00
|
|
|
( loop ) DUP2 GET #00 NEQ ,&loop JNZ
|
2021-02-23 16:49:36 -05:00
|
|
|
POP2
|
2021-03-01 12:38:54 -05:00
|
|
|
|
2021-04-20 14:32:26 -04:00
|
|
|
RTN
|
|
|
|
|
2021-04-21 14:12:42 -04:00
|
|
|
@hello-word "hello 20 "World!
|
2021-01-29 14:35:59 -05:00
|
|
|
```
|
|
|
|
|
2021-02-08 17:49:45 -05:00
|
|
|
## TODOs
|
2021-02-01 14:58:47 -05:00
|
|
|
|
2021-04-02 23:40:53 -04:00
|
|
|
- Shortcut to export/import disk state
|
2021-03-11 15:19:59 -05:00
|
|
|
|
2021-03-08 13:30:13 -05:00
|
|
|
## Palettes
|
|
|
|
|
2021-04-13 14:38:22 -04:00
|
|
|
- `#6a03` `#4a0d` `#aa0c`, purple/cyan
|
|
|
|
- `#a1f3` `#a14d` `#a16c`, grey-pink/teal
|
|
|
|
- `#8c4b` `#884b` `#e8bb`, commodore64
|
2021-03-08 13:30:13 -05:00
|
|
|
|
2021-01-30 17:25:48 -05: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-05 23:18:30 -05:00
|
|
|
https://justinmeiners.github.io/lc3-vm/
|