Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6648 → Rev 6647

/programs/demos/3DS/B_PROCS.INC
749,9 → 749,8
push ecx
mov edi,[screen_ptr]
movzx ecx,word[size_x_var] ;SIZE_X*3/4
lea ecx,[ecx*3+1]
lea ecx,[ecx*3]
shr ecx,2
 
; mov ecx,SIZE_X*3/4
xor eax,eax
rep stosd
/programs/demos/3DS/DATA.INC
38,8 → 38,8
XYZpartices:
db 'X','Y','Z'
i10 dw 10
draw_win_at_first db 1
 
 
menu:
db 2 ; button number = index
db 'rotary ' ; label
314,7 → 314,7
if Ext=SSE2
db ' (SSE2)'
end if
db ' 0.067',0
db ' 0.066',0
labellen:
STRdata db '-1 '
 
440,10 → 440,6
dw ?
size_x_var:
dw ?
x_start:
dw ?
y_start:
dw ?
 
;===
 
530,8 → 526,6
; screen rb SIZE_X * SIZE_Y * 3 ; screen buffer
;align 16
; Z_buffer rb SIZE_X * SIZE_Y * 4
procinfo:
rb 1024 ; process info
I_Param rb 256
memStack rb 4000 ;memory area for stack
align 16
/programs/demos/3DS/History.txt
1,9 → 1,4
 
View 3ds 0,066 - X 2016
1. App window size according to current screen resolution.
2. New emboss procedure.
-----------------------------------------------------------------------------------
 
View3ds 0.065 - Feb 2015
1. Asc files support.
-----------------------------------------------------------------------------------
/programs/demos/3DS/README.TXT
1,11 → 1,11
View3ds 0.067 - tiny viewer to .3ds and .asc files with several graphics
View3ds 0.066 - tiny viewer to .3ds and .asc files with several graphics
effects implementation.
 
 
What's new?
1. Sizable app window.
1. App window size according to current screen resolution;
2, New emboss procedure.
 
 
Buttons description:
1. rotary: choosing rotary axle: x, y, x+y.
2. shd. model: choosing shading model: flat, grd (smooth), env (spherical
35,4 → 35,4
20. bright - -> decrease picture brightness.
21. wav effect -> do effect based sine function.
 
Maciej Guba XI 2016
Maciej Guba X 2016
/programs/demos/3DS/VIEW3DS.ASM
1,5 → 1,5
 
; application : View3ds ver. 0.067 - tiny .3ds and .asc files viewer
; application : View3ds ver. 0.066 - tiny .3ds and .asc files viewer
; with a few graphics effects demonstration.
; compiler : FASM
; system : KolibriOS
54,18 → 54,15
 
START: ; start of execution
cld
; mov eax,14 ; window size according to cur res ...
; int 0x40
; sub eax,150 shl 16 + 150
mov eax, 600 shl 16 + 600 ; ... or set manually
mov eax,14
int 0x40
sub eax,150 shl 16 + 150
mov [size_y_var],ax
shr ax,1
mov [vect_y],ax
 
 
shr ax,2
shr ax,1
movzx ebx,ax
lea ebx,[ebx*3]
push ebx
fninit
fild dword[esp]
77,10 → 74,7
shr ax,1
mov [vect_x],ax
 
mov eax, 20 shl 16 + 20
mov [x_start],eax
 
 
call alloc_buffer_mem
call read_param
call read_from_disk ; read, if all is ok eax = 0
113,10 → 107,6
end if
call read_from_file
.opt:
 
 
; call alloc_buffer_mem ; alloc memfor screnn and z buffer
 
call optimize_object1 ; proc in file b_procs.asm
; set point(0,0,0) in center and calc all coords
; to be in <-1.0,1.0>
127,12 → 117,12
call init_envmap_cub
call generate_texture2
call init_sincos_tab
 
call do_color_buffer ; intit color_map
mov edi,bumpmap
call calc_bumpmap
call calc_bumpmap_coords ; bump and texture mapping
call draw_window
mov [draw_win_at_first],0
 
still:
 
154,27 → 144,6
jmp noclose
 
red: ; redraw
mov eax,9 ; get process info
mov ebx,procinfo
mov ecx,-1
int 0x40
mov eax,[procinfo+42] ; read params of window
sub eax,115
mov [size_x_var],ax
shr ax,1
mov [vect_x],ax
;
mov eax,[procinfo+46]
sub eax,30
mov [size_y_var],ax
shr ax,1
mov [vect_y],ax
 
mov eax,[procinfo+34]
mov [x_start],ax
mov eax,[procinfo+38]
mov [y_start],ax
call alloc_buffer_mem ;realloc mem for scr & z buffs
call draw_window
 
jmp noclose
738,7 → 707,7
pop eax
 
mov eax,7 ; put image
mov ebx,[screen_ptr]
mov ebx,screen
mov ecx,[size_y_var]
; mov ecx,SIZE_X shl 16 + SIZE_Y
mov edx,5 shl 16 + 25
796,46 → 765,10
 
 
alloc_buffer_mem:
mov eax, 68
mov ebx, 11
int 0x40 ; -> create heap, to be sure
 
 
movzx ecx,word[size_x_var]
movzx eax,word[size_y_var]
mul ecx
; add eax,100
push eax
lea ecx,[eax*3]
mov eax,68
mov ebx,20
mov edx,[screen_ptr]
cmp [draw_win_at_first],1
jne @f
xor edx,edx
@@:
int 0x40
mov [screen_ptr],eax
 
pop ecx
shl ecx,2
mov eax,68
mov ebx,20
mov edx,[Zbuffer_ptr]
cmp [draw_win_at_first],1
jne @f
xor edx,edx
@@:
int 0x40
mov [Zbuffer_ptr],eax
 
if 0
;old Menuet style alloc
movzx ecx,word[size_x_var]
movzx eax,word[size_y_var]
add eax,200
mul ecx
lea ecx,[eax*3]
add ecx,16
and ecx,0xfffffff0
push ecx
849,7 → 782,6
mov [Zbuffer_ptr],MEM_END
pop ecx
add [Zbuffer_ptr],ecx
end if
ret
 
update_flags:
1716,7 → 1648,7
ret
 
clrscr:
mov edi,[screen_ptr]
mov edi,screen
movzx ecx,word[size_x_var]
movzx eax,word[size_y_var]
imul ecx,eax
1984,7 → 1916,7
ror ebx,16
mov ecx,dword[xx3]
ror ecx,16
mov edi,[screen_ptr]
lea edi,[screen]
cmp [catmull_flag],0
je @f
; lea esi,[Z_buffer]
2052,7 → 1984,7
mov ecx,dword[xx3]
ror ecx,16
; mov edi,screen
mov edi,[screen_ptr]
lea edi,[screen]
cmp [catmull_flag],0
je @f
; lea esi,[Z_buffer]
2116,7 → 2048,7
ror ebx,16
mov ecx,dword[xx3]
ror ecx,16
mov edi,[screen_ptr]
mov edi,screen
mov esi,envmap
cmp [catmull_flag],0
je @f
2252,7 → 2184,7
ror ebx,16
mov ecx,dword[xx3]
ror ecx,16
mov edi,[screen_ptr]
mov edi,screen
mov esi,envmap
mov edx,bumpmap ;BUMP_MAPPING
 
2292,7 → 2224,7
ror ebx,16
mov ecx,dword[xx3]
ror ecx,16
mov edi,[screen_ptr]
mov edi,screen
mov esi,texmap
cmp [catmull_flag],0
je @f
2406,7 → 2338,7
ror ebx,16
mov ecx,dword[xx3]
ror ecx,16
mov edi,[screen_ptr]
mov edi,screen
mov edx,texmap
mov esi,[Zbuffer_ptr]
 
2467,7 → 2399,7
ror ebx,16
mov ecx,dword[xx3]
ror ecx,16
mov edi,[screen_ptr]
mov edi,screen
mov esi,texmap
mov edx,envmap
 
2549,7 → 2481,7
ror ebx,16
mov ecx,dword[xx3]
ror ecx,16
mov edi,[screen_ptr]
mov edi,screen
mov esi,envmap
mov edx,bumpmap
 
2595,7 → 2527,7
; mov bl,[eax] ;
; test bl,00000001b ;
; jz @f ;
mov edi,[screen_ptr]
mov edi,screen
mov esi,[Zbuffer_ptr]
 
mov eax,[col1]
2630,7 → 2562,7
; test bl,00000010b
; jz @f
 
mov edi,[screen_ptr]
mov edi,screen
mov esi,[Zbuffer_ptr]
 
mov eax,[col1]
2666,7 → 2598,7
; test bl,00000100b ;
; jz @f ;
 
mov edi,[screen_ptr]
mov edi,screen
mov esi,[Zbuffer_ptr]
 
mov eax,[col3]
3175,18 → 3107,13
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov bx,[x_start]
shl ebx,16
mov cx,[y_start]
shl ecx,16
;ebx - [x start] *65536 + [x size]
;ecx - [y start] *65536 + [y size]
mov ebx,50*65536;+SIZE_X;+80+30 ; [x start] *65536 + [x size]
mov ecx,50*65536;+SIZE_Y;+30 ; [y start] *65536 + [y size]
mov bx,[size_x_var]
add bx,115
mov cx,[size_y_var]
add cx,30
; @@:
mov edx,0x13000000 ; color of work area RRGGBB,8->color gl
mov edx,0x14000000 ; color of work area RRGGBB,8->color gl
mov edi,labelt ; WINDOW LABEL
int 0x40