home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / TIMESRC.ZIP / L2.ASM < prev    next >
Assembly Source File  |  1994-02-23  |  4KB  |  168 lines

  1.         .386p
  2. code32  segment para public use32
  3.         assume cs:code32, ds:code32
  4.  
  5. include pmode.inc
  6. include vrt.inc
  7. include gnbg.inc
  8. include sc.inc
  9. include grfx.inc
  10. include v.inc
  11.  
  12. public  _l2start
  13.  
  14. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  15. ; DATA
  16. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  17. align 4
  18. posrout         dd      pos0
  19.  
  20. posrouttbl      dd      pos0,pos1,pos2
  21. POSROUTTBLLEN=($-posrouttbl)/4
  22.  
  23. routtbl         dd      p00,p20,p10,p30
  24. ROUTTBLLEN=($-routtbl)/4
  25.  
  26. p0y             dw      251
  27. p0yd            db      -1
  28. p0xi            db      0
  29.  
  30. align 2
  31. p1x             dw      0
  32. p1xd            db      2
  33. p1y             db      80
  34. p1yd            db      0
  35.  
  36. align 2
  37. p2x             dw      0
  38. p2xd            db      2
  39. p2i             db      0
  40.  
  41. routtblindex    db      0
  42. posroutindex    db      0
  43.  
  44. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  45. ; CODE
  46. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  47.  
  48. include l2p0.m
  49. include l2p1.m
  50. include l2p2.m
  51. include l2p3.m
  52.  
  53. ;─────────────────────────────────────────────────────────────────────────────
  54. pos0:
  55.         mov ebx,offset sincos0
  56.         mov bl,p0xi
  57.         add bl,3
  58.         mov p0xi,bl
  59.         movzx ebx,byte ptr [ebx]
  60.         shr ebx,1
  61.         add ebx,127
  62.         movzx edx,p0y
  63.         movsx eax,p0yd
  64.         add edx,eax
  65.         mov p0y,dx
  66.         jz short pos0f0
  67.         cmp edx,251
  68.         clc
  69.         jne _ret
  70. pos0f0:
  71.         neg al
  72.         mov p0yd,al
  73.         jmp posd
  74. ;-----------------------------------------------------------------------------
  75. pos1:
  76.         movzx edx,p1y
  77.         movsx eax,p1yd
  78.         add edx,eax
  79.         inc eax
  80.         cmp dl,200
  81.         jb short pos1f1
  82.         dec eax
  83.         neg eax
  84. pos1f1:
  85.         mov p1y,dl
  86.         mov p1yd,al
  87.         movzx ebx,p1x
  88.         movsx eax,p1xd
  89.         add ebx,eax
  90.         mov p1x,bx
  91.         jz short pos1f0
  92.         cmp ebx,384
  93.         clc
  94.         jne _ret
  95. pos1f0:
  96.         neg al
  97.         mov p1xd,al
  98.         jmp short posd
  99. ;-----------------------------------------------------------------------------
  100. pos2:
  101.         movzx ebx,p2x
  102.         movsx eax,p2xd
  103.         add ebx,eax
  104.         mov p2x,bx
  105.         jz short pos2f0
  106.         cmp ebx,384+64
  107.         jae short pos2f0
  108.         mov ecx,offset sincos0
  109.         mov cl,p2i
  110.         add cl,7
  111.         mov p2i,cl
  112.         movzx eax,byte ptr [ecx]
  113.         shr eax,2
  114.         add ebx,eax
  115.         sub ebx,64
  116.         cmp ebx,384
  117.         jbe short pos2f1
  118.         xor ebx,ebx
  119. pos2f1:
  120.         add cl,40h
  121.         mov al,[ecx]
  122.         shr eax,2
  123.         lea edx,[eax+93]
  124.         clc
  125.         ret
  126. pos2f0:
  127.         neg al
  128.         mov p2xd,al
  129.         jmp short posd
  130. ;-----------------------------------------------------------------------------
  131. posd:
  132.         movzx eax,posroutindex
  133.         inc eax
  134.         cmp al,POSROUTTBLLEN
  135.         jb short posdf0
  136.         xor al,al
  137. posdf0:
  138.         mov posroutindex,al
  139.         mov eax,posrouttbl[eax*4]
  140.         mov posrout,eax
  141.         stc
  142.         ret
  143.  
  144. ;─────────────────────────────────────────────────────────────────────────────
  145. setnext:
  146.         movzx eax,routtblindex
  147.         inc eax
  148.         cmp al,ROUTTBLLEN
  149.         jb short setnextf0
  150.         xor eax,eax
  151. setnextf0:
  152.         mov ebx,routtbl[eax*4]
  153.         mov _l2rout,ebx
  154.         mov routtblindex,al
  155. ;       xor _l2order,1
  156.         ret
  157.  
  158. ;═════════════════════════════════════════════════════════════════════════════
  159. _l2start:
  160.         cmp _l2on,0
  161.         je _ret
  162.         mov _l2rout,offset p00
  163.         ret
  164.  
  165. code32  ends
  166.         end
  167.  
  168.