Subversion Repositories Kolibri OS

Rev

Rev 6769 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2984 leency 1
do_sinus:
8014 leency 2
   .x      equ  [ebp-8]
3
   .y      equ  [ebp-12]
4
   .new_y  equ  [ebp-16]
5
   .temp   equ  [ebp-20]
2984 leency 6
   push    ebp
8014 leency 7
   mov     ebp,esp
8
   sub     esp,64
9
   mov     dword .x,0
10
   mov     dword .y,0
11
   mov     esi,[screen_ptr]
12
   mov     edi,[Zbuffer_ptr]
2984 leency 13
   push    edi
14
   ;  clear Zbuffer temporally used as image buffer
6619 leency 15
   movzx   ecx,word[size_x_var]
16
   movzx   eax,word[size_y_var]
17
   imul    ecx,eax  ;SIZE_X*SIZE_Y
8014 leency 18
   xor     eax,eax
2984 leency 19
   cld
8014 leency 20
   rep     stosd
21
   pop     edi
2984 leency 22
;   movzx   eax,[sinus_flag]
23
;   mov     edx,10
24
;   mul     edx
25
;   mov     [sin_amplitude],eax
26
;   mov     [sin_frq],eax
27
   fninit
28
;if Ext = SSE2
29
;   movups  xmm1,[const0123]   ; xmm1 - init values
30
;   mov     eax,0x000000ff
31
;   movd    xmm2,eax
32
;   shufps  xmm2,xmm2,0        ; xmm2 - mask value
33
;   mov     eax,4
34
;   movd    xmm3,eax
35
;   shufps  xmm3,xmm3,0
36
 .again:
37
if  0
38
   fild    dword .x
39
   fidiv   [sin_frq]
40
   fsin
41
   fimul   [sin_amplitude]
42
   fiadd   dword .y
43
   fistp   dword .new_y
44
else
45
   fild    dword .x
46
   fmul    [sin_frq]
47
   fistp   dword .temp
8014 leency 48
   mov     eax, .temp
2984 leency 49
;   mov     bx, [angle_x]
50
;   add     bx, [angle_y]
51
;   movzx   ebx,bx
52
;   shr     ebx,1       ; change phase
53
;   add     eax,ebx
54
 
55
 
8014 leency 56
   and     eax, 0x000000ff
2984 leency 57
 
58
;   cdq
59
 ;  mul     [sin_frq]
60
;   and      eax,0x000000ff
61
;   and     ax,0x00ff
62
;   cwde
63
 
8014 leency 64
   fld     dword [sin_tab+eax*4]
2984 leency 65
   fimul   dword [sin_amplitude]
66
   fiadd   dword .y
67
   fistp   dword .new_y
68
end if
8014 leency 69
   mov     eax,.new_y
70
   or      eax,eax
71
   jl      .skip
6619 leency 72
   movzx   ebx,word[size_y_var]
8014 leency 73
   cmp     eax,ebx  ;SIZE_Y
74
   jg      .skip
6619 leency 75
   movzx   edx,word[size_x_var]
8014 leency 76
   mul     edx
6619 leency 77
;   shl     eax,9
8014 leency 78
   add     eax,dword .x
79
   lea     ebx,[eax*3]
80
   mov     eax,[esi]
81
   mov     [edi+ebx],eax
2984 leency 82
 .skip:
8014 leency 83
   add     esi,3
84
   inc     dword .x
6619 leency 85
   movzx   edx,word[size_x_var]
8014 leency 86
   cmp     dword .x,edx  ;SIZE_X
87
   jl      .again
88
   mov     dword .x,0
89
   inc     dword .y
6619 leency 90
   movzx   edx,word[size_y_var]
8014 leency 91
   cmp     dword .y,edx   ;SIZE_Y
92
   jl      .again
2984 leency 93
 
94
   ; copy from temporary buffer -> Zbuffer to screen
8014 leency 95
   mov     esi,[Zbuffer_ptr]
96
   mov     edi,[screen_ptr]
6619 leency 97
   movzx   ecx,word[size_x_var]
98
   movzx   eax,word[size_y_var]
99
   imul    ecx,eax
8014 leency 100
   lea     ecx,[ecx*3]
101
   shr     ecx,2
6619 leency 102
 ;  mov     ecx,SIZE_X*SIZE_Y*3/4
2984 leency 103
   cld
8014 leency 104
   rep     movsd
2984 leency 105
 
106
 
8014 leency 107
   mov     esp,ebp
108
   pop     ebp
2984 leency 109
ret
110
 
111
 
1245 hidnplayr 112
draw_dots:
8014 leency 113
   mov     esi,[points_translated_ptr]
114
   mov     ecx,[points_count_var]
1245 hidnplayr 115
 .drw:
116
 @@:
117
   lodsd
8014 leency 118
   add     esi,2           ; skip z
1245 hidnplayr 119
   movzx   ebx,ax
8014 leency 120
   shr     eax,16          ; bx = x , ax = y
121
   or      ax,ax
122
   jl      @f
123
   or      bx,bx
124
   jl      @f
125
   cmp     ax,[size_y_var]  ;SIZE_Y
126
   jge     @f
127
   cmp     bx,[size_x_var]  ;SIZE_X
128
   jge     @f
6619 leency 129
   movzx   edx,word[size_x_var]  ;SIZE_X      ; SIZE_X not only power of 2   -> 256,512,...
8014 leency 130
   mul     edx
131
   add     eax,ebx
132
   mov     edi,[screen_ptr]
133
   lea     eax,[eax*3]
134
   add     edi,eax
135
   xor     eax,eax
136
   not     eax
1245 hidnplayr 137
   stosd
138
 @@:
139
   loop    .drw
140
 
141
ret
142
 
6619 leency 143
do_emboss:   ; sse2 version only
144
if Ext >= SSE2
145
 movzx ecx,[bumps_deep_flag]
146
 inc   ecx
147
 call  blur_screen    ;blur n times
148
 
149
 mov   eax,[size_y_var]  ;load both x, y
150
 mov   ebx,eax
151
 shr   ebx,16
152
 cwde
153
 mul   ebx
154
 mov   ecx,eax
155
 sub   ecx,ebx
156
 sub   ecx,ebx
157
 mov   esi,[screen_ptr]
158
 mov   edi,[Zbuffer_ptr]
159
 lea   ebx,[ebx*3]
160
 mov   edx,esi
161
 add   esi,ebx
162
 lea   ebx,[ebx+esi]
163
 pxor  xmm0,xmm0
164
 push  eax
165
@@:
166
 movlps     xmm1,[esi+3]
167
 movhps     xmm1,[esi+6]
168
 punpcklbw  xmm1,xmm0
169
 movlps     xmm2,[esi-3]
170
 movhps     xmm2,[esi]
171
 punpcklbw  xmm2,xmm0
172
 movlps     xmm3,[ebx]
173
 movhps     xmm3,[ebx+3]
174
 movlps     xmm4,[edx]
175
 movhps     xmm4,[edx+3]
176
 punpcklbw  xmm3,xmm0
177
 punpcklbw  xmm4,xmm0
178
 psubsw     xmm1,xmm2
8014 leency 179
 paddw      xmm1,[emboss_bias]
6619 leency 180
 psubsw     xmm3,xmm4
8014 leency 181
 paddw      xmm3,[emboss_bias]
6619 leency 182
 pmulhw     xmm1,xmm3
183
 movaps      xmm7,xmm1
184
 movaps      xmm6,xmm1
8014 leency 185
 psrlq       xmm7,2*8
186
 psrlq       xmm6,4*8
6619 leency 187
 pmaxsw      xmm1,xmm7
188
 pmaxsw      xmm1,xmm6
189
 
190
if 0
191
 movaps      xmm7,xmm3
192
 movaps      xmm6,xmm3
8014 leency 193
 psrlq       xmm7,2*8
194
 psrlq       xmm6,4*8
6619 leency 195
 pmaxsw      xmm3,xmm7
196
 pmaxsw      xmm3,xmm6
197
end if
198
 pmaxsw      xmm1,xmm3
199
 
8014 leency 200
 movd        eax,xmm1
201
 movzx       eax,al
202
 lea         eax,[eax*3+envmap_cub]
203
 mov         eax,[eax]
204
 mov        [edi],eax  ;xmm1
6619 leency 205
 psrldq     xmm1,8
8014 leency 206
 movd       eax,xmm1
207
 movzx      eax,al
208
 lea        eax,[eax*3+envmap_cub]
209
 mov        eax,[eax]
210
 mov        [edi+4],eax
6619 leency 211
 
212
 
8014 leency 213
 add    edi,8
214
 add    esi,6
215
 add    ebx,6
216
 add    edx,6
217
 sub    ecx,2
218
 jnc    @b
6619 leency 219
 
220
 
8014 leency 221
 pop    ecx  ;,eax
222
 mov    edi,[screen_ptr]
223
 mov    esi,[Zbuffer_ptr]
6619 leency 224
@@:
225
 movsd
8014 leency 226
 dec    edi
227
 loop   @b
6619 leency 228
end if
229
ret
230
 
6769 IgorA 231
;align 16
232
; emboss_bias:
233
;    dw 128, 128, 128, 128, 128, 128, 128, 128
6619 leency 234
 
235
if 0  ; old emb proc
236
 
1245 hidnplayr 237
 ;  emboss -  after drawing all,
238
 ;  transfer screen buffer into bump map
239
 ;  and draw two bump triangles
240
 ; *************************************
8014 leency 241
        mov     esi,screen
242
        mov     edi,bumpmap2
243
        mov     ecx,TEXTURE_SIZE/3
244
        cld
1245 hidnplayr 245
if  Ext=NON
8014 leency 246
        xor     eax,eax
247
        xor     bh,bh
248
        xor     dh,dh
1245 hidnplayr 249
      @@:
8014 leency 250
        lodsb
251
        movzx   bx,al
252
        lodsb
253
        movzx   dx,al
254
        lodsb
255
        add     ax,bx
256
        add     ax,dx
1245 hidnplayr 257
      ;  cwd
258
      ;  div     [i3]
259
 ;;       push    ax
260
 ;;       pop     bx
261
 ;;       shr     bx,3
262
 ;;       shr     ax,2
263
 ;;       add     ax,bx
264
 
8014 leency 265
        lea      eax,[eax*5]
266
        shr      ax,4
1245 hidnplayr 267
 
8014 leency 268
        stosb
269
        loop    @b
1245 hidnplayr 270
else
8014 leency 271
        emms
272
        pxor          mm1,mm1
273
        mov           ebx,0x0000ffff
1245 hidnplayr 274
      @@:
8014 leency 275
        movd          mm0,[esi]
276
        punpcklbw     mm0,mm1
277
        movq          mm2,mm0
278
        psrlq         mm2,16
279
        movq          mm3,mm0
280
        psrlq         mm3,32
281
        paddw         mm0,mm2
282
        paddw         mm0,mm3
1245 hidnplayr 283
 
284
 
8014 leency 285
        movd          eax,mm0
286
        and           eax,ebx
287
        lea           eax,[eax*5]
288
        shr           ax,4
289
        stosb
290
        add           esi,3
291
        loop          @b
1245 hidnplayr 292
 
293
end if
8014 leency 294
        push    ebp
1245 hidnplayr 295
 
8014 leency 296
        push    dword 0          ; env coords
297
        push    word 0
298
        push    word SIZE_X
299
        push    word SIZE_Y
300
        push    dword 0
301
        push    dword 0          ; bump coords
302
        push    word SIZE_X
303
        push    word SIZE_Y
304
        push    word 0
305
        mov     eax,SIZE_Y
306
        mov     ebx,SIZE_X*65536+0
307
        xor     ecx,ecx
308
        mov     edx,bumpmap2
309
        mov     esi,envmap
310
        mov     edi,screen
311
        call    bump_triangle
1245 hidnplayr 312
 
8014 leency 313
        push    dword SIZE_X shl 16 + SIZE_Y       ; env coords
314
        push    word 0
315
        push    word SIZE_X
316
        push    word SIZE_Y
317
        push    word 0
318
        push    dword SIZE_X shl 16 + SIZE_Y        ; bump coords
319
        push    word 0
320
        push    word SIZE_X
321
        push    word SIZE_Y
322
        push    word 0
323
        mov     eax,SIZE_Y
324
        mov     ebx,SIZE_X * 65536+0
325
        mov     ecx,SIZE_X shl 16 + SIZE_Y
326
        mov     edx,bumpmap2
327
        mov     esi,envmap
328
        mov     edi,screen
329
        call    bump_triangle
1245 hidnplayr 330
 
8014 leency 331
        pop     ebp
1245 hidnplayr 332
ret
6619 leency 333
end if
1245 hidnplayr 334
;********************************EMBOSS DONE*******************************
335
 
336
 
337
generate_object2:  ; torus
338
;in  ax - figure number       2=torus, 3=loop, 4=loop
339
;locals
340
;   counter dw ?
341
;   sin     dd ?
342
;   cos     dd ?
343
;endl
344
.counter equ  word[ebp-2]
8014 leency 345
.sin     equ  dword[ebp-6]
346
.cos     equ  dword[ebp-10]
347
.sin2    equ  dword[ebp-14]
348
.cos2    equ  dword[ebp-18]
1245 hidnplayr 349
.piD180m3 equ dword[ebp-22]
8014 leency 350
.cD2      equ word[ebp-24]
351
        push  ebp
352
        mov   ebp,esp
353
        sub   esp,24
1245 hidnplayr 354
 
8014 leency 355
        push  ax
1245 hidnplayr 356
 
8014 leency 357
        fninit
358
        mov     edi,[points_ptr]
359
        xor     eax,eax
360
                                    ; init seed -> 4   3d points
361
        mov     dword[edi],-1.0     ; x
362
        add     edi,4
363
        stosd                       ; y
364
        stosd                       ; z
365
        mov     dword[edi],-0.9     ; x1
366
        mov     dword[edi+4],0.1    ; y1
367
        add     edi,8
368
        stosd                       ; z1
369
        mov     dword[edi],-0.8
370
        add     edi,4
371
        stosd
372
        stosd
373
        mov     dword[edi],-0.9     ; x3
374
        mov     dword[edi+4],-0.1   ; y3
375
        add     edi,8
376
        stosd                       ; z3
377
        mov     [points_count_var],4
1245 hidnplayr 378
 
8014 leency 379
        fld     [piD180]
380
        fidiv   [i3]
381
        fstp    .piD180m3
382
        mov     .cD2,5
1245 hidnplayr 383
 
8014 leency 384
        pop     ax
385
        mov     ecx,1
386
        mov     edx,9
387
      .next:                      ; calc angle and rotate seed 4 points
388
        mov     .counter,cx
389
        mov     ebx,[points_ptr]
390
        fld     .piD180m3
391
        fimul   .counter
392
        fld     st
393
        fsincos
394
        fstp    .sin
395
        fstp    .cos
396
        fadd    st,st0
397
        fsincos
398
        fstp    .sin2
399
        fstp    .cos2
1245 hidnplayr 400
 
8014 leency 401
      .rotor:                          ; next 4
402
        ; rotary y
403
        fld     dword[ebx]         ; x
404
        fld     .sin
405
        fmul    dword[ebx+8]       ; z * sinbeta
406
        fchs
407
        fld     .cos
408
        fmul    dword[ebx]         ; x * cosbeta
409
        faddp
410
        fstp    dword[edi]         ; new x
411
        fmul    .sin             ; old x * sinbeta
412
        fld     .cos
413
        fmul    dword[ebx+8]       ; z * cosbeta
414
        faddp
415
        dec     dx
416
        or      dx,dx
417
        jnz     @f
1245 hidnplayr 418
;        mov     .counter,dx
8014 leency 419
        fld     st
420
        fidiv   [i3]
421
        faddp
1245 hidnplayr 422
    @@:
8014 leency 423
        fstp    dword[edi+8]       ; new z
424
        fld     dword[ebx+4]
425
        or      dx,dx
426
        jnz     @f
1245 hidnplayr 427
  ;      fld1
428
  ;      faddp
429
;        fld     st
8014 leency 430
        fadd    st,st0
431
        fadd    st,st0
1245 hidnplayr 432
;        fxch
433
;        fimul   [i3]
434
;        fsin
435
;        faddp
8014 leency 436
        mov     dx,9
1245 hidnplayr 437
    @@:
8014 leency 438
        fstp    dword[edi+4]
439
        ; rotary x
440
        cmp     al,3
441
        jl      .end_rot
442
        fld     dword[edi+4]    ;y
443
        fld     .sin2
444
        fmul    dword[edi+8]    ;z
445
        fld     .cos2
446
        fmul    dword[edi+4]    ;y
447
        faddp
448
        fstp    dword[edi+4]    ; new y
449
        fmul    .sin2       ; sinbeta * old y
450
        fchs
451
        fld     .cos2
452
        fmul    dword[edi+8]
453
        faddp
454
        fstp    dword[edi+8]
455
        ; rotary z
456
        cmp     al,4
457
        jl      .end_rot
458
        fld     dword[edi]      ;x
459
        fld     .sin
460
        fmul    dword[edi+4]    ;y
461
        fld     .cos
462
        fmul    dword[edi]      ;x
463
        faddp
464
        fstp    dword[edi]      ;new x
465
        fmul    .sin       ; sinbeta * old x
466
        fchs
467
        fld     .cos
468
        fmul    dword[edi+4]         ; cosbeta * y
469
        faddp
470
        fstp    dword[edi+4]    ; new y
1245 hidnplayr 471
 
472
 
473
 
474
      .end_rot:
475
 
8014 leency 476
        add     edi,12
477
        add     ebx,12
478
        mov     esi,[points_ptr]
479
        add     esi,12*4
480
        cmp     ebx,esi
481
        jl      .rotor
1245 hidnplayr 482
 
8014 leency 483
        add     [points_count_var],4
484
        add     cx,18
485
        cmp     cx,(18*21*3)+1
486
        jle     .next
1245 hidnplayr 487
 
8014 leency 488
        mov     edi,[triangles_ptr]
489
        mov     eax,4
490
        mov     ebx,4+4
491
        mov     [triangles_count_var],160*3    ;164*3   ;140
1245 hidnplayr 492
 
8014 leency 493
        mov     ecx,80*3  ;68
1245 hidnplayr 494
      @@:
8014 leency 495
        stosd                 ;----
496
        mov     [edi],ebx      ;    |
497
        add     edi,4         ;    |
498
        inc     eax            ;    |
499
        stosd                 ;    |repeat 4 times
1245 hidnplayr 500
 
8014 leency 501
        mov     [edi],ebx      ;    |
502
        inc     ebx
503
        add     edi,4
504
        stosd                 ;    |
505
        mov     [edi],ebx      ;    |
506
        add     edi,4         ;----
507
        loop     @b
1245 hidnplayr 508
 
509
 
8014 leency 510
        mov     dword[edi],-1  ; < - end mark
511
        mov       [culling_flag],0
1245 hidnplayr 512
 
8014 leency 513
        mov     esp,ebp
514
        pop     ebp
1245 hidnplayr 515
 
516
ret
517
 
518
 
519
generate_object3:  ; heart
520
;locals
521
;   counter dw ?
522
;   sin     dd ?
523
;   cos     dd ?
524
;endl
525
.counter equ  word[ebp-2]
8014 leency 526
.sin     equ  dword[ebp-6]
527
.cos     equ  dword[ebp-10]
528
.sin2    equ  dword[ebp-14]
529
.cos2    equ  dword[ebp-18]
1245 hidnplayr 530
.piD180m3 equ dword[ebp-22]
8014 leency 531
.cD2      equ word[ebp-24]
532
        push  ebp
533
        mov   ebp,esp
534
        sub   esp,24
1245 hidnplayr 535
 
8014 leency 536
        fninit
537
        mov     edi,[points_ptr]
538
        xor     eax,eax
539
                               ; init seed -> eight   3d points
540
        mov     dword[edi],2.0
541
        add     edi,4
542
        stosd
543
        stosd
1245 hidnplayr 544
 
8014 leency 545
        mov     dword[edi],2.0
546
        mov     dword[edi+4],-0.5
547
        add     edi,8
548
        stosd
1245 hidnplayr 549
 
8014 leency 550
        mov     dword[edi],1.5
551
        mov     dword[edi+4],-1.5
552
        add     edi,8
553
        stosd
554
        mov     dword[edi],1.0
555
        mov     dword[edi+4],-2.0
556
        add     edi,8
557
        stosd
1245 hidnplayr 558
 
8014 leency 559
        stosd
560
        mov     dword[edi],-2.5
561
        add     edi,4
562
        stosd
1245 hidnplayr 563
 
8014 leency 564
        mov     [points_count_var],5
1245 hidnplayr 565
 
8014 leency 566
        mov     ecx,1
567
      .next:                      ; calc angle and rotate seed 4 points
568
        mov     .counter,cx
569
        mov     ebx,[points_ptr]
570
        fld     [piD180]
571
        fimul   .counter
572
        fsincos
573
        fstp    .sin
574
        fstp    .cos
1245 hidnplayr 575
 
8014 leency 576
      .rotor:                          ; next 4
577
        ; rotary y
578
        fld     dword[ebx]         ; x
579
        fld     .sin
580
        fmul    dword[ebx+8]       ; z * sinbeta
581
        fchs
582
        fld     .cos
583
        fmul    dword[ebx]         ; x * cosbeta
584
        faddp
585
        fidiv   [i3]
586
        fstp    dword[edi]         ; new x
587
        fmul    .sin               ; old x * sinbeta
588
        fld     .cos
589
        fmul    dword[ebx+8]       ; z * cosbeta
590
        faddp
591
        fstp    dword[edi+8]       ; new z
1245 hidnplayr 592
 
8014 leency 593
        fld     dword[ebx+4]   ;y
594
        fstp    dword[edi+4]
1245 hidnplayr 595
 
596
 
597
      .end_rot:
598
 
8014 leency 599
        add     edi,12
600
        add     ebx,12
601
        mov     esi,[points_ptr]
602
        add     esi,12*5
603
        cmp     ebx,esi  ;real_points + (12*5)
604
        jl      .rotor
1245 hidnplayr 605
 
8014 leency 606
        add     [points_count_var],5
607
        add     cx,18
608
        cmp     cx,(18*21)+1
609
        jle     .next
1245 hidnplayr 610
;last points
611
 
8014 leency 612
        xor     eax,eax
1245 hidnplayr 613
 
8014 leency 614
        mov     dword[edi],0.22
615
        mov     dword[edi+4],0.77
616
        mov     dword[edi+8],1.25
617
        add     edi,12
1245 hidnplayr 618
 
8014 leency 619
        mov     dword[edi],0.22
620
        mov     dword[edi+4],0.77
621
        mov     dword[edi+8],-1.25
622
        add     edi,12
623
        stosd
1245 hidnplayr 624
 
8014 leency 625
        add     [points_count_var],2
1245 hidnplayr 626
 
627
; init triangles list
628
 
8014 leency 629
        mov     edi,[triangles_ptr]
630
        mov     eax,5
631
        mov     ebx,5+5
632
        mov     [triangles_count_var],200  ;204
1245 hidnplayr 633
 
8014 leency 634
        mov     ecx,100
1245 hidnplayr 635
      @@:
8014 leency 636
        stosd                 ;----
637
        mov     [edi],ebx      ;    |
638
        add     edi,4         ;    |
639
        inc     eax            ;    |
640
        stosd                 ;    |repeat
1245 hidnplayr 641
 
8014 leency 642
        mov     [edi],ebx      ;    |
643
        inc     ebx
644
        add     edi,4
645
        stosd                 ;    |
646
        mov     [edi],ebx      ;    |
647
        add     edi,4         ;----
648
        loop     @b
1245 hidnplayr 649
 
8014 leency 650
        mov     eax,5
651
        mov     ebx,[points_count_var]
652
        sub     ebx,2
653
        mov     dl,2
1245 hidnplayr 654
    .nx:
8014 leency 655
        mov     ecx,5
656
        add     [triangles_count_var],ecx
1245 hidnplayr 657
    @@:
8014 leency 658
        stosd
659
        add     eax,5
660
        stosd
661
        mov     dword[edi],ebx
662
        add     edi,4
663
        loop    @b
1245 hidnplayr 664
 
8014 leency 665
        cmp     dl,1
666
        je      @f
1245 hidnplayr 667
 
8014 leency 668
        inc     ebx
669
        jmp     .lab
1245 hidnplayr 670
     @@:
8014 leency 671
        dec     ebx
1245 hidnplayr 672
     .lab:
8014 leency 673
        mov     ecx,5
674
        add     [triangles_count_var],ecx
1245 hidnplayr 675
     @@:
8014 leency 676
        stosd
677
        add     eax,5
678
        stosd
679
        mov     dword[edi],ebx
680
        add     edi,4
681
        loop    @b
1245 hidnplayr 682
 
8014 leency 683
        dec     dl
684
        or      dl,dl
685
        jnz     .nx
1245 hidnplayr 686
 
8014 leency 687
        sub     eax,25
688
        stosd
689
        sub     eax,50
690
        stosd
691
        mov     dword[edi],ebx
692
        add     edi,4
1245 hidnplayr 693
 
8014 leency 694
        stosd
695
        add     eax,50
696
        stosd
697
        inc     ebx
698
        mov     dword[edi],ebx
699
        add     edi,4
700
        add     [triangles_count_var],2
1245 hidnplayr 701
 
8014 leency 702
        mov     dword[edi],-1  ; < - end mark
703
        mov     [culling_flag],0
1245 hidnplayr 704
 
8014 leency 705
        mov     esp,ebp
706
        pop     ebp
1245 hidnplayr 707
 
708
ret
8014 leency 709