init one line project

This commit is contained in:
Travis Shears 2025-06-27 16:35:07 +02:00
parent 085f014e95
commit 1f4b6008d7
4 changed files with 44 additions and 17 deletions

View file

@ -1,5 +1,8 @@
These are my UXN experiments. These are my UXN experiments.
## One Line
A 88x31 image for my personal site footer. Inspired by [aleteoryx](https://aleteoryx.compost.party/button.html).
## 99 Bottles of beer ## 99 Bottles of beer

0
day_1.tal Normal file
View file

View file

@ -1,18 +1,17 @@
@Log #18 ( hello.tal )
( devices )
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
|0100 LIT "h ;Log DEO ( h ) ( macros )
LIT "e #18 DEO ( e ) ( print a character to standard output )
LIT "l #18 DEO ( l ) %EMIT { .Console/write DEO } ( character -- )
#6c #18 DEO ( l ) ( print a newline )
#6f #18 DEO ( o ) %NL { #0a EMIT } ( -- )
#0a #18 DEO ( newline )
#18s
#19 DUP ( 25 25 ) ( main program )
#0a DIV ( 25 02 ) |0100 LIT "h EMIT
SWP DUP ( 02 25 25 ) LIT "e EMIT
#0a DIV ( 02 25 02 ) LIT "l EMIT
#0a MUL ( 02 25 20 ) LIT "l EMIT
SUB ( 02 05 ) LIT "o EMIT
#30 ADD SWP #30 ADD NL
#18 DEO #18 DEO

25
one_line_canvas.tal Normal file
View file

@ -0,0 +1,25 @@
|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|58 @width
|1f @height
(to run gui: `./run_ui.sh one_line_canvas.tal`)
(to run debugger: `../uxn/bin/uxnasm one_line_canvas.tal one_line_canvas.rom && ../uxn/bin/uxnemu ../beetbug.rom ./one_line_canvas.rom`)
|0100
@on-reset
setup-gui
BRK
@setup-gui ( -- )
(set screen height and width the 3x canvas size)
LIT2 =width #0003 MUL2 .Screen/width DEO2
LIT2 =height #0003 MUL2 .Screen/height DEO2
(set basic color scheme)
#f07f .System/r DEO2
#f0d6 .System/g DEO2
#f0b2 .System/b DEO2
JMP2r