Rev 274 | Rev 341 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
31 | halyavin | 1 | ; |
2 | ; END |
||
3 | ; |
||
47 | halyavin | 4 | ; |
5 | ; and if we know that high 24 bits of eax are zero, we can use 1st form |
||
6 | ; the same about ebx,ecx,edx |
||
31 | halyavin | 7 | |
59 | halyavin | 8 | include "lang.inc" |
31 | halyavin | 9 | include "macros.inc" |
10 | |||
11 | meos_app_start |
||
12 | code |
||
13 | |||
47 | halyavin | 14 | do_draw: |
31 | halyavin | 15 | |
16 | mov eax,48 |
||
17 | mov ebx,3 |
||
18 | mov ecx,sc |
||
19 | mov edx,sizeof.system_colors |
||
20 | int 0x40 |
||
21 | |||
47 | halyavin | 22 | mov al,12 ; eax=12 - tell os about redraw start |
23 | mov bl,1 |
||
31 | halyavin | 24 | int 0x40 |
25 | |||
47 | halyavin | 26 | mov al,14 ; eax=14 - get screen max x & max y |
31 | halyavin | 27 | int 0x40 |
28 | |||
47 | halyavin | 29 | movzx ecx,ax |
31 | halyavin | 30 | |
31 | shr eax,17 |
||
47 | halyavin | 32 | ; sub eax,110 |
31 | halyavin | 33 | shl eax,16 |
47 | halyavin | 34 | ; mov ebx,eax |
35 | ; add ebx,220 |
||
36 | lea ebx,[eax-110*10000h+220] |
||
31 | halyavin | 37 | |
38 | shr ecx,1 |
||
47 | halyavin | 39 | ; sub ecx,50 |
31 | halyavin | 40 | shl ecx,16 |
47 | halyavin | 41 | ; add ecx,100 |
42 | sub ecx,50*10000h - 100 |
||
31 | halyavin | 43 | |
44 | mov eax,0 ; define and draw window |
||
195 | heavyiron | 45 | mov edx,[sc.work] |
46 | mov esi,edx |
||
47 | mov edi,edx |
||
31 | halyavin | 48 | int 0x40 |
49 | |||
195 | heavyiron | 50 | mov edx,0x444444 |
47 | halyavin | 51 | mov al,13 |
195 | heavyiron | 52 | mcall ,18 shl 16+90,29 shl 16+27 |
47 | halyavin | 53 | push ebx |
195 | heavyiron | 54 | mcall ,121 shl 16+90, |
47 | halyavin | 55 | xchg ebx,[esp] |
195 | heavyiron | 56 | mcall ,,63 shl 16+27 |
47 | halyavin | 57 | pop ebx |
58 | mcall |
||
31 | halyavin | 59 | |
195 | heavyiron | 60 | xor edx,edx |
47 | halyavin | 61 | mov al,8 |
62 | inc edx |
||
195 | heavyiron | 63 | mcall ,15 shl 16+87,26 shl 16+24,,0xbb0055 |
47 | halyavin | 64 | inc edx |
195 | heavyiron | 65 | mcall ,118 shl 16+87,,,0xaaaa ;cccc |
47 | halyavin | 66 | inc edx |
195 | heavyiron | 67 | mcall ,15 shl 16+87,60 shl 16+24,,0x9900 |
47 | halyavin | 68 | inc edx |
195 | heavyiron | 69 | mcall ,118 shl 16+87,,,0xaaaaaa ;cccccc |
31 | halyavin | 70 | |
47 | halyavin | 71 | mov al,4 ; 0x00000004 = write text |
31 | halyavin | 72 | mov ebx,75*65536+10 |
195 | heavyiron | 73 | mov ecx,[sc.work_text] ; 8b window nro - RR GG BB color |
74 | or ecx,0x10000000 |
||
31 | halyavin | 75 | mov edx,label1 ; pointer to text beginning |
76 | mov esi,label1_len ; text length |
||
77 | int 0x40 |
||
78 | |||
318 | heavyiron | 79 | mov ecx,0xeeeeee ; 8b window nro - RR GG BB color |
195 | heavyiron | 80 | or ecx,0x10000000 |
31 | halyavin | 81 | mov ebx,25*65536+30 |
82 | mov edx,label2 ; pointer to text beginning |
||
83 | mov esi,label2_len ; text length |
||
84 | int 0x40 |
||
85 | |||
86 | mov ebx,20*65536+64 |
||
87 | mov edx,label3 ; pointer to text beginning |
||
88 | mov esi,label3_len ; text length |
||
89 | int 0x40 |
||
90 | |||
91 | mov ebx,45*65536+41 |
||
92 | mov edx,label4 ; pointer to text beginning |
||
93 | mov esi,label4_len ; text length |
||
94 | int 0x40 |
||
95 | |||
96 | mov ebx,40*65536+75 |
||
97 | mov edx,label5 ; pointer to text beginning |
||
98 | mov esi,label5_len ; text length |
||
99 | int 0x40 |
||
100 | |||
47 | halyavin | 101 | mov al,12 ; tell os about redraw end |
31 | halyavin | 102 | mov ebx,2 |
103 | int 0x40 |
||
104 | |||
47 | halyavin | 105 | still: |
31 | halyavin | 106 | |
47 | halyavin | 107 | mov eax,10 ; wait here for event |
108 | int 0x40 |
||
31 | halyavin | 109 | |
47 | halyavin | 110 | dec eax |
111 | jz do_draw |
||
112 | dec eax |
||
113 | jnz button |
||
114 | key: |
||
115 | mov al,2 ; now eax=2 - get key code |
||
116 | int 40h |
||
117 | mov al,ah |
||
118 | cmp al,13 |
||
119 | jz restart |
||
120 | cmp al,27 |
||
121 | jz close_1 |
||
122 | cmp al,180 |
||
123 | jz restart_kernel |
||
124 | cmp al,181 |
||
125 | jz power_off |
||
126 | jmp still |
||
31 | halyavin | 127 | |
47 | halyavin | 128 | button: |
129 | mov al,17 ; now eax=17 - get pressed button id |
||
130 | int 0x40 |
||
131 | xchg al,ah |
||
132 | dec eax |
||
133 | jz power_off |
||
134 | dec eax |
||
135 | jz restart_kernel |
||
136 | dec eax |
||
137 | jz restart |
||
138 | ; we have only one button left, this is close button |
||
139 | ; dec eax |
||
140 | ; jnz still |
||
141 | close_1: |
||
142 | or eax,-1 |
||
143 | int 40h |
||
31 | halyavin | 144 | |
47 | halyavin | 145 | power_off: |
146 | push 2 |
||
147 | jmp mcall_and_close |
||
148 | |||
149 | restart: |
||
150 | push 3 |
||
151 | jmp mcall_and_close |
||
152 | |||
153 | restart_kernel: |
||
154 | push 4 |
||
155 | mcall_and_close: |
||
156 | pop ecx |
||
157 | mcall 18,9 |
||
158 | jmp close_1 |
||
159 | |||
31 | halyavin | 160 | data |
161 | |||
162 | if lang eq ru |
||
163 | |||
164 | label1: |
||
165 | db ' :' |
||
166 | label1_len = $ - label1 |
||
167 | |||
168 | label2: |
||
169 | db ' ' |
||
170 | label2_len = $ - label2 |
||
171 | |||
172 | label3: |
||
173 | db ' ' |
||
174 | label3_len = $ - label3 |
||
175 | |||
135 | diamond | 176 | else if lang eq en |
31 | halyavin | 177 | |
178 | label1: |
||
179 | db ' SELECT:' |
||
180 | label1_len = $ - label1 |
||
181 | |||
182 | label2: |
||
183 | db 'POWER OFF KERNEL' |
||
184 | label2_len = $ - label2 |
||
185 | |||
186 | label3: |
||
187 | db ' RESTART CANCEL' |
||
188 | label3_len = $ - label3 |
||
189 | |||
274 | kaitz | 190 | else if lang eq et |
191 | |||
192 | label1: |
||
193 | db ' VALI:' |
||
194 | label1_len = $ - label1 |
||
195 | |||
196 | label2: |
||
197 | db 'LάLITA VΔLJA KERNEL' |
||
198 | label2_len = $ - label2 |
||
199 | |||
200 | label3: |
||
201 | db ' RESTART TάHISTA' |
||
202 | label3_len = $ - label3 |
||
203 | |||
135 | diamond | 204 | else |
205 | |||
206 | label1: |
||
207 | db 'WAEHLEN:' |
||
208 | label1_len = $ - label1 |
||
209 | |||
210 | label2: |
||
195 | heavyiron | 211 | db ' BEENDEN KERNEL' |
135 | diamond | 212 | label2_len = $ - label2 |
213 | |||
214 | label3: |
||
215 | db ' NEUSTART ABBRECHEN' |
||
216 | label3_len = $ - label3 |
||
217 | |||
218 | end if |
||
219 | |||
31 | halyavin | 220 | label4: |
318 | heavyiron | 221 | db '(End) (Home)' |
31 | halyavin | 222 | label4_len = $ - label4 |
223 | |||
224 | label5: |
||
318 | heavyiron | 225 | db '(Enter) (Esc)' |
31 | halyavin | 226 | label5_len = $ - label5 |
227 | |||
228 | |||
229 | udata |
||
230 | sc system_colors |
||
231 | |||
232 | meos_app_end |