Compare commits
24 Commits
main
...
d6/sep7-ch
Author | SHA1 | Date |
---|---|---|
~d6 | 469f0348eb | |
Devine Lu Linvega | fe5a9321d0 | |
Devine Lu Linvega | 18ad732a24 | |
Devine Lu Linvega | e5f695d09f | |
Devine Lu Linvega | 4430c2eb3d | |
Devine Lu Linvega | 94dbf747c2 | |
Devine Lu Linvega | 0150e67e11 | |
~d6 | 6e635d94a3 | |
~d6 | 54fa407a68 | |
Devine Lu Linvega | bf99790adb | |
Devine Lu Linvega | d16798dc7b | |
Devine Lu Linvega | 7adfa6906f | |
Devine Lu Linvega | 041f3dda07 | |
Devine Lu Linvega | f194db1610 | |
Devine Lu Linvega | 3e41f3b3b2 | |
Devine Lu Linvega | 9b15f5f079 | |
Devine Lu Linvega | c57be86439 | |
Devine Lu Linvega | 2d1b4b2670 | |
Devine Lu Linvega | f8cf42530f | |
Devine Lu Linvega | 8859196212 | |
Devine Lu Linvega | a47bc38042 | |
Devine Lu Linvega | fe35aadb66 | |
Devine Lu Linvega | c535dbf3d4 | |
Devine Lu Linvega | c149d1b9e7 |
|
@ -0,0 +1,30 @@
|
|||
ID=catty
|
||||
DIR=~/roms
|
||||
ASM=uxncli ${DIR}/drifblim.rom
|
||||
LIN=uxncli ${DIR}/uxnlin.rom
|
||||
EMU=uxn11
|
||||
ROM=bin/${ID}.rom
|
||||
|
||||
all: ${ROM}
|
||||
|
||||
lint:
|
||||
@ ${LIN} src/${ID}.tal
|
||||
run: all
|
||||
@ ${EMU} ${ROM}
|
||||
clean:
|
||||
@ rm -f ${ROM} ${ROM}.sym
|
||||
install: ${ROM}
|
||||
@ cp ${ROM} ${DIR}
|
||||
uninstall:
|
||||
@ rm -f ${DIR}/${ID}.rom
|
||||
archive:
|
||||
cat src/${ID}.tal src/assets.tal | sed 's/~[^[:space:]]\+//' > ~/Git/oscean/etc/${ID}.tal.txt
|
||||
uxnasm ~/Git/oscean/etc/${ID}.tal.txt ${ROM}
|
||||
@ ${EMU} ${ROM}
|
||||
|
||||
.PHONY: all clean lint run install uninstall archive
|
||||
|
||||
${ROM}: src/${ID}.tal src/assets.tal
|
||||
@ mkdir -p bin
|
||||
@ ${ASM} src/${ID}.tal ${ROM}
|
||||
|
|
@ -0,0 +1,272 @@
|
|||
( assets )
|
||||
|
||||
@check-icn [ aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55 ]
|
||||
|
||||
@font [
|
||||
0405 0509 0709 0903 0505 0807 0407 0307
|
||||
0808 0808 0808 0808 0808 0304 0607 0608
|
||||
0a09 0908 0807 0708 0806 0708 070b 0a08
|
||||
0808 0808 0809 090b 0707 0706 0706 0408
|
||||
0108 0807 0707 0607 0704 0606 040b 0707
|
||||
0807 0607 0608 070a 0707 0705 0405 0801 ]
|
||||
&glyphs [
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1010 1010 2020 2000 2000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0050 5050 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0001 0a3f 147e 2420 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0008 3854 5030 1028 24a4 7820 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 3e51 9264 0816 2949 8600 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0018 2424 2830 508a 848a 7100 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0040 4040 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0008 1020 2040 4040 4040 2020 1000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0020 1008 0808 0808 0810 1020 4000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 4428 fe28 4402 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 1010 7c10 1000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 2020 4000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 7e00 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0004 0408 0810 1020 2040 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0018 2442 4282 8282 8244 3800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0808 0808 0808 1010 1000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 3c42 0204 1820 4080 fc00 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1c22 0418 0402 8284 7800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 2022 4244 84fe 0408 0808 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 3e40 8070 0804 0484 7800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0010 2040 409c a2c2 8244 3800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 7e82 0404 0808 1010 1000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0018 2444 4830 4884 8484 7800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 7884 8282 423e 0404 0810 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0020 0000 0000 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0010 1000 0000 2020 4000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0408 1020 2010 0800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 7c00 7c00 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 4020 1008 0810 2000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 3c42 0204 0810 2000 2000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 001f 204e 5253 4c21 1e00 0000 0000
|
||||
0000 0000 8080 8000 0000 0000 0000 0000
|
||||
0001 0305 0912 1227 fa42 8280 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0e11 1122 2621 4141 829c 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1c22 4480 8080 8044 3800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0010 7824 2242 4242 8284 f800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1c20 4040 7880 8080 7800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1c20 4040 7880 8080 8000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0c30 4080 8c92 8244 3800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 2222 2242 7c44 8488 8800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0808 1010 1010 2020 2000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0e34 0404 0448 8888 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1126 2830 2050 4844 4200 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1010 2020 2040 4040 3c00 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0008 1818 292a 4a4c 4881 8100 0000 0000
|
||||
0000 40c0 4040 4080 8000 0000 0000 0000
|
||||
0000 1010 2829 2945 4542 4200 0000 0000
|
||||
0000 8080 8000 0000 0000 0000 0000 0000
|
||||
0000 3844 8282 8284 8448 3000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1c22 4242 8498 8080 8000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1824 4242 8284 9448 3400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 3844 8488 f0a0 9088 8402 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1c22 2018 0442 8284 7800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0004 7e08 0810 1010 2020 2000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 2121 4142 8282 8244 3800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 4142 4244 2428 2810 1000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 8080 8888 4955 5522 2200 0000 0000
|
||||
0000 4040 8080 0000 0000 0000 0000 0000
|
||||
0004 4428 2810 1028 4844 8400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 8444 2828 1010 1020 2000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 3cc4 0810 1020 408c f000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0018 2020 2020 4040 4040 4030 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0020 2020 1010 1010 0808 0808 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0018 0404 0408 0808 1010 1060 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 2050 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 ff00 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 1e22 4284 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0020 2040 5864 4242 8284 b800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 3844 8880 8088 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0002 0204 043c 4484 8888 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 3844 84f8 8088 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
000c 1020 2078 2020 4040 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 1824 4444 8c94 6808 9060 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0020 4040 98a4 c4c4 8888 9000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1000 2020 2020 4040 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0400 0404 0408 0808 1010 9060 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 2020 4048 5060 a090 8800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 2020 2040 4040 8080 8000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 5867 4444 8888 8800 0000 0000
|
||||
0000 0000 0080 4040 4080 8000 0000 0000
|
||||
0000 0000 5864 4484 8488 8800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 1824 4484 8488 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 2834 2222 2244 5840 8080 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 344c 4484 8c94 6808 1010 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 5c60 4040 8080 8000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 1824 4038 0488 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1010 f820 2020 4040 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 2242 4484 8c94 6400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0002 8484 8848 5020 2000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0091 91aa aa44 4400 0000 0000
|
||||
0000 0000 8000 0000 0000 0000 0000 0000
|
||||
0000 0000 4448 2810 2848 4480 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 8484 8850 5020 2040 4080 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 7c88 1020 4084 f800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
1820 2040 4040 8040 4040 4040 3000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
1010 1010 2020 2020 2020 4040 4000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
2010 1010 1008 1010 1010 2020 4000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 3946 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0200 0305 0912 1227 fa42 8280 0000 0000
|
||||
8000 0000 0000 0000 0000 0000 0000 0000
|
||||
0c12 0c04 0c14 244e 7484 8484 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1c22 4284 8080 8044 3810 1060 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0810 003c 4040 f880 8080 7800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
3946 0022 5252 524a 8a8a 8480 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
2400 3844 8282 8282 8444 3800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
1200 2121 2141 4141 4122 1c00 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0004 0800 1e22 4282 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0008 0400 1e22 4282 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
000c 1200 1e22 4284 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1200 1e22 4282 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0032 4c00 1e22 4282 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0c12 0c00 1e22 4282 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 0000 3844 8880 8088 7020 1060 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0008 1000 3844 88f0 8088 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0020 1000 3844 88f0 8088 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0030 4800 3844 88f0 8088 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 2800 3844 88f0 8088 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0010 2000 2020 4040 4080 8000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0020 1000 1010 2020 2040 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0030 4800 1010 2020 2040 4000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 5000 2020 4040 4080 8000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0064 9800 5864 4484 8488 8800 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0008 1000 3844 8484 8488 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0020 1000 3844 8484 8488 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0030 4800 3844 8484 8488 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 4800 3844 8484 8488 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0064 9800 3844 8484 8488 7000 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0004 0800 2242 4484 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0010 0800 2242 4484 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
000c 1200 2242 4284 848c 7400 0000 0000
|
||||
0000 0000 0000 0000 0000 0000 0000 0000
|
||||
0000 1400 2242 4484 848c 7400 0000 0000 ]
|
||||
|
||||
@message/buf $200
|
||||
|
||||
@input/buf $200
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
( listen! )
|
||||
|
||||
|10 @Console &vector $2 &read $5 &type $1 &write $1 &error $3 &addr $2 &mode $1 &exec $1
|
||||
|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
|
||||
|20 @Screen &vector $2 &width $2 &height $2 &auto $2 &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 $6 &scrolly &scrolly-hb $1 &scrolly-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
|
||||
|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
|
||||
|000
|
||||
|
||||
|100
|
||||
@on-reset ( -> )
|
||||
( | theme )
|
||||
#f0e1 DUP2 .System/r DEO2
|
||||
DUP2 .System/g DEO2
|
||||
.System/b DEO2
|
||||
( | size )
|
||||
#0200 .Screen/width DEO2
|
||||
#0100 .Screen/height DEO2
|
||||
#0010 .Screen/x DEO2
|
||||
#0010 .Screen/y DEO2
|
||||
( | request )
|
||||
;dict/test .Console/addr DEO2
|
||||
[ LIT2 03 -Console/mode ] DEO
|
||||
[ LIT2 01 -Console/exec ] DEO
|
||||
;on-console .Console/vector DEO2
|
||||
;on-control .Controller/vector DEO2
|
||||
BRK
|
||||
|
||||
@on-console ( -> )
|
||||
[ LIT2 01 -Console/type ] DEI EQU ?{ BRK }
|
||||
[ LIT2 0a -Console/read ] DEI EQUk ?{ message/<append>
|
||||
POP BRK }
|
||||
POP2 message/<parse>
|
||||
BRK
|
||||
|
||||
@on-control ( -> )
|
||||
.Controller/key DEI DUP ?{ POP BRK }
|
||||
DUP #0d NEQ ?{ POP input/<send>
|
||||
BRK }
|
||||
input/<append>
|
||||
BRK
|
||||
|
||||
(
|
||||
@|input )
|
||||
|
||||
@input/<send> ( -- )
|
||||
;message/pen LDA2 #0010 ADD2 ;message/pen STA2
|
||||
;&buf .Console/addr DEO2
|
||||
[ LIT2 01 -Console/exec ] DEO
|
||||
JMP2r
|
||||
|
||||
@input/<append> ( c -- )
|
||||
[ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
|
||||
STA
|
||||
( >> )
|
||||
|
||||
@input/<draw> ( -- )
|
||||
#0010 .Screen/x DEO2
|
||||
;message/pen LDA2 .Screen/y DEO2
|
||||
;&buf #01 !<draw-uf2>
|
||||
|
||||
(
|
||||
@|message )
|
||||
|
||||
@message/<parse> ( -- )
|
||||
#00 /<append>
|
||||
#0010 .Screen/x DEO2
|
||||
[ LIT2 &pen 0010 ] DUP2 #0010 ADD2 ,&pen STR2
|
||||
.Screen/y DEO2
|
||||
;&buf #01 <draw-uf2>
|
||||
( >> )
|
||||
|
||||
@message/<new> ( -- )
|
||||
( reset ) ;&buf ,&ptr STR2
|
||||
JMP2r
|
||||
|
||||
@message/<append> ( c -- )
|
||||
[ LIT2 &ptr =&buf ] INC2k ,&ptr STR2
|
||||
STA
|
||||
JMP2r
|
||||
|
||||
(
|
||||
@|drawing )
|
||||
|
||||
@<draw-uf2> ( text* color -- )
|
||||
,<draw-glyph>/color STR
|
||||
[ LIT2 15 -Screen/auto ] DEO
|
||||
&>w ( -- )
|
||||
LDAk <draw-glyph>
|
||||
&continue ( -- )
|
||||
next-glyph LDAk ?&>w &end POP2 JMP2r
|
||||
|
||||
@<draw-glyph> ( char -- )
|
||||
DUP #7f LTH ?{
|
||||
POP ;check-icn .Screen/addr DEO2
|
||||
,&color LDR .Screen/sprite DEO
|
||||
JMP2r }
|
||||
#20 SUB #00 SWP
|
||||
( ) DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
|
||||
( ) ;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2
|
||||
( ) [ LIT &color 05 ] .Screen/sprite DEOk DEO
|
||||
.Screen/x DEO2
|
||||
JMP2r
|
||||
|
||||
@next-glyph ( addr* -- addr* )
|
||||
INC2 LDAk
|
||||
( utf8 ) #06 SFT #02 EQU ?next-glyph
|
||||
JMP2r
|
||||
|
||||
(
|
||||
@|stdlib )
|
||||
|
||||
@<pstr> ( str* -- )
|
||||
LDAk #18 DEO
|
||||
INC2 & LDAk ?<pstr>
|
||||
POP2 JMP2r
|
||||
|
||||
@<perr> ( str* -- )
|
||||
LDAk #19 DEO
|
||||
INC2 & LDAk ?<perr>
|
||||
POP2 JMP2r
|
||||
|
||||
@<phex> ( short* -: )
|
||||
SWP /b
|
||||
&b ( byte -: )
|
||||
DUP #04 SFT /c
|
||||
&c ( byte -: )
|
||||
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #19 DEO
|
||||
JMP2r
|
||||
|
||||
(
|
||||
@|strings )
|
||||
|
||||
@dict
|
||||
&test "ls $1
|
||||
|
||||
~src/assets.tal
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# m291
|
||||
|
||||
A music player, written in [Uxntal](https://wiki.xxiivv.com/site/uxntal.html).
|
||||
|
||||
## Build
|
||||
|
||||
You must have the [Uxn11](https://git.sr.ht/~rabbits/uxn/) assembler and emulator.
|
||||
|
||||
```sh
|
||||
uxnasm src/m291.tal bin/m291.rom
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The following command will read a `tal` file and raise warnings if optimizations can be found.
|
||||
|
||||
```sh
|
||||
ux11 bin/m291.rom
|
||||
```
|
||||
|
||||
## Extras
|
||||
|
||||
- [Need a hand?](https://llllllll.co/t/uxn-virtual-computer/46103)
|
||||
- Linted with [uxnlin](https://git.sr.ht/~rabbits/uxnlin)
|
||||
- Assembled with [drifblim](https://git.sr.ht/~rabbits/drifblim)
|
|
@ -16,6 +16,7 @@
|
|||
@playing $1
|
||||
@mode $1
|
||||
@paused $1
|
||||
@prefix &folders $1 &tracks $1
|
||||
@secfrom $2
|
||||
@secto $2
|
||||
@secprog $2
|
||||
|
@ -51,12 +52,15 @@
|
|||
( name ) "m291 0a
|
||||
( desc ) "Audio 20 "Player 0a
|
||||
( auth ) "By 20 "Linvega 20 "& 20 "d6 0a
|
||||
( date ) "29 20 "Aug 20 "2024 $2
|
||||
( date ) "6 20 "Sep 20 "2024 $2
|
||||
|
||||
%min ( x y -- min ) {
|
||||
LTHk [ JMP SWP POP ] }
|
||||
|
||||
(
|
||||
@|vectors )
|
||||
|
||||
@on-console ( -> brk )
|
||||
@on-console ( -> )
|
||||
[ LIT2 01 -Console/type ] DEI EQU ?{ BRK }
|
||||
[ LIT2 0a -Console/read ] DEI EQUk ?{ message/<append>
|
||||
POP BRK }
|
||||
|
@ -78,7 +82,7 @@
|
|||
POP2 <update-cursor>
|
||||
( | route events )
|
||||
.Mouse/y DEI2
|
||||
( > ) DUP2 #0014 LTH2 ?&status-bar
|
||||
( > ) DUP2 #0018 LTH2 ?&status-bar
|
||||
( > ) [ LIT2 00 -playing ] LDZ EQU ?{ DUP2 #0098 LTH2 ?&player }
|
||||
( | on list )
|
||||
<y-id>
|
||||
|
@ -116,11 +120,12 @@
|
|||
POP2 BRK
|
||||
|
||||
&scroll ( distance -> )
|
||||
.selection/scroll LDZ ADD
|
||||
( above ) DUP #ff EQU ?{
|
||||
( below ) DUP #18 ADD .lines/tracks LDZ GTH ?{ DUP .selection/scroll STZ
|
||||
<redraw-dir> } }
|
||||
POP BRK
|
||||
.selection/scroll LDZ ADD INCk ?{ POP BRK }
|
||||
.lines/folders LDZ .lines/tracks LDZ ADD #18 SUB
|
||||
( needs scroll ) DUP #80 LTH ?{ POP2 BRK }
|
||||
( max scroll ) min .selection/scroll STZ
|
||||
<redraw-dir>
|
||||
BRK
|
||||
|
||||
@on-control ( -> )
|
||||
( | mod )
|
||||
|
@ -130,6 +135,7 @@
|
|||
( esc ) DUP #1b NEQ ?{ <escape> }
|
||||
( enter ) DUP #0d NEQ ?{ .selection LDZ <pick> }
|
||||
( space ) DUP #20 NEQ ?{ <send-pause> }
|
||||
DUP #20 SUB #5f GTH ?{ DUP <find-any> }
|
||||
POP
|
||||
( | button )
|
||||
.Controller/button DEI
|
||||
|
@ -137,8 +143,8 @@
|
|||
( down ) DUP #20 NEQ ?{ #01 <move> }
|
||||
( left ) DUP #40 NEQ ?{ <escape> }
|
||||
( right ) DUP #80 NEQ ?{ .selection LDZ <pick> }
|
||||
( A ) DUP #01 NEQ ?{ .selection LDZ <pick> }
|
||||
( B ) DUP #02 NEQ ?{ <send-pause> }
|
||||
( select [shift] ) DUP #04 NEQ ?{ <send-pause> }
|
||||
( start [home] ) DUP #08 NEQ ?{ .selection LDZ <pick> }
|
||||
POP BRK
|
||||
|
||||
(
|
||||
|
@ -192,7 +198,7 @@
|
|||
@<seek> ( x* -- )
|
||||
pos-to-seconds DUP2 #00e7 LTH2 #00 SWP ADD2 ;dict/jump-cmd <pstr>
|
||||
<pdec>
|
||||
LIT2 "s 18 DEO
|
||||
[ LIT2 "s 18 ] DEO
|
||||
#0a18 DEO
|
||||
JMP2r
|
||||
|
||||
|
@ -208,16 +214,26 @@
|
|||
JMP2r
|
||||
|
||||
@<send-pause> ( -- )
|
||||
.playing LDZ ?{ JMP2r }
|
||||
[ LIT2 02 -paused ] LDZ ORA .paused STZ
|
||||
;dict/pause-cmd <pstr> !<draw-play>
|
||||
|
||||
@<move> ( mod -- )
|
||||
.selection LDZ ADD
|
||||
( top ) DUP .selection/scroll LDZ #ff00 NEQ2 ?{ POP JMP2r }
|
||||
( top ) INCk ?{ POP JMP2r }
|
||||
( bottom ) DUP .lines/folders LDZ .lines/tracks LDZ ADD NEQ ?{ POP JMP2r }
|
||||
( >> )
|
||||
|
||||
@<select> ( id -- )
|
||||
( | follow )
|
||||
DUP .selection/scroll LDZ SUB
|
||||
( top ) DUP #80 AND #00 EQU ?{
|
||||
DUP .selection/scroll LDZ ADD .selection/scroll STZ !&resume }
|
||||
( bottom ) DUP #18 LTH ?{
|
||||
DUP .selection/scroll LDZ ADD #17 SUB .selection/scroll STZ }
|
||||
&resume ( id scroll -- )
|
||||
POP
|
||||
( | continue )
|
||||
[ LIT &last ff ] NEQk ?{ POP2 JMP2r }
|
||||
POP DUP ,&last STR
|
||||
.selection STZ !<redraw-dir>
|
||||
|
@ -228,7 +244,7 @@
|
|||
POP JMP2r
|
||||
|
||||
&tracks ( id -- )
|
||||
.selection/scroll LDZ ADD DUP .selection/track STZ
|
||||
DUP .selection/track STZ
|
||||
#00 SWP
|
||||
( CELLSIZE ) #70 SFT2 ;mem/tracks ADD2 !<send-load>
|
||||
|
||||
|
@ -240,13 +256,31 @@
|
|||
path/<push> !<refresh-dir>
|
||||
|
||||
@<escape> ( -- )
|
||||
( > ) [ LIT2 00 -selection/scroll ] STZ
|
||||
;path/null LDA ?{ JMP2r }
|
||||
[ LIT2 00 -selection/scroll ] STZ
|
||||
path/pop !<refresh-dir>
|
||||
|
||||
@<change-mode> ( -- )
|
||||
.mode LDZk INC #03 DIVk MUL SUB SWP STZ !<draw-mode>
|
||||
|
||||
@<find-any> ( letter -- )
|
||||
( case insensitive ) cflc STH
|
||||
( | folders )
|
||||
.lines/folders LDZ #00
|
||||
&>folders ( -- )
|
||||
#00 OVR
|
||||
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2 LDA cflc STHkr NEQ ?{ POPr NIP !<select> }
|
||||
INC GTHk ?&>folders
|
||||
POP2
|
||||
( | tracks )
|
||||
.lines/tracks LDZ #00
|
||||
&>tracks ( -- )
|
||||
#00 OVR
|
||||
( CELLSIZE ) #70 SFT2 ;mem/tracks ADD2 LDA cflc STHkr NEQ ?{
|
||||
POPr NIP .lines/folders LDZ ADD !<select> }
|
||||
INC GTHk ?&>tracks
|
||||
POP2 POPr JMP2r
|
||||
|
||||
(
|
||||
@|events )
|
||||
|
||||
|
@ -279,6 +313,7 @@
|
|||
POP2 STH2r STH2r SWP2 OVR2 ADD2 SWP2
|
||||
( | print )
|
||||
calc-width .secprog STZ2
|
||||
<draw-title-scroll>
|
||||
<draw-progress>
|
||||
<draw-timestamp> !message/<new>
|
||||
|
||||
|
@ -308,20 +343,7 @@
|
|||
|
||||
@<y-id> ( y* -- id )
|
||||
[ LIT2 00 -playing ] LDZ EQU ?{ #0080 SUB2 }
|
||||
#0018 SUB2
|
||||
( | above )
|
||||
DUP2 #8000 GTH2 ?&outside
|
||||
( | spacer )
|
||||
has-spacer #00 EQU ?{
|
||||
DUP2 [ LIT2 00 -lines/folders ] LDZ #40 SFT2 SUB2 #0008 LTH2 ?&outside
|
||||
DUP2 [ LIT2 00 -lines/folders ] LDZ #40 SFT2 GTH2 #00 SWP #30 SFT2 SUB2 }
|
||||
#04 SFT2 NIP
|
||||
( | below )
|
||||
DUP count-lines LTH ?{ POP #ff }
|
||||
JMP2r
|
||||
|
||||
&outside ( y* -- id )
|
||||
POP2 #ff JMP2r
|
||||
#0018 SUB2 #04 SFT2 NIP #17 min .selection/scroll LDZ ADD JMP2r
|
||||
|
||||
@<refresh-dir> ( -- )
|
||||
;path .File/name DEO2
|
||||
|
@ -335,16 +357,15 @@
|
|||
&w ( -- )
|
||||
DUP2 <parse-line>
|
||||
lcap/ INC2 LDAk ?&w
|
||||
POP2 sort-folders sort-tracks
|
||||
POP2 <post-refresh>
|
||||
( >> )
|
||||
|
||||
@<fit-window> ( -- )
|
||||
#00
|
||||
( folders ) .lines/folders LDZ
|
||||
( tracks ) .lines/tracks LDZ
|
||||
( scroll ) #18 LTHk [ JMP SWP ] POP ADD
|
||||
( tracks ) .lines/tracks LDZ ADD
|
||||
( scroll ) #18 LTHk [ JMP SWP ] POP
|
||||
( empty ) DUP #00 EQU ADD #40 SFT2
|
||||
( no-folder spacer ) has-spacer #00 EQU ?{ #0008 ADD2 }
|
||||
( padding ) #0020 ADD2
|
||||
( playing ) [ LIT2 00 -playing ] LDZ EQU ?{ #0080 ADD2 }
|
||||
.Screen/height DEO2
|
||||
|
@ -382,43 +403,84 @@
|
|||
@str-lth ( a* b* -- a>b )
|
||||
STH2
|
||||
&>loop ( -- )
|
||||
LDAk LDAkr STHr SUBk ?&done
|
||||
DUP2 #0000 EQU2 ?&done
|
||||
POP2 INC2 INC2r !&>loop
|
||||
&done NIP2 LTH POP2r JMP2r
|
||||
LDAk LDAkr STHr SUBk ?{
|
||||
DUP2 #0000 EQU2 ?{ POP2 INC2 INC2r !&>loop } }
|
||||
NIP2 LTH POP2r JMP2r
|
||||
|
||||
@str-len ( a* -- len )
|
||||
[ LITr 00 ]
|
||||
&>loop ( -- )
|
||||
LDAk ?{ POP2 STHr JMP2r }
|
||||
INCr INC2 !&>loop
|
||||
|
||||
@str-prefix ( a* b* -- len )
|
||||
STH2
|
||||
DUP2 ,&a0 STR2
|
||||
&>loop ( -- )
|
||||
LDAk LDAkr STHr NEQk ?{
|
||||
DUP2 #0000 EQU2 ?{ POP2 INC2 INC2r !&>loop } }
|
||||
POP2 POP2r [ LIT2 &a0 $2 ] SUB2 NIP JMP2r
|
||||
|
||||
@<post-refresh> ( -- )
|
||||
common-folder-prefix .prefix/folders STZ
|
||||
common-track-prefix .prefix/tracks STZ
|
||||
sort-folders !sort-tracks
|
||||
|
||||
@sort-folders ( -- )
|
||||
;mem/folders DUP2 LIT2 [ 00 -lines/folders ] LDZ #01 SUB #70 SFT2 ADD2 !sort-tracks-0
|
||||
.lines/folders LDZ ?{ JMP2r }
|
||||
;mem/folders DUP2 [ LIT2 00 -lines/folders ] LDZ #01 SUB
|
||||
( CELLSIZE ) #70 SFT2 ADD2 !sort-files
|
||||
|
||||
@sort-tracks ( -- )
|
||||
;mem/tracks DUP2 LIT2 [ 00 -lines/tracks ] LDZ #01 SUB #70 SFT2 ADD2
|
||||
.lines/tracks LDZ ?{ JMP2r }
|
||||
;mem/tracks DUP2 [ LIT2 00 -lines/tracks ] LDZ #01 SUB
|
||||
( CELLSIZE ) #70 SFT2 ADD2
|
||||
( >> )
|
||||
|
||||
@sort-tracks-0 ( first* last* -- )
|
||||
SWP2 &loop GTH2k ?&ok
|
||||
POP2 POP2 JMP2r
|
||||
&ok OVR2 OVR2 STH2k #0080 ADD2 &loop2 LTH2k ?&done
|
||||
DUP2 STH2kr str-lth ?&replace
|
||||
!&inc
|
||||
&replace POP2r STH2k &inc #0080 ADD2 !&loop2
|
||||
&done POP2 POP2 DUP2 STH2r swap-tracks #0080 ADD2 !&loop
|
||||
@sort-files ( first* last* -- )
|
||||
SWP2
|
||||
&>loop ( -- )
|
||||
GTH2k ?{ POP2 POP2 JMP2r }
|
||||
OVR2 OVR2 STH2k #0080 ADD2
|
||||
&>loop2 ( -- )
|
||||
LTH2k ?&done
|
||||
DUP2 STH2kr str-lth ?&replace
|
||||
!{
|
||||
&replace POP2r STH2k }
|
||||
#0080 ADD2 !&>loop2
|
||||
|
||||
&done ( -- )
|
||||
POP2 POP2 DUP2 STH2r swap-tracks #0080 ADD2 !&>loop
|
||||
|
||||
@swap-tracks ( src* dst* -- )
|
||||
EQU2k ?&skip
|
||||
DUP2 ;tmp <scpy>
|
||||
OVR2 STH2
|
||||
<scpy>
|
||||
;tmp STH2r <scpy>
|
||||
JMP2r
|
||||
&skip POP2 POP2 JMP2r
|
||||
EQU2k ?{
|
||||
DUP2 ;tmp <scpy>
|
||||
OVR2 STH2
|
||||
<scpy>
|
||||
;tmp STH2r !<scpy> }
|
||||
POP2 POP2 JMP2r
|
||||
|
||||
@common-folder-prefix ( -- len )
|
||||
[ LIT2 01 -lines/folders ] LDZ LTH ?{ #00 JMP2r }
|
||||
;mem/folders DUP2 [ LIT2 00 -lines/folders ] LDZ #70 SFT2 ADD2 !common-prefix-0
|
||||
|
||||
@common-track-prefix ( -- len )
|
||||
[ LIT2 01 -lines/tracks ] LDZ LTH ?{ #00 JMP2r }
|
||||
;mem/tracks DUP2 [ LIT2 00 -lines/tracks ] LDZ #70 SFT2 ADD2
|
||||
( >> )
|
||||
|
||||
@common-prefix-0 ( first* limit* -- len )
|
||||
SWP2 DUP2k str-len STH
|
||||
,&s0 STR2
|
||||
#0080 ADD2
|
||||
&>loop ( -- )
|
||||
GTH2k ?{ POP2 POP2 STHr JMP2r }
|
||||
DUP2 [ LIT2 &s0 $2 ] str-prefix STHr min STH
|
||||
#0080 ADD2 !&>loop
|
||||
|
||||
@count-lines ( -- lines )
|
||||
.lines/folders LDZ .lines/tracks LDZ ADD JMP2r
|
||||
|
||||
@has-spacer ( -- f )
|
||||
[ LIT2 00 -lines/folders ] LDZ NEQ
|
||||
( .. ) [ LIT2 00 -lines/tracks ] LDZ NEQ AND JMP2r
|
||||
|
||||
@is-folder ( line* -- line* f )
|
||||
DUP2 lcap/ #0001 SUB2 LDA [ LIT "/ ] EQU JMP2r
|
||||
|
||||
|
@ -513,32 +575,54 @@
|
|||
#0008 .Screen/x DEO2
|
||||
;dict/empty #0f !<draw-uf2> }
|
||||
( | folders )
|
||||
;mem/folders .lines/folders LDZ .selection LDZ <draw-folders>
|
||||
has-spacer #00 EQU ?{ ;dash-icn <draw-spacer> }
|
||||
;mem/tracks .lines/tracks LDZ .selection LDZ .lines/folders LDZ SUB
|
||||
<draw-folders>
|
||||
( >> )
|
||||
|
||||
@<draw-files> ( addr* length selection -- )
|
||||
,&sel STR
|
||||
DUP ?{ POP2 POP JMP2r }
|
||||
@<draw-tracks> ( -- )
|
||||
.selection LDZ .lines/folders LDZ SUB ,&sel STR
|
||||
#0008 .Screen/x DEO2
|
||||
#00 SWP2 ,&t STR2
|
||||
.lines/tracks LDZ #00 NEQk ?{ POP2 JMP2r }
|
||||
.selection/scroll LDZ .lines/folders LDZ LTH ?{
|
||||
.selection/scroll LDZ .lines/folders LDZ SUB ADD }
|
||||
&>l ( -- )
|
||||
( scroll ) DUP #18 LTH ?{ POP2 JMP2r }
|
||||
[ LITr 05 ]
|
||||
( | selected )
|
||||
DUP [ LIT &sel $1 ] NEQ ?{
|
||||
POPr [ LITr 06 ] ;fill-icn <draw-background> }
|
||||
( | marker )
|
||||
DUP .selection/scroll LDZ ADD .selection/track LDZ NEQ ?{
|
||||
DUP .selection/track LDZ NEQ ?{
|
||||
[ LIT2 15 -Screen/auto ] DEO
|
||||
#0000 .Screen/x DEO2
|
||||
;poke-icn .Screen/addr DEO2
|
||||
DUPr [ LITr -Screen/sprite ] DEOr }
|
||||
( | normal )
|
||||
#0008 .Screen/x DEO2
|
||||
#00 OVR .selection/scroll LDZ ADD
|
||||
( CELLSIZE ) #70 SFT2 [ LIT2 &t $2 ] ADD2 STHr <draw-uf2>
|
||||
#00 OVR
|
||||
( CELLSIZE ) #70 SFT2 ;mem/tracks ADD2 STHr <draw-uf2-track>
|
||||
.Screen/y DEI2k #0010 ADD2 ROT DEO2
|
||||
INC GTHk ?&>l
|
||||
POP2 JMP2r
|
||||
|
||||
@<draw-folders> ( -- )
|
||||
.selection LDZ ,&sel STR
|
||||
#0008 .Screen/x DEO2
|
||||
.lines/folders LDZ #00 NEQk ?{ POP2 JMP2r }
|
||||
.selection/scroll LDZ ADD GTHk ?{ POP2 JMP2r }
|
||||
&>l ( -- )
|
||||
[ LITr 05 ]
|
||||
( | selected )
|
||||
DUP [ LIT &sel $1 ] NEQ ?{
|
||||
POPr [ LITr 06 ] ;fill-icn <draw-background> }
|
||||
( | gizmo )
|
||||
.Screen/y DEI2 [ LIT2 15 -Screen/auto ] DEO
|
||||
.Screen/width DEI2 #0010 SUB2 .Screen/x DEO2
|
||||
[ LIT2 00 "> ] #20 SUB #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
|
||||
DUPr [ LITr -Screen/sprite ] DEOr
|
||||
.Screen/y DEO2
|
||||
( | normal )
|
||||
#0008 .Screen/x DEO2
|
||||
#00 OVR
|
||||
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2 STHr <draw-uf2-folder>
|
||||
.Screen/y DEI2k #0010 ADD2 ROT DEO2
|
||||
INC GTHk ?&>l
|
||||
POP2 JMP2r
|
||||
|
@ -576,10 +660,23 @@
|
|||
<draw-next>
|
||||
<draw-progress> !<draw-timestamp>
|
||||
|
||||
@<draw-title-scroll> ( -- )
|
||||
;id3/title get-uf2-width #00d0 LTH2 ?{
|
||||
[ LIT2 &f $2 ] INC2k ,&f STR2
|
||||
DUP #0f AND ?{
|
||||
#0020 .Screen/y DEO2
|
||||
<clear-line>
|
||||
#0001 .Screen/x DEO2
|
||||
#0020 .Screen/y DEO2
|
||||
#04 SFT2 ;id3/title !<draw-uf2-scroll> }
|
||||
POP2 }
|
||||
JMP2r
|
||||
|
||||
@<draw-title> ( -- )
|
||||
( | clear )
|
||||
#0020 .Screen/y DEO2
|
||||
<clear-line>
|
||||
#0000 ;<draw-title-scroll>/f STA2
|
||||
( | draw )
|
||||
#0020 .Screen/y DEO2
|
||||
;id3/title get-uf2-width #00d0 LTH2 ?{
|
||||
|
@ -744,30 +841,6 @@
|
|||
.Screen/y DEO2
|
||||
JMP2r
|
||||
|
||||
@<draw-folders> ( addr* length selection -- )
|
||||
,&sel STR
|
||||
DUP ?{ POP2 POP JMP2r }
|
||||
#0008 .Screen/x DEO2
|
||||
#00 SWP2 ,&t STR2
|
||||
&>l ( -- )
|
||||
[ LITr 05 ]
|
||||
( | selected )
|
||||
DUP [ LIT &sel $1 ] NEQ ?{
|
||||
POPr [ LITr 06 ] ;fill-icn <draw-background> }
|
||||
( | gizmo )
|
||||
.Screen/y DEI2 [ LIT2 15 -Screen/auto ] DEO
|
||||
.Screen/width DEI2 #0010 SUB2 .Screen/x DEO2
|
||||
[ LIT2 00 "> ] #20 SUB #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
|
||||
DUPr [ LITr -Screen/sprite ] DEOr
|
||||
.Screen/y DEO2
|
||||
( | normal )
|
||||
#0008 .Screen/x DEO2
|
||||
#00 OVR
|
||||
( CELLSIZE ) #70 SFT2 [ LIT2 &t $2 ] ADD2 STHr <draw-uf2>
|
||||
.Screen/y DEI2k #0010 ADD2 ROT DEO2
|
||||
INC GTHk ?&>l
|
||||
POP2 JMP2r
|
||||
|
||||
@get-uf2-width ( text* -- width* )
|
||||
[ LIT2r 0000 ]
|
||||
&>while ( -- )
|
||||
|
@ -775,10 +848,33 @@
|
|||
ADD2r next-glyph LDAk ?&>while
|
||||
POP2 STH2r JMP2r
|
||||
|
||||
@<draw-uf2-scroll> ( offset* text* -- )
|
||||
[ LIT2 15 -Screen/auto ] DEO
|
||||
.Screen/width DEI2 ,&bound STR2
|
||||
STH2k llen DIV2k MUL2 SUB2 STH2kr ADD2
|
||||
&>w ( -- )
|
||||
.Screen/x DEI2 [ LIT2 &bound $2 ] LTH2 ?{ POP2 POP2r JMP2r }
|
||||
LDAk DUP ?{
|
||||
POP2 POP STH2kr #20 <draw-glyph> !&>w }
|
||||
<draw-glyph>
|
||||
next-glyph !&>w
|
||||
|
||||
@<draw-uf2-center> ( text* color -- )
|
||||
STH
|
||||
.Screen/x DEI2 OVR2 get-uf2-width #01 SFT2 SUB2 .Screen/x DEO2
|
||||
STHr
|
||||
STHr !<draw-uf2>
|
||||
|
||||
@<draw-uf2-folder> ( text* color -- )
|
||||
STH
|
||||
.prefix/folders LDZ #03 GTH ?{ STHr !<draw-uf2> }
|
||||
;dict/ellipses STHkr <draw-uf2>
|
||||
[ LIT2 00 -prefix/folders ] LDZ ADD2 STHr !<draw-uf2>
|
||||
|
||||
@<draw-uf2-track> ( text* color -- )
|
||||
STH
|
||||
.prefix/tracks LDZ #03 GTH ?{ STHr !<draw-uf2> }
|
||||
;dict/ellipses STHkr <draw-uf2>
|
||||
[ LIT2 00 -prefix/tracks ] LDZ ADD2 STHr
|
||||
( >> )
|
||||
|
||||
@<draw-uf2> ( text* color -- )
|
||||
|
@ -786,18 +882,13 @@
|
|||
[ LIT2 15 -Screen/auto ] DEO
|
||||
.Screen/width DEI2 #0018 SUB2 ,&bound STR2
|
||||
&>w ( -- )
|
||||
LDAk [ LIT ". ] NEQ ?{ INC2k ;dict/mp3-ext scmp3 ?&end }
|
||||
LDAk <draw-glyph>
|
||||
( | trim )
|
||||
.Screen/x DEI2 [ LIT2 &bound $2 ] LTH2 ?{
|
||||
POP2 [ LIT ". ] <draw-glyph>
|
||||
[ LIT ". ] !<draw-glyph> }
|
||||
next-glyph LDAk ?&>w
|
||||
POP2 JMP2r
|
||||
|
||||
@next-glyph ( addr* -- addr* )
|
||||
INC2 LDAk
|
||||
( utf8 ) #06 SFT #02 EQU ?next-glyph
|
||||
JMP2r
|
||||
next-glyph LDAk ?&>w &end POP2 JMP2r
|
||||
|
||||
@<draw-glyph> ( char -- )
|
||||
DUP #7f LTH ?{
|
||||
|
@ -811,6 +902,11 @@
|
|||
.Screen/x DEO2
|
||||
JMP2r
|
||||
|
||||
@next-glyph ( addr* -- addr* )
|
||||
INC2 LDAk
|
||||
( utf8 ) #06 SFT #02 EQU ?next-glyph
|
||||
JMP2r
|
||||
|
||||
@<update-cursor> ( color addr* -- )
|
||||
;fill-icn .Screen/addr DEO2
|
||||
#40 <draw-cursor>
|
||||
|
@ -829,6 +925,10 @@
|
|||
(
|
||||
@|stdlib )
|
||||
|
||||
@cflc ( c -- lowercase )
|
||||
DUP #41 SUB #1a GTH ?{ #20 ADD }
|
||||
JMP2r
|
||||
|
||||
@scap ( str* -- end* )
|
||||
INC2 & LDAk ?scap
|
||||
JMP2r
|
||||
|
@ -939,6 +1039,7 @@
|
|||
&pause-cmd "pause 0a $1
|
||||
&no-artist "Unknown 20 "Artist $1
|
||||
&no-album "Unknown 20 "Album $1
|
||||
&ellipses "... 20 $1
|
||||
|
||||
~src/assets.tal
|
||||
|
||||
|
|
Loading…
Reference in New Issue