Rev 7 | Rev 35 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7 | Rev 33 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; WINDOW SKIN for MenuetOS ;; |
3 | ;; WINDOW SKIN for MenuetOS ;; |
4 | ;; ;; |
4 | ;; ;; |
5 | ;; entryway@bkg.lt ;; |
5 | ;; entryway@bkg.lt ;; |
6 | ;; ;; |
6 | ;; ;; |
7 | ;; Bugfixes & upgrades by ;; |
7 | ;; Bugfixes & upgrades by ;; |
8 | ;; Samuel Rodriguez Perez ;; |
8 | ;; Samuel Rodriguez Perez ;; |
9 | ;; Xeoda@ciberirmandade.org ;; |
9 | ;; Xeoda@ciberirmandade.org ;; |
10 | ;; ;; |
10 | ;; ;; |
11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | include "skindata.inc" |
15 | include "skindata.inc" |
16 | 16 | ||
17 | virtual at 0 |
17 | virtual at 0 |
18 | bmp_header: |
18 | bmp_header: |
19 | .type rw 1 ; "BM" signature |
19 | .type rw 1 ; "BM" signature |
20 | .filesize rd 1 ; size of the file |
20 | .filesize rd 1 ; size of the file |
21 | .reserved rd 1 ; zero |
21 | .reserved rd 1 ; zero |
22 | .offbits rd 1 ; pointer to image data |
22 | .offbits rd 1 ; pointer to image data |
23 | ;---------------- |
23 | ;---------------- |
24 | .headsize rd 1 ; usually 40 bytes for image header |
24 | .headsize rd 1 ; usually 40 bytes for image header |
25 | .width rd 1 |
25 | .width rd 1 |
26 | .height rd 1 |
26 | .height rd 1 |
27 | .planes rw 1 ; usually 1 |
27 | .planes rw 1 ; usually 1 |
28 | .bitcount rw 1 ; currently 24 bits/pixel (0x18) |
28 | .bitcount rw 1 ; currently 24 bits/pixel (0x18) |
29 | .compress rd 1 ; zero |
29 | .compress rd 1 ; zero |
30 | .sizeimage rd 1 ; x*y*(bitcount/8) |
30 | .sizeimage rd 1 ; x*y*(bitcount/8) |
31 | .unused rd 4 ; these bits aren't used by MeOS |
31 | .unused rd 4 ; these bits aren't used by MeOS |
32 | bmp_data: |
32 | bmp_data: |
33 | end virtual |
33 | end virtual |
34 | 34 | ||
35 | virtual at 0x778000 |
35 | virtual at 0x778000 |
36 | _bmp_bpl dd ? ; bytes per line |
36 | _bmp_bpl dd ? ; bytes per line |
37 | _bmp_dpl dd ? ; dwords per line |
37 | _bmp_dpl dd ? ; dwords per line |
38 | _bmp_zb dd ? ; bytes filled by zeroes at the end of a scanline |
38 | _bmp_zb dd ? ; bytes filled by zeroes at the end of a scanline |
39 | align 32 |
39 | align 32 |
40 | raw_data: |
40 | raw_data: |
41 | end virtual |
41 | end virtual |
42 | 42 | ||
43 | bmp2raw: |
43 | bmp2raw: |
44 | ; esi = to bmp data (source) |
44 | ; esi = to bmp data (source) |
45 | ; edi = to raw data (destination) |
45 | ; edi = to raw data (destination) |
46 | cmp [esi+bmp_header.type],'BM' ; check if bmp file is really loaded |
46 | cmp [esi+bmp_header.type],'BM' ; check if bmp file is really loaded |
47 | jne .finish |
47 | jne .finish |
48 | mov edx,esi |
48 | mov edx,esi |
49 | 49 | ||
50 | mov eax,[edx+bmp_header.width] |
50 | mov eax,[edx+bmp_header.width] |
51 | imul eax,3 |
51 | imul eax,3 |
52 | push eax |
52 | push eax |
53 | test eax,11b |
53 | test eax,11b |
54 | jz @f |
54 | jz @f |
55 | add eax,4 |
55 | add eax,4 |
56 | @@: |
56 | @@: |
57 | shr eax,2 |
57 | shr eax,2 |
58 | mov [_bmp_dpl],eax |
58 | mov [_bmp_dpl],eax |
59 | shl eax,2 |
59 | shl eax,2 |
60 | mov [_bmp_bpl],eax |
60 | mov [_bmp_bpl],eax |
61 | pop ebx |
61 | pop ebx |
62 | sub eax,ebx |
62 | sub eax,ebx |
63 | mov [_bmp_zb],eax |
63 | mov [_bmp_zb],eax |
64 | 64 | ||
65 | add esi,bmp_data |
65 | add esi,bmp_data |
66 | mov eax,[_bmp_bpl] |
66 | mov eax,[_bmp_bpl] |
67 | imul eax,[edx+bmp_header.height] |
67 | imul eax,[edx+bmp_header.height] |
68 | add esi,eax |
68 | add esi,eax |
69 | mov ebx,[edx+bmp_header.height] ; ebx = y |
69 | mov ebx,[edx+bmp_header.height] ; ebx = y |
70 | cld |
70 | cld |
71 | .y_begin: |
71 | .y_begin: |
72 | sub esi,[_bmp_bpl] |
72 | sub esi,[_bmp_bpl] |
73 | push esi |
73 | push esi |
74 | mov ecx,[_bmp_dpl] |
74 | mov ecx,[_bmp_dpl] |
75 | rep movsd |
75 | rep movsd |
76 | pop esi |
76 | pop esi |
77 | sub edi,[_bmp_zb] |
77 | sub edi,[_bmp_zb] |
78 | dec ebx |
78 | dec ebx |
79 | jne .y_begin |
79 | jne .y_begin |
80 | 80 | ||
81 | .finish: |
81 | .finish: |
82 | ret |
82 | ret |
83 | 83 | ||
84 | 84 | ||
85 | ; BMP support by Ivan Poddubny |
85 | ; BMP support by Ivan Poddubny |
86 | ; 1) load LEFT.BMP |
86 | ; 1) load LEFT.BMP |
87 | ; a) _skinleftw = bmp_width |
87 | ; a) _skinleftw = bmp_width |
88 | ; b) _skinleft = 0 |
88 | ; b) _skinleft = 0 |
89 | ; c) _refleft = 0x778000 |
89 | ; c) _refleft = 0x778000 |
90 | ; d) convert |
90 | ; d) convert |
91 | ; 2) load BASE.BMP |
91 | ; 2) load BASE.BMP |
92 | ; a) _skinbasew = bmp_width |
92 | ; a) _skinbasew = bmp_width |
93 | ; b) _skinbase = _skinleftw |
93 | ; b) _skinbase = _skinleftw |
94 | ; c) _refbase = _refleft+sizeof(left_raw_converted) |
94 | ; c) _refbase = _refleft+sizeof(left_raw_converted) |
95 | ; d) convert |
95 | ; d) convert |
96 | ; 3) load OPER.BMP |
96 | ; 3) load OPER.BMP |
97 | ; a) _skinoper = minus width from bmp file |
97 | ; a) _skinoper = minus width from bmp file |
98 | ; b) _skinoperw = width from bmp file |
98 | ; b) _skinoperw = width from bmp file |
99 | ; c) _refoper = _refbase+sizeof(oper_raw_converted) |
99 | ; c) _refoper = _refbase+sizeof(oper_raw_converted) |
100 | ; d) convert |
100 | ; d) convert |
101 | ; 4) set height |
101 | ; 4) set height |
102 | 102 | ||
103 | load_bmp_file: |
103 | load_bmp_file: |
104 | ; eax = pointer to filename |
104 | ; eax = pointer to filename |
105 | mov ebx, 1 |
105 | mov ebx, 1 |
106 | or ecx, -1 |
106 | or ecx, -1 |
107 | mov edx, 0x90000 |
107 | mov edx, 0x90000 |
108 | mov esi, 12 |
108 | mov esi, 12 |
109 | call fileread |
109 | call fileread |
110 | ret |
110 | ret |
111 | 111 | ||
112 | 112 | ||
113 | load_default_skin: |
113 | load_default_skin: |
114 | pushad |
114 | pushad |
115 | mov eax, _fileleft |
115 | mov eax, _fileleft |
116 | call load_bmp_file |
116 | call load_bmp_file |
117 | mov eax, [0x90000+bmp_header.width] |
117 | mov eax, [0x90000+bmp_header.width] |
118 | mov [_skinleftw], eax |
118 | mov [_skinleftw], eax |
119 | mov [_skinleft], 0 |
119 | mov [_skinleft], 0 |
120 | mov edi, raw_data |
120 | mov edi, raw_data |
121 | mov [_refleft], edi |
121 | mov [_refleft], edi |
122 | mov esi, 0x90000 |
122 | mov esi, 0x90000 |
123 | call bmp2raw |
123 | call bmp2raw |
124 | mov eax, [_bmp_bpl] |
124 | mov eax, [_bmp_bpl] |
125 | imul eax, [0x90000+bmp_header.height] |
125 | imul eax, [0x90000+bmp_header.height] |
126 | push eax |
126 | push eax |
127 | 127 | ||
128 | mov eax, _filebase |
128 | mov eax, _filebase |
129 | call load_bmp_file |
129 | call load_bmp_file |
130 | mov eax, [0x90000+bmp_header.width] |
130 | mov eax, [0x90000+bmp_header.width] |
131 | mov [_skinbasew], eax |
131 | mov [_skinbasew], eax |
132 | mov eax, [_skinleftw] |
132 | mov eax, [_skinleftw] |
133 | mov [_skinbase], eax |
133 | mov [_skinbase], eax |
134 | pop eax |
134 | pop eax |
135 | add eax, [_refleft] |
135 | add eax, [_refleft] |
136 | ; align to 32-byte boundary |
136 | ; align to 32-byte boundary |
137 | test eax, 11111b |
137 | test eax, 11111b |
138 | jz @f |
138 | jz @f |
139 | shr eax, 5 |
139 | shr eax, 5 |
140 | inc eax |
140 | inc eax |
141 | shl eax, 5 |
141 | shl eax, 5 |
142 | @@: |
142 | @@: |
143 | ; save base address |
143 | ; save base address |
144 | mov [_refbase], eax |
144 | mov [_refbase], eax |
145 | ; convert |
145 | ; convert |
146 | mov edi, eax |
146 | mov edi, eax |
147 | mov esi, 0x90000 |
147 | mov esi, 0x90000 |
148 | call bmp2raw |
148 | call bmp2raw |
149 | mov eax, [_bmp_bpl] |
149 | mov eax, [_bmp_bpl] |
150 | imul eax, [0x90000+bmp_header.height] |
150 | imul eax, [0x90000+bmp_header.height] |
151 | push eax |
151 | push eax |
152 | 152 | ||
153 | mov eax, _fileoper |
153 | mov eax, _fileoper |
154 | call load_bmp_file |
154 | call load_bmp_file |
155 | mov eax, [0x90000+bmp_header.width] |
155 | mov eax, [0x90000+bmp_header.width] |
156 | mov [_skinoperw], eax |
156 | mov [_skinoperw], eax |
157 | neg eax |
157 | neg eax |
158 | mov [_skinoper], eax |
158 | mov [_skinoper], eax |
159 | pop eax |
159 | pop eax |
160 | add eax, [_refbase] |
160 | add eax, [_refbase] |
161 | ; align to 32-byte boundary |
161 | ; align to 32-byte boundary |
162 | test eax, 11111b |
162 | test eax, 11111b |
163 | jz @f |
163 | jz @f |
164 | shr eax, 5 |
164 | shr eax, 5 |
165 | inc eax |
165 | inc eax |
166 | shl eax, 5 |
166 | shl eax, 5 |
167 | @@: |
167 | @@: |
168 | mov [_refoper], eax |
168 | mov [_refoper], eax |
169 | mov edi, eax |
169 | mov edi, eax |
170 | mov esi, 0x90000 |
170 | mov esi, 0x90000 |
171 | call bmp2raw |
171 | call bmp2raw |
172 | 172 | mov eax, [0x90000+bmp_header.height] |
|
- | 173 | mov [_skinh], eax |
|
- | 174 | popad |
|
- | 175 | ||
- | 176 | ret |
|
- | 177 | ||
- | 178 | load_default_skin_1: |
|
173 | 179 | pushad |
|
- | 180 | mov eax, _fileleft_1 |
|
174 | ; mov eax, [0x90000+bmp_header.height] |
181 | call load_bmp_file |
- | 182 | mov eax, [0x90000+bmp_header.width] |
|
- | 183 | mov [_skinleftw], eax |
|
- | 184 | mov [_skinleft_1], 0 |
|
- | 185 | mov edi, raw_data+1000h |
|
- | 186 | mov [_refleft_1], edi |
|
175 | ; imul eax, [0x90000+bmp_header.width] |
187 | mov esi, 0x90000 |
- | 188 | call bmp2raw |
|
176 | ; imul eax, 3 |
189 | mov eax, [_bmp_bpl] |
- | 190 | imul eax, [0x90000+bmp_header.height] |
|
177 | ; add eax, raw_data ; now eax points to the last line of image |
191 | push eax |
178 | 192 | ||
- | 193 | mov eax, _filebase_1 |
|
- | 194 | call load_bmp_file |
|
179 | ; mov ecx, [eax] |
195 | mov eax, [0x90000+bmp_header.width] |
- | 196 | mov [_skinbasew], eax |
|
180 | ; mov [_coloroutborder], ecx |
197 | mov eax, [_skinleftw] |
- | 198 | mov [_skinbase], eax |
|
- | 199 | pop eax |
|
- | 200 | add eax, [_refleft_1] |
|
- | 201 | ; align to 32-byte boundary |
|
- | 202 | test eax, 11111b |
|
- | 203 | jz @f |
|
- | 204 | shr eax, 5 |
|
181 | ; mov [_colorborder], ecx |
205 | inc eax |
- | 206 | shl eax, 5 |
|
- | 207 | @@: |
|
- | 208 | ; save base address |
|
- | 209 | mov [_refbase_1], eax |
|
182 | ; sub eax, 2*3 |
210 | ; convert |
- | 211 | mov edi, eax |
|
- | 212 | mov esi, 0x90000 |
|
183 | ; mov ecx, [eax] |
213 | call bmp2raw |
- | 214 | mov eax, [_bmp_bpl] |
|
- | 215 | imul eax, [0x90000+bmp_header.height] |
|
184 | ; mov [_colorframe], ecx |
216 | push eax |
- | 217 | ||
- | 218 | mov eax, _fileoper_1 |
|
- | 219 | call load_bmp_file |
|
- | 220 | mov eax, [0x90000+bmp_header.width] |
|
- | 221 | mov [_skinoperw], eax |
|
- | 222 | neg eax |
|
- | 223 | mov [_skinoper], eax |
|
- | 224 | pop eax |
|
- | 225 | add eax, [_refbase_1] |
|
- | 226 | ; align to 32-byte boundary |
|
- | 227 | test eax, 11111b |
|
- | 228 | jz @f |
|
- | 229 | shr eax, 5 |
|
- | 230 | inc eax |
|
185 | 231 | shl eax, 5 |
|
- | 232 | @@: |
|
- | 233 | mov [_refoper_1], eax |
|
- | 234 | mov edi, eax |
|
- | 235 | mov esi, 0x90000 |
|
186 | 236 | call bmp2raw |
|
187 | mov eax, [0x90000+bmp_header.height] |
237 | mov eax, [0x90000+bmp_header.height] |
188 | mov [_skinh], eax |
238 | mov [_skinh], eax |
189 | popad |
239 | popad |
190 | ret |
240 | ret |
191 | 241 | ||
192 | - | ||
193 | - | ||
194 | drawwindow_IV: |
242 | drawwindow_IV: |
195 | 243 | ||
196 | pusha |
244 | pusha |
197 | 245 | ||
198 | push edx |
246 | push edx |
199 | 247 | ||
200 | mov edi,[esp] ; RECTANGLE |
248 | mov edi,[esp] ; RECTANGLE |
201 | 249 | ||
202 | mov eax,[edi+0] |
250 | mov eax,[edi+0] |
203 | shl eax,16 |
251 | shl eax,16 |
204 | mov ax,[edi+0] |
252 | mov ax,[edi+0] |
205 | add ax,[edi+8] |
253 | add ax,[edi+8] |
206 | mov ebx,[edi+4] |
254 | mov ebx,[edi+4] |
207 | shl ebx,16 |
255 | shl ebx,16 |
208 | mov bx,[edi+4] |
256 | mov bx,[edi+4] |
209 | add bx,[edi+12] |
257 | add bx,[edi+12] |
210 | ; mov esi,[edi+24] |
258 | ; mov esi,[edi+24] |
211 | ; shr esi,1 |
259 | ; shr esi,1 |
212 | ; and esi,0x007f7f7f |
260 | ; and esi,0x007f7f7f |
213 | mov esi,[_coloroutborder] |
261 | mov esi,[_coloroutborder] |
214 | call draw_rectangle |
262 | call draw_rectangle |
215 | mov ecx,3 |
263 | mov ecx,3 |
216 | _dw3l: |
264 | _dw3l: |
217 | add eax,1*65536-1 |
265 | add eax,1*65536-1 |
218 | add ebx,1*65536-1 |
266 | add ebx,1*65536-1 |
219 | test ax,ax |
267 | test ax,ax |
220 | js no_skin_add_button |
268 | js no_skin_add_button |
221 | test bx,bx |
269 | test bx,bx |
222 | js no_skin_add_button |
270 | js no_skin_add_button |
223 | mov esi,[_colorframe] ;[edi+24] |
271 | mov esi,[_colorframe] ;[edi+24] |
224 | call draw_rectangle |
272 | call draw_rectangle |
225 | dec ecx |
273 | dec ecx |
226 | jnz _dw3l |
274 | jnz _dw3l |
227 | mov esi,[_colorborder] |
275 | mov esi,[_colorborder] |
228 | add eax,1*65536-1 |
276 | add eax,1*65536-1 |
229 | add ebx,1*65536-1 |
277 | add ebx,1*65536-1 |
230 | test ax,ax |
278 | test ax,ax |
231 | js no_skin_add_button |
279 | js no_skin_add_button |
232 | test bx,bx |
280 | test bx,bx |
233 | js no_skin_add_button |
281 | js no_skin_add_button |
234 | call draw_rectangle |
282 | call draw_rectangle |
235 | 283 | ||
236 | mov esi,[esp] |
284 | mov esi,[esp] |
237 | mov eax,[esi+8] ; window width |
285 | mov eax,[esi+8] ; window width |
238 | mov edx,[_skinleft] |
286 | mov edx,[_skinleft] |
239 | shl edx,16 |
287 | shl edx,16 |
240 | mov ecx,[_skinleftw] |
288 | mov ecx,[_skinleftw] |
241 | shl ecx,16 |
289 | shl ecx,16 |
242 | add ecx,[_skinh] |
290 | add ecx,[_skinh] |
243 | mov ebx,[_refleft] |
291 | |
- | 292 | cmp [aw_yes],1 |
|
- | 293 | ; cmp [esp+32+4+2], word 1 |
|
- | 294 | jne @f |
|
- | 295 | mov ebx,[_refleft] |
|
244 | call sys_putimage |
296 | jmp no_aw_3 |
- | 297 | @@: |
|
- | 298 | mov ebx,[_refleft_1] |
|
- | 299 | no_aw_3: |
|
- | 300 | call sys_putimage |
|
245 | 301 | ||
246 | mov esi,[esp] |
302 | mov esi,[esp] |
247 | mov eax,[esi+8] |
303 | mov eax,[esi+8] |
248 | sub eax,[_skinleftw] |
304 | sub eax,[_skinleftw] |
249 | sub eax,[_skinoperw] |
305 | sub eax,[_skinoperw] |
250 | cmp eax,[_skinbase] |
306 | cmp eax,[_skinbase] |
251 | jng non_base |
307 | jng non_base |
252 | xor edx,edx |
308 | xor edx,edx |
253 | mov ebx,[_skinbasew] |
309 | mov ebx,[_skinbasew] |
254 | div ebx |
310 | div ebx |
255 | 311 | ||
256 | inc eax |
312 | inc eax |
257 | 313 | ||
- | 314 | cmp [aw_yes],1 |
|
- | 315 | ; cmp [esp+32+4+2], word 1 |
|
- | 316 | jne @f |
|
258 | mov ebx,[_refbase] |
317 | mov ebx,[_refbase] |
- | 318 | jmp no_aw_2 |
|
- | 319 | @@: |
|
- | 320 | mov ebx,[_refbase_1] |
|
- | 321 | no_aw_2: |
|
259 | mov ecx,[_skinbasew] |
322 | mov ecx,[_skinbasew] |
260 | shl ecx,16 |
323 | shl ecx,16 |
261 | add ecx,[_skinh] |
324 | add ecx,[_skinh] |
262 | mov edx,[_skinbase] |
325 | mov edx,[_skinbase] |
263 | sub edx,[_skinbasew] |
326 | sub edx,[_skinbasew] |
264 | shl edx,16 |
327 | shl edx,16 |
265 | baseskinloop: |
328 | baseskinloop: |
266 | shr edx,16 |
329 | shr edx,16 |
267 | add edx,[_skinbasew] |
330 | add edx,[_skinbasew] |
268 | shl edx,16 |
331 | shl edx,16 |
269 | 332 | ||
270 | push eax ebx ecx edx |
333 | push eax ebx ecx edx |
271 | call sys_putimage |
334 | call sys_putimage |
272 | pop edx ecx ebx eax |
335 | pop edx ecx ebx eax |
273 | 336 | ||
274 | dec eax |
337 | dec eax |
275 | jnz baseskinloop |
338 | jnz baseskinloop |
276 | non_base: |
339 | non_base: |
277 | 340 | ||
278 | mov esi,[esp] |
341 | mov esi,[esp] |
279 | mov edx,[esi+8] |
342 | mov edx,[esi+8] |
280 | sub edx,[_skinoperw] |
343 | sub edx,[_skinoperw] |
281 | inc edx |
344 | inc edx |
282 | shl edx,16 |
345 | shl edx,16 |
283 | mov ebx,[_refoper] |
346 | cmp [aw_yes],1 |
- | 347 | ; cmp [esp+32+4+2], word 1 |
|
- | 348 | jne @f |
|
- | 349 | mov ebx,[_refoper] |
|
284 | mov ecx,[_skinoperw] |
350 | jmp no_aw_1 |
- | 351 | @@: |
|
- | 352 | mov ebx,[_refoper_1] |
|
- | 353 | no_aw_1: |
|
- | 354 | mov ecx,[_skinoperw] |
|
285 | shl ecx,16 |
355 | shl ecx,16 |
286 | add ecx,[_skinh] |
356 | add ecx,[_skinh] |
287 | call sys_putimage |
357 | call sys_putimage |
288 | 358 | ||
289 | mov esi,[esp] |
359 | mov esi,[esp] |
290 | 360 | ||
291 | mov edx,[esi+04] ; WORK AREA |
361 | mov edx,[esi+04] ; WORK AREA |
292 | add edx,21+5 |
362 | add edx,21+5 |
293 | mov ebx,[esi+04] |
363 | mov ebx,[esi+04] |
294 | add ebx,[esi+12] |
364 | add ebx,[esi+12] |
295 | cmp edx,ebx |
365 | cmp edx,ebx |
296 | jg _noinside2 |
366 | jg _noinside2 |
297 | mov eax,5 |
367 | mov eax,5 |
298 | mov ebx,[_skinh] |
368 | mov ebx,[_skinh] |
299 | mov ecx,[esi+8] |
369 | mov ecx,[esi+8] |
300 | mov edx,[esi+12] |
370 | mov edx,[esi+12] |
301 | sub ecx,4 |
371 | sub ecx,4 |
302 | sub edx,4 |
372 | sub edx,4 |
303 | mov edi,[esi+16] |
373 | mov edi,[esi+16] |
304 | call [drawbar] |
374 | call [drawbar] |
305 | _noinside2: |
375 | _noinside2: |
306 | 376 | ||
307 | mov edi,[0xfe88] |
377 | mov edi,[0xfe88] |
308 | movzx eax,word [edi] |
378 | movzx eax,word [edi] |
309 | cmp eax,1000 |
379 | cmp eax,1000 |
310 | jge no_skin_add_button |
380 | jge no_skin_add_button |
311 | inc eax |
381 | inc eax |
312 | mov [edi],ax |
382 | mov [edi],ax |
313 | 383 | ||
314 | shl eax,4 |
384 | shl eax,4 |
315 | add eax,edi |
385 | add eax,edi |
316 | 386 | ||
317 | mov bx,[0x3000] |
387 | mov bx,[0x3000] |
318 | mov [eax],bx |
388 | mov [eax],bx |
319 | 389 | ||
320 | add eax,2 ; save button id number |
390 | add eax,2 ; save button id number |
321 | mov bx,1 |
391 | mov bx,1 |
322 | mov [eax],bx |
392 | mov [eax],bx |
323 | add eax,2 ; x start |
393 | add eax,2 ; x start |
324 | mov ebx,[esp] |
394 | mov ebx,[esp] |
325 | mov ebx,[ebx+8] |
395 | mov ebx,[ebx+8] |
326 | cmp [_buttonCx],0 |
396 | cmp [_buttonCx],0 |
327 | jg _bCx_at_right |
397 | jg _bCx_at_right |
328 | mov ebx,[_buttonCw] ; ebx will be 0 in next instruction |
398 | mov ebx,[_buttonCw] ; ebx will be 0 in next instruction |
329 | _bCx_at_right: |
399 | _bCx_at_right: |
330 | sub ebx,[_buttonCw] |
400 | sub ebx,[_buttonCw] |
331 | sub ebx,[_buttonCx] |
401 | sub ebx,[_buttonCx] |
332 | mov [eax],bx |
402 | mov [eax],bx |
333 | add eax,2 ; x size |
403 | add eax,2 ; x size |
334 | mov ebx,[_buttonCw] |
404 | mov ebx,[_buttonCw] |
335 | mov [eax],bx |
405 | mov [eax],bx |
336 | add eax,2 ; y start |
406 | add eax,2 ; y start |
337 | mov ebx,[_buttonCy] |
407 | mov ebx,[_buttonCy] |
338 | mov [eax],bx |
408 | mov [eax],bx |
339 | add eax,2 ; y size |
409 | add eax,2 ; y size |
340 | mov ebx,[_buttonCh] |
410 | mov ebx,[_buttonCh] |
341 | mov [eax],bx |
411 | mov [eax],bx |
342 | 412 | ||
343 | ;* minimize button |
413 | ;* minimize button |
344 | mov edi,[0xfe88] |
414 | mov edi,[0xfe88] |
345 | movzx eax,word [edi] |
415 | movzx eax,word [edi] |
346 | cmp eax,1000 |
416 | cmp eax,1000 |
347 | jge no_skin_add_button |
417 | jge no_skin_add_button |
348 | inc eax |
418 | inc eax |
349 | mov [edi],ax |
419 | mov [edi],ax |
350 | 420 | ||
351 | shl eax,4 |
421 | shl eax,4 |
352 | add eax,edi |
422 | add eax,edi |
353 | 423 | ||
354 | mov bx,[0x3000] |
424 | mov bx,[0x3000] |
355 | mov [eax],bx |
425 | mov [eax],bx |
356 | 426 | ||
357 | add eax,2 ; save button id number |
427 | add eax,2 ; save button id number |
358 | mov bx,65535 ;999 |
428 | mov bx,65535 ;999 |
359 | mov [eax],bx |
429 | mov [eax],bx |
360 | add eax,2 ; x start |
430 | add eax,2 ; x start |
361 | mov ebx,[esp] |
431 | mov ebx,[esp] |
362 | mov ebx,[ebx+8] |
432 | mov ebx,[ebx+8] |
363 | cmp [_buttonMx],0 |
433 | cmp [_buttonMx],0 |
364 | jg _bMx_at_right |
434 | jg _bMx_at_right |
365 | mov ebx,[_buttonMw] ; ebx will be 0 in next instruction |
435 | mov ebx,[_buttonMw] ; ebx will be 0 in next instruction |
366 | _bMx_at_right: |
436 | _bMx_at_right: |
367 | sub ebx,[_buttonMw] |
437 | sub ebx,[_buttonMw] |
368 | sub ebx,[_buttonMx] |
438 | sub ebx,[_buttonMx] |
369 | mov [eax],bx |
439 | mov [eax],bx |
370 | add eax,2 ; x size |
440 | add eax,2 ; x size |
371 | mov ebx,[_buttonMw] |
441 | mov ebx,[_buttonMw] |
372 | mov [eax],bx |
442 | mov [eax],bx |
373 | add eax,2 ; y start |
443 | add eax,2 ; y start |
374 | mov ebx,[_buttonMy] |
444 | mov ebx,[_buttonMy] |
375 | mov [eax],bx |
445 | mov [eax],bx |
376 | add eax,2 ; y size |
446 | add eax,2 ; y size |
377 | mov ebx,[_buttonMh] |
447 | mov ebx,[_buttonMh] |
378 | mov [eax],bx |
448 | mov [eax],bx |
379 | ;* minimize button |
449 | ;* minimize button |
380 | 450 | ||
381 | no_skin_add_button: |
451 | no_skin_add_button: |
382 | 452 | ||
383 | add esp,4 |
453 | add esp,4 |
384 | popa |
454 | popa |
385 | ret |
455 | |
- | 456 | ret |
|
386 | 457 |