Rev 109 | Rev 195 | 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 |
||
45 | mov edx,[sc.work_button] |
||
46 | mov esi,edx ;[sc.work_button] |
||
47 | xor edi,edi |
||
48 | int 0x40 |
||
49 | |||
50 | xor edx,edx |
||
47 | halyavin | 51 | mov al,13 |
52 | mcall ,14 shl 16+90,25 shl 16+27 |
||
53 | push ebx |
||
54 | mcall ,117 shl 16+90, |
||
55 | xchg ebx,[esp] |
||
56 | mcall ,,59 shl 16+27 |
||
57 | pop ebx |
||
58 | mcall |
||
31 | halyavin | 59 | |
47 | halyavin | 60 | mov al,8 |
61 | inc edx |
||
62 | mcall ,15 shl 16+87,26 shl 16+24,,0xdd7700 |
||
63 | inc edx |
||
64 | mcall ,118 shl 16+87,,,0xbbbb ;cccc |
||
65 | inc edx |
||
66 | mcall ,15 shl 16+87,60 shl 16+24,,0xbb00 |
||
67 | inc edx |
||
68 | mcall ,118 shl 16+87,,,0xbbbbbb ;cccccc |
||
31 | halyavin | 69 | |
47 | halyavin | 70 | mov al,4 ; 0x00000004 = write text |
31 | halyavin | 71 | mov ebx,75*65536+10 |
72 | mov ecx,[sc.work_button_text] ; 8b window nro - RR GG BB color |
||
73 | or ecx,0x10000000 |
||
74 | mov edx,label1 ; pointer to text beginning |
||
75 | mov esi,label1_len ; text length |
||
76 | int 0x40 |
||
77 | |||
78 | mov ecx,0x10ffffff |
||
79 | mov ebx,25*65536+30 |
||
80 | mov edx,label2 ; pointer to text beginning |
||
81 | mov esi,label2_len ; text length |
||
82 | int 0x40 |
||
83 | |||
84 | mov ebx,20*65536+64 |
||
85 | mov edx,label3 ; pointer to text beginning |
||
86 | mov esi,label3_len ; text length |
||
87 | int 0x40 |
||
88 | |||
89 | mov ecx,0xffffff |
||
90 | mov ebx,45*65536+41 |
||
91 | mov edx,label4 ; pointer to text beginning |
||
92 | mov esi,label4_len ; text length |
||
93 | int 0x40 |
||
94 | |||
95 | mov ebx,40*65536+75 |
||
96 | mov edx,label5 ; pointer to text beginning |
||
97 | mov esi,label5_len ; text length |
||
98 | int 0x40 |
||
99 | |||
47 | halyavin | 100 | mov al,12 ; tell os about redraw end |
31 | halyavin | 101 | mov ebx,2 |
102 | int 0x40 |
||
103 | |||
47 | halyavin | 104 | still: |
31 | halyavin | 105 | |
47 | halyavin | 106 | mov eax,10 ; wait here for event |
107 | int 0x40 |
||
31 | halyavin | 108 | |
47 | halyavin | 109 | dec eax |
110 | jz do_draw |
||
111 | dec eax |
||
112 | jnz button |
||
113 | key: |
||
114 | mov al,2 ; now eax=2 - get key code |
||
115 | int 40h |
||
116 | mov al,ah |
||
117 | cmp al,13 |
||
118 | jz restart |
||
119 | cmp al,27 |
||
120 | jz close_1 |
||
121 | cmp al,180 |
||
122 | jz restart_kernel |
||
123 | cmp al,181 |
||
124 | jz power_off |
||
125 | jmp still |
||
31 | halyavin | 126 | |
47 | halyavin | 127 | button: |
128 | mov al,17 ; now eax=17 - get pressed button id |
||
129 | int 0x40 |
||
130 | xchg al,ah |
||
131 | dec eax |
||
132 | jz power_off |
||
133 | dec eax |
||
134 | jz restart_kernel |
||
135 | dec eax |
||
136 | jz restart |
||
137 | ; we have only one button left, this is close button |
||
138 | ; dec eax |
||
139 | ; jnz still |
||
140 | close_1: |
||
141 | or eax,-1 |
||
142 | int 40h |
||
31 | halyavin | 143 | |
47 | halyavin | 144 | power_off: |
145 | push 2 |
||
146 | jmp mcall_and_close |
||
147 | |||
148 | restart: |
||
149 | push 3 |
||
150 | jmp mcall_and_close |
||
151 | |||
152 | restart_kernel: |
||
153 | push 4 |
||
154 | mcall_and_close: |
||
155 | pop ecx |
||
156 | mcall 18,9 |
||
157 | jmp close_1 |
||
158 | |||
31 | halyavin | 159 | data |
160 | |||
161 | if lang eq ru |
||
162 | |||
163 | label1: |
||
164 | db ' :' |
||
165 | label1_len = $ - label1 |
||
166 | |||
167 | label2: |
||
168 | db ' ' |
||
169 | label2_len = $ - label2 |
||
170 | |||
171 | label3: |
||
172 | db ' ' |
||
173 | label3_len = $ - label3 |
||
174 | |||
135 | diamond | 175 | else if lang eq en |
31 | halyavin | 176 | |
177 | label1: |
||
178 | db ' SELECT:' |
||
179 | label1_len = $ - label1 |
||
180 | |||
181 | label2: |
||
182 | db 'POWER OFF KERNEL' |
||
183 | label2_len = $ - label2 |
||
184 | |||
185 | label3: |
||
186 | db ' RESTART CANCEL' |
||
187 | label3_len = $ - label3 |
||
188 | |||
135 | diamond | 189 | else |
190 | |||
191 | label1: |
||
192 | db 'WAEHLEN:' |
||
193 | label1_len = $ - label1 |
||
194 | |||
195 | label2: |
||
196 | db ' BEENDEN KERNEL' |
||
197 | label2_len = $ - label2 |
||
198 | |||
199 | label3: |
||
200 | db ' NEUSTART ABBRECHEN' |
||
201 | label3_len = $ - label3 |
||
202 | |||
203 | end if |
||
204 | |||
31 | halyavin | 205 | label4: |
206 | db '(End) (Home)' |
||
207 | label4_len = $ - label4 |
||
208 | |||
209 | label5: |
||
210 | db '(Enter) (Esc)' |
||
211 | label5_len = $ - label5 |
||
212 | |||
213 | |||
214 | udata |
||
215 | sc system_colors |
||
216 | |||
217 | meos_app_end |