( build: uxnasm src/turye.tal turye.rom | start: uxnemu turye.rom ) |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 $5 &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 |80 @Controller/vector $2 &button $1 &key $1 |90 @Mouse/vector $2 &x $2 &y $2 &state $1 &pad $3 &sx $2 &sy $1 &sy-lb $1 |a0 @File/vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |0012 @header/height |008a @MARGIN |000 @glyph/sel $1 @guide/height $1 @src/buf $40 &cap $1 &changed $1 |100 @on-reset ( -> ) ( | meta ) ;meta #06 DEO2 theme/ #0210 #01d0 window/ ( | unlock ) ;on-button .Controller/vector DEO2 ;editor/on-mouse .Mouse/vector DEO2 ( | defaults ) [ LIT2 0b -guide/height ] STZ ( | loader ) .Console/type DEI ?{ project/ BRK } ;src/on-console .Console/vector DEO2 BRK @meta 00 ( name ) "Turye 0a ( details ) "A 20 "Font 20 "Editor 0a ( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a ( date ) "Mar 20 "19, 20 "2025 00 ( data ) 02 ( icon ) 83 =appicon ( mani ) 0a =manifest/dat @manifest/dat ( . ) ={ =dict/turye ( - ) 01 "n =project/ =dict/new ( - ) 01 "o =project/ =dict/open ( - ) 01 "s =project/ =dict/save ( - ) 01 "q =project/ =dict/exit } ={ =dict/edit ( - ) 01 "c =snarf/ =dict/copy ( - ) 01 "v =snarf/ =dict/paste ( - ) 01 "x =snarf/ =dict/cut ( - ) 00 7f =glyph/ =dict/erase } ={ =dict/glyph ( - ) 11 00 =glyph/ =dict/drag-up ( - ) 21 00 =glyph/ =dict/drag-down ( - ) 41 00 =glyph/ =dict/shift-left ( - ) 81 00 =glyph/ =dict/shift-right ( - ) 42 00 =glyph/ =dict/decr-width ( - ) 82 00 =glyph/ =dict/incr-width } ={ =dict/move ( - ) 10 00 =glyph/ =dict/up ( - ) 20 00 =glyph/ =dict/down ( - ) 40 00 =glyph/ =dict/left ( - ) 80 00 =glyph/ =dict/right } ={ =dict/guide ( - ) 12 00 =guide/ =dict/incr-guide ( - ) 22 00 =guide/ =dict/decr-guide } $1 ( @|vectors ) @on-button ( -> ) .Controller/button DEI2 manifest/scan INC2k ORA ?{ POP2 .Controller/key DEI pangram/ BRK } ( * ) JSR2 BRK ( @|src ) @src/on-console ( -> ) .Console/read DEI ( ) DUP #20 GTH ?{ POP #0000 .Console/vector DEO2 project/ BRK } / BRK @src/ ( c -- ) [ LIT2 00 &ptr -&buf ] INCk ,&ptr STR STZ2 JMP2r @src/ ( -- ) ;&default-name ( >> ) @src/ ( str* -- ) [ LIT2 -&buf _&ptr ] STR &>w ( -- ) LDAk / INC2 LDAk #1f GTH ?&>w POP2 JMP2r @src/change ( -- ) .&changed LDZ ?{ [ LIT2 01 -&changed ] STZ !header/ } JMP2r @src/ ( -- ) .&changed LDZ ?{ JMP2r } [ LIT2 00 -&changed ] STZ !header/ @src/default-name "untitled.uf2 $1 ( @|project ) @project/ ( -- ) src/ src/ [ LIT "a ] glyph/ @glyph/ ( -- ) .&sel LDZ #10 ADD !/ @glyph/ ( -- ) .&sel LDZ INC !/ ( glyph -- ) DUP .&sel LDZ NEQ ?{ POP JMP2r } .&sel STZ ! @glyph/get-addr ( -- addr* ) [ LIT2 00 -&sel ] LDZ #50 SFT2 ;data/glyphs ADD2 JMP2r @glyph/get-width ( -- width ) [ LIT2 00 -&sel ] LDZ ;data/widths ADD2 LDA JMP2r ( @|Collection ) @collection/on-mouse ( -> ) cursor/ .Mouse/state DEI ?{ BRK } ( | detect inside frame ) ( x ) .Mouse/x DEI2 #0008 SUB2 #05 SFT2 NIP ( y ) .Mouse/y DEI2 #00a8 SUB2 #0011 DIV2 #40 SFT2 NIP ORA glyph/ BRK } POP2 / BRK &on-mouse-outside ( x* y* -> ) POP2 POP2 .Mouse/state DEI ?{ BRK } / BRK @browser/on-button ( -> ) .Controller/button DEI2 ( | key handlers ) DUP #1b NEQ ?{ / } #0d NEQ ?{ / } ( | but handlers ) DUP #10 NEQ ?{ #ff / } DUP #20 NEQ ?{ #01 / } DUP #40 NEQ ?{ #f9 / } DUP #80 NEQ ?{ #07 / } POP BRK @browser/ ( -- ) ;editor/on-mouse .Mouse/vector DEO2 ;on-button .Controller/vector DEO2 [ LIT2 00 -Mouse/state ] DEO ! @browser/ ( -- ) ;&on-mouse .Mouse/vector DEO2 ;&on-button .Controller/vector DEO2 #00 / / [ LIT2 00 -Mouse/state ] DEO !/ @browser/ ( -- ) ;&selected LDA @browser/