home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
- ; ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ GEL PICTURE ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- ; Code: Unreal,
- ; Gfx: Tees.
- ; PUBLISHED WITH IMPHOBIA. Use this source anyway You like.
-
-
-
- .MODEL LARGE
- .STACK
- CODE SEGMENT PUBLIC USE16 PARA 'CODE'
- MODEL LARGE
-
- ASSUME cs:CODE
- JUMPS
- .386C
-
- sinelen equ 360*2-1 ; these two little craps are here in order
- sinelen2 equ 360*2-1 ; to have free hand in changing sinetable
- ; so that they can be two different
-
- pict dw 0 ; alloc places seg addy here
- pict2 dw 0 ; alloc places seg addy here
- Value_S dw 0 ; actual pos in sinetable 1
- Value_S2 dw 180 ; actual pos in sinetable 2
- Cnter dw 0 ; counter value
-
- ; ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░includes░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- INCLUDE INC.INC
- include iff
- include sin3
-
- ; ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░macros░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- ; ax = movement value
- DrawY MACRO
- xchg ah,al ; ax*256
- add di,ax ; add to di
- shr ax,2 ; ax/4 (ax*256 + ax*64 = ax*320 )
- add di,ax
-
- BEP = 0 ; counters
- BIP = 10
-
- rept 95 ; this states how high is pic
- mov al,byte ptr ds:[si][BEP] ; pixel from 1st buff...
- mov byte ptr es:[di][biP],al ; ...into another one...
- BEP=BEP+320
- BIP=BIP+320
- endm
- ENDM
-
- ;══════════════════════════════════════════════════════════════════════════════
-
- SineY MACRO
- LOCAL GELIZE, BOTTOM
- mov ax,pict ; from this place
- mov ds,ax
- mov si,0
- mov ax,pict2 ; into this one
- mov es,ax
- mov di,0
- mov dx,di
- mov bx,Value_S ; here starts value from sinetable
- mov cx,170 ; that's the X size of pic
- Gelize: add bx,2 ; next sine value (2 bcoz word)
- cmp bx,sinelen ; end of sinetable?
- jle Bottom ; if nope, then Bottom
- mov bx,0 ; reset counter
- Bottom: mov ax,word ptr fs:[bx][sinus] ; take the sine value
- add ax,512 ; kill minus sign
- shr ax,5 ; and divide by 32
- DrawY ; call the macro moving line in Y
- inc dx ; next x position
- mov di,dx ; update destroyed registers
- mov si,dx
- dec cx
- jnz Gelize
- ENDM
- ;══════════════════════════════════════════════════════════════════════════════
- ; This one is lousy 200 bytes moving stuff... nothin' to say...
- DrawX MACRO
- push cx
- add di,ax
- mov cx,50
- rep movsd
- pop cx
- ENDM
- ;══════════════════════════════════════════════════════════════════════════════
- SineX MACRO
- PUSHA
- mov ax,pict2 ; That's the buffer where are the
- mov ds,ax ; effects of Siney's works
- mov si,0
- mov ax,0a000h ; Screen
- mov es,ax
- mov di,0
-
- mov cx,120 ; how many lines
- mov dx,di ; this thing keeps good si and di
- mov bx,Value_S2 ; sine start value
- sGelize:add bx,2 ; usual sine stuff
- cmp bx,sinelen
- jle sBottom
- mov bx,0
- sBottom:mov ax,word ptr fs:[bx][sinus]
- add ax,512
- shr ax,3 ; div by 8
- DrawX ; sine by x
-
- add dx,320 ; next Y line
- mov di,dx
- mov si,dx
-
- dec cx
- jnz sGelize
- POPA
- ENDM
-
-
- ; ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░START!░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
-
- Start: mov ax,13h
- int 10h ; set mode
- SetBlock 64000/16 ; set progsize
-
- Alloc 64000/16,pict ; alloc some mem for buffers
- Alloc 64000/16,pict2
- Filldd pict,0,16000,0 ; fill buffers with 0's
- Filldd pict2,0,16000,0
-
- mov dx,3d4h
- mov al,9
- out dx,al
- inc dx
- mov ax,2
- out dx,al ; stretch the view
-
- IFF code,teesgel,pict ; depack picture to pict
- mov ax,seg CODE ; set fs to CODE, it's just an ex,
- mov fs,ax ; I could aswell use CS.
- HERE: SINEY ; wobble Y
- SineX ; wobble X
- call RAMK
-
- add Value_S,2 ; test sine pointers
- cmp Value_S,sinelen
- jb Value_Sok
- mov Value_S,0
- Value_Sok:
- add Value_S2,2
- cmp Value_S2,sinelen2
- jb Value_Sok2
- mov Value_S2,0
- Value_Sok2:
- in al,60h ; esc Pressed
- cmp al,1
- jne Here
-
- free pict ; free memory allocated b'fore
- free pict2
- mov ax,3
- int 10h
- mov ax,4c00h
- int 21h
-
-
- teesgel label ; here's great Tees picture.
- include pic.inc
- CODE ENDS
- End Start
-