uxn-utils/gui/sixels/sixels.tal

30 lines
558 B
Tal
Raw Normal View History

2023-03-21 00:07:28 -04:00
@draw-sixel ( str* -- str* )
[ LITr -Screen/y ] DEI2r
.Screen/x DEI2 ,&x STR2
INC2
&w
LDAk #21 LTH ?&end
( line feed )
LDAk LIT "- NEQ ?&no-lf
[ LIT2 &x $2 ] .Screen/x DEO2
.Screen/y DEI2k #0006 ADD2 ROT DEO2
INC2 !&w
&no-lf
( pixel )
LDAk LIT "? SUB ,&t STR
is-selected ,&sel STR
.Screen/y DEI2
#0600
&col
DUP #05 NEQ INC .Screen/auto DEO
[ LIT &t $1 ] OVR SFT #01 AND [ LIT &sel $1 ] ADD .Screen/pixel DEO
INC GTHk ?&col
POP2
.Screen/y DEO2
INC2 !&w &end
STH2r .Screen/y DEO2
#15 .Screen/auto DEO
JMP2r