(sixels) Added RLE rune
This commit is contained in:
parent
a7f873ec11
commit
12ef82bdf8
|
@ -19,12 +19,31 @@
|
|||
[ LIT2 02 -Screen/auto ] DEO
|
||||
.Screen/x DEI2 ,&anchor STR2
|
||||
&w ( -- )
|
||||
LDAk [ LIT "- ] NEQ ?{
|
||||
[ LIT2 &anchor $2 ] .Screen/x DEO2
|
||||
.Screen/y DEI2k #0006 ADD2 ROT DEO2
|
||||
!& }
|
||||
LDAk [ LIT "? ] SUB ,&t STR
|
||||
#0600
|
||||
LDAk [ LIT "$ ] EQU ?&op-over
|
||||
LDAk [ LIT "- ] EQU ?&op-line
|
||||
LDAk [ LIT "! ] EQU ?&op-rle
|
||||
LDAk [ LIT "? ] SUB <draw-sixels>/op-col
|
||||
& INC2 LDAk ?&w
|
||||
POP2 JMP2r
|
||||
&op-line ( -- )
|
||||
.Screen/y DEI2k #0006 ADD2 ROT DEO2
|
||||
&op-over ( -- )
|
||||
[ LIT2 &anchor $2 ] .Screen/x DEO2
|
||||
!&
|
||||
|
||||
@<draw-sixels>/op-rle ( addr* -- addr* )
|
||||
( rune ) INC2
|
||||
( length ) sdec
|
||||
( target ) OVR2 LDA ,&t STR
|
||||
#0000
|
||||
&l ( -- )
|
||||
[ LIT &t $1 ] <draw-sixels>/op-col
|
||||
INC2 GTH2k ?&l
|
||||
POP2 POP2 INC2 !<draw-sixels>/
|
||||
|
||||
@<draw-sixels>/op-col ( byte -- )
|
||||
,&t STR
|
||||
#0600
|
||||
&l ( -- )
|
||||
[ LIT &t $1 ] OVR SFT #01 AND .Screen/pixel DEO
|
||||
INC GTHk ?&l
|
||||
|
@ -32,8 +51,18 @@
|
|||
( | advance )
|
||||
.Screen/x DEI2k INC2 ROT DEO2
|
||||
.Screen/y DEI2k #0006 SUB2 ROT DEO2
|
||||
& INC2 LDAk ?&w
|
||||
POP2 JMP2r
|
||||
JMP2r
|
||||
|
||||
@sdec ( str* -- str* val* )
|
||||
[ LIT2r 0000 ]
|
||||
&w ( -- )
|
||||
( validate ) LDAk [ LIT "0 ] SUB #09 GTH ?&end
|
||||
( accumulate ) [ LIT2r 000a ] MUL2r
|
||||
( combine ) LDAk [ LIT "0 ] SUB [ LITr 00 ] STH ADD2r
|
||||
( continue ) INC2 LDAk ?&w
|
||||
&end STH2r JMP2r
|
||||
|
||||
@sample [ "???owYn||~ywo??-?IRJaVNn^NVbJRI $1 ]
|
||||
|
||||
@sample-rle [ "||||!12w $1 ]
|
||||
|
||||
|
|
Loading…
Reference in New Issue