home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / CONTRSRC.ZIP / SRC / MORFLAME / TRACING.INC < prev    next >
Encoding:
Text File  |  1994-11-12  |  19.5 KB  |  630 lines

  1. ; Real-Time Ray-Casting, Morflame octobre 1994
  2. ; requiert une table de cosinus/sinus * 512 en dword (à inclure dans le 
  3. ; main).
  4. ; code optimisé. Une plus grande rapidité serait obtenue en précalculant
  5. ; des tables (estimé à +/- 1Mb pour un affichage extra!)
  6. ; si une couleur 0 est rencontrée dans le bitmap, une colonne verticale est
  7. ; tracée, et la position x actuelle est lockée via le vecteur flags.
  8. ; Ainsi, tout ce qui est derrière n'est pas calculé.
  9.  
  10. ; Constantes
  11.       Angle_vue EQU 60*4
  12.       Angle_vue_div_2 EQU 30*4
  13.       
  14. ;---------------------------------------------------------------------------
  15. MRF_TEXT ENDS
  16. _DATA2 SEGMENT
  17.     cam_x DWORD 320*512
  18.     cam_y DWORD 1600*512
  19.     cam_angle WORD 90*4         ; * 4 pour accès rapide table dword
  20.     cam_angle_minus_k WORD ?
  21.     cam_angle_plus_k WORD ?
  22.     angle       WORD ?
  23.     wx          DWORD ?
  24.     wy          DWORD ?
  25.     px          DWORD ?
  26.     py          DWORD ?
  27.     mx          DWORD ?
  28.     my          DWORD ? 
  29.     a_x         DWORD ?
  30.     a_y         DWORD ?
  31.     b_x         DWORD ?
  32.     b_y         DWORD ?
  33.     xdiff       DWORD ?
  34.     ydiff       DWORD ?
  35.     xstep       DWORD ?
  36.     ystep       DWORD ?
  37.     flags       byte 320 dup (0)        ; pour le clipping des murs
  38.     i WORD ?
  39.     j WORD ?
  40.     k WORD ?
  41. ;---------------------------------------------------------------------------
  42. ; Carte de l'environnement
  43. ;---------------------------------------------------------------------------
  44.     EVEN
  45.     map LABEL BYTE 
  46.     db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
  47.     db 2,2,0,2,2,2,0,2,2,2,2,2,0,0,0,2
  48.     db 2,2,0,2,2,2,0,2,2,2,2,2,0,0,0,2
  49.     db 2,2,0,0,2,2,0,2,2,2,2,2,0,0,0,2
  50.     db 2,2,0,0,2,2,0,2,2,2,2,2,0,0,0,2
  51.     db 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2
  52.     db 2,2,0,2,2,2,2,2,2,2,2,2,0,0,0,2
  53.     db 2,0,0,2,0,2,2,2,0,0,0,2,0,0,0,2
  54.     db 2,2,0,2,0,2,2,2,2,2,0,2,0,0,0,2
  55.     db 2,0,0,2,0,0,0,0,0,0,0,2,0,0,0,2
  56.     db 2,2,0,2,0,0,0,0,0,0,0,2,0,0,0,2
  57.     db 2,0,0,2,0,0,0,0,0,0,0,2,0,0,0,2
  58.     db 2,2,0,2,2,2,2,2,2,2,2,2,0,0,0,2
  59.     db 0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2
  60.     db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
  61.     db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
  62. ;---------------------------------------------------------------------------
  63. _DATA2 ENDS
  64. MRF_TEXT SEGMENT
  65. ;------------------------------------------------------------------------------
  66. Tourne_Droite MACRO vitesse
  67. LOCAL saut        
  68.     sub     cam_angle, 4*vitesse         ; 4=1°
  69.     cmp     cam_angle, 0
  70.     jge     saut
  71.     mov     cam_angle, 359*4
  72. saut:
  73. ENDM
  74. ;------------------------------------------------------------------------------
  75. Tourne_Gauche MACRO vitesse       
  76. LOCAL saut        
  77.     add     cam_angle, 4*vitesse         ; 4=1°
  78.     cmp     cam_angle, 359*4
  79.     jle     saut
  80.     mov     cam_angle, 0
  81. saut:
  82. ENDM
  83. ;***************************************************************************
  84. EFFACE_MUR MACRO label_fin
  85. LOCAL fin, bcl3
  86.     mov     bx, bp 
  87. bcl3:   mov     byte ptr es:[bx],00h            ; ligne vert de dx à bp
  88.     sub     bx, 80
  89.     cmp     bx, dx
  90.     jge     bcl3
  91. ENDM
  92. ;***************************************************************************
  93. TRAITE_MUR MACRO label_fin
  94. LOCAL fin, bcl3
  95.     cmp     al, 0                           ; couleur noire (0) ?
  96.     jnz     fin
  97.     
  98.     ; Détermination de la couleur du mur 
  99.  
  100.     mov     ax, i                           ; profondeur
  101.     sub     ax, 102
  102.     shr     ax, 1                           ; position dans palette
  103.     mov     bl, 80
  104.     sub     bl, al        
  105.     mov     al, bl
  106.  
  107.     mov     bx, bp                          ; si oui alors mur !
  108.       ;  sub     bx, 80
  109.  
  110. bcl3:   mov     byte ptr es:[bx], al            ; ligne vert de dx à bp
  111.     sub     bx, 80
  112.     cmp     bx, dx
  113.     jg      bcl3
  114.     mov     bx, cx
  115.     mov     byte ptr flags[bx], 1           ; flag on, pos x lockée !
  116.     jmp     label_fin
  117. fin:                                            ; si non alors sol/plafond !
  118. ENDM
  119. ;***************************************************************************
  120. TRAITE_MUR2 MACRO label_fin
  121. LOCAL fin, bcl3
  122.  
  123. IFNDEF posx                
  124. MRF_TEXT ENDS
  125. _DATA2 SEGMENT
  126.  
  127.    posx word ?
  128.  
  129. _DATA2 ENDS
  130. MRF_TEXT SEGMENT
  131. ENDIF        
  132.     cmp     al, 0                           ; couleur noire (0) ?
  133.     jnz     fin                             ; si oui alors mur !
  134.     
  135.     push    cx
  136.     push    si
  137.     push    edi
  138.     push    fs
  139.     
  140.     LSFS    wall, si
  141.     mov     eax, esi                        ; position x
  142.     shr     eax, 9                          ; divisé par 512
  143.     mov     ebx, edi                        ; position y
  144.     shr     ebx, 9                          ; divisé par 512
  145.     add     eax, ebx                        ; x+y
  146.     and     ax, 07Fh                        ; modulo 128
  147.     mov     posx, ax                        ; cx contient le x du bitmap
  148.     
  149.     mov     bx, dx                          ; position depart (haut)
  150.     xor     eax, eax                        ; incrément dans le bitmap
  151.     mov     si, i                           ; la profondeur (100-200)
  152.     shl     si, 2
  153.     mov     ecx, Hauteur_Mur[si]
  154.     mov     esi, ecx
  155.  
  156. bcl3:   add     eax, esi                        ; incrémentation en y du bmp
  157.     mov     edi, eax
  158.     shr     edi, 2
  159.     add     di, posx                        ; on ajoute pos x =offset bmp
  160.     
  161.     mov     cl, byte ptr fs:[di]
  162.  
  163.     mov     byte ptr es:[bx], cl
  164.     
  165.     add     bx, 80                          ; un pixel plus bas ...
  166.     cmp     bx, bp
  167.     jle     bcl3
  168.  
  169.     
  170.     mov     bx, cx
  171.     mov     byte ptr flags[bx], 1           ; flag on, pos x lockée !
  172.     
  173.     pop     fs
  174.     pop     edi
  175.     pop     si
  176.     pop     cx
  177.     
  178.     jmp     label_fin
  179.  
  180. fin:                                            ; si non alors sol/plafond !
  181.  
  182. ENDM
  183.  
  184. ;***************************************************************************
  185.  
  186. TROUVE_BITMAP MACRO
  187.     push    ebx
  188.     mov     eax, esi                        ; trouver le bon bitmap
  189.     shr     eax, 9+7
  190.     mov     ebx, edi
  191.     shr     ebx, 9+7                        ; div 512*128
  192.     shl     ebx, 4                          ; * 16
  193.     add     ebx, eax        
  194.     xor     eax, eax
  195.     
  196.     mov     al, map[ebx]        
  197.     shl     eax, 14
  198.     pop     ebx
  199.  
  200. ENDM        
  201.  
  202. ;***************************************************************************
  203.     
  204.  
  205. ;***************************************************************************
  206. ;*                                                                         *
  207. ;*                                                                         *
  208. ;*                                                                         *
  209. ;*                                                                         *
  210. ;*                                                                         *
  211. ;*                                                                         *
  212. ;*                                                                         *
  213. ;*             FLOORS, Basse résolution (pour vieilles bécanes)            *
  214. ;*                                                                         *
  215. ;*                                                                         *
  216. ;*                                                                         *
  217. ;*                                                                         *
  218. ;*                                                                         *
  219. ;*                                                                         *
  220. ;*                                                                         *
  221. ;***************************************************************************
  222.  
  223.  
  224. FLOORS_LOW_DETAIL PROC
  225.     push    bp
  226.     mov     bp, sp
  227.  
  228.     LSFS    mapping, ax
  229.     LSGS    ceil, ax
  230.     mov     k, angle_vue_div_2
  231. ;------------------------------------------ Charge segment VGA
  232.     mov     ax, 0A000h
  233.     mov     es, ax 
  234. ;------------------------------------------ Précalculations
  235.     mov     ax, cam_angle
  236.     sub     ax, k
  237.     cmp     ax, 0
  238.     jge     @F
  239.     add     ax, 360*4
  240. @@:     mov     cam_angle_minus_k, ax
  241.     mov     ax, cam_angle
  242.     add     ax, k
  243.     cmp     ax, 360*4
  244.     jl      @F
  245.     sub     ax, 360*4
  246. @@:     mov     cam_angle_plus_k, ax
  247. ;------------------------------------------ mise à 0 des flags
  248.     mov     bx, 64
  249. bcl0:   mov     byte ptr flags[bx], 0
  250.     dec     bx
  251.     jnz     bcl0
  252. ;------------------------------------------ Boucles imbriquées
  253. OUT_16  SC_Index, 0F02h                 ; choix des plan 1-4
  254.  
  255. mov     cx, 98 
  256. LSFS    _DATA, ax
  257. mov     di, Dest ; fs:[_WorkAdr] ;current_page  ; une des deux pages actives !
  258. mov     dx, word ptr fs:[di] ;current_page
  259. mov     bp, word ptr fs:[di]
  260. LSFS    mapping, ax
  261. add     dx, 80-1                        ; idem ceil
  262. add     bp, 80*200-1                     ; position départ floor
  263. ;------------------------------------------ N°1
  264. bcl1:   mov     i, cx
  265.     mov     di, cx
  266.     shl     di, 2
  267.     mov     si, cam_angle_minus_k   ; si est bien positionné dans cos/sin
  268.     mov     ebx, view_distance[di]
  269.     mov     eax, cosinus_2[si]        ; calcul de a_x
  270.     imul    eax, ebx
  271.     add     eax, cam_x
  272.     mov     a_x, eax
  273.     mov     eax, sinus_2[si]          ; calcul de a_y
  274.     imul    eax, ebx
  275.     add     eax, cam_y
  276.     mov     a_y, eax
  277.     mov     si, cam_angle_plus_k    ; si est bien positionné dans cos/sin
  278.     mov     ecx, cosinus_2[si]        ; calcul de b_x
  279.     imul    ecx, ebx
  280.     add     ecx, cam_x
  281.     mov     eax, sinus_2[si]          ; calcul de b_y
  282.     imul    eax, ebx
  283.     add     eax, cam_y
  284.     sub     eax, a_y                ; eax = ydiff (by-ay)
  285.     sub     ecx, a_x                ; ecx = xdiff (bx-ax)
  286.     sar     eax, 6                  ; diviser par view_width
  287.     sar     ecx, 6                  ; (=256) si 1pt précision
  288.                     ; (=128) si 2pts précision
  289.     mov     ystep, eax
  290.     mov     xstep, ecx
  291.     add     i, 100 
  292. ;------------------------------------------        
  293.     mov     cx, 64                          ; cx = j
  294.     mov     esi, a_x
  295.     mov     edi, a_y
  296. ;------------------------------------------ N°2
  297. bcl2:   mov     bx, cx                          ; position x lockée ?
  298.     cmp     byte ptr flags[bx], 0
  299.     jnz     fbcl2
  300.  
  301.     mov     eax, esi
  302.     shr     eax, 9
  303.     sub     eax, 32
  304.     and     eax, 7Fh    ; 0000 0000 0000 0000 0000 0000 0111 1111y
  305.     
  306.     mov     ebx, edi   
  307.     shr     ebx, 2
  308.     and     ebx, 3F00h  ; 0000 0000 0000 0000 0011 1111 0000 0000y
  309.     add     ebx, eax                                   ;1 ?
  310.     
  311.     TROUVE_BITMAP
  312.     add     ebx, eax        
  313.     
  314.     mov     al, byte ptr fs:mapping[ebx]    ; couleur du sol
  315.  
  316.     TRAITE_MUR fbcl2        
  317.     
  318.     mov     es:[bp], al                     ; double pixel sol
  319.     mov     al, byte ptr gs:ceil[ebx]       ; couleur du plafond        
  320.     mov     bx, dx
  321.     mov     es:[bx], al                     ; double pixel plafond
  322. fbcl2:  add     esi, xstep
  323.     add     edi, ystep
  324.     dec     bp                              ; offset_pix_floor-=1
  325.     dec     dx                              ; offset_pix_ceil-=1
  326.     dec     cx
  327.     jnz     bcl2
  328.  
  329. fbcl1:  add     dx, 144
  330.     sub     bp, 16
  331.  
  332.     sub     i, 100
  333.     mov     cx, i
  334.     dec     cx
  335.     cmp     cx, 15 
  336.     jnz     bcl1
  337.  
  338. ; ----------------------------------------- Effacement de ce qui reste
  339.     mov     si, 64
  340.  
  341. eff:  
  342.     cmp     byte ptr flags[si], 0   
  343.     jnz     @F
  344.     Efface_Mur
  345.  
  346. @@:     dec     bp
  347.     dec     dx
  348.     dec     si
  349.     jnz     eff
  350.  
  351.     pop     bp
  352.     ret
  353.  
  354. FLOORS_LOW_DETAIL ENDP
  355.  
  356.  
  357.  
  358. ;***************************************************************************
  359. ;*                                                                         *
  360. ;*                                                                         *
  361. ;*                                                                         *
  362. ;*                                                                         *
  363. ;*                                                                         *
  364. ;*                                                                         *
  365. ;*                                                                         *
  366. ;*             FLOORS, Moyenne résolution (pour les bonnes bécanes)        *
  367. ;*                                                                         *
  368. ;*                                                                         *
  369. ;*                                                                         *
  370. ;*                                                                         *
  371. ;*                                                                         *
  372. ;*                                                                         *
  373. ;*                                                                         *
  374. ;***************************************************************************
  375.  
  376. FLOORS_MEDIUM_DETAIL PROC
  377.     push    bp
  378.     mov     bp, sp
  379.  
  380.     LSFS    mapping, ax
  381.     LSGS    ceil, ax
  382.     mov     k, angle_vue_div_2
  383. ;------------------------------------------ Charge segment VGA
  384.     mov     ax, 0A000h
  385.     mov     es, ax 
  386. ;------------------------------------------ Précalculations
  387.     mov     ax, cam_angle
  388.     sub     ax, k
  389.     cmp     ax, 0
  390.     jge     @F
  391.     add     ax, 360*4
  392. @@:     mov     cam_angle_minus_k, ax
  393.     mov     ax, cam_angle
  394.     add     ax, k
  395.     cmp     ax, 360*4
  396.     jl      @F
  397.     sub     ax, 360*4
  398. @@:     mov     cam_angle_plus_k, ax
  399. ;------------------------------------------ mise à 0 des flags
  400.     mov     bx, 130
  401. bcl0:   mov     byte ptr flags[bx], 0
  402.     dec     bx
  403.     jnz     bcl0
  404.  
  405. ;---------------------------------------------------------------------------
  406. ;                               PLANS 1-2
  407. ;---------------------------------------------------------------------------
  408.  
  409. ;------------------------------------------ Boucles imbriquées
  410. OUT_16  SC_Index, 0302h                 ; choix des plan 1-2
  411.  
  412. mov     cx, 98
  413. LSFS    _DATA, ax
  414. mov     di, Dest ;fs:[_WorkAdr] ;current_page  ; une des deux pages actives !
  415. mov     dx, word ptr fs:[di] ;current_page
  416. mov     bp, word ptr fs:[di]
  417. LSFS    mapping, ax
  418. add     dx, 80-1                         ; idem ceil
  419. add     bp, 80*200-1                     ; position départ floor
  420. ;------------------------------------------ N°1
  421. bcl1:   mov     i, cx
  422.     mov     di, cx
  423.     shl     di, 2
  424.     mov     si, cam_angle_minus_k   ; si est bien positionné dans cos/sin
  425.     mov     ebx, view_distance[di]
  426.     mov     eax, cosinus_2[si]        ; calcul de a_x
  427.     imul    eax, ebx
  428.     add     eax, cam_x
  429.     mov     a_x, eax
  430.     mov     eax, sinus_2[si]          ; calcul de a_y
  431.     imul    eax, ebx
  432.     add     eax, cam_y
  433.     mov     a_y, eax
  434.     mov     si, cam_angle_plus_k    ; si est bien positionné dans cos/sin
  435.     mov     ecx, cosinus_2[si]        ; calcul de b_x
  436.     imul    ecx, ebx
  437.     add     ecx, cam_x
  438.     mov     eax, sinus_2[si]          ; calcul de b_y
  439.     imul    eax, ebx
  440.     add     eax, cam_y
  441.     sub     eax, a_y                ; eax = ydiff (by-ay)
  442.     sub     ecx, a_x                ; ecx = xdiff (bx-ax)
  443.     sar     eax, 6                  ; diviser par view_width
  444.     sar     ecx, 6                  ; (=256) si 1pt précision
  445.                     ; (=128) si 2pts précision
  446.     mov     ystep, eax
  447.     mov     xstep, ecx
  448.     add     i, 100 
  449. ;------------------------------------------        
  450.     mov     cx, 128                           ; cx = j
  451.     mov     esi, a_x
  452.     mov     edi, a_y
  453. ;------------------------------------------ N°2
  454. bcl2:   mov     bx, cx                          ; position x lockée ?
  455.     cmp     byte ptr flags[bx], 0
  456.     jnz     fbcl2
  457.     
  458.     mov     eax, esi
  459.     shr     eax, 9
  460.     sub     eax, 32
  461.     and     eax, 7Fh    ; 0000 0000 0000 0000 0000 0000 0111 1111y
  462.     
  463.     mov     ebx, edi   
  464.     shr     ebx, 2
  465.     and     ebx, 3F00h  ; 0000 0000 0000 0000 0011 1111 0000 0000y
  466.     add     ebx, eax                                   ;1 ?
  467.     
  468.     TROUVE_BITMAP
  469.     add     ebx, eax        
  470.     
  471.     mov     al, byte ptr fs:mapping[ebx]    ; couleur du sol
  472.     
  473.     TRAITE_MUR fbcl2        
  474.  
  475.     mov     es:[bp], al                     ; double pixel sol
  476.     mov     al, byte ptr gs:ceil[ebx]       ; couleur du plafond        
  477.     mov     bx, dx
  478.     mov     es:[bx], al                     ; double pixel plafond
  479. fbcl2:  add     esi, xstep
  480.     add     edi, ystep
  481.     dec     bp                              ; offset_pix_floor-=1
  482.     dec     dx                              ; offset_pix_ceil-=1
  483.     sub     cx, 2
  484.     jnz     bcl2
  485.  
  486. fbcl1:  add     dx, 144 
  487.     sub     bp, 16
  488.     sub     i, 100
  489.     mov     cx, i
  490.     dec     cx
  491.     cmp     cx, 15
  492.     jnz     bcl1
  493.  
  494. ; ----------------------------------------- Effacement de ce qui reste
  495.     
  496.     mov     si, 128
  497. eff:  
  498.     cmp     byte ptr flags[si], 0
  499.     jnz     @F
  500.     Efface_Mur
  501.  
  502. @@:     dec     bp
  503.     dec     dx
  504.     sub     si, 2
  505.     jnz     eff
  506.  
  507. ;------------------------------------------ mise à 0 des flags
  508.     mov     bx, 128
  509. bcl0_2: mov     byte ptr flags[bx], 0
  510.     dec     bx
  511.     jnz     bcl0_2
  512.  
  513. ;---------------------------------------------------------------------------
  514. ;                               PLANS 3-4
  515. ;---------------------------------------------------------------------------
  516.  
  517. ;------------------------------------------ Boucles imbriquées
  518. OUT_16  SC_Index, 0C02h                 ; choix des plan 3-4
  519.  
  520.  
  521. mov     cx, 98 
  522. LSFS    _DATA, ax
  523. mov     bp, Dest ;fs:[_WorkAdr] ;current_page  ; une des deux pages actives !
  524. mov     dx, word ptr fs:[bp] ;current_page
  525. mov     bp, word ptr fs:[bp]
  526. LSFS    mapping, ax
  527. add     dx, 80-1                         ; idem ceil
  528. add     bp, 80*200-1                     ; position départ floor
  529. ;------------------------------------------ N°1
  530. bcl1_2:   mov     i, cx
  531.     mov     di, cx
  532.     shl     di, 2
  533.     mov     si, cam_angle_minus_k   ; si est bien positionné dans cos/sin
  534.     mov     ebx, view_distance[di]
  535.     mov     eax, cosinus_2[si]        ; calcul de a_x
  536.     imul    eax, ebx
  537.     add     eax, cam_x
  538.     mov     a_x, eax
  539.     mov     eax, sinus_2[si]          ; calcul de a_y
  540.     imul    eax, ebx
  541.     add     eax, cam_y
  542.     mov     a_y, eax
  543.     mov     si, cam_angle_plus_k    ; si est bien positionné dans cos/sin
  544.     mov     ecx, cosinus_2[si]        ; calcul de b_x
  545.     imul    ecx, ebx
  546.     add     ecx, cam_x
  547.     mov     eax, sinus_2[si]          ; calcul de b_y
  548.     imul    eax, ebx
  549.     add     eax, cam_y
  550.     sub     eax, a_y                ; eax = ydiff (by-ay)
  551.     sub     ecx, a_x                ; ecx = xdiff (bx-ax)
  552.     sar     eax, 7                  ; diviser par view_width
  553.     sar     ecx, 7                  ; (=256) si 1pt précision
  554.                     ; (=128) si 2pts précision
  555.     
  556.     mov     ystep, eax
  557.     mov     xstep, ecx
  558.     
  559.     add     i, 100 
  560. ;------------------------------------------        
  561.     mov     cx, 128                           ; cx = j
  562.     
  563.     mov     esi, a_x                ; départ dans la map 
  564.     mov     edi, a_y
  565.     sub     esi, xstep
  566.     sub     edi, ystep
  567.  
  568.     shl     xstep, 1                  
  569.     shl     ystep, 1
  570. ;------------------------------------------ N°2
  571. bcl2_2: mov     bx, cx                           ; position x lockée ?
  572.     
  573.     cmp     byte ptr flags[bx], 0
  574.     jnz     fbcl2_2
  575.     
  576.  
  577.     mov     eax, esi
  578.     shr     eax, 9
  579.     sub     eax, 32
  580.     and     eax, 7Fh    ; 0000 0000 0000 0000 0000 0000 0111 1111y
  581.     
  582.     mov     ebx, edi   
  583.     shr     ebx, 2
  584.     and     ebx, 3F00h  ; 0000 0000 0000 0000 0011 1111 0000 0000y
  585.     add     ebx, eax                                   ;1 ?
  586.     
  587.     TROUVE_BITMAP
  588.     add     ebx, eax        
  589.     mov     al, byte ptr fs:mapping[ebx]    ; couleur du sol
  590.  
  591.     TRAITE_MUR fbcl2_2
  592.  
  593.     mov     es:[bp], al                     ; double pixel sol
  594.     mov     al, byte ptr gs:ceil[ebx]       ; couleur du plafond        
  595.     mov     bx, dx
  596.     mov     es:[bx], al                     ; double pixel plafond
  597. fbcl2_2:  
  598.     add     esi, xstep
  599.     add     edi, ystep
  600.     dec     bp                              ; offset_pix_floor-=1
  601.     dec     dx                              ; offset_pix_ceil-=1
  602.     sub     cx, 2
  603.     jnz     bcl2_2
  604.  
  605. fbcl1_2:add     dx, 144 
  606.     sub     bp, 16
  607.     sub     i, 100
  608.     mov     cx, i
  609.     dec     cx
  610.     cmp     cx, 15
  611.     jnz     bcl1_2
  612.  
  613. ; ----------------------------------------- Effacement de ce qui reste
  614.     
  615.     mov     si, 128
  616. eff2:  
  617.     cmp     byte ptr flags[si], 0
  618.     jnz     @F
  619.     Efface_Mur
  620.  
  621. @@:     dec     bp
  622.     dec     dx
  623.     sub     si, 2
  624.     jnz     eff2
  625.  
  626.     pop     bp
  627.     ret
  628.  
  629. FLOORS_MEDIUM_DETAIL ENDP
  630.