@@ 9,6 9,8 @@
|0000
+ @tool $1
+
|0100
#fc0f .System/r DEO2
@@ 76,21 78,19 @@ JMP2r
( next shape ) #0009 ADD2
JMP2r
-@get-x1 ( mem* -- x1* mem* )
- LDA2k SWP2
-JMP2r
-
-@get-y1 ( mem* -- x1* mem* )
- INC2k INC2 LDA2 SWP2
-JMP2r
-
-@get-x2 ( mem* -- x1* mem* )
- INC2k #0003 ADD2 LDA2 SWP2
-JMP2r
-
-@get-y2 ( mem* -- x1* mem* )
- INC2k #0005 ADD2 LDA2 SWP2
-JMP2r
+(
+@|tools )
+
+@tool-select
+ &name =dict/select
+@tool-text
+ &name =dict/text
+@tool-line
+ &name =dict/line
+@tool-rect
+ &name =dict/rect
+@tool-arc
+ &name =dict/arc
(
@|drawing )
@@ 178,6 178,34 @@ JMP2r
@draw-toolbar ( -- )
+ #0010
+ DUP2 .Screen/x DEO2
+ .Screen/y DEO2
+ ;tools-lut/end ;tools-lut
+ &l
+ ( is selected ) DUP2 ;tools-lut SUB2 NIP #01 SFT .tool LDZ EQU STH
+ LDA2k LDA2 #0c09 STHr JMP SWP POP draw-text-color
+ #0010 .Screen/x DEO2
+ #0008 .Screen/y DEI2 ADD2 .Screen/y DEO2
+ INC2 INC2 GTH2k ?&l
+ POP2 POP2
+
+JMP2r
+
+@draw-text-color ( str* color -- )
+
+ ,draw-text/color STR
+
+@draw-text ( str* -- )
+
+ #01 .Screen/auto DEO
+ &w
+ LDAk #00 SWP #20 SUB #30 SFT2 ;font ADD2 .Screen/addr DEO2
+ [ LIT &color 01 ] .Screen/sprite DEO
+ INC2 LDAk ?&w
+ POP2
+ #00 .Screen/auto DEO
+
JMP2r
@update-cursor ( color addr* -- )
@@ 193,6 221,25 @@ JMP2r
JMP2r
(
+@|helpers )
+
+@get-x1 ( mem* -- x1* mem* )
+ LDA2k SWP2
+JMP2r
+
+@get-y1 ( mem* -- x1* mem* )
+ INC2k INC2 LDA2 SWP2
+JMP2r
+
+@get-x2 ( mem* -- x1* mem* )
+ INC2k #0003 ADD2 LDA2 SWP2
+JMP2r
+
+@get-y2 ( mem* -- x1* mem* )
+ INC2k #0005 ADD2 LDA2 SWP2
+JMP2r
+
+(
@|stdlib )
@abs2 DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 JMP2r
@@ 208,6 255,21 @@ JMP2r
(
@|assets )
+@dict
+ &select "select $1
+ &text "text $1
+ &line "line $1
+ &rect "rect $1
+ &arc "arc $1
+
+@tools-lut
+ =tool-select
+ =tool-text
+ =tool-line
+ =tool-rect
+ =tool-arc
+ &end
+
@shapes-lut
=shape-null
=shape-color
@@ 221,6 283,55 @@ JMP2r
[ 0018 245a 5a24 1800 183c 7ee7 e77e 3c18 ]
@brush
&1 [ 3c7e ffff ffff 7e3c ]
+@font ( atari8 )
+0000 0000 0000 0000 6060 6060 6000 6000
+6666 6600 0000 0000 006c fe6c 6cfe 6c00
+183e 603c 067c 1800 0066 6c18 3066 4600
+386c 3870 decc 7600 6060 6000 0000 0000
+1c30 3030 3030 1c00 380c 0c0c 0c0c 3800
+0066 3cff 3c66 0000 0018 187e 1818 0000
+0000 0000 0030 3060 0000 007e 0000 0000
+0000 0000 0018 1800 0306 0c18 3060 c000
+3c66 6e76 6666 3c00 1838 1818 1818 7e00
+3c66 060c 1830 7e00 7e0c 180c 0666 3c00
+0c1c 3c6c 7e0c 0c00 7e60 7c06 0666 3c00
+3c60 607c 6666 3c00 7e06 0c18 3030 3000
+3c66 663c 6666 3c00 3c66 663e 060c 3800
+0018 1800 0018 1800 0018 1800 1818 3000
+0c18 3060 3018 0c00 0000 7e00 007e 0000
+3018 0c06 0c18 3000 3c66 060c 1800 1800
+3c66 6e6a 6e60 3e00 183c 6666 7e66 6600
+7c66 667c 6666 7c00 3c66 6060 6066 3c00
+786c 6666 666c 7800 7e60 607c 6060 7e00
+7e60 607c 6060 6000 3e60 606e 6666 3e00
+6666 667e 6666 6600 3c18 1818 1818 3c00
+3e06 0606 0666 3c00 666c 7870 786c 6600
+6060 6060 6060 7e00 c6ee fed6 c6c6 c600
+6676 7e7e 6e66 6600 3c66 6666 6666 3c00
+7c66 667c 6060 6000 3c66 6666 766c 3600
+7c66 667c 6c66 6600 3c66 603c 0666 3c00
+7e18 1818 1818 1800 6666 6666 6666 3e00
+6666 6666 663c 1800 c6c6 c6d6 feee c600
+6666 3c18 3c66 6600 6666 663c 1818 1800
+7e06 0c18 3060 7e00 3c30 3030 3030 3c00
+c060 3018 0c06 0300 3c0c 0c0c 0c0c 3c00
+1038 6cc6 0000 0000 0000 0000 0000 fe00
+0060 3018 0000 0000 0000 3c06 3e66 3e00
+6060 7c66 6666 7c00 0000 3c60 6060 3c00
+0606 3e66 6666 3e00 0000 3c66 7e60 3c00
+1c30 7c30 3030 3000 0000 3e66 663e 067c
+6060 7c66 6666 6600 1800 3818 1818 3c00
+1800 1818 1818 1870 6060 666c 786c 6600
+3818 1818 1818 3c00 0000 ecfe d6c6 c600
+0000 7c66 6666 6600 0000 3c66 6666 3c00
+0000 7c66 6666 7c60 0000 3e66 6666 3e06
+0000 7c66 6060 6000 0000 3e60 3c06 7c00
+0018 7e18 1818 0e00 0000 6666 6666 3e00
+0000 6666 663c 1800 0000 c6c6 d67c 6c00
+0000 663c 183c 6600 0000 6666 663e 067c
+0000 7e0c 1830 7e00 1c30 3060 3030 1c00
+1818 1818 1818 1818 380c 0c06 0c0c 3800
+0000 60f2 9e0c 0000 3c42 9985 8599 423c
(
@|memory )