home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / DISKMAGS / IMPHOB_9.ZIP / IMP9_EX!.ZIP / UNR_TWST.ZIP / TWIST.ASM < prev   
Encoding:
Assembly Source File  |  1994-12-31  |  2.3 KB  |  156 lines

  1.  
  2.  
  3.  
  4. ;    ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒TWIST STUFF▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  5.  
  6. ; By Unreal / Surprise! Prods
  7. ; Example gfx by Tees / Surprise! Prods
  8. ; Published with Imphobia Diskmagazine
  9. ; Use it anyway You like
  10.  
  11. doublesize equ 0  ; thing indicating whether to double pixels in X or not
  12.           ; changed only before assemblation
  13. .MODEL LARGE
  14. .STACK
  15.  
  16. CODE SEGMENT PUBLIC USE16 PARA 'CODE'
  17. MODEL LARGE
  18.  
  19. ASSUME cs:CODE
  20. JUMPS
  21. .386C
  22.  
  23. include inc.inc
  24. include iff
  25. memory     dw     0
  26. xpoz    dw     0
  27. starts    dw    0
  28. ;══════════════════════════════════════════════════════════════════════════════
  29. Start:  SetMode 13h
  30.     setblock 64000/16
  31.     alloc    64000/16,memory
  32.     iff    code,pictie,memory
  33. SineLp:    mov    xpoz,0
  34.     call    drawsine
  35.     add    starts,4
  36.     cmp    starts,360
  37.     jle    SineOk
  38.     mov    starts,0
  39. SineOk:
  40.     call    ramk
  41.     waitesc    SineLp
  42.     call    wait4key
  43.     free    memory
  44.         SetMode 3
  45.         Quit    0
  46.  
  47. ;    ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  48. Drawsine:
  49.     mov    ax,0a000h
  50.     add    ax,320*30/16
  51.     mov    es,ax
  52.     mov    ax,memory
  53.  
  54.     mov    ds,ax
  55.     mov    cx,160
  56.     mov    dx,starts
  57.     mov    di,0
  58.     mov    si,0
  59.     mov    xpoz,si
  60. AtTune:    mov    bx,dx
  61.     mov    ax,word ptr cs:[sinie][bx]
  62.     mov    bx,ax
  63.     add    bx,512
  64.     shr    bx,3
  65.     inc    bx
  66.     add    bx,30
  67. ; tu jest wielkosc obecnej linii (vertical size)
  68.     call    Gummie
  69.     add    di,320
  70.     add    si,320
  71.     add    xpoz,320
  72.     add    dx,2
  73.     cmp    dx,360
  74.     jl    yetok
  75.     mov    dx,0
  76. yetok:    uloop    cx,attune
  77.     ret
  78. ;    ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  79.  
  80.  
  81. Gummie:    pusha
  82. ;bx=size
  83. ;di=screen offset
  84.     mov    ax,160
  85.     sub    ax,bx
  86.     push    ax
  87.     mov    ax,160
  88.     mov    dx,0
  89.     div    bx
  90.     mov    bp,ax
  91.     mov    ax,0
  92.     div    bx
  93.     mov    dx,ax
  94. ; bp:dx - add/adc
  95. ; bx is a counter
  96.     mov    cx,0
  97.     mov    ax,bp    ;- x
  98.     neg    ax
  99. Bear:    add    cx,dx
  100.     adc    ax,bp
  101.     mov    si,xpoz
  102.     add    si,ax
  103. if doublesize eq 0
  104.     movsb
  105. endif
  106.  
  107. if doublesize eq 1
  108.     push    ax
  109.     lodsb
  110.     stosb
  111.     stosb
  112.     pop    ax    
  113. endif
  114.     uloop    bx,bear
  115.     pop    bx
  116.     mov    ax,160
  117.     mov    dx,0
  118.     div    bx
  119.     mov    bp,ax
  120.     mov    ax,0
  121.     div    bx
  122.     mov    dx,ax
  123. ; bp:dx - add/adc
  124. ; bx is a counter
  125.     mov    cx,0
  126.     mov    ax,bp    ;- x
  127.     neg    ax
  128. Bear2:    add    cx,dx
  129.     adc    ax,bp
  130.     mov    si,xpoz
  131.     add    si,160
  132.     add    si,ax
  133. if doublesize eq 0
  134.     movsb
  135. endif
  136.  
  137. if doublesize eq 1
  138.     push    ax
  139.     lodsb
  140.     stosb
  141.     stosb
  142.     pop    ax    
  143. endif
  144.  
  145.     uloop    bx,bear2
  146.     popa
  147.     ret
  148.  
  149. pictie label
  150.     include surprise.inc
  151. sinie label
  152.     include sine.asm
  153. CODE ENDS
  154. End Start
  155.  
  156.