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-home-dirty.om

151 lines · 2812 bytes Raw Blame History
1note Incremental HOME pixels must equal a complete redraw, including an independently moving background.
2note Reuses the HOME oracle's isolated NIGHT/MIND boundary and existing Nsky storage for comparison.
3global Targ uchar 32
4global Ttime long 1
5fn tdstrip to long
6ret add get Hm 24 div get Hm 26 2
7end
8fn tdpx xx long yy long to void
9c = ulong add 131844 and add xx yy 31
10if lt xx add tdstrip hms 70
11if ge xx tdstrip
12c = add c shl ulong and get Ttime 0 31 8
13end
14end
15put Nfrm add mul ulong yy ulong get Lg 0 ulong xx uint c
16end
17fn tdrow x long y long w long to void
18for i ulong ulong w
19tdpx add x long i y
20end
21end
22fn tdback x long y long w long h long to void
23for j ulong ulong h
24tdrow x add y long j w
25end
26hmtext x y w h
27end
28fn tdwhole to void
29tdback get Hm 28 get Hm 29 get Hm 30 get Hm 31
30end
31fn tdsaverow at ulong to void
32for i ulong ulong get Hm 30
33put Nsky add at i get Nfrm add at i
34end
35end
36fn tdsave to void
37at = mul ulong get Hm 29 ulong get Lg 0
38at = add at ulong get Hm 28
39for j ulong ulong get Hm 31
40tdsaverow at
41at = add at ulong get Lg 0
42end
43end
44fn tdequalrow at ulong to bool
45for i ulong ulong get Hm 30
46if ne get Nsky add at i get Nfrm add at i
47ret false
48end
49end
50ret true
51end
52fn tdequal to bool
53at = mul ulong get Hm 29 ulong get Lg 0
54at = add at ulong get Hm 28
55for j ulong ulong get Hm 31
56if not tdequalrow at
57ret false
58end
59at = add at ulong get Lg 0
60end
61ret true
62end
63fn tdpartial to void
64x = pkmax get Hm 28 get Hmdirty 0
65y = pkmax get Hm 29 get Hmdirty 1
66w = add get Hm 28 get Hm 30
67w = pkmin w add get Hmdirty 0 get Hmdirty 2
68w = sub w x
69h = add get Hm 29 get Hm 31
70h = pkmin h add get Hmdirty 1 get Hmdirty 3
71h = sub h y
72if gt get Hmdirty 2 0
73if gt w 0
74if gt h 0
75tdback x y w h
76end
77end
78end
79note The changing strip represents a NIGHT dirty region intersecting the bar.
80tdback tdstrip get Hm 29 hms 70 get Hm 31
81end
82fn tdbudget to bool
83a = mul get Hmdirty 2 get Hmdirty 3
84b = mul get Hm 30 get Hm 31
85ret le a div b 4
86end
87fn main to long
88put Lg 0 1280
89put Lg 1 800
90put Lg 2 170
91n = argread 2 Targ 0 32
92if le n 0
93ret 64
94end
95if eq get Targ 0 52
96put Lg 0 3840
97put Lg 1 2160
98put Lg 2 512
99end
100put Targ 0 0
101n = argread 1 Targ 0 32
102if le n 0
103ret 64
104end
105put Lg 3 div get Lg 0 2
106put Lg 4 div mul get Lg 1 40 100
107pkinit
108hminit
109note A static footer exercises its invalidation when typing and opacity change.
110put Hmfoot 0 65
111put Hmfootn 0 1
112put Ttime 0 15300
113tdwhole
114for frame ulong 400
115if ge frame 15
116if lt frame 174
117hmkey add 65 rem frame 26
118end
119end
120if ge frame 200
121if lt frame 210
122hmkey 8
123end
124end
125if eq frame 220
126hmkey 13
127end
128if eq frame 350
129put Hmsay 0 72
130put Hmsay 1 105
131put Hmsayn 0 2
132hmsaid
133end
134hmstep get Ttime 0
135if eq get Targ 0 98
136if or eq frame 12 eq frame 190
137if not tdbudget
138ret 11
139end
140end
141end
142tdpartial
143tdsave
144tdwhole
145if not tdequal
146ret 30
147end
148put Ttime 0 add get Ttime 0 100
149end
150ret 0
151end