uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit ddac370775031a940cc973917f5b866b311dc78d
parent 511b2366eee99a4087282a418af2c162340571f4
Author: neauoire <aliceffekt@gmail.com>
Date:   Tue, 17 Aug 2021 19:17:47 -0700

Improvement of examples

Diffstat:
Mbuild.sh | 4++--
Mprojects/examples/demos/drum-rack.tal | 54+++++++++++++++++++++++++++---------------------------
Mprojects/examples/demos/musictracker.tal | 4++--
Mprojects/examples/demos/piano.tal | 35++++++++++++++++++-----------------
Mprojects/examples/demos/polycat.tal | 8++++----
Mprojects/examples/demos/theme.tal | 4++--
Mprojects/examples/devices/console.lib.tal | 4++--
Mprojects/examples/gui/animation.tal | 16++++++++--------
Mprojects/examples/gui/hover.tal | 43+++++++++++++++++++++++++++----------------
Mprojects/examples/gui/label.tal | 12++++++------
Mprojects/examples/gui/picture.tal | 7++++---
11 files changed, 102 insertions(+), 89 deletions(-)

diff --git a/build.sh b/build.sh @@ -54,9 +54,9 @@ then fi echo "Assembling.." -./bin/uxnasm projects/examples/demos/life.tal bin/life.rom +./bin/uxnasm projects/examples/demos/piano.tal bin/piano.rom echo "Running.." -./bin/uxnemu bin/life.rom +./bin/uxnemu bin/piano.rom echo "Done." diff --git a/projects/examples/demos/drum-rack.tal b/projects/examples/demos/drum-rack.tal @@ -142,7 +142,7 @@ OVR #01 ;draw-pad JSR2 ( draw mixer ) OVR #04 / ;draw-mixer JSR2 - ( incr ) SWP #01 + SWP + ( incr ) SWP INC SWP LTHk ,&draw-pads JCN POP2 @@ -166,7 +166,7 @@ BRK ( y ) .mix-view/y1 LDZ2 PAD-HEIGHT STHkr TOS ** ++ #0002 ++ ( output ) .Audio0/output STHr #40 SFT + DEI ;draw-monitor JSR2 - ( incr ) SWP #01 + SWP + ( incr ) SWP INC SWP LTHk ,&loop JCN POP2 @@ -178,15 +178,15 @@ BRK .Mouse/state DEI #00 ! #01 JCN [ BRK ] - .Mouse/x DEI2 DUP2 .pad-view/x1 LDZ2 >> ROT ROT .pad-view/x2 LDZ2 #0001 ++ << #0101 == + .Mouse/x DEI2 DUP2 .pad-view/x1 LDZ2 >> ROT ROT .pad-view/x2 LDZ2 INC2 << #0101 == .Mouse/y DEI2 DUP2 .pad-view/y1 LDZ2 >> ROT ROT .pad-view/y2 LDZ2 << #0101 == #0101 == ;on-touch-pad JCN2 - .Mouse/x DEI2 DUP2 .mix-view/x1 LDZ2 >> ROT ROT .mix-view/x2 LDZ2 #0001 ++ << #0101 == + .Mouse/x DEI2 DUP2 .mix-view/x1 LDZ2 >> ROT ROT .mix-view/x2 LDZ2 INC2 << #0101 == .Mouse/y DEI2 DUP2 .mix-view/y1 LDZ2 >> ROT ROT .mix-view/y2 LDZ2 << #0101 == #0101 == ;on-touch-mix JCN2 - .Mouse/x DEI2 DUP2 .oct-view/x1 LDZ2 >> ROT ROT .oct-view/x2 LDZ2 #0001 ++ << #0101 == + .Mouse/x DEI2 DUP2 .oct-view/x1 LDZ2 >> ROT ROT .oct-view/x2 LDZ2 INC2 << #0101 == .Mouse/y DEI2 DUP2 .oct-view/y1 LDZ2 >> ROT ROT .oct-view/y2 LDZ2 << #0101 == #0101 == ;on-touch-oct JCN2 @@ -244,13 +244,13 @@ BRK DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + .Audio0/adsr [ STHkr #40 SFT + ] DEO &no-d DUP #02 ! ,&no-s JCN - .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI + .Audio0/adsr [ STHkr #40 SFT + ] INC DEI #10 .Mouse/state DEI #10 = #e0 * + + - .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEO &no-s + .Audio0/adsr [ STHkr #40 SFT + ] INC DEO &no-s DUP #03 ! ,&no-r JCN - .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI + .Audio0/adsr [ STHkr #40 SFT + ] INC DEI DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + - .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEO &no-r + .Audio0/adsr [ STHkr #40 SFT + ] INC DEO &no-r ( modes ) DUP #04 ! ,&no-repeat JCN .modes [ STHkr + ] LDZ @@ -280,7 +280,7 @@ BRK .Mouse/x DEI2 .oct-view/x1 LDZ2 -- 8// TOB #08 ! ,&no-mod JCN .Mouse/y DEI2 .oct-view/y1 LDZ2 -- 8// TOB DUP #00 ! ,&no-incr JCN - .piano/octave LDZ #01 + .piano/octave STZ &no-incr + .piano/octave LDZ INC .piano/octave STZ &no-incr DUP #02 ! ,&no-decr JCN .piano/octave LDZ #01 - .piano/octave STZ &no-decr POP @@ -346,9 +346,9 @@ RTN OVR TOS 10** [ DUP2r STH2r ] ++ LDA #02 / TOS 4// .wav-view/y1 LDZ2 ++ .Screen/y DEO2 - .Screen/x DEI2 #0001 ++ .Screen/x DEO2 + .Screen/x DEI2 INC2 .Screen/x DEO2 ( draw ) #02 .Screen/pixel DEO - ( incr ) SWP #01 + SWP + ( incr ) SWP INC SWP LTHk ,&loop JCN POP2 POP2r @@ -365,9 +365,9 @@ RTN DUP2 .mix-view/x1 LDZ2 #0010 ++ SWP2 .Audio0/adsr [ STHkr #40 SFT + ] DEI #0f AND ;draw-knob JSR2 DUP2 .mix-view/x1 LDZ2 #0020 ++ SWP2 - .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI #04 SFT ;draw-knob JSR2 + .Audio0/adsr [ STHkr #40 SFT + ] INC DEI #04 SFT ;draw-knob JSR2 DUP2 .mix-view/x1 LDZ2 #0030 ++ SWP2 - .Audio0/adsr [ STHkr #40 SFT + ] #01 + DEI #0f AND ;draw-knob JSR2 + .Audio0/adsr [ STHkr #40 SFT + ] INC DEI #0f AND ;draw-knob JSR2 ( once/repeat ) DUP2 .mix-view/x1 LDZ2 #0040 ++ SWP2 .modes [ STHkr + ] LDZ ;draw-switch JSR2 @@ -460,12 +460,12 @@ RTN #00 #0f &loop - OVR #10 SWP - STHkr #0f AND < #01 + .Screen/pixel DEO + OVR #10 SWP - STHkr #0f AND < INC .Screen/pixel DEO .Screen/x DEI2 #0002 ++ .Screen/x DEO2 - OVR #10 SWP - STHkr #04 SFT < #01 + .Screen/pixel DEO + OVR #10 SWP - STHkr #04 SFT < INC .Screen/pixel DEO .Screen/x DEI2 #0002 -- .Screen/x DEO2 .Screen/y DEI2 #0002 ++ .Screen/y DEO2 - ( incr ) SWP #01 + SWP + ( incr ) SWP INC SWP LTHk ,&loop JCN POP2 @@ -552,21 +552,21 @@ RTN @line-rect ( x1* y1* x2* y2* color -- ) ( load ) .color STZ DUP2 STH2 .rect/y2 STZ2 .rect/x2 STZ2 DUP2 STH2 .rect/y1 STZ2 .rect/x1 STZ2 - STH2r #0001 ++ STH2r + STH2r INC2 STH2r &ver ( save ) OVR2 .Screen/y DEO2 ( draw ) .rect/x1 LDZ2 .Screen/x DEO2 .color LDZ DUP .Screen/pixel DEO ( draw ) .rect/x2 LDZ2 .Screen/x DEO2 .Screen/pixel DEO - ( incr ) SWP2 #0001 ++ SWP2 + ( incr ) SWP2 INC2 SWP2 OVR2 OVR2 LTS2 ,&ver JCN POP2 POP2 - .rect/x1 LDZ2 #0001 ++ .rect/x2 LDZ2 #0001 -- + .rect/x1 LDZ2 INC2 .rect/x2 LDZ2 #0001 -- &hor ( save ) OVR2 .Screen/x DEO2 ( draw ) .rect/y1 LDZ2 .Screen/y DEO2 .color LDZ DUP .Screen/pixel DEO ( draw ) .rect/y2 LDZ2 .Screen/y DEO2 .Screen/pixel DEO - ( incr ) SWP2 #0001 ++ SWP2 - OVR2 OVR2 #0001 ++ LTS2 ,&hor JCN + ( incr ) SWP2 INC2 SWP2 + OVR2 OVR2 INC2 LTS2 ,&hor JCN POP2 POP2 RTN @@ -576,11 +576,11 @@ RTN ( load ) STH STH2 .Screen/y DEO2 .Screen/x DEO2 STH2r &loop - DUP2 LDA #00 SWP #0030 -- 8** ;font-num-uc ++ .Screen/addr DEO2 + LDAk #00 SWP #0030 -- 8** ;font-num-uc ++ .Screen/addr DEO2 ( draw ) STHkr .Screen/sprite DEO - ( incr ) #0001 ++ + ( incr ) INC2 ( incr ) .Screen/x DEI2 #0008 ++ .Screen/x DEO2 - DUP2 LDA #00 ! ,&loop JCN + LDAk #00 ! ,&loop JCN POP2 POPr @@ -596,10 +596,10 @@ RTN &hor ( save ) OVR2 .Screen/x DEO2 ( draw ) .color LDZ .Screen/pixel DEO - ( incr ) SWP2 #0001 ++ SWP2 + ( incr ) SWP2 INC2 SWP2 OVR2 OVR2 LTS2 ,&hor JCN POP2 POP2 STH2r STH2r - ( incr ) SWP2 #0001 ++ SWP2 + ( incr ) SWP2 INC2 SWP2 OVR2 OVR2 LTS2 ,&ver JCN POP2 POP2 POP2 POP2 diff --git a/projects/examples/demos/musictracker.tal b/projects/examples/demos/musictracker.tal @@ -452,10 +452,10 @@ RTN ( load ) .label/addr STZ2 .label/color STZ .Screen/y DEO2 .Screen/x DEO2 .label/addr LDZ2 &loop - ( draw ) DUP2 LDA #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO + ( draw ) LDAk #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO ( incr ) ++ ( incr ) .Screen/x DEI2 8++ .Screen/x DEO2 - DUP2 LDA ,&loop JCN + LDAk ,&loop JCN POP2 RTN diff --git a/projects/examples/demos/piano.tal b/projects/examples/demos/piano.tal @@ -11,6 +11,7 @@ %MOD { DUP2 / * - } %LTS2 { #8000 ++ SWP2 #8000 ++ >> } %GTS2 { #8000 ++ SWP2 #8000 ++ << } +%2/ { #01 SFT } %2// { #01 SFT2 } %4// { #02 SFT2 } %8// { #03 SFT2 } @@ -102,7 +103,7 @@ BRK .adsr-view/x2 LDZ2 #003a -- #0002 ++ .Screen/x DEO2 #10 OVR - .Audio0/output DEI #04 SFT < .Screen/pixel DEO .Screen/y DEI2 #0002 ++ .Screen/y DEO2 - #01 + GTHk ,&loop JCN + INC GTHk ,&loop JCN POP2 BRK @@ -140,7 +141,7 @@ BRK DUP #04 SFT #01 AND #01 ! ,&no-up JCN ( move ) .Audio0/addr DEI2 #0001 -- .Audio0/addr DEO2 &no-up DUP #05 SFT #01 AND #01 ! ,&no-down JCN - ( move ) .Audio0/addr DEI2 #0001 ++ .Audio0/addr DEO2 &no-down + ( move ) .Audio0/addr DEI2 INC2 .Audio0/addr DEO2 &no-down DUP #06 SFT #01 AND #01 ! ,&no-left JCN ( move ) .Audio0/addr DEI2 #0010 -- .Audio0/addr DEO2 &no-left DUP #07 SFT #01 AND #01 ! ,&no-right JCN @@ -188,7 +189,7 @@ BRK .Mouse/y DEI2 .octave-view/y1 LDZ2 -- 8// NIP [ #00 ] !~ ,&no-incr JCN .octave LDZ #03 = ,&no-incr JCN - .octave LDZ #01 + .octave STZ &no-incr + .octave LDZ INC .octave STZ &no-incr [ #02 ] !~ ,&no-decr JCN .octave LDZ #ff = ,&no-decr JCN .octave LDZ #01 - .octave STZ &no-decr @@ -218,13 +219,13 @@ BRK DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + .Audio0/adsr DEO &no-d [ #02 ] !~ ,&no-s JCN - .Audio0/adsr #01 + DEI + .Audio0/adsr INC DEI #10 .Mouse/state DEI #10 = #e0 * + + - .Audio0/adsr #01 + DEO &no-s + .Audio0/adsr INC DEO &no-s [ #03 ] !~ ,&no-r JCN - .Audio0/adsr #01 + DEI + .Audio0/adsr INC DEI DUP #f0 AND STH #01 .Mouse/state DEI #10 = #0e * + + #0f AND STHr + - .Audio0/adsr #01 + DEO &no-r + .Audio0/adsr INC DEO &no-r [ #05 ] !~ ,&no-left JCN .Audio0/volume DEI #10 .Mouse/state DEI #10 = #e0 * + + @@ -317,10 +318,10 @@ RTN .Audio0/adsr DEI #0f AND ;draw-knob JSR2 .adsr-view/x1 LDZ2 #0030 ++ .adsr-view/y1 LDZ2 - .Audio0/adsr #01 + DEI #04 SFT + .Audio0/adsr INC DEI #04 SFT ;draw-knob JSR2 .adsr-view/x1 LDZ2 #0048 ++ .adsr-view/y1 LDZ2 - .Audio0/adsr #01 + DEI #0f AND + .Audio0/adsr INC DEI #0f AND ;draw-knob JSR2 ( volume ) .adsr-view/x2 LDZ2 #0028 -- .adsr-view/y1 LDZ2 @@ -337,7 +338,7 @@ RTN ( clear ) .wave-view/x1 LDZ2 .wave-view/y1 LDZ2 - .wave-view/x2 LDZ2 #0001 ++ + .wave-view/x2 LDZ2 INC2 .wave-view/y2 LDZ2 #00 ;fill-rect JSR2 @@ -354,13 +355,13 @@ RTN #03 .Screen/pixel DEO &no-dot DUP TOS .Audio0/addr DEI2 ++ LDA - #02 / + 2/ TOS 4// .wave-view/y1 LDZ2 ++ .Screen/y DEO2 - .Screen/x DEI2 #0001 ++ .Screen/x DEO2 + .Screen/x DEI2 INC2 .Screen/x DEO2 ( draw ) DUP .Audio0/length DEI2 NIP > - .Audio0/length DEI2 #0100 !! #0101 == DUP ADD #01 + .Screen/pixel DEO - #01 + GTHk ,&loop JCN + .Audio0/length DEI2 #0100 !! #0101 == DUP ADD INC .Screen/pixel DEO + INC GTHk ,&loop JCN POP2 ( range ) @@ -380,7 +381,7 @@ RTN &loop DUP2 .Screen/y DEO2 ( draw ) STHkr .Screen/pixel DEO - #0001 ++ GTH2k ,&loop JCN + INC2 GTH2k ,&loop JCN POP2 POP2 POPr @@ -438,10 +439,10 @@ RTN &hor ( save ) DUP2 .Screen/x DEO2 ( draw ) ,&color LDR .Screen/pixel DEO - ( incr ) #0001 ++ + ( incr ) INC2 OVR2 OVR2 GTS2 ,&hor JCN POP2 POP2 STH2r STH2r - ( incr ) #0001 ++ + ( incr ) INC2 OVR2 OVR2 GTS2 ,&ver JCN POP2 POP2 POP2 POP2 diff --git a/projects/examples/demos/polycat.tal b/projects/examples/demos/polycat.tal @@ -52,7 +52,7 @@ BRK @on-frame ( -> ) - .cat/timer LDZ #01 ADD [ DUP ] .cat/timer STZ + .cat/timer LDZ INC [ DUP ] .cat/timer STZ DUP ,&skip0 JCN #0000 ;draw-tail JSR2 &skip0 [ #10 ] !~ ,&skip1 JCN #0001 ;draw-tail JSR2 &skip1 [ #20 ] !~ ,&skip2 JCN #0002 ;draw-tail JSR2 &skip2 @@ -126,13 +126,13 @@ RTN .cat/x LDZ2 #0010 SUB2 .Screen/x DEO2 ;ground .Screen/addr DEO2 - #00 #10 + #10 #00 &loop ( draw ) #01 .Screen/sprite DEO ( sety ) .Screen/addr DEI2 #0008 ADD2 .Screen/addr DEO2 ( setx ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 - ( incr ) SWP #01 ADD SWP - LTHk ,&loop JCN + ( incr ) INC + GTHk ,&loop JCN POP2 RTN diff --git a/projects/examples/demos/theme.tal b/projects/examples/demos/theme.tal @@ -327,12 +327,12 @@ RTN .Screen/x DEO2 STH2r &loop - DUP2 LDA #00 SWP 8** + LDAk #00 SWP 8** ;font ADD2 .Screen/addr DEO2 ( draw ) STHkr .Screen/sprite DEO ( incr ) ++ ( incr ) .Screen/x DEI2 8+ .Screen/x DEO2 - DUP2 LDA ,&loop JCN + LDAk ,&loop JCN POP2 POPr RTN diff --git a/projects/examples/devices/console.lib.tal b/projects/examples/devices/console.lib.tal @@ -33,9 +33,9 @@ BRK @print ( addr* -- ) &loop - ( send ) DUP2 LDA .Console/write DEO + ( send ) LDAk .Console/write DEO ( incr ) #0001 ADD2 - ( loop ) DUP2 LDA ,&loop JCN + ( loop ) LDAk ,&loop JCN POP2 RTN diff --git a/projects/examples/gui/animation.tal b/projects/examples/gui/animation.tal @@ -52,19 +52,19 @@ BRK ( stash ) STH ;dvd_icn .Screen/addr DEO2 - .dvd/y LDZ2 [ .dvd/y LDZ2 #0010 ADD2 ] + [ .dvd/y LDZ2 #0010 ADD2 ] .dvd/y LDZ2 &ver - OVR2 .Screen/y DEO2 - .dvd/x LDZ2 [ .dvd/x LDZ2 #0020 ADD2 ] + DUP2 .Screen/y DEO2 + [ .dvd/x LDZ2 #0020 ADD2 ] .dvd/x LDZ2 &hor - OVR2 .Screen/x DEO2 + DUP2 .Screen/x DEO2 ( draw ) STHkr .Screen/sprite DEO ( next ) .Screen/addr DEI2 #0008 ADD2 .Screen/addr DEO2 - ( incr ) SWP2 #0008 ADD2 SWP2 - LTH2k ,&hor JCN + ( incr ) #0008 ADD2 + GTH2k ,&hor JCN POP2 POP2 - ( incr ) SWP2 #0008 ADD2 SWP2 - LTH2k ,&ver JCN + ( incr ) #0008 ADD2 + GTH2k ,&ver JCN POP2 POP2 ( destroy ) POPr diff --git a/projects/examples/gui/hover.tal b/projects/examples/gui/hover.tal @@ -1,6 +1,11 @@ ( GUI Hover ) +%+ { ADD } %- { SUB } +%< { LTH } %> { GTH } %= { EQU } %! { NEQ } +%++ { ADD2 } %-- { SUB2 } +%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 } %RTN { JMP2r } +%GTS2 { #8000 ++ SWP2 #8000 ++ << } ( devices ) @@ -12,7 +17,7 @@ |0000 -@color [ &byte $1 ] +@color $1 @pointer [ &x $2 &y $2 &sprite $2 ] @rect [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] @r1 [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ] @@ -34,28 +39,27 @@ @on-mouse - ( defaults ) ;pointer_icn .pointer/sprite STZ2 #01 .color STZ .Mouse/x DEI2 .Mouse/y DEI2 .r1 ;within-rect JSR2 #00 EQU ,&draw1 JCN #02 .color STZ ;hand_icn .pointer/sprite STZ2 - &draw1 + &draw1 .r1/x1 LDZ2 .r1/y1 LDZ2 .r1/x2 LDZ2 .r1/y2 LDZ2 .color LDZ ;line-rect JSR2 #01 .color STZ .Mouse/x DEI2 .Mouse/y DEI2 .r2 ;within-rect JSR2 #00 EQU ,&draw2 JCN #03 .color STZ ;hand_icn .pointer/sprite STZ2 - &draw2 + &draw2 .r2/x1 LDZ2 .r2/y1 LDZ2 .r2/x2 LDZ2 .r2/y2 LDZ2 .color LDZ ;line-rect JSR2 #01 .color STZ .Mouse/x DEI2 .Mouse/y DEI2 .r3 ;within-rect JSR2 #00 EQU ,&draw3 JCN #02 .color STZ ;hand_icn .pointer/sprite STZ2 - &draw3 + &draw3 .r3/x1 LDZ2 .r3/y1 LDZ2 .r3/x2 LDZ2 .r3/y2 LDZ2 .color LDZ ;line-rect JSR2 ;draw-cursor JSR2 @@ -99,18 +103,25 @@ RTN @line-rect ( x1* y1* x2* y2* color -- ) - ( load ) .color STZ .rect/y2 STZ2 .rect/x2 STZ2 DUP2 .Screen/y DEO2 .rect/y1 STZ2 DUP2 .Screen/x DEO2 .rect/x1 STZ2 - &hor - ( incr ) .Screen/x DEI2 #0001 ADD2 .Screen/x DEO2 - ( draw ) .rect/y1 LDZ2 .Screen/y DEO2 .color LDZ .Screen/pixel DEO - ( draw ) .rect/y2 LDZ2 .Screen/y DEO2 .color LDZ .Screen/pixel DEO - .Screen/x DEI2 .rect/x2 LDZ2 LTH2 ,&hor JCN - .rect/y1 LDZ2 .Screen/y DEO2 + ( load ) .color STZ + STH2k .rect/y2 STZ2 .rect/x2 STZ2 + STH2k .rect/y1 STZ2 .rect/x1 STZ2 + STH2r STH2r SWP2 &ver - ( draw ) .rect/x1 LDZ2 .Screen/x DEO2 .color LDZ .Screen/pixel DEO - ( draw ) .rect/x2 LDZ2 .Screen/x DEO2 .color LDZ .Screen/pixel DEO - ( incr ) .Screen/y DEI2 #0001 ADD2 .Screen/y DEO2 - .Screen/y DEI2 .rect/y2 LDZ2 #0001 ADD2 LTH2 ,&ver JCN + ( save ) DUP2 .Screen/y DEO2 + ( draw ) .rect/x1 LDZ2 .Screen/x DEO2 .color LDZ DUP .Screen/pixel DEO + ( draw ) .rect/x2 LDZ2 .Screen/x DEO2 .Screen/pixel DEO + ( incr ) INC2 + OVR2 OVR2 GTS2 ,&ver JCN + POP2 POP2 + .rect/x1 LDZ2 .rect/x2 LDZ2 SWP2 + &hor + ( save ) DUP2 .Screen/x DEO2 + ( draw ) .rect/y1 LDZ2 .Screen/y DEO2 .color LDZ DUP .Screen/pixel DEO + ( draw ) .rect/y2 LDZ2 .Screen/y DEO2 .Screen/pixel DEO + ( incr ) INC2 + OVR2 OVR2 GTS2 ,&hor JCN + POP2 POP2 RTN diff --git a/projects/examples/gui/label.tal b/projects/examples/gui/label.tal @@ -52,10 +52,10 @@ RTN ( load ) .label/addr STZ2 .label/color STZ .Screen/y DEO2 .Screen/x DEO2 .label/addr LDZ2 &loop - ( draw ) DUP2 LDA #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO + ( draw ) LDAk #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO ( incr ) #0001 ADD2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 - DUP2 LDA ,&loop JCN + LDAk ,&loop JCN POP2 RTN @@ -66,10 +66,10 @@ RTN ( align ) .label/addr LDZ2 ;get-text-length JSR2 8** 2// SUB2 .Screen/x DEO2 .label/addr LDZ2 &loop - ( draw ) DUP2 LDA #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO + ( draw ) LDAk #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO ( incr ) #0001 ADD2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 - DUP2 LDA ,&loop JCN + LDAk ,&loop JCN POP2 RTN @@ -80,10 +80,10 @@ RTN ( align ) .label/addr LDZ2 ;get-text-length JSR2 8** SUB2 .Screen/x DEO2 .label/addr LDZ2 &loop - ( draw ) DUP2 LDA #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO + ( draw ) LDAk #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/sprite DEO ( incr ) #0001 ADD2 ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 - DUP2 LDA ,&loop JCN + LDAk ,&loop JCN POP2 RTN diff --git a/projects/examples/gui/picture.tal b/projects/examples/gui/picture.tal @@ -21,7 +21,7 @@ |0100 - ( theme ) #037a .System/r DEO2 #032a .System/g DEO2 #052a .System/b DEO2 + ( theme ) #f07a .System/r DEO2 #f02a .System/g DEO2 #f02a .System/b DEO2 ( background ) ;checker_icn #02 ;cover-pattern JSR2 @@ -37,6 +37,7 @@ ( load ) ;chr2_path .File/name DEO2 #0900 .File/length DEO2 ;image .File/load DEO2 ( draw ) #0088 #0088 #0060 #0060 #81 ;image ;draw-chr JSR2 + BRK @draw-icn ( x y width height color addr -- ) @@ -79,9 +80,9 @@ RTN RTN -@cover-pattern ( addr color -- ) +@cover-pattern ( addr* color -- ) - ( load ) .color STZ .Screen/addr DEO2 + ( load ) .color/byte STZ .Screen/addr DEO2 #0000 .Screen/height DEI2 &ver ( save ) OVR2 .Screen/y DEO2