|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 |a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |0000 @src $40 |0100 @on-reset ( -> ) #f0ef .System/r DEO2 #f0e6 .System/g DEO2 #f0e2 .System/b DEO2 #0010 DUP2 .Screen/x DEO2 .Screen/y DEO2 #0120 DUP2 .Screen/width DEO2 .Screen/height DEO2 ( | begin ) ;on-console .Console/vector DEO2 BRK @on-console ( -> ) .Console/read DEI DUP #20 LTH OVR #7f GTH ORA ?{ ;src scap STA BRK } POP ( | load ) ;src .File/name DEO2 #8000 .File/length DEO2 ;img/data .File/read DEO2 ;img/data BRK @ ( data* -- ) [ LIT2 02 -Screen/auto ] DEO .Screen/x DEI2 ,&anchor STR2 &w ( -- ) LDAk [ LIT "$ ] EQU ?&op-over LDAk [ LIT "- ] EQU ?&op-line LDAk [ LIT "! ] EQU ?&op-rle LDAk [ LIT "? ] SUB /op-col & INC2 LDAk ?&w POP2 JMP2r &op-line ( -- ) .Screen/y DEI2k #0006 ADD2 ROT DEO2 &op-over ( -- ) [ LIT2 &anchor $2 ] .Screen/x DEO2 !& @/op-rle ( addr* -- addr* ) LDAk #19 DEO INC2k sdec pdec #2019 DEO LDA #19 DEO #0a19 DEO ( rune ) INC2 ( length ) sdec ( target ) OVR2 LDA [ LIT "? ] SUB ,&t STR #0000 &l ( -- ) [ LIT &t $1 ] DUP #19 DEO /op-col INC2 GTH2k ?&l #0a19 DEO POP2 POP2 INC2 !/ @/op-col ( byte -- ) ,&t STR #0600 &l ( -- ) [ LIT &t $1 ] OVR SFT #01 AND .Screen/pixel DEO INC GTHk ?&l POP2 ( | advance ) .Screen/x DEI2k INC2 ROT DEO2 .Screen/y DEI2k #0006 SUB2 ROT DEO2 JMP2r ( @|stdlib ) @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 @scap ( str* -- end* ) LDAk #00 NEQ [ JMP JMP2r ] &w INC2 LDAk ?&w JMP2r @phex ( short* -- ) SWP phex/b &b ( -- ) DUP #04 SFT phex/c &c ( -- ) #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO JMP2r @pdec ( short* -- ) #2710 [ LIT2r 00fb ] &w ( -- ) DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{ DUP [ LIT "0 ] ADD #19 DEO INCr } POP2 #000a DIV2 SWPr INCr STHkr ?&w POP2r POP2 POP2 JMP2r ( @|memory ) @sample [ "???owYn||~ywo??-?IRJaVNn^NVbJRI $1 ] @img &data