Rev 2881 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2881 | Rev 2984 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; application : View3ds ver. 0.062 - tiny .3ds files viewer. |
1 | ; application : View3ds ver. 0.063 - tiny .3ds files viewer. |
2 | ; compiler : FASM |
2 | ; compiler : FASM |
3 | ; system : KolibriOS |
3 | ; system : KolibriOS |
4 | ; author : Macgub aka Maciej Guba |
4 | ; author : Macgub aka Maciej Guba |
5 | ; email : macgub3@wp.pl |
5 | ; email : macgub3@wp.pl |
6 | ; web : www.macgub.hekko.pl |
6 | ; web : www.macgub.hekko.pl |
Line 263... | Line 263... | ||
263 | add_vec_buttons: ; can move: object, camera,.. list is open |
263 | add_vec_buttons: ; can move: object, camera,.. list is open |
264 | ; |
264 | ; |
265 | cmp ah,30 |
265 | cmp ah,30 |
266 | jne .next |
266 | jne .next |
267 | cmp [move_flag],1 |
267 | cmp [move_flag],0 |
268 | je @f |
268 | jne @f |
269 | ; cmp [move_flag],2 |
269 | ; cmp [move_flag],2 |
270 | ; je .set_light1 |
270 | ; je .set_light1 |
271 | sub [vect_y],10 |
271 | sub [vect_y],10 |
272 | jmp .next |
272 | jmp .next |
273 | @@: |
273 | @@: |
274 | sub [yobs],10 ; observator = camera position |
274 | cmp [move_flag],1 |
- | 275 | jne @f |
|
- | 276 | sub [yobs],10 ; observator = camera position |
|
275 | jmp .next |
277 | jmp .next |
276 | 278 | @@: |
|
277 | ;-------------------------------------------------- |
279 | sub [sin_amplitude],10 |
- | 280 | ;-------------------------------------------------- |
|
278 | ; .set_light1: ; r - |
281 | ; .set_light1: ; r - |
279 | ; movzx ebx,[light_no_flag] ; * 22 |
282 | ; movzx ebx,[light_no_flag] ; * 22 |
280 | ; mov ecx,ebx |
283 | ; mov ecx,ebx |
281 | ; shl ebx,4 |
284 | ; shl ebx,4 |
282 | ; shl ecx,1 |
285 | ; shl ecx,1 |
Line 294... | Line 297... | ||
294 | cmp ah,31 |
297 | cmp ah,31 |
295 | jne .next1 |
298 | jne .next1 |
296 | cmp [move_flag],1 |
299 | cmp [move_flag],1 |
297 | je @f |
300 | je @f |
298 | 301 | add [vect_z],10 |
|
299 | add [vect_z],10 |
- | |
300 | jmp .next1 |
302 | jmp .next1 |
301 | @@: |
303 | @@: |
302 | add [zobs],10 ; observator = camera position |
304 | add [zobs],10 ; observator = camera position |
303 | .next1: |
305 | .next1: |
304 | cmp ah,33 |
306 | cmp ah,33 |
305 | jne .next2 |
307 | jne .next2 |
306 | cmp [move_flag],1 |
308 | cmp [move_flag],0 |
307 | je @f |
309 | jne @f |
308 | 310 | sub [vect_x],10 |
|
309 | sub [vect_x],10 |
- | |
310 | jmp .next2 |
311 | jmp .next2 |
311 | @@: |
312 | @@: |
312 | sub [xobs],10 ; observator = camera position |
313 | cmp [move_flag],1 |
- | 314 | jne @f |
|
- | 315 | sub [xobs],10 ; observator = camera position |
|
313 | .next2: |
316 | jmp .next2 |
- | 317 | @@: |
|
- | 318 | fninit |
|
- | 319 | fld [sin_frq] |
|
- | 320 | fsub [sin_delta] |
|
- | 321 | fstp [sin_frq] |
|
- | 322 | .next2: |
|
314 | cmp ah,32 |
323 | cmp ah,32 |
315 | jne .next3 |
324 | jne .next3 |
316 | cmp [move_flag],1 |
325 | cmp [move_flag],0 |
317 | je @f |
326 | jne @f |
318 | 327 | add [vect_x],10 |
|
319 | add [vect_x],10 |
- | |
320 | jmp .next3 |
328 | jmp .next3 |
321 | @@: |
329 | @@: |
322 | add [xobs],10 ; observator = camera position |
330 | cmp [move_flag],1 |
- | 331 | jne @f |
|
- | 332 | add [xobs],10 ; observator = camera position |
|
323 | .next3: |
333 | jmp .next3 |
- | 334 | @@: |
|
- | 335 | fninit |
|
- | 336 | fld [sin_frq] ; change wave effect frequency |
|
- | 337 | fadd [sin_delta] |
|
- | 338 | fstp [sin_frq] |
|
- | 339 | .next3: |
|
324 | cmp ah,34 |
340 | cmp ah,34 |
325 | jne .next4 |
341 | jne .next4 |
326 | cmp [move_flag],1 |
342 | cmp [move_flag],1 |
327 | je @f |
343 | je @f |
328 | 344 | ||
Line 332... | Line 348... | ||
332 | sub [zobs],10 ; observator = camera position |
348 | sub [zobs],10 ; observator = camera position |
333 | .next4: |
349 | .next4: |
334 | cmp ah,35 |
350 | cmp ah,35 |
335 | jne .next5 |
351 | jne .next5 |
336 | cmp [move_flag],1 |
352 | cmp [move_flag],0 |
337 | je @f |
353 | jne @f |
338 | 354 | ; call add_vector |
|
339 | ; call add_vector |
- | |
340 | add [vect_y],10 |
355 | add [vect_y],10 |
341 | jmp .next5 |
356 | jmp .next5 |
342 | @@: |
357 | @@: |
343 | add [yobs],10 ; observator = camera position |
358 | cmp [move_flag],1 |
- | 359 | jne @f |
|
- | 360 | add [yobs],10 ; observator = camera position |
|
344 | .next5: |
361 | jmp .next5 |
- | 362 | @@: |
|
- | 363 | add [sin_amplitude],10 |
|
- | 364 | .next5: |
|
345 | 365 | ||
Line 346... | Line 366... | ||
346 | 366 | ||
Line 433... | Line 453... | ||
433 | jmp .blurrr |
453 | jmp .blurrr |
434 | @@: |
454 | @@: |
435 | call draw_triangles ; draw all triangles from the list |
455 | call draw_triangles ; draw all triangles from the list |
436 | .blurrr: |
456 | .blurrr: |
437 | cmp [fire_flag],0 |
457 | cmp [sinus_flag],0 |
- | 458 | je @f |
|
- | 459 | call do_sinus |
|
- | 460 | @@: |
|
- | 461 | cmp [fire_flag],0 |
|
438 | jne @f |
462 | jne @f |
439 | cmp [blur_flag],0 |
463 | cmp [blur_flag],0 |
440 | je .no_blur ; no blur, no fire |
464 | je .no_blur ; no blur, no fire |
441 | movzx ecx,[blur_flag] |
465 | movzx ecx,[blur_flag] |
442 | call blur_screen ; blur and fire |
466 | call blur_screen ; blur and fire |
Line 627... | Line 651... | ||
627 | rep stosd |
651 | rep stosd |
628 | end if |
652 | end if |
629 | .no_min: |
653 | .no_min: |
630 | end if |
654 | end if |
631 | ;========================commented===================================== |
655 | |
632 | RDTSC |
- | |
- | 656 | RDTSC |
|
633 | sub eax,[esp] |
657 | sub eax,[esp] |
634 | sub eax,41 |
658 | sub eax,41 |
635 | ; pop eax |
659 | ; pop eax |
636 | 660 | ||
Line 646... | Line 670... | ||
646 | 670 | ||
Line 647... | Line 671... | ||
647 | mov eax,7 ; put image |
671 | mov eax,7 ; put image |
648 | mov ebx,screen |
672 | mov ebx,screen |
649 | mov ecx,SIZE_X shl 16 + SIZE_Y |
673 | mov ecx,SIZE_X shl 16 + SIZE_Y |
650 | mov edx,5 shl 16 + 23 |
674 | mov edx,5 shl 16 + 25 |
651 | int 0x40 |
675 | int 0x40 |
Line 652... | Line 676... | ||
652 | 676 | ||
653 | mov eax,13 |
677 | mov eax,13 |
654 | mov ebx,530*65536+60 |
678 | mov ebx,530*65536+60 |
Line 2787... | Line 2811... | ||
2787 | mov edx,[edges_ptr] |
2811 | mov edx,[edges_ptr] |
2788 | int 0x40 ; -> allocate memory to edges |
2812 | int 0x40 ; -> allocate memory to edges |
2789 | mov [edges_ptr], eax ; -> eax = pointer to allocated mem |
2813 | mov [edges_ptr], eax ; -> eax = pointer to allocated mem |
2790 | 2814 | ||
Line -... | Line 2815... | ||
- | 2815 | mov eax,-1 ; fill edges list |
|
- | 2816 | movzx ecx,[triangles_count_var] ; importand if object generated |
|
- | 2817 | shr ecx,2 |
|
- | 2818 | inc ecx |
|
- | 2819 | mov edi,[edges_ptr] |
|
- | 2820 | cld |
|
- | 2821 | rep stosd |
|
- | 2822 | ||
Line 2791... | Line 2823... | ||
2791 | 2823 | ||
2792 | ; mov eax, 68 |
2824 | ; mov eax, 68 |
2793 | ; mov ebx, 12 |
2825 | ; mov ebx, 12 |
2794 | ; movzx ecx, [triangles_count_var] |
2826 | ; movzx ecx, [triangles_count_var] |
Line 2976... | Line 3008... | ||
2976 | mov eax,0 ; function 0 : define and draw window |
3008 | mov eax,0 ; function 0 : define and draw window |
2977 | mov ebx,100*65536;+SIZE_X;+80+30 ; [x start] *65536 + [x size] |
3009 | mov ebx,100*65536;+SIZE_X;+80+30 ; [x start] *65536 + [x size] |
2978 | mov ecx,100*65536;+SIZE_Y;+30 ; [y start] *65536 + [y size] |
3010 | mov ecx,100*65536;+SIZE_Y;+30 ; [y start] *65536 + [y size] |
2979 | mov bx,[size_x] |
3011 | mov bx,[size_x] |
2980 | add bx,114 |
3012 | add bx,115 |
2981 | mov cx,[size_y] |
3013 | mov cx,[size_y] |
2982 | add cx,30 |
3014 | add cx,30 |
2983 | mov edx,0x14000000 ; color of work area RRGGBB,8->color gl |
3015 | mov edx,0x14000000 ; color of work area RRGGBB,8->color gl |
2984 | mov edi,labelt ; WINDOW LABEL |
3016 | mov edi,labelt ; WINDOW LABEL |
2985 | int 0x40 |
3017 | int 0x40 |
2986 | 3018 |