0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-22 22:05:11 +00:00
uxn/README.md

94 lines
1.5 KiB
Markdown
Raw Normal View History

2021-01-29 19:17:59 +00:00
# Uxn
2021-03-23 02:04:31 +00:00
A [stack-based VM](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-03-23 02:04:31 +00:00
To build the Uxn emulator, you must have [SDL2](https://wiki.libsdl.org/).
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
```
( hello world )
2021-01-30 22:25:48 +00:00
2021-03-16 16:27:51 +00:00
%RTN { JMP2r }
2021-03-21 21:37:39 +00:00
( devices )
|0100 ;Console { pad 8 char 1 byte 1 short 2 }
|0200 ,RESET JMP2
|0204 ,ERROR JMP2
|0208 ,FRAME JMP2
2021-03-21 21:37:39 +00:00
( program )
@RESET
2021-03-11 20:19:59 +00:00
,text1 ,print-label JSR2
,text2 ,print-label JSR2
2021-03-14 01:34:08 +00:00
#ab =Console.byte
#cdef =Console.short
2021-02-08 04:49:00 +00:00
2021-02-13 21:21:05 +00:00
BRK
2021-02-05 22:01:34 +00:00
@print-label ( text )
2021-03-11 20:19:59 +00:00
$loop
( send ) DUP2 PEK2 =Console.char
2021-03-11 23:47:28 +00:00
( incr ) #0001 ADD2
( loop ) DUP2 PEK2 #00 NEQ ^$loop JNZ
POP2
2021-03-01 17:38:54 +00:00
2021-03-14 21:26:17 +00:00
RTN
2021-03-11 23:47:28 +00:00
@text1 [ Welcome 20 to 20 UxnVM 0a00 ]
@text2 [ Hello 20 World 0a00 ]
2021-02-08 04:49:00 +00:00
2021-03-22 19:33:15 +00:00
@FRAME BRK
@ERROR BRK
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-02-26 18:16:35 +00:00
### OS Boot Disk
2021-02-15 01:00:17 +00:00
2021-02-26 18:16:35 +00:00
- Load external disk in disk2
### Assembler
2021-02-15 01:00:17 +00:00
- Includes
- Defines
2021-03-11 03:41:46 +00:00
- Jump helpers
2021-03-22 16:56:33 +00:00
- Implement Peek/Pook to helpers
- Create a theme designer application
- DateTime device
- Document controller.player2
2021-03-14 20:30:17 +00:00
2021-03-11 20:19:59 +00:00
## Notes
2021-03-08 18:30:13 +00:00
## Palettes
- `[ 6a03 4a0d aa0c ]`, purple/cyan
- `[ a1f3 a14d a16c ]`, grey-pink/teal
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/