generator and source files for the site
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
5.5 KiB

# intro to uxn programming workshop
online workshop to learn the basics of {uxn} programming.
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.
# at babycastles
=> Video recording: Babycastles Academy: Intro to Uxn (yt)
=> magnet:?xt=urn:btih:538f0f7b6cd8a5e5a38dbe1a638ac96aad18701c&dn=Babycastles%20Academy%3A%20Intro%20to%20Uxn%20360p.mp4& Video recording: Babycastles Academy: Intro to Uxn (magnet link)
event info:
=> Babycastles Academy: Intro to Uxn Programming
sunday, november 21, 12021, at 3pm UTC-5 (EST)
# 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.
We will use the learn-uxn website by metasyn, that requires a web browser with javascript enabled:
=> learn-uxn
# outline
## 1) uxn, varvara, and its architecture
* what is uxn, varvara, uxntal?
* varvara computer architecture
=> uxn documentation
=> varvara documentation
=> Unknown Fields Division - Summer 2014 China Cargo ship expedition
=> Rare Earthenware - Unknown Fields
## 2) uxntal basics
* the stack and postfix notation
* {hexadecimal} numbers
* bytes and shorts
* outputs and inputs
## 3) drawing into the screen
* learn-uxn site
* system colors
* uxntal labels
* screen device
* drawing a pixel
=> learn-uxn
## 4) sprite drawing
* designing a sprite
* drawing a sprite
=> 100R - nasu spritesheet editor
## 5) interactivity loop
* draw loop: screen vector
* mouse device
* reading the mouse
* drawing!
## 6) conditional behavior
* flags
* a small conditional example
* more possibilities
## 7) outro
* {uxn tutorial} and more resources!
* {support} babycastles, 100R, and compudanzas!
=> babycastles
=> 100R
# links and resources
## for the workshop
=> learn-uxn by metasyn
=> uxn technical documentation
=> varvara documentation
=> decimal to hexadecimal converter
=> 100R - nasu spritesheet editor
=> uxn source code
=> ./hexadecimal.gmi {hexadecimal}
## and more
=> ./uxn_tutorial.gmi {uxn tutorial}
=> the uxntal opcode manual
=> uxntal cheatsheet
=> uxn repository
=> llllllll forum
=> awesome uxn: awesome things from the community
=> 100R - uxn
irc channel: #uxn on
# 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 )
( 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
( 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 )
&draw ( draw sprite: 4-fg, 5-color1 and alpha )
#45 .Screen/sprite DEO
( sprite data )
@brush 3e7e ffff ffff 7e3c
# support
if you enjoyed this workshop and found it helpful, consider giving us your {support} :)
=> compudanzas on patreon
=> compudanzas on ko-fi