Renamed chr-ciew to icnchr

This commit is contained in:
Devine Lu Linvega 2023-04-13 10:24:07 -07:00
parent 9c056418ca
commit a7fb6d0673
5 changed files with 58 additions and 43 deletions

View File

@ -4,8 +4,9 @@ ASM="uxncli $HOME/roms/drifblim.rom"
EMU="uxnemu" EMU="uxnemu"
LIN="uxncli $HOME/roms/uxnlin.rom" LIN="uxncli $HOME/roms/uxnlin.rom"
SRC="chr-view.tal" ID="icnchr"
DST="chr-view.rom" SRC="${ID}.tal"
DST="${ID}.rom"
CPY="$HOME/roms" CPY="$HOME/roms"
ARG="pc9820x10.chr" ARG="pc9820x10.chr"

View File

@ -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 |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 |10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
@ -26,7 +26,7 @@ BRK
@on-console ( -> ) @on-console ( -> )
;src STH2 LIT2r =src
( read source ) ( read source )
.Console/read DEI .Console/read DEI
DUP #20 LTH OVR #7f GTH ORA ?&end DUP #20 LTH OVR #7f GTH ORA ?&end
@ -89,9 +89,9 @@ BRK
;src !draw-image ;src !draw-image
&no-light &no-light
set-theme-light set-theme-light
;src draw-image ;src
JMP2r !draw-image
@set-theme-dark ( -- ) @set-theme-dark ( -- )
@ -116,9 +116,9 @@ JMP2r
;src !draw-image ;src !draw-image
&no-chr &no-chr
set-mode-icn set-mode-icn
;src draw-image ;src
JMP2r !draw-image
@set-mode-chr ( -- ) @set-mode-chr ( -- )
@ -165,9 +165,7 @@ JMP2r
&no-line &no-line
.File/success DEI2 ORA ?&stream .File/success DEI2 ORA ?&stream
draw-interface !draw-interface
JMP2r
&buf $10 &buf $10
@draw-interface ( -- ) @draw-interface ( -- )
@ -182,9 +180,9 @@ JMP2r
.Screen/width DEI2 #03 SFT2 NIP draw-byte .Screen/width DEI2 #03 SFT2 NIP draw-byte
LIT "x draw-chr LIT "x draw-chr
.Screen/height DEI2 #03 SFT2 NIP draw-byte .Screen/height DEI2 #03 SFT2 NIP draw-byte
LIT ") draw-chr LIT ")
JMP2r !draw-chr
@draw-str ( str* -- ) @draw-str ( str* -- )

View File

@ -1,5 +1,7 @@
|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 |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 |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 |0000
@ -8,15 +10,24 @@
|0100 |0100
( theme ) ( theme )
#ff0f .System/r DEO2 #0f0f .System/r DEO2
#0fa0 .System/g DEO2 #0ff0 .System/g DEO2
#0f20 .System/b DEO2 #0f0f .System/b DEO2
( size ) ( size )
#0100 .Screen/width DEO2 #0100 .Screen/width DEO2
#0080 .Screen/height DEO2 #0100 .Screen/height DEO2
( animate ) ( animate )
#01 .Screen/auto DEO #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 BRK
@ -28,21 +39,6 @@ BRK
JMP2r 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 ( -- ) @draw-bg ( -- )
#0000 .Screen/y DEO2 #0000 .Screen/y DEO2
@ -72,22 +68,42 @@ JMP2r
@draw-circle ( offset* -- ) @draw-circle ( offset* -- )
( x ) ( x )
DUP2 #001f ADD2 #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #0a SFT2 DUP2 #001f ADD2 #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #09 SFT2
[ LIT2 &offset $2 ] ADD2 #0080 ADD2
#0030 SUB2 #0040 SUB2
.Screen/x DEO2 .Screen/x DEO2
( y ) ( y )
DUP2 #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #0a SFT2 #0018 ADD2 #007f AND2 #10 SFT2 ;cos ADD2 LDA2 #09 SFT2
.Screen/y DEO2 #0030 ADD2 .Screen/y DEO2
#16 .Screen/auto DEO prng ADD #80 ORA .Screen/pixel DEO
;circle-icn .Screen/addr DEO2
POP2
,&offset LDR2 .f LDZ2 ADD2 #04 SFT2
#0003 AND2 ;&colors ADD2 LDA .Screen/sprite DEOk DEO
JMP2r JMP2r
&colors 05 0a 0f 0a &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 ) @|assets )