Rev 4284 | 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 | |
5665 | Pathoswith | 26 | |
1742 | mario79 | 27 | |
4213 | heavyiron | 28 | START: |
29 | |||
1742 | mario79 | 30 | |
4213 | heavyiron | 31 | inc eax |
5665 | Pathoswith | 32 | test eax,eax |
33 | jz close |
||
34 | |||
1742 | mario79 | 35 | |
5665 | Pathoswith | 36 | call [init_checkbox2] |
37 | |||
1742 | mario79 | 38 | |
4213 | heavyiron | 39 | |
40 | |||
5665 | Pathoswith | 41 | mov [autosave],eax |
42 | dec eax |
||
43 | jnz @f |
||
44 | bts dword [check1.flags],1 |
||
45 | @@: |
||
4213 | heavyiron | 46 | mcall 40,0x80000027 |
5665 | Pathoswith | 47 | redraw: |
4213 | heavyiron | 48 | call draw_window |
49 | still: |
||
1742 | mario79 | 50 | mov al,10 |
4051 | heavyiron | 51 | mcall ;wait here for event |
5665 | Pathoswith | 52 | dec eax |
1742 | mario79 | 53 | jz redraw |
5665 | Pathoswith | 54 | dec eax |
1742 | mario79 | 55 | jz key |
5665 | Pathoswith | 56 | dec eax |
4213 | heavyiron | 57 | jz button |
5665 | Pathoswith | 58 | |
4044 | heavyiron | 59 | |
4213 | heavyiron | 60 | call [check_box_mouse2] |
61 | bt dword [check1.flags],1 |
||
5665 | Pathoswith | 62 | jnc @f |
4213 | heavyiron | 63 | mov [autosave],1 |
64 | jmp still |
||
65 | @@: |
||
66 | mov [autosave],0 |
||
67 | jmp still |
||
68 | |||
4266 | heavyiron | 69 | |
4213 | heavyiron | 70 | mov al,2 |
4051 | heavyiron | 71 | mcall ;eax=2 - get key code |
5665 | Pathoswith | 72 | mov al,ah |
1742 | mario79 | 73 | cmp al,13 |
74 | je restart |
||
4215 | heavyiron | 75 | cmp al,19 |
1742 | mario79 | 76 | je checkbox |
4215 | heavyiron | 77 | cmp al,180 |
1742 | mario79 | 78 | je restart_kernel |
4215 | heavyiron | 79 | cmp al,181 |
1742 | mario79 | 80 | je power_off |
4215 | heavyiron | 81 | cmp al,27 |
82 | jne still |
||
83 | |||
1742 | mario79 | 84 | |
4215 | heavyiron | 85 | mcall -1 |
86 | |||
87 | |||
4044 | heavyiron | 88 | mcall 17 ;eax=17 - get pressed button id |
5665 | Pathoswith | 89 | xchg al,ah |
1742 | mario79 | 90 | dec eax |
91 | jz close |
||
5665 | Pathoswith | 92 | dec eax |
1742 | mario79 | 93 | jz restart_kernel |
5665 | Pathoswith | 94 | dec eax |
1742 | mario79 | 95 | jz restart |
5665 | Pathoswith | 96 | dec eax |
1742 | mario79 | 97 | jnz checkbox |
4213 | heavyiron | 98 | |
4044 | heavyiron | 99 | |
2676 | leency | 100 | push 2 |
101 | jmp mcall_and_close |
||
102 | |||
4213 | heavyiron | 103 | |
2676 | leency | 104 | push 3 |
1742 | mario79 | 105 | jmp mcall_and_close |
106 | |||
4213 | heavyiron | 107 | |
4044 | heavyiron | 108 | push 4 |
1742 | mario79 | 109 | |
4213 | heavyiron | 110 | |
1742 | mario79 | 111 | if fade=1 |
4266 | heavyiron | 112 | ; === FADE IN === |
113 | mov eax, color1 |
||
114 | @@: |
||
115 | mov ebx, [eax + 32] |
||
116 | mov [eax], ebx |
||
117 | add eax, 4 |
||
118 | cmp eax, color21 |
||
119 | jne @b |
||
120 | |||
121 | |||
122 | end if |
||
123 | |||
124 | |||
4213 | heavyiron | 125 | cmp [autosave],1 |
126 | jne no_save |
||
127 | |||
4284 | heavyiron | 128 | |
129 | mov al,4 |
||
130 | mcall ,<50,120> ,0x800000cc,label7 ;eax=4 - write text |
||
5665 | Pathoswith | 131 | end if |
4284 | heavyiron | 132 | |
133 | |||
4213 | heavyiron | 134 | test eax,eax |
135 | js no_save |
||
5665 | Pathoswith | 136 | mov ecx,eax |
4213 | heavyiron | 137 | mcall 18,21 |
138 | mov ecx,eax |
||
139 | @@: |
||
140 | push ecx |
||
141 | mcall 23,100 |
||
4215 | heavyiron | 142 | dec eax |
4213 | heavyiron | 143 | jnz no_red |
144 | call draw_window |
||
145 | no_red: |
||
4266 | heavyiron | 146 | pop ecx |
4213 | heavyiron | 147 | mcall 9,proc_info |
148 | cmp [proc_info+50],9 |
||
149 | je no_save |
||
5665 | Pathoswith | 150 | jmp @b |
4213 | heavyiron | 151 | no_save: |
152 | pop ecx |
||
1742 | mario79 | 153 | mcall 18,9 |
4266 | heavyiron | 154 | ret |
4268 | heavyiron | 155 | |
1742 | mario79 | 156 | |
4213 | heavyiron | 157 | btc dword [check1.flags],1 |
158 | jc .1 |
||
5665 | Pathoswith | 159 | mov [autosave],1 |
4213 | heavyiron | 160 | jmp .draw |
161 | .1: |
||
162 | mov [autosave],0 |
||
163 | .draw: |
||
164 | push dword check1 |
||
165 | call [check_box_draw2] |
||
166 | jmp still |
||
167 | |||
4266 | heavyiron | 168 | |
4213 | heavyiron | 169 | mov al,12 |
170 | mcall ,1 |
||
4215 | heavyiron | 171 | |
1742 | mario79 | 172 | |
4215 | heavyiron | 173 | mcall ;eax=14 - get screen max x & max y |
5665 | Pathoswith | 174 | movzx ecx,ax |
4213 | heavyiron | 175 | shr eax,17 |
4215 | heavyiron | 176 | shl eax,16 |
177 | lea ebx,[eax-165 shl 16+332] |
||
5665 | Pathoswith | 178 | shr ecx,1 |
4215 | heavyiron | 179 | shl ecx,16 |
180 | lea ecx,[ecx-70 shl 16+132] |
||
5665 | Pathoswith | 181 | |
4213 | heavyiron | 182 | |
4215 | heavyiron | 183 | mcall , , ,[color1],0x01000000 ;define and draw window |
5665 | Pathoswith | 184 | |
4213 | heavyiron | 185 | |
186 | mcall ,<0,333> ,<0,133> |
||
5665 | Pathoswith | 187 | mcall ,<1,331>,<1,131>,[color2] |
188 | mcall ,<2,330>,<2,130>, [color3] |
||
189 | |||
4213 | heavyiron | 190 | |
4215 | heavyiron | 191 | mcall ,<16,144> ,<16,36>,4,[color4] ;eax=8 - draw buttons |
5665 | Pathoswith | 192 | mcall ,<170,144>, ,2,[color5] |
193 | mcall , ,<62,36>,1,[color6] |
||
194 | mcall ,<16,144> , ,3,[color7] |
||
195 | |||
4213 | heavyiron | 196 | |
4215 | heavyiron | 197 | mcall ,<28,19> ,[color8],label2 ;eax=4 - write text |
5665 | Pathoswith | 198 | mcall ,<28,65> , ,label3 |
199 | mcall ,<64,40> ,[color9],label5 |
||
200 | mcall ,<64,86> , ,label6 |
||
201 | |||
4215 | heavyiron | 202 | |
4213 | heavyiron | 203 | call [check_box_draw2] |
204 | |||
205 | |||
206 | mcall ,2 |
||
207 | ret |
||
208 | ;--------------------------------------------------------------------- |
||
4215 | heavyiron | 209 | ;data |
210 | include 'data.inc' |
||
4044 | heavyiron | 211 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 212 | IM_END: |
213 | ;--------------------------------------------------------------------- |
||
214 | align 4 |
||
215 | |||
1742 | mario79 | 216 | |
4213 | heavyiron | 217 | |
218 | |||
219 | ;--------------------------------------------------------------------- |
||
220 | cur_dir_path: |
||
221 | rb 4096 |
||
5665 | Pathoswith | 222 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 223 | library_path: |
224 | rb 4096 |
||
5665 | Pathoswith | 225 | ;--------------------------------------------------------------------- |
4213 | heavyiron | 226 | align 32 |
227 | rb 4096 |
||
5665 | Pathoswith | 228 | stacktop: |
4213 | heavyiron | 229 | 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,331>0,133>0,333>50,120> |
5665 | Pathoswith | 230 |