commit 57e969e
Devine Lu Linvega
·
2024-11-13 16:45:24 +0000 UTC
parent 2e8e2d5
bios rom is drawing stacks
3 files changed,
+43,
-61
+4,
-3
1@@ -16,9 +16,10 @@
2 |0100 ( -> )
3
4 ( theme )
5- #4cfd .System/r DEO2
6- #4cf3 .System/g DEO2
7- #dcf2 .System/b DEO2
8+ #0fa8 .System/r DEO2
9+ #0f4f .System/g DEO2
10+ #0fc2 .System/b DEO2
11+ #abcd
12
13 ( vectors )
14 ;on-mouse .Mouse/vector DEO2
+0,
-0
+39,
-58
1@@ -11,16 +11,18 @@
2
3 @on-reset ( -> )
4 ;on-frame .Screen/vector DEO2
5+ .Screen/height DEI2 #0030 SUB2 ,on-frame/anchor-y STR2
6 BRK
7
8 @on-frame ( -> )
9- #0040 .Screen/x DEO2
10- #0070 .Screen/y DEO2
11- [ LIT2 15 -Screen/auto ] DEO
12- #8000 .System/wst DEI ;wst-txt <draw-stack>
13- #0040 .Screen/x DEO2
14- #0090 .Screen/y DEO2
15- #8100 .System/rst DEI ;rst-txt <draw-stack>
16+ [ LIT &f $1 ] INCk ,&f STR
17+ #07 AND ?{
18+ #0008 .Screen/x DEO2
19+ [ LIT2 &anchor-y $2 ] .Screen/y DEO2
20+ #8000 .System/wst DEI ;dict/wst-txt <draw-stack>
21+ #0008 .Screen/x DEO2
22+ .Screen/y DEI2k #0019 ADD2 ROT DEO2
23+ #8100 .System/rst DEI ;dict/rst-txt <draw-stack> }
24 BRK
25
26 %<draw-space> ( -- ) {
27@@ -29,66 +31,45 @@
28 @<draw-stack> ( addr* ptr name* -- )
29 <draw-text>
30 <draw-space>
31- #43 ;<draw-glyph>/color STA
32+ #43 ;<draw-char>/color STA
33 DUP <draw-byte>
34 <draw-space>
35- #41 ;<draw-glyph>/color STA
36- #04 SUB #00 SWP ADD2 DUP2 #0009 ADD2 SWP2 [ LITr 00 ]
37+ #41 ;<draw-char>/color STA
38+ #04 SUB #00 SWP ADD2 DUP2 #0009 ADD2 SWP2 STHk
39 &>l ( -- )
40- STHkr #04 NEQ ?{ #44 ;<draw-glyph>/color STA }
41- STHkr #05 NEQ ?{ #41 ;<draw-glyph>/color STA }
42+ STHkr #80 LTH #42 SWP SUB ;<draw-char>/color STA
43 LDAk <draw-byte>
44 .Screen/x DEI2k #0008 ADD2 ROT DEO2
45 INCr INC2 GTH2k ?&>l
46- POP2 POP2 POPr JMP2r
47-
48-@wst-txt "WST $1
49-
50-@rst-txt "RST $1
51+ POP2 POP2 POPr
52+ ( | outline )
53+ .Screen/x DEI2k #0080 SUB2 ROT DEO2
54+ .Screen/y DEI2k #0008 SUB2 ROT DEO2
55+ [ LIT2 35 -Screen/auto ] DEO
56+ ;outline-icn .Screen/addr DEO2
57+ [ LIT2 4a -Screen/sprite ] DEOk DEOk DEOk DEO
58+ .Screen/y DEI2k #0008 ADD2 ROT DEO2
59+ .Screen/x DEI2k #0018 SUB2 ROT DEO2
60+ JMP2r
61
62 @<draw-text> ( str* -- )
63 [ LIT2 15 -Screen/auto ] DEO
64 &>w ( -- )
65- LDAk #08 NEQ ?{ <draw-bs> !&res }
66- LDAk #0a NEQ ?{ <draw-lb> !&res }
67- ( ) LDAk <draw-char> &res INC2 LDAk ?&>w
68+ LDAk <draw-char> &res INC2 LDAk ?&>w
69 POP2 JMP2r
70
71 @<draw-byte> ( byte -- )
72+ [ LIT2 15 -Screen/auto ] DEO
73 DUP #04 SFT <draw-hex>
74
75 @<draw-hex> ( byte -- )
76 #0f AND #00 SWP ;base16-lut ADD2 LDA
77
78 @<draw-char> ( char -- )
79- get-glyph
80- ( >> )
81-
82-@<draw-glyph> ( addr* -- )
83- .Screen/addr DEO2
84+ #20 SUB #00 SWP #40 SFT2 ;font-icn ADD2 .Screen/addr DEO2
85 [ LIT2 &color 41 -Screen/sprite ] DEO
86 JMP2r
87
88-@get-glyph ( char -- addr* )
89- DUP #0a EQU ?&blank
90- DUP #09 EQU ?&blank
91- DUP #20 LTH ?&unknown
92- DUP #7e GTH ?&unknown
93- #20 SUB #00 SWP #40 SFT2 ;font-icn ADD2 JMP2r
94- &unknown POP ;halftone-icn JMP2r
95- &blank POP ;blank-icn JMP2r
96-
97-@<draw-lb> ( -- )
98- .Screen/y DEI2k #0010 ADD2 ROT DEO2
99- #0014 .Screen/x DEO2
100- JMP2r
101-
102-@<draw-bs> ( -- )
103- .Screen/x DEI2k #0008 SUB2 ROT DEO2
104- #20 <draw-char>
105- .Screen/x DEI2k #0008 SUB2 ROT DEO2
106- JMP2r
107-
108 @<phex> ( short* -: )
109 SWP /b
110 &b ( byte -: )
111@@ -97,25 +78,25 @@
112 #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #19 DEO
113 JMP2r
114
115-@base16-lut [ "0123456789abcdef ]
116+@dict
117+ &wst-txt "WST $1
118+ &rst-txt "RST $1
119
120-@cursor-icn [ 80c0 e0f0 f8e0 1000 ]
121+@base16-lut [ "0123456789abcdef ]
122
123 @fill-icn [ ffff ffff ffff ffff ]
124
125-@caret-icn [ 4040 4040 4040 4040 4040 4040 4040 4040 ]
126-
127-@blank-icn [ $10 ]
128-
129 @halftone-icn [ aa55 aa55 aa55 aa55 aa55 aa55 aa55 aa55 ]
130
131-@ascii-icn [
132- aa55 805f 9051 9357 aa55 02f9 0a89 cae9
133- 9753 9150 9f40 aa55 eac9 8a09 fa01 aa55 ]
134-
135-@hex-icn [
136- aa55 805f 9057 9455 aa55 02f9 0ae9 2aa9
137- 9554 9750 9f40 aa55 aa29 ea09 fa01 aa55 ]
138+@outline-icn [
139+ 0000 0000 0304 0808 0808 0808 0808 0808
140+ 0808 0808 0808 0808 0808 0403 0000 0000
141+ 0000 0000 ff00 0000 0000 0000 0000 0000
142+ 0000 0000 0000 0000 0000 00ff 0000 0000
143+ 0000 0000 ff00 0000 0000 0000 0000 0000
144+ 0000 0000 0000 0000 0000 00ff 0000 0000
145+ 0000 0000 c020 1010 1010 1010 1010 1010
146+ 1010 1010 1010 1010 1010 20c0 0000 0000 ]
147
148 @font-icn [
149 0000 0000 0000 0000 0000 0000 0000 0000