home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / LESS_SRC.ZIP / 4K.ASM < prev    next >
Assembly Source File  |  1994-09-09  |  2KB  |  105 lines

  1.  
  2. .model tiny,Pascal
  3. .386
  4. dosseg
  5. locals
  6. bezier_only = 1
  7.  
  8. screen_seg segment para public use16
  9. screen_seg ends
  10.  
  11. .code
  12. extrn scanconvert2:proc
  13.  
  14. public bezier
  15.  
  16. oldsp dw 0
  17. oldss dw 0
  18. allocaddr dw 0
  19. currentx dw 0
  20. currenty dw 0
  21. depth dw 0
  22. bezier_t proc x1:WORD,y1:WORD,x2:WORD,y2:WORD,x3:WORD,y3:WORD,x4:WORD,y4:WORD,color:WORD
  23.     local r1x:WORD,r1y:WORD,r2x:WORD,r2y:WORD,r3x:WORD,r3y:WORD,q1x:WORD,q1y:WORD,q2x:WORD,q2y:WORD,s1x:WORD,s1y:WORD
  24.     mov ax,x2
  25.     mov bx,ax
  26.     add ax,x1
  27.     shr ax,1
  28.     mov r1x,ax
  29.     mov cx,x3
  30.     add bx,cx
  31.     shr bx,1
  32.     add cx,x4
  33.     shr cx,1
  34.     mov r3x,cx
  35.     add cx,bx
  36.     add ax,bx
  37.     shr ax,1
  38.     shr cx,1
  39.     mov q1x,ax
  40.     mov q2x,cx
  41.     add ax,cx
  42.     shr ax,1
  43.     mov s1x,ax
  44.     mov ax,y2
  45.     mov bx,ax
  46.     add ax,y1
  47.     shr ax,1
  48.     mov r1y,ax
  49.     mov cx,y3
  50.     add bx,cx
  51.     shr bx,1
  52.     add cx,y4
  53.     shr cx,1
  54.     mov r3y,cx
  55.     add cx,bx
  56.     add ax,bx
  57.     shr ax,1
  58.     shr cx,1
  59.     mov q1y,ax
  60.     mov q2y,cx
  61.     add ax,cx
  62.     shr ax,1
  63.     mov s1y,ax
  64.     dec depth
  65.     cmp depth,0
  66.     jnz ei_lopetus
  67.     shr s1x,4
  68.     shr s1y,4
  69.     call scanconvert2,currentx,currenty,s1x,s1y,color
  70.     mov ax,s1x
  71.     mov currentx,ax
  72.     mov ax,s1y
  73.     mov currenty,ax
  74.     inc depth
  75.     ret
  76. ei_lopetus:
  77.     call bezier_t,x1,y1,r1x,r1y,q1x,q1y,s1x,s1y,color
  78.     call bezier_t,s1x,s1y,q2x,q2y,r3x,r3y,x4,y4,color
  79.     inc depth
  80.     ret
  81. endp
  82. bezier proc x1:WORD,y1:WORD,x2:WORD,y2:WORD,x3:WORD,y3:WORD,x4:WORD,y4:WORD,color:WORD
  83.     mov cl,4
  84.     mov depth,8
  85.     mov ax,x1
  86.     mov currentx,ax
  87.     mov ax,y1
  88.     mov currenty,ax
  89.     shr currentx,cl
  90.     shr currenty,cl
  91.     call bezier_t,x1,y1,x2,y2,x3,y3,x4,y4,color
  92.     shr x4,4
  93.     shr y4,4
  94.     call scanconvert2,currentx,currenty,x4,y4,color
  95.     ret
  96.  
  97. endp
  98.  
  99. do_it:
  100.  
  101. endp
  102.  
  103. end
  104.  
  105.