Rev 5665 | Rev 6215 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5665 | Pathoswith | 1 | |
1742 | mario79 | 2 | ; KolibriOS Team 2005-2015 |
5665 | Pathoswith | 3 | |
4 | |||
4266 | heavyiron | 5 | |
1742 | mario79 | 6 | |
5665 | Pathoswith | 7 | org 0x0 ; адресация с нуля |
4266 | heavyiron | 8 | |
1742 | mario79 | 9 | |
5665 | Pathoswith | 10 | dd 0x01 ; версия заголовка (всегда 1) |
11 | dd START ; адрес первой команды |
||
12 | dd IM_END ; размер программы |
||
13 | dd I_END ; количество памяти |
||
14 | dd stacktop ; адрес вершины стека |
||
15 | dd 0x0 ; адрес буфера для параметров |
||
16 | dd cur_dir_path |
||
4213 | heavyiron | 17 | |
1742 | mario79 | 18 | |
4213 | heavyiron | 19 | include '../../../macros.inc' |
20 | include '../../../proc32.inc' |
||
21 | include '../../../dll.inc' |
||
22 | include '../../../develop/libraries/box_lib/load_lib.mac' |
||
23 | include '../../../develop/libraries/box_lib/trunk/box_lib.mac' |
||
24 | |||
1742 | mario79 | 25 | |
6190 | leency | 26 | |
1742 | mario79 | 27 | |
6190 | leency | 28 | { |
29 | mcall 13, (x) shl 16 + (width), (y) shl 16 + (height), color |
||
30 | } |
||
31 | |||
32 | |||
33 | { |
||
34 | DrawBar x,y,w,1,color |
||
35 | DrawBar x,y+h,w,1 |
||
36 | DrawBar x,y,1,h |
||
37 | DrawBar x+w,y,1,h+1 |
||
38 | } |
||
39 | |||
40 | |||
41 | |||
4213 | heavyiron | 42 | START: |
43 | |||
1742 | mario79 | 44 | |
6190 | leency | 45 | |
4213 | heavyiron | 46 | inc eax |
5665 | Pathoswith | 47 | test eax,eax |
48 | jz close |
||
49 | |||
1742 | mario79 | 50 | |
5665 | Pathoswith | 51 | call [init_checkbox2] |
52 | |||
1742 | mario79 | 53 | |
4213 | heavyiron | 54 | |
55 | |||
5665 | Pathoswith | 56 | mov [autosave],eax |
57 | dec eax |
||
58 | jnz @f |
||
59 | bts dword [check1.flags],1 |
||
60 | @@: |
||
4213 | heavyiron | 61 | mcall 40,0x80000027 |
5665 | Pathoswith | 62 | redraw: |
4213 | heavyiron | 63 | call draw_window |
64 | still: |
||
1742 | mario79 | 65 | mov al,10 |
4051 | heavyiron | 66 | mcall ;wait here for event |
5665 | Pathoswith | 67 | dec eax |
1742 | mario79 | 68 | jz redraw |
5665 | Pathoswith | 69 | dec eax |
1742 | mario79 | 70 | jz key |
5665 | Pathoswith | 71 | dec eax |
4213 | heavyiron | 72 | jz button |
5665 | Pathoswith | 73 | |
4044 | heavyiron | 74 | |
4213 | heavyiron | 75 | call [check_box_mouse2] |
76 | bt dword [check1.flags],1 |
||
5665 | Pathoswith | 77 | jnc @f |
4213 | heavyiron | 78 | mov [autosave],1 |
79 | jmp still |
||
80 | @@: |
||
81 | mov [autosave],0 |
||
82 | jmp still |
||
83 | |||
4266 | heavyiron | 84 | |
4213 | heavyiron | 85 | mov al,2 |
4051 | heavyiron | 86 | mcall ;eax=2 - get key code |
5665 | Pathoswith | 87 | mov al,ah |
1742 | mario79 | 88 | cmp al,13 |
89 | je restart |
||
4215 | heavyiron | 90 | cmp al,19 |
1742 | mario79 | 91 | je checkbox |
4215 | heavyiron | 92 | cmp al,180 |
1742 | mario79 | 93 | je restart_kernel |
4215 | heavyiron | 94 | cmp al,181 |
1742 | mario79 | 95 | je power_off |
4215 | heavyiron | 96 | cmp al,27 |
97 | jne still |
||
98 | |||
1742 | mario79 | 99 | |
4215 | heavyiron | 100 | mcall -1 |
101 | |||
102 | |||
4044 | heavyiron | 103 | mcall 17 ;eax=17 - get pressed button id |
5665 | Pathoswith | 104 | xchg al,ah |
1742 | mario79 | 105 | dec eax |
106 | jz close |
||
5665 | Pathoswith | 107 | dec eax |
1742 | mario79 | 108 | jz restart_kernel |
5665 | Pathoswith | 109 | dec eax |
1742 | mario79 | 110 | jz restart |
5665 | Pathoswith | 111 | dec eax |
1742 | mario79 | 112 | jnz checkbox |
4213 | heavyiron | 113 | |
4044 | heavyiron | 114 | |
2676 | leency | 115 | push 2 |
116 | jmp mcall_and_close |
||
117 | |||
4213 | heavyiron | 118 | |
2676 | leency | 119 | push 3 |
1742 | mario79 | 120 | jmp mcall_and_close |
121 | |||
4213 | heavyiron | 122 | |
4044 | heavyiron | 123 | push 4 |
1742 | mario79 | 124 | |
4213 | heavyiron | 125 | |
1742 | mario79 | 126 | if fade=1 |
4266 | heavyiron | 127 | ; === FADE IN === |
128 | mov eax, color1 |
||
129 | @@: |
||
130 | mov ebx, [eax + 32] |
||
131 | mov [eax], ebx |
||
132 | add eax, 4 |
||
133 | cmp eax, color21 |
||
134 | jne @b |
||
135 | |||
136 | |||
137 | end if |
||
138 | |||
139 | |||
4213 | heavyiron | 140 | cmp [autosave],1 |
141 | jne no_save |
||
142 | |||
4284 | heavyiron | 143 | |
144 | mov al,4 |
||
145 | mcall ,<50,120> ,0x800000cc,label7 ;eax=4 - write text |
||
5665 | Pathoswith | 146 | end if |
4284 | heavyiron | 147 | |
148 | |||
4213 | heavyiron | 149 | test eax,eax |
150 | js no_save |
||
5665 | Pathoswith | 151 | mov ecx,eax |
4213 | heavyiron | 152 | mcall 18,21 |
153 | mov ecx,eax |
||
154 | @@: |
||
155 | push ecx |
||
156 | mcall 23,100 |
||
4215 | heavyiron | 157 | dec eax |
4213 | heavyiron | 158 | jnz no_red |
159 | call draw_window |
||
160 | no_red: |
||
4266 | heavyiron | 161 | pop ecx |
4213 | heavyiron | 162 | mcall 9,proc_info |
163 | cmp [proc_info+50],9 |
||
164 | je no_save |
||
5665 | Pathoswith | 165 | jmp @b |
4213 | heavyiron | 166 | no_save: |
167 | pop ecx |
||
1742 | mario79 | 168 | mcall 18,9 |
4266 | heavyiron | 169 | ret |
4268 | heavyiron | 170 | |
1742 | mario79 | 171 | |
4213 | heavyiron | 172 | btc dword [check1.flags],1 |
173 | jc .1 |
||
5665 | Pathoswith | 174 | mov [autosave],1 |
4213 | heavyiron | 175 | jmp .draw |
176 | .1: |
||
177 | mov [autosave],0 |
||
178 | .draw: |
||
179 | push dword check1 |
||
180 | call [check_box_draw2] |
||
181 | jmp still |
||
182 | |||
4266 | heavyiron | 183 | |
4213 | heavyiron | 184 | mcall 12,1 |
6190 | leency | 185 | |
1742 | mario79 | 186 | |
4215 | heavyiron | 187 | mcall ;eax=14 - get screen max x & max y |
5665 | Pathoswith | 188 | movzx ecx,ax |
4213 | heavyiron | 189 | shr eax,17 |
4215 | heavyiron | 190 | shl eax,16 |
191 | lea ebx,[eax-165 shl 16+332] |
||
5665 | Pathoswith | 192 | shr ecx,1 |
4215 | heavyiron | 193 | shl ecx,16 |
194 | lea ecx,[ecx-70 shl 16+132] |
||
5665 | Pathoswith | 195 | |
4213 | heavyiron | 196 | |
4215 | heavyiron | 197 | mov edx, 0x01000000 |
6190 | leency | 198 | mcall ;define and draw window |
199 | |||
4213 | heavyiron | 200 | |
6190 | leency | 201 | mov al,13 |
4213 | heavyiron | 202 | mcall ,<1,331>,<1,1>,[color2] |
6190 | leency | 203 | mcall ,<1,1>,<1,131> |
204 | mcall ,<2,330>,<2,130>, [color3] |
||
5665 | Pathoswith | 205 | |
4213 | heavyiron | 206 | |
4215 | heavyiron | 207 | mcall ,<16,144> ,<16,36>,4,[color4] ;eax=8 - draw buttons |
5665 | Pathoswith | 208 | mcall ,<170,144>, ,2,[color5] |
209 | mcall , ,<62,36>,1,[color6] |
||
210 | mcall ,<16,144> , ,3,[color7] |
||
211 | |||
4213 | heavyiron | 212 | |
4215 | heavyiron | 213 | mcall ,<28,19> ,[color8],label2 ;eax=4 - write text |
5665 | Pathoswith | 214 | mcall ,<28,65> , ,label3 |
215 | mcall ,<64,40> ,[color9],label5 |
||
216 | mcall ,<64,86> , ,label6 |
||
217 | |||
4215 | heavyiron | 218 | |
4213 | heavyiron | 219 | call [check_box_draw2] |
220 | |||
221 | |||
222 | mcall ,2 |
||
223 | ret |
||
224 | ;--------------------------------------------------------------------- |
||
4215 | heavyiron | 225 | ;data |
226 | include 'data.inc' |
||
4044 | heavyiron | 227 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 228 | IM_END: |
229 | ;--------------------------------------------------------------------- |
||
230 | align 4 |
||
231 | |||
1742 | mario79 | 232 | |
4213 | heavyiron | 233 | |
234 | |||
235 | ;--------------------------------------------------------------------- |
||
236 | cur_dir_path: |
||
237 | rb 4096 |
||
5665 | Pathoswith | 238 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 239 | library_path: |
240 | rb 4096 |
||
5665 | Pathoswith | 241 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 242 | align 32 |
243 | rb 4096 |
||
5665 | Pathoswith | 244 | stacktop: |
4213 | heavyiron | 245 | I_END: ; метка конца программы64,86>64,40>28,65>28,19>16,144>62,36>170,144>16,36>16,144>2,130>2,330>1,131>1,1>1,1>1,331>50,120> |
5665 | Pathoswith | 246 |