Subversion Repositories Kolibri OS

Rev

Rev 2490 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. ;  (Ü) ( ) Ü ) ( )   256b intro by baze/3SC for Syndeecate 2001
  3. ;  ßÛß ÛÜÛ ÛÛÛ ÛÛÜ   loveC: thanks, Serzh: eat my socks dude ;]
  4. ;  ( ) ( ) ( ) ( )   e-mail: baze@stonline.sk, web: www.3SC.sk
  5.  
  6. ;  Menuet port by VT
  7.  
  8. appname equ 'TUBE - FPU'
  9.  
  10. use32
  11.              org  0x0
  12.  
  13.              db   'MENUET01'
  14.              dd   0x01
  15.              dd   START
  16.              dd   I_END
  17.              dd   0x40000
  18.              dd   0x40000
  19.              dd   0,0
  20.  
  21. include '..\..\..\macros.inc'
  22.  
  23. START:
  24.  
  25.    call draw_window
  26.  
  27.    call init_tube
  28.  
  29.    push ebx
  30.  
  31. still:
  32.  
  33.    pop  ebx
  34.  
  35.    call MAIN
  36.  
  37.    push ebx
  38.  
  39.    mov  eax,23
  40.    mov  ebx,1
  41.    mcall
  42.  
  43.    cmp  eax,1
  44.    jne  no_red
  45.    call draw_window
  46.    jmp  still
  47.   no_red:
  48.  
  49.    cmp  eax,0
  50.    je   still
  51.  
  52.    or   eax,-1
  53.    mcall
  54.  
  55. SCREEN  equ 160
  56. PIXBUF  equ 200h
  57. EYE     equ EYE_P-2
  58.  
  59.  
  60. MAIN:
  61.  
  62.  add    bh,10;8
  63.  mov    edi,PIXBUF
  64.  fadd   dword [di-PIXBUF+TEXUV-4]
  65.  push   di
  66.  mov    dx,-80
  67.  
  68. TUBEY:
  69.  
  70.  mov    bp,-160
  71.  
  72. TUBEX:
  73.  
  74.  mov    si,TEXUV
  75.  fild   word [si-TEXUV+EYE]
  76.  mov    [si],bp
  77.  fild   word [si]
  78.  mov    [si],dx
  79.  fild   word [si]
  80.  mov    cl,2
  81.  
  82. ROTATE:
  83.  
  84.  fld    st3
  85.  fsincos
  86.  fld    st2
  87.  fmul   st0,st1
  88.  fld    st4
  89.  fmul   st0,st3
  90.  db     0xde,0xe9 ; fsubp   st1,st0
  91.  db     0xd9,0xcb ; fxch    st3
  92.  fmulp  st2,st0
  93.  fmulp  st3,st0
  94.  faddp  st2,st0
  95.  db     0xd9,0xca ; fxch    st2
  96.  
  97.  loop   ROTATE
  98.  
  99.  fld    st1
  100.  db     0xdc,0xc8 ; fmul    st0,st
  101.  fld    st1
  102.  db     0xdc,0xc8 ; fmul    st0,st
  103.  faddp  st1,st0
  104.  fsqrt
  105.  db     0xde,0xfb ; fdivp   st3,st0
  106.  fpatan
  107.  fimul  word [si-4]
  108.  fistp  word [si]
  109.  fimul  word [si-4]
  110.  fistp  word [si+1]
  111.  mov    si,[si]
  112.  
  113.  lea    ax,[bx+si]
  114.  add    al,ah
  115.  and    al,64
  116.  mov    al,-5
  117.  jz     STORE_1
  118.  
  119.  shl    si,2
  120.  lea    ax,[bx+si]
  121.  sub    al,ah
  122.  mov    al,-16
  123.  jns    STORE_1
  124.  
  125.  shl    si,1
  126.  mov    al,-48
  127.  
  128. STORE_1:
  129.  
  130. ; add    al,[ebx+esi+0x80000]
  131.  add    [di],al
  132.  inc    di
  133.  
  134.  inc    bp
  135.  cmp    bp,160
  136.  
  137. EYE_P:
  138.  
  139.  jnz    TUBEX
  140.  inc    dx
  141.  cmp    dx,80
  142.  jnz    TUBEY
  143.  
  144.  call   display_image
  145.  
  146.  pop    si
  147.  mov    ch,SCREEN*320/256
  148.  
  149. BLUR:
  150.  
  151.  inc    si
  152.  sar    byte [si],2
  153.  loop   BLUR
  154.  
  155.  ret
  156.  
  157.  
  158.  
  159. display_image:
  160.  
  161.   pusha
  162.  
  163.   mov esi,PIXBUF
  164.   mov edi,0x10000
  165.  newp:
  166.   movzx edx,byte [esi]
  167.   shl edx,4
  168. ;  mov dh,dl
  169.   mov [edi],edx
  170.  
  171.   add edi,3
  172.   inc esi
  173.  
  174.   cmp esi,320*160+PIXBUF
  175.   jbe newp
  176.  
  177.   mov eax,7
  178.   mov ecx,320*65536+160
  179.   xor edx,edx
  180.   mov ebx,0x10000
  181.   mcall
  182.  
  183.   popa
  184.   ret
  185.  
  186.  
  187.  
  188. draw_window:
  189.  
  190.      pusha
  191.  
  192.      mcall 12, 1
  193.          mcall 48, 4 ;get skin width
  194.          lea  ecx,[100*65536+164+eax]
  195.      xor  eax,eax
  196.      mov  ebx,100*65536+329
  197.      mov  edx,0x74000000
  198.      mov  edi,title
  199.      mcall
  200.      mcall 12, 2
  201.      popa
  202.      ret
  203.  
  204. title db appname,0
  205.  
  206. db 41,0,0xC3,0x3C
  207.  
  208. TEXUV:
  209.  
  210. init_tube:
  211.  
  212.   mov ecx,256
  213.  
  214. PAL1:
  215.  
  216.   mov dx,3C8h
  217.   mov ax,cx
  218.   inc dx
  219.   sar al,1
  220.   js PAL2
  221.   mul al
  222.   shr ax,6
  223.  
  224. PAL2:
  225.  
  226.   mov al,0
  227.   jns PAL3
  228.   sub al,cl
  229.   shr al,1
  230.   shr al,1
  231.  
  232. PAL3:
  233.  
  234.   mov bx,cx
  235.   mov [ebx+0x1000],bh
  236.   loop PAL1
  237.   mov  ecx,256
  238.  
  239. TEX:
  240.  
  241.   mov bx,cx
  242.   add ax,cx
  243.   rol ax,cl
  244.   mov dh,al
  245.   sar dh,5
  246.   adc dl,dh
  247.   adc dl,[ebx+255+0x1000]
  248.   shr dl,1
  249.   mov [ebx+0x1000],dl
  250.   not bh
  251.   mov [ebx+0x1000],dl
  252.   loop TEX
  253.  
  254.   fninit
  255.   fldz
  256.  
  257.   ret
  258.  
  259.  
  260. I_END:
  261.  
  262.  
  263.  
  264.  
  265.