Rev 274 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 274 | Rev 484 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | db 'MENUET01' ; identifier |
13 | db 'MENUET01' ; identifier |
14 | dd 1 ; header version |
14 | dd 1 ; header version |
15 | dd START ; start address |
15 | dd START ; start address |
16 | dd I_END ; file size |
16 | dd I_END ; file size |
17 | dd 28000h ; memory |
17 | dd 28000h ; memory |
18 | dd 28000h ; stack pointer (0x10000+ - work area for os) |
18 | dd 10000h ; stack pointer |
19 | dd 0,0 ; parameters, reserved |
19 | dd 0,0 ; parameters, reserved |
Line 20... | Line 20... | ||
20 | 20 | ||
21 | include 'lang.inc' |
21 | include 'lang.inc' |
- | 22 | include 'macros.inc' |
|
- | 23 | include 'kglobals.inc' |
|
22 | include 'macros.inc' |
24 | include 'unpacker.inc' |
Line 23... | Line 25... | ||
23 | ;****************************************************************************** |
25 | ;****************************************************************************** |
24 | 26 | ||
Line 139... | Line 141... | ||
139 | jne no_3d |
141 | jne no_3d |
140 | mov eax,48 |
142 | mov eax,48 |
141 | mov ebx,1 |
143 | mov ebx,1 |
142 | mov ecx,1 |
144 | mov ecx,1 |
143 | int 0x40 |
145 | int 0x40 |
144 | mov eax,48 |
- | |
145 | mov ebx,0 |
- | |
146 | mov ecx,0 |
- | |
147 | int 0x40 |
- | |
148 | jmp still |
146 | jmp doapply |
149 | no_3d: |
147 | no_3d: |
Line 150... | Line 148... | ||
150 | 148 | ||
151 | cmp ah,15 ; set flat buttons |
149 | cmp ah,15 ; set flat buttons |
152 | jne no_flat |
150 | jne no_flat |
- | 151 | mcall 48, 1, 0 |
|
153 | mcall 48, 1, 0 |
152 | doapply: |
154 | mcall 48, 0, 0 |
153 | mcall 48, 0, 0 |
155 | jmp still |
154 | jmp still |
Line 156... | Line 155... | ||
156 | no_flat: |
155 | no_flat: |
Line 161... | Line 160... | ||
161 | mov eax,48 |
160 | mov eax,48 |
162 | mov ebx,2 |
161 | mov ebx,2 |
163 | mov ecx,color_table |
162 | mov ecx,color_table |
164 | mov edx,10*4 |
163 | mov edx,10*4 |
165 | int 0x40 |
164 | int 0x40 |
166 | mov eax,48 |
165 | jmp doapply |
167 | mov ebx,0 |
- | |
168 | mov ecx,0 |
- | |
169 | int 0x40 |
- | |
170 | no_apply: |
166 | no_apply: |
Line 171... | Line 167... | ||
171 | 167 | ||
172 | cmp ah,17 ; load skin file |
168 | cmp ah,17 ; load skin file |
173 | jne no_load_skin |
169 | jne no_load_skin |
Line 273... | Line 269... | ||
273 | popa |
269 | popa |
274 | ret |
270 | ret |
Line 275... | Line 271... | ||
275 | 271 | ||
276 | 272 | ||
277 | load_file: |
- | |
278 | pushad |
273 | load_file: |
279 | 274 | xor eax, eax |
|
280 | mov [read_info.mode] ,0 |
275 | mov ebx, read_info |
281 | mov [read_info.start_block],0 |
276 | mov dword [ebx], eax ; subfunction: read |
282 | mov [read_info.blocks] ,1 |
277 | mov dword [ebx+4], eax ; offset (low dword) |
283 | mov [read_info.address] ,color_table |
278 | mov dword [ebx+8], eax ; offset (high dword) |
284 | mov [read_info.workarea] ,0x10000 |
- | |
285 | mcall 58, read_info |
279 | mov dword [ebx+12], 40 ; read colors file: 4*10 bytes |
286 | - | ||
287 | ; call draw_colours |
- | |
288 | 280 | mov dword [ebx+16], color_table ; address |
|
Line 289... | Line 281... | ||
289 | popad |
281 | mcall 70 |
- | 282 | ret |
|
- | 283 | ||
- | 284 | load_skin_file: |
|
- | 285 | xor eax, eax |
|
- | 286 | mov ebx, read_info |
|
- | 287 | mov dword [ebx], eax ; subfunction: read |
|
- | 288 | mov dword [ebx+4], eax ; offset (low dword) |
|
- | 289 | mov dword [ebx+8], eax ; offset (high dword) |
|
- | 290 | mov dword [ebx+12], 32*1024 ; read: max 32 KBytes |
|
- | 291 | mov dword [ebx+16], 0x10000 ; address |
|
- | 292 | mcall 70 |
|
- | 293 | ||
- | 294 | mov esi, 0x10000 |
|
- | 295 | ||
- | 296 | cmp dword [esi], 'KPCK' |
|
- | 297 | jnz notpacked |
|
290 | ret |
298 | cmp dword [esi+4], 32*1024 ; max 32 KBytes |
- | 299 | ja doret |
|
- | 300 | push 0x20000 |
|
- | 301 | push esi |
|
Line 291... | Line 302... | ||
291 | 302 | call unpack |
|
292 | load_skin_file: |
- | |
293 | pushad |
- | |
294 | - | ||
295 | mov [read_info.mode] ,0 |
- | |
296 | mov [read_info.start_block],0 |
303 | mov esi, 0x20000 |
Line -... | Line 304... | ||
- | 304 | notpacked: |
|
297 | mov [read_info.blocks] ,64 |
305 | |
298 | mov [read_info.address] ,0x20000 |
306 | cmp dword[esi+SKIN_HEADER.ident],'SKIN' |
Line 299... | Line 307... | ||
299 | mov [read_info.workarea] ,0x10000 |
307 | jne doret |
300 | mcall 58, read_info |
308 | |
301 | 309 | mov edi,0x18000 |
|
302 | cmp dword[0x20000+SKIN_HEADER.ident],'SKIN' |
310 | mov ecx,0x8000/4 |
Line 303... | Line -... | ||
303 | jne @f |
- | |
304 | - | ||
305 | mov esi,fname |
- | |
306 | mov edi,skin_info.fname |
- | |
307 | mov ecx,257 |
- | |
308 | rep movsb |
311 | rep movsd |
309 | 312 | ||
310 | mov esi,0x20000 |
313 | mov esi,fname |
311 | mov edi,0x18000 |
314 | mov edi,skin_info.fname |
312 | mov ecx,0x8000/4 |
315 | mov ecx,257 |
313 | rep movsd |
316 | rep movsb |
314 | 317 | ||
315 | mov ebp,0x18000 |
318 | mov ebp,0x18000 |
Line 316... | Line -... | ||
316 | mov esi,[ebp+SKIN_HEADER.params] |
- | |
317 | add esi,ebp |
319 | mov esi,[ebp+SKIN_HEADER.params] |
Line 318... | Line 320... | ||
318 | lea esi,[esi+SKIN_PARAMS.dtp.data] |
320 | add esi,ebp |
319 | mov edi,color_table |
321 | lea esi,[esi+SKIN_PARAMS.dtp.data] |
320 | mov ecx,10 |
- | |
321 | rep movsd |
322 | mov edi,color_table |
322 | @@: |
323 | mov ecx,10 |
323 | 324 | rep movsd |
|
324 | popad |
325 | doret: |
325 | ret |
326 | |
326 | - | ||
327 | 327 | ret |
|
328 | save_file: |
328 | |
Line 329... | Line -... | ||
329 | pushad |
- | |
330 | 329 | ||
Line 331... | Line 330... | ||
331 | mov [write_info.mode] ,1 |
330 | save_file: |
Line 332... | Line 331... | ||
332 | mov [write_info.bytes2write],10*4 |
331 | mov ebx, write_info |
Line 355... | Line 354... | ||
355 | f11: |
354 | f11: |
356 | mov eax,10 |
355 | mov eax,10 |
357 | int 0x40 |
356 | int 0x40 |
358 | cmp eax,2 |
357 | cmp eax,2 |
359 | jne read_done |
358 | jne read_done |
360 | mov eax,2 |
359 | ; mov eax,2 |
361 | int 0x40 |
360 | int 0x40 |
362 | shr eax,8 |
361 | shr eax,8 |
363 | cmp eax,13 |
362 | cmp eax,13 |
364 | je read_done |
363 | je read_done |
365 | cmp eax,8 |
364 | cmp eax,8 |
Line 379... | Line 378... | ||
379 | cmp edi, fname+87 |
378 | cmp edi, fname+87 |
380 | jne f11 |
379 | jne f11 |
Line 381... | Line 380... | ||
381 | 380 | ||
Line 382... | Line 381... | ||
382 | read_done: |
381 | read_done: |
383 | - | ||
384 | mov ecx, fname |
382 | |
385 | add ecx, 88 |
383 | mov ecx, fname+88 |
386 | sub ecx, edi |
384 | sub ecx, edi |
387 | mov eax, 0 |
385 | mov eax, 0 |
Line 1039... | Line 1037... | ||
1039 | end if |
1037 | end if |
Line 1040... | Line 1038... | ||
1040 | 1038 | ||
Line -... | Line 1039... | ||
- | 1039 | ||
- | 1040 | color dd 0 |
|
1041 | 1041 | ||
Line -... | Line 1042... | ||
- | 1042 | IncludeIGlobals |
|
- | 1043 | ||
1042 | color dd 0 |
1044 | I_END: |
1043 | 1045 | ||
1044 | I_END: |
1046 | IncludeUGlobals |
1045 | 1047 | ||
1046 | read_info: |
1048 | read_info: |