diff --git a/gui/chr-view/akane20x10.icn b/gui/icnchr/akane20x10.icn similarity index 100% rename from gui/chr-view/akane20x10.icn rename to gui/icnchr/akane20x10.icn diff --git a/gui/chr-view/build.sh b/gui/icnchr/build.sh similarity index 85% rename from gui/chr-view/build.sh rename to gui/icnchr/build.sh index b0f1f52..99c9489 100755 --- a/gui/chr-view/build.sh +++ b/gui/icnchr/build.sh @@ -4,8 +4,9 @@ ASM="uxncli $HOME/roms/drifblim.rom" EMU="uxnemu" LIN="uxncli $HOME/roms/uxnlin.rom" -SRC="chr-view.tal" -DST="chr-view.rom" +ID="icnchr" +SRC="${ID}.tal" +DST="${ID}.rom" CPY="$HOME/roms" ARG="pc9820x10.chr" diff --git a/gui/chr-view/chr-view.tal b/gui/icnchr/icnchr.tal similarity index 97% rename from gui/chr-view/chr-view.tal rename to gui/icnchr/icnchr.tal index ac94077..30dfd91 100644 --- a/gui/chr-view/chr-view.tal +++ b/gui/icnchr/icnchr.tal @@ -1,4 +1,4 @@ -( uxnemu chr-view.rom image.chr ) +( uxnemu icnchr.rom image20x20.chr ) |00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1 |10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1 @@ -26,7 +26,7 @@ BRK @on-console ( -> ) - ;src STH2 + LIT2r =src ( read source ) .Console/read DEI DUP #20 LTH OVR #7f GTH ORA ?&end @@ -89,9 +89,9 @@ BRK ;src !draw-image &no-light set-theme-light - ;src draw-image + ;src -JMP2r +!draw-image @set-theme-dark ( -- ) @@ -116,9 +116,9 @@ JMP2r ;src !draw-image &no-chr set-mode-icn - ;src draw-image + ;src -JMP2r +!draw-image @set-mode-chr ( -- ) @@ -165,9 +165,7 @@ JMP2r &no-line .File/success DEI2 ORA ?&stream - draw-interface - -JMP2r +!draw-interface &buf $10 @draw-interface ( -- ) @@ -182,9 +180,9 @@ JMP2r .Screen/width DEI2 #03 SFT2 NIP draw-byte LIT "x draw-chr .Screen/height DEI2 #03 SFT2 NIP draw-byte - LIT ") draw-chr + LIT ") -JMP2r +!draw-chr @draw-str ( str* -- ) diff --git a/gui/chr-view/pc9820x10.chr b/gui/icnchr/pc9820x10.chr similarity index 100% rename from gui/chr-view/pc9820x10.chr rename to gui/icnchr/pc9820x10.chr diff --git a/gui/misc/tcc/day8.tal b/gui/misc/tcc/day8.tal index ac6ff0b..53c6204 100644 --- a/gui/misc/tcc/day8.tal +++ b/gui/misc/tcc/day8.tal @@ -1,5 +1,7 @@ |00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 |20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 +|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 + |0000 @@ -8,15 +10,24 @@ |0100 ( theme ) - #ff0f .System/r DEO2 - #0fa0 .System/g DEO2 - #0f20 .System/b DEO2 + #0f0f .System/r DEO2 + #0ff0 .System/g DEO2 + #0f0f .System/b DEO2 ( size ) #0100 .Screen/width DEO2 - #0080 .Screen/height DEO2 + #0100 .Screen/height DEO2 ( animate ) #01 .Screen/auto DEO - ;on-frame .Screen/vector DEO2 + ;on-frame2 .Screen/vector DEO2 + + prng-init + +BRK + +@on-frame2 ( -> ) + + [ LIT2 &f $2 ] INC2k ,&f STR2 + draw-circle BRK @@ -28,21 +39,6 @@ BRK JMP2r -@on-frame ( -> ) - - ;draw-bg JSR2 - - #3000 - &l - #00 OVR #20 SFT2 ;draw-circle/offset STA2 - #00 OVR .f LDZ2 #00 SFT2 ADD2 ;draw-circles JSR2 - INC GTHk ,&l JCN - POP2 - - .f LDZ2k INC2 #007f AND2 ROT STZ2 - -BRK - @draw-bg ( -- ) #0000 .Screen/y DEO2 @@ -72,22 +68,42 @@ JMP2r @draw-circle ( offset* -- ) ( x ) - DUP2 #001f ADD2 #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #0a SFT2 - [ LIT2 &offset $2 ] ADD2 - #0030 SUB2 + DUP2 #001f ADD2 #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #09 SFT2 + #0080 ADD2 + #0040 SUB2 .Screen/x DEO2 ( y ) - DUP2 #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #0a SFT2 #0018 ADD2 - .Screen/y DEO2 - #16 .Screen/auto DEO - ;circle-icn .Screen/addr DEO2 - POP2 - ,&offset LDR2 .f LDZ2 ADD2 #04 SFT2 - #0003 AND2 ;&colors ADD2 LDA .Screen/sprite DEOk DEO + #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #09 SFT2 + #0030 ADD2 .Screen/y DEO2 + prng ADD #80 ORA .Screen/pixel DEO JMP2r &colors 05 0a 0f 0a +@prng-init ( -- ) + + ( seed ) + #00 .DateTime/second DEI + #00 .DateTime/minute DEI #60 SFT2 EOR2 + #00 .DateTime/hour DEI #c0 SFT2 EOR2 ,prng/x STR2 + #00 .DateTime/hour DEI #04 SFT2 + #00 .DateTime/day DEI #10 SFT2 EOR2 + #00 .DateTime/month DEI #60 SFT2 EOR2 + .DateTime/year DEI2 #a0 SFT2 EOR2 ,prng/y STR2 + +JMP2r + +@prng ( -- number* ) + + LIT2 &x $2 + DUP2 #50 SFT2 EOR2 + DUP2 #03 SFT2 EOR2 + LIT2 &y $2 DUP2 ,&x STR2 + DUP2 #01 SFT2 EOR2 EOR2 + ,&y STR2k POP + +JMP2r + ( @|assets )