home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / demodisc / basq / source / look / lookme.asm < prev    next >
Encoding:
Assembly Source File  |  1994-05-13  |  3.8 KB  |  123 lines

  1.         .286
  2.         .Model small
  3.         .data
  4. db 13, 10
  5. db "*-----------------------------------------------------------------*", 13, 10
  6. db "|Tittle: Interference Plasma                                      |", 13, 10
  7. db "|Author: Heikki Vesalainen / Appellssiini                         |", 13, 10
  8. db "|Release date: 15th may 1994                                      |", 13, 10
  9. db "|                                                                 |", 13, 10
  10. db "|  This is greet-ware! You must send me greetings and credit me   |", 13, 10
  11. db "| if you use this effect (or a similar one) in your production(s).|", 13, 10
  12. db "*-----------------------------------------------------------------*", 13, 10
  13. db 13, 10
  14.  
  15. sarkas  dw      ?                       ;Sarkas is a counter.
  16. x       dw      ?                       ;This also
  17. y       dw      ?                       ;And this.
  18. plac    equ     178
  19. adder   equ     30
  20. adder2  equ     0
  21.  
  22. include setpal.inc                      ;Setpal macro
  23. include pal.asm                         ;a palette
  24. include hsini.dat                       ;A large sin table
  25.  
  26. .code
  27. start:
  28.       mov       ax, 0013h               ;Video mode 13h
  29.       int       10h
  30.  
  31.       setpal    256*3, palette          ;set the palette of 3*256 values
  32.  
  33.       mov       sarkas, plac            ;The starting plase, try changing
  34.  
  35.       mov       ax, @data               ;Set ds to data
  36.       mov       ds, ax
  37.  
  38.       mov       ax, 0a000h              ;Set es to video
  39.       mov       es, ax
  40.  
  41. framejump:
  42.  
  43.       xor       di, di                  ;first pixel
  44.  
  45.       mov       si, 200                 ;n:o rows
  46.  
  47.       inc       sarkas                  ;Next sarkas value
  48.       mov       bx, sarkas
  49.  
  50.       mov       dl, sin[bx]             ;This changes ones in a frame
  51.  
  52.       cmp       sarkas, 359             ;Check for the boundary of sarkas
  53.       jna       rowjump                 ;if sarkas > 359, then
  54.       mov       sarkas, 0               ;sarkas = 0
  55.  
  56. rowjump:
  57.       mov       cx, 320                 ;pixels / row
  58.  
  59.       mov       bx, sarkas
  60.       mov       ah, sin[si+adder2]      ;These change ones every row
  61.       mov       dh, sin[bx+si+adder2]
  62.       
  63.         pixeljump:
  64.  
  65.         mov       bx, cx
  66.         mov       al, sin[bx+adder]       ;These change for every pixel
  67.         add       bx, sarkas
  68.         add       al, sin[bx+adder]
  69.  
  70.         add       al, ah
  71.         xor       al, dh                  ;This is it! XOR or OR
  72.         sub       al, dl
  73.  
  74.         mov       byte ptr es:[di], al
  75.  
  76.         inc       di                      ;next pixel
  77.  
  78.         dec       cx
  79.         jnz       pixeljump
  80.  
  81.       in        al, 60h                 ;esc?
  82.       cmp       al, 1
  83.       jz        dos
  84.  
  85.       dec       si                      ;next row
  86.       jnz       rowjump
  87.  
  88.       jmp       framejump
  89.  
  90. dos:
  91.       mov       ax, 0003h               ;Normal Video
  92.       int       10h
  93.  
  94.       push      cs
  95.       pop       ds
  96.       mov       dx, offset c
  97.       mov       ah, 9
  98.       int       21h
  99.  
  100.       xor       al, al                  ;Flush the Keyboard buffer
  101.       mov       ah, 0Ch
  102.       int       21h
  103.  
  104.       
  105.       mov       ax, 4c00h               ;And out!
  106.       int       21h
  107.  
  108. c       db      13, 10
  109.         db      "                                       ", 13, 10
  110.         db      "An Appellssiini Production             ", 13, 10
  111.         db      "                                       ", 13, 10
  112.         db      "Code and effect by Heikki Vesalainen   ", 13, 10
  113.         db      "                                       ", 13, 10
  114.         db      "Greetings go to Orange dudes           ", 13, 10
  115.         db      "and to everyone else out there!        ", 13, 10
  116.         db      "                                       ", 13, 10, "$"
  117.  
  118.                  
  119. .stack
  120.  
  121.       END       start
  122.         
  123.