home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / TIMESRC.ZIP / MISC.M < prev    next >
Text File  |  1994-02-25  |  4KB  |  164 lines

  1.  
  2. extrn   voltbl:byte
  3.  
  4. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  5. ; DATA
  6. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  7. align 4
  8. tintred         dd      ?
  9. tintgreen       dd      ?
  10. tintblue        dd      ?
  11. tintlevel       dd      ?
  12.  
  13. tinttbl         label   byte
  14. temp=1
  15. rept 40h
  16.                 db      3 dup(temp)
  17.   temp=temp+1
  18. endm
  19.  
  20. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  21. ; CODE
  22. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  23.  
  24. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  25. ; Do misc stuff, loop and tint switches
  26. ; Out:
  27. ;   EAX,EBX,ECX,EDX,ESI,EDI,EBP - ?
  28. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  29. _misc_setup:
  30.         mov al,'e'
  31.         call _cchekswitchnc
  32.         setnc al
  33.         mov _skipend,al
  34.  
  35.         mov al,'g'
  36.         call _cchekswitchnc
  37.         jc short misc_setupf3
  38.         mov dword ptr voltbl[0],0a0908004h
  39.         mov dword ptr voltbl[4],0d0c8c0b8h
  40.         mov dword ptr voltbl[8],0e0dcd8d4h
  41.         mov dword ptr voltbl[12],0e8e6e4e2h
  42. misc_setupf3:
  43.  
  44.         mov al,'l'
  45.         call _cchekswitch
  46.         jnc short misc_setupf0
  47.         mov al,'L'
  48.         call _cchekswitch
  49.         jc short misc_setupf1
  50. misc_setupf0:
  51.         mov edx,_lomembase
  52.         call _ccheksstr
  53.         jc short misc_setupf1
  54.         call misc_setupr0
  55.         jc short misc_setupf1
  56.         mov _loop,eax
  57. misc_setupf1:
  58.  
  59.         mov al,'t'
  60.         call _cchekswitch
  61.         jnc short misc_setupf2
  62.         mov al,'T'
  63.         call _cchekswitch
  64.         jc _ret
  65. misc_setupf2:
  66.         mov edx,_lomembase
  67.         call _ccheksstr
  68.         jc _ret
  69.         call misc_setupr0
  70.         jc _ret
  71.         cmp eax,63
  72.         ja _ret
  73.         mov tintred,eax
  74.         call misc_setupr0
  75.         jc _ret
  76.         cmp eax,63
  77.         ja _ret
  78.         mov tintgreen,eax
  79.         call misc_setupr0
  80.         jc _ret
  81.         cmp eax,63
  82.         ja _ret
  83.         mov tintblue,eax
  84.         call misc_setupr0
  85.         jc _ret
  86.         cmp eax,63
  87.         ja _ret
  88.         inc eax
  89.         mov esi,64
  90.         sub esi,eax
  91.         mov tintlevel,eax
  92.  
  93.         mov edi,offset pal00
  94.         mov eax,offset pal0a+64*3*6
  95.         sub eax,edi
  96.         xor edx,edx
  97.         mov ebx,3
  98.         div ebx
  99.         mov ebp,eax
  100. misc_setupl0:
  101.         movzx eax,byte ptr [edi]
  102.         add al,[edi+1]
  103.         add al,[edi+2]
  104.         mov al,tinttbl[eax]
  105.         imul eax,tintlevel
  106.         shr eax,6
  107.         mov ebx,eax
  108.         mov ecx,eax
  109.         mov edx,eax
  110.         imul ebx,tintred
  111.         imul ecx,tintgreen
  112.         imul edx,tintblue
  113.  
  114.         movzx eax,byte ptr [edi]
  115.         imul eax,esi
  116.         add eax,ebx
  117.         shr eax,6
  118.         stosb
  119.         movzx eax,byte ptr [edi]
  120.         imul eax,esi
  121.         add eax,ecx
  122.         shr eax,6
  123.         stosb
  124.         movzx eax,byte ptr [edi]
  125.         imul eax,esi
  126.         add eax,edx
  127.         shr eax,6
  128.         stosb
  129.         dec ebp
  130.         jnz misc_setupl0
  131.  
  132.         ret
  133. ;-----------------------------------------------------------------------------
  134. misc_setupr0:
  135.         dec edx
  136.         xor ebx,ebx
  137.         xor eax,eax
  138. misc_setupr0l0:
  139.         inc edx
  140.         mov al,[edx]
  141.         cmp al,1
  142.         jc _ret
  143.         sub al,'0'
  144.         jc misc_setupr0l0
  145.         cmp al,9
  146.         ja misc_setupr0l0
  147. misc_setupr0l1:
  148.         inc edx
  149.         mov bl,[edx]
  150.         sub bl,'0'
  151.         jc short misc_setupr0l1d
  152.         cmp bl,9
  153.         ja short misc_setupr0l1d
  154.         cmp eax,429496729
  155.         cmc
  156.         jc _ret
  157.         lea eax,[eax*4+eax]
  158.         lea eax,[eax*2+ebx]
  159.         jmp misc_setupr0l1
  160. misc_setupr0l1d:
  161.         clc
  162.         ret
  163.  
  164.