compudanzas/src/intro_to_uxn_programming.gmo

164 lines
5.9 KiB
Plaintext
Raw Permalink Normal View History

2021-11-06 01:37:26 +00:00
# intro to uxn programming workshop
2021-11-22 20:36:17 +00:00
online workshop to learn the basics of {uxn} programming.
2022-01-09 21:25:18 +00:00
in order to dig deeper, you can get and read our {introduction to uxn programming book}!
alternatively, you can check out our {uxn tutorial} online.
2021-11-06 01:37:26 +00:00
2021-11-22 02:38:34 +00:00
# at babycastles
2022-11-21 11:13:54 +00:00
+ <iframe title="Babycastles Academy: Intro to Uxn" src="https://spectra.video/videos/embed/0238e8e4-192a-4abe-9de8-49bc12ec7ac8" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups" width="560" height="315" frameborder="0"></iframe>
=> https://spectra.video/w/1gV9xtPSU6wPHkH4terVDs Video recording: Babycastles Academy: Intro to Uxn (spectra.video)
2021-11-23 02:40:09 +00:00
=> https://www.youtube.com/watch?v=LrNuq_JgaOA Video recording: Babycastles Academy: Intro to Uxn (yt)
=> magnet:?xt=urn:btih:538f0f7b6cd8a5e5a38dbe1a638ac96aad18701c&dn=Babycastles%20Academy%3A%20Intro%20to%20Uxn%20360p.mp4&tr=https%3A%2F%2Fspectra.video%2Ftracker%2Fannounce&ws=https%3A%2F%2Fspectra-prod.us-east-1.linodeobjects.com%2Fstreaming-playlists%2Fhls%2F0238e8e4-192a-4abe-9de8-49bc12ec7ac8%2Fa828b9f5-4458-4179-9fef-5328433849cc-360-fragmented.mp4 Video recording: Babycastles Academy: Intro to Uxn (magnet link)
event info:
2021-11-22 02:38:34 +00:00
=> https://withfriends.co/event/13004513/babycastles_academy_intro_to_uxn_programming Babycastles Academy: Intro to Uxn Programming
sunday, november 21, 12021, at 3pm UTC-5 (EST)
2021-11-06 01:37:26 +00:00
# description
Have you wondered how computers function under layers of abstraction? Are you curious about learning about assembly languages? Would you like to try fun challenges, while getting to know a permacomputing platform? Join us in learning about Uxn!
Uxn is a portable 8-bit virtual computer inspired by forth-machines, capable of running simple tools and games, and programmable in its own unique assembly language called Uxntal.
Uxn is at the core of Varvara computer, a platform for running small audio/visual applications. Varvara has been ported already to several years old and modern computing platforms, like the Gameboy Advance, Nintendo DS, the Playdate, and more.
In this workshop we'll introduce the basic concepts to start programming this computer: its architecture, the programming paradigms of Uxntal, and some low-level aspects that will allow us to create a simple drawing tool!
Pre-requisites: This workshop is best for those with some previous programming experience. However, no previous experience with assembly or low-level computing is needed.
2022-02-10 20:47:52 +00:00
We will use the learn-uxn website by metasyn, that requires a web browser with javascript enabled:
2021-11-06 01:37:26 +00:00
=> https://metasyn.github.io/learn-uxn learn-uxn
2021-11-15 23:40:39 +00:00
# outline
2021-11-20 02:14:32 +00:00
## 1) uxn, varvara, and its architecture
2021-11-15 23:40:39 +00:00
* what is uxn, varvara, uxntal?
* varvara computer architecture
2021-11-20 02:14:32 +00:00
2021-11-21 16:48:34 +00:00
=> https://wiki.xxiivv.com/site/uxn.html uxn documentation
2021-11-20 20:20:16 +00:00
=> https://wiki.xxiivv.com/site/varvara.html varvara documentation
2021-11-21 16:48:34 +00:00
=> https://web.archive.org/web/20210415134117/http://www.unknownfieldsdivision.com/summer2014china-aworldadriftpart02.html Unknown Fields Division - Summer 2014 China Cargo ship expedition
2022-02-10 20:47:52 +00:00
=> https://www.youtube.com/watch?v=YMKJ7S7fKOk Rare Earthenware - Unknown Fields
2021-11-21 16:48:34 +00:00
2021-11-20 02:14:32 +00:00
## 2) uxntal basics
2021-11-15 23:40:39 +00:00
* the stack and postfix notation
2021-11-20 20:20:16 +00:00
* {hexadecimal} numbers
* bytes and shorts
* outputs and inputs
2021-11-20 02:14:32 +00:00
## 3) drawing into the screen
2021-11-20 20:20:16 +00:00
* learn-uxn site
* system colors
2021-11-20 02:14:32 +00:00
* uxntal labels
2021-11-20 20:20:16 +00:00
* screen device
2021-11-15 23:40:39 +00:00
* drawing a pixel
2021-11-20 02:14:32 +00:00
2021-11-20 20:20:16 +00:00
=> https://metasyn.github.io/learn-uxn learn-uxn
2021-11-20 02:14:32 +00:00
## 4) sprite drawing
2021-11-15 23:40:39 +00:00
* designing a sprite
* drawing a sprite
2021-11-20 02:14:32 +00:00
2021-11-20 20:20:16 +00:00
=> https://100r.co/site/nasu.html 100R - nasu spritesheet editor
2021-11-20 02:14:32 +00:00
## 5) interactivity loop
2021-11-20 20:20:16 +00:00
* draw loop: screen vector
* mouse device
2021-11-15 23:40:39 +00:00
* reading the mouse
2021-11-20 20:20:16 +00:00
* drawing!
2021-11-17 03:15:39 +00:00
2021-11-20 02:14:32 +00:00
## 6) conditional behavior
2021-11-17 03:15:39 +00:00
2021-11-20 20:20:16 +00:00
* flags
2021-11-20 02:14:32 +00:00
* a small conditional example
* more possibilities
2021-11-20 20:20:16 +00:00
## 7) outro
* {uxn tutorial} and more resources!
* {support} babycastles, 100R, and compudanzas!
=> https://www.babycastles.com/ babycastles
=> https://100r.co/ 100R
2021-11-20 02:14:32 +00:00
# links and resources
2021-11-17 03:15:39 +00:00
2021-11-20 02:14:32 +00:00
## for the workshop
2021-11-17 03:15:39 +00:00
=> https://metasyn.github.io/learn-uxn/ learn-uxn by metasyn
=> https://wiki.xxiivv.com/site/uxn.html uxn technical documentation
2021-11-20 20:20:16 +00:00
=> https://wiki.xxiivv.com/site/varvara.html varvara documentation
2021-11-20 02:14:32 +00:00
=> https://akkartik.github.io/mu/tutorial/converter.html decimal to hexadecimal converter
=> https://100r.co/site/nasu.html 100R - nasu spritesheet editor
2021-11-21 19:43:32 +00:00
=> https://git.sr.ht/~rabbits/uxn uxn source code
2021-11-20 02:14:32 +00:00
=> ./hexadecimal.gmi {hexadecimal}
2022-02-10 20:47:52 +00:00
## and more
2021-11-20 02:14:32 +00:00
=> ./uxn_tutorial.gmi {uxn tutorial}
2021-11-17 03:15:39 +00:00
=> https://wiki.xxiivv.com/site/uxntal_reference.html the uxntal opcode manual
=> https://wiki.xxiivv.com/site/uxntal_cheatsheet.html uxntal cheatsheet
=> https://git.sr.ht/~rabbits/uxn uxn repository
=> https://llllllll.co/t/uxn-virtual-computer/ llllllll forum
=> https://github.com/hundredrabbits/awesome-uxn awesome uxn: awesome things from the community
2021-11-20 02:14:32 +00:00
=> https://100r.co/site/uxn.html 100R - uxn
2022-06-06 21:11:44 +00:00
=> https://merveilles.town/tags/uxn #uxn in merveilles
2021-11-17 03:15:39 +00:00
2021-11-20 02:14:32 +00:00
# example program
```
( simple drawing tool )
( devices )
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ]
|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ]
( init )
2022-02-10 20:47:52 +00:00
|0100
2021-11-20 02:14:32 +00:00
@on-reset
( set system colors )
#0a6f .System/r DEO2
#05cf .System/g DEO2
#0caf .System/b DEO2
( configure screen device )
;on-frame .Screen/vector DEO2
;brush .Screen/addr DEO2
BRK
@on-frame
( read mouse coordinates )
( and use as screen coordinates )
.Mouse/x DEI2 .Screen/x DEO2
.Mouse/y DEI2 .Screen/y DEO2
( read mouse state and compare for left click )
.Mouse/state DEI
#01 EQU ,&draw JCN ( jump when mouse is pressed )
BRK
&draw ( draw sprite: 4-fg, 5-color1 and alpha )
#45 .Screen/sprite DEO
BRK
( sprite data )
@brush 3e7e ffff ffff 7e3c
```
2021-11-20 02:24:04 +00:00
# support
if you enjoyed this workshop and found it helpful, consider giving us your {support} :)
=> https://www.patreon.com/compudanzas compudanzas on patreon
=> https://ko-fi.com/compudanzas compudanzas on ko-fi