;------------------------------------------------------------------------- ;XXXXXXXXXXXXXX||:::===---- KDE ----====::::|||||XXXXXXXXXXXXXXXXXX ;XXXXXXXXXXXXXX|:=- by Wessko's Melodyes -=:|XXXXXXXXXXXXXXXXXXXXXXXXX ;------------------------------------------------------------------------- ;/* SORRY, LINUX FANS! IT WOULD BE GREAT-A DESKTOP ENVIRONMENT IN 256 BYTEs ;BUT IT'S STILL IMPOSSIBLE */ ; ; Credits: ;WESSKO'S MELODYES: ; DUKE NUKEM - CODE,GFX,GRX,3DENGINEERING.... ; ; JUST IN TWO SENTENCES: ;i just saw an awfully slow intro, concerning about the same effect, written ;by Ufix of DSK!...i just wanna unblame myself - i really did not copied ;*ANYTHING*. Also my one is better because of the following: ;1: mine is 7-8 times faster (uses SQRT precalculated table, as the Ufix's ; does not - relies on the slow FPU) ;2: runs until keypress (ufix's runs until keypress *OR* generated 600 frames) ; The problem is that the most beautiful color effects are exactly after ; 700-800 frames-so i recommend you to wait mine until you see the nice ; thing:) ; ; Hope i convinced you i'm not a pirate (at least i don't steal in silence ; and also steal for good purposes only:) (i have a version of Ufix's intro ; *WITH* SQRT table and i can give it if ya want to see the differences:) ; (if ya notice them :))) ; ; here's the source;i put some comments:) IDEAL MODEL TINY P386n ;system requirements:386DX P387 ;with FPU DATASEG x1 DW -300 ;xcoord of "flare" no.1 (it's not a flare if fact, ) x2 dw 620 ;xcoord of "flare" no.2 (but i can't name it) y1 dw -100 ;.... y2 dw 300 cbx dw ? res db ? SQRTabl db 65000 DUP (?) ;the praised sqrt table (increases da speed 7 times) CODESEG org 100h Start: ;now we'll perform a cycle to initialise mov cx,65000 ;the table mov di,offset SQRTabl xor bx,bx @initloop: mov [cbx],bx fild [cbx] fsqrt ;this is 65000 fsqrts (!!) ; mov [cbx],10 ;(but without them they'll be about ; fild [cbx] ;12000000 (65000 per frame) ) ; fdiv ;the trick is that we calculate one fistp [cbx] ;full frame only once, and the other mov ax,[cbx] ;choice is to do it every frame stosb inc bx ;bx is the main variable here loop @initloop mov ax,13h ;set videomode 320x200x8bit int 10h ;use BIOS push 0a000h ;load the video segment pop es ;in es @mainloop: xor di, di xor bx,bx ;bx=linenumber @lineloop: xor ax,ax ;ax=colonumber @hhe: ; putpix push ax push bx ;save all registers sub ax,[x1] ;get in ax the vertical distance sub bx,[y1] push bx ;bx is needed later mov bx,ax ;ax=ax*ax imul bx mov si,ax ;si=axý pop ax ;ax=bx mov bx,ax ;bx=bx imul bx ;ax=bxý add si,ax ;si=axý+bxý (pithagor theorem) shr si,6 ;si=(axý+bxý)/64 (Duke nukem's Theorem :)) add si,offset sqrtabl ;for example si=6; we'll get in ax sqrt(6) ;xor ax,ax ;[ds:si+offset sqrtabl] is sqrt (si) lodsb ; load the value mov [res],al ;save it pop bx ; now the absolute same procedure for the pop ax ; other "flare"... push ax push bx sub ax,[x2] sub bx,[y2] push bx mov bx,ax imul bx mov si,ax pop ax mov bx,ax imul bx add si,ax shr si,6 add si,offset sqrtabl ; xor ax,ax lodsb ;ax=sqrt((vdistý+hdistý)/64) ; mov al, [ds:si] ; pop bx ; pop ax ; sub ax,[x3] ; sub bx,[y3] ; call absregs ; push bx ; mov bx,ax ; imul bx ; mov si,ax ; pop ax ; mov bx,ax ; imul bx ; add si,ax ;add si,offset sqrtabl ; xor ax,ax ; lodsb add al,[res] ;ax=ax+the_saved_value (from flare no 1) add al,32 ;min color=32 (colors >32 are much prettier stosb ;at last-store the calculated thing in VRAM pop bx ;pop all registers pop ax ;endp putpix inc ax ;next pixel cmp ax,320 ;have we reached the end if the line? jb @hhe ;no? -next pixel inc bx ;yes? -next line cmp bl ,200 ;have we reached the last line? jb @lineloop ;no? -next line inc [x1] ;flare no1 moves right... dec [x2] ;flare no2 moves left--- dec [y2] ;...and up inc [y1] ;---and down ; dec [y3] mov ah,0bh ;0bh dos function - check keyboard int 21h ;call DOS/WinDOS/whatever or al,al ;is key pressed? je @mainloop ;no? then next frame mov ah,7 ;yes? -select DOS function: read key int 21h ;read it mov ax,3 ;back to textmode 80x25x4bitcol... int 10h mov ax,4c00h ;and terminate program int 21h virus db 0,0,"(r)ViruS",0,0 END Start ;end/entry point