interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / aienux / allen / tests / look-paint.om

243 lines · 3965 bytes Raw Blame History
1note tests/look-paint.om: prints the drawing kit's values in the same order as the C harness
2note (~/work/IMacLook/paint/ptest.c over aienux 4b24df65 paint.c); the two outputs must cmp equal.
3note Unit: font-data.om font.om look-paint.om tio.om tests/look-paint.om.
4global Tcs ulong 12
5fn tdump to void
6for i ulong 3072
7tu ulong get Nfrm i
8tnl
9end
10end
11fn tword pen ulong y long c uchar color ulong a ulong plus bool to ulong
12pen = pkletter pen y c color a plus
13tu pen
14tnl
15ret pen
16end
17fn tblend to void
18put Tcs 0 0
19put Tcs 1 1052688
20put Tcs 2 1193046
21put Tcs 3 16777215
22put Tcs 4 13158655
23put Tcs 5 4227327
24put Tcs 6 16711680
25put Tcs 7 65280
26put Tcs 8 255
27put Tcs 9 8355711
28put Tcs 10 66051
29put Tcs 11 16711422
30for i ulong 12
31for j ulong 12
32a = ulong 0
33while le a 256
34tu pkadd get Tcs i get Tcs j a
35tc 32
36tu pkmix get Tcs i get Tcs j a
37tc 32
38tu pkscale get Tcs i a
39tnl
40a = add a 19
41end
42end
43end
44for i ulong 12
45j = rem add i 1 12
46tu pkadd get Tcs i get Tcs j 256
47tc 32
48tu pkmix get Tcs i get Tcs j 256
49tc 32
50tu pkscale get Tcs i 256
51tnl
52end
53end
54fn tthread x0 long y0 long x1 long y1 long color ulong w long to void
55put Pa 0 w
56pkthread x0 y0 x1 y1 color 0
57end
58fn tshapes to void
59for i ulong 3072
60put Nfrm i 1052688
61end
62pkclip 0 0 64 48
63pkglow 500 400 300 13158655 200
64pkglow -40 700 160 16777215 256
65put Pa 1 200
66put Pa 2 60
67tthread 30 40 900 600 16762368 16
68put Pa 1 30
69put Pa 2 255
70tthread 800 20 100 700 4227327 40
71put Pa 1 255
72put Pa 2 255
73tthread 100 100 110 700 16777215 24
74put Pa 1 0
75put Pa 2 256
76tthread 50 650 950 660 16746496 8
77put Pa 1 100
78put Pa 2 100
79tthread 300 300 300 300 16777215 16
80tthread 300 300 500 500 16777215 0
81put Pa 1 256
82put Pa 2 0
83tthread -200 -100 1200 900 8454016 50
84pkclip 10 5 30 30
85pkglow 300 300 400 16711680 128
86pkclip -5 -5 20 20
87put Pa 1 200
88put Pa 2 200
89tthread 0 0 500 120 16777215 12
90tdump
91end
92fn trrect to void
93put Lg 9 6
94for j ulong 48
95for i ulong 64
96tl pksdrrect long i long j 8 6 40 30
97tc 32
98end
99tnl
100end
101put Lg 9 0
102for j ulong 48
103for i ulong 64
104tl pksdrrect long i long j -3 10 70 15
105tc 32
106end
107tnl
108end
109end
110fn tletters to void
111if not afinit 14 1250
112trap 9
113end
114for i ulong 3072
115if eq and i 1 1
116put Nfrm i 2105408
117else
118put Nfrm i 0
119end
120end
121pkclip 0 0 64 48
122pen = ulong 868
123pen = tword pen 20 65 16769184 230 false
124pen = tword pen 20 103 16769184 230 false
125pen = tword pen 20 63 16769184 230 false
126pen = tword pen 20 106 16769184 230 false
127pen = tword pen 20 32 16769184 230 false
128pen = tword pen 20 44 16769184 230 false
129pen = tword pen 20 87 16769184 230 false
130pen = 256
131pen = tword pen 38 105 8438015 256 true
132pen = tword pen 38 77 8438015 256 true
133pen = tword pen 38 97 8438015 256 true
134pen = tword pen 38 99 8438015 256 true
135pkclip 10 5 30 30
136pen = 256
137pen = tword pen 30 88 16728128 120 true
138pen = tword pen 30 121 16728128 120 true
139pkclip 0 0 64 48
140pen = 256
141pen = tword pen 30 81 16728128 0 false
142tdump
143end
144fn main to int
145pkinit
146for i ulong 677
147a = mul i 97
148tl pksin a
149tc 32
150tl pkcos a
151tnl
152end
153y = long -50000
154while le y 50000
155x = long -50000
156while le x 50000
157tu pkatan2 y x
158tnl
159x = add x 3331
160end
161y = add y 2917
162end
163tu pkatan2 3 0
164tnl
165tu pkatan2 -7 0
166tnl
167for i ulong 600
168tu pkexpneg mul i 7
169tnl
170end
171for i ulong 257
172tu get Plog i
173tnl
174end
175v = ulong 1
176while lt v 4611686018427387904
177tu pklog2q16 v
178tc 32
179tu pkisqrt v
180tnl
181v = add mul v 3 1
182end
183tu pklog2q16 0
184tc 32
185tu pkisqrt 0
186tnl
187y = long -2000
188while le y 2000
189x = long -3000
190while le x 3000
191tu pkhash x y 909
192tc 32
193tu pknoise x y 909
194tc 32
195tu pkfbm x y 909 4
196tnl
197x = add x 413
198end
199y = add y 377
200end
201t = long -20
202while le t 280
203tu pksmooth t
204tc 32
205tu pkeaseout t
206tc 32
207tl pkprog ulong add 1000 t 990 1200
208tnl
209t = add t 7
210end
211tl pkprog 5 9 20
212tc 32
213tl pkprog 50 9 20
214tc 32
215tl pkprog 20 9 20
216tnl
217t = long -40
218while le t 40
219tu pkcover t
220tnl
221t = add t 3
222end
223l = ulong 0
224while lt l 40000
225tu pklenc l
226tnl
227l = add l 61
228end
229for i ulong 256
230tu ulong get Slin i
231tc 32
232tu ulong get Ssrgb add mul i 16 1
233tnl
234end
235tblend
236put Lg 0 64
237put Lg 1 48
238tshapes
239trrect
240tletters
241tflush
242ret 0
243end