need help for my next 256 intro
category: general [glöplog]
-is this possible to use directly some variable instead of [si-0xsomething] when using fpu load/store??
I just wanna draw a point for each pixel ont the screen where color = distance from center
x=x-160
y=y-100
color = sqrt(x*x+y*y);
whats the best , simpliest way to do this
Also how to avoid screen flickering?? use two screen buffer? Waiting VBlank doest seems to help so much.... (see AcidCandy effect) (i will post the source has soon as I will get it back)
What i have done:
Code:
mov al,0x13
int 0x10
push word 0xa000
pop es
mov cx,255
pal:
  mov dx,0x3c8
  mov al,cl
  out dx,al
  inc dx
  out dx,al
  xor al,al
  out dx,al
  out dx,al
loop pal
nextframe:
  mov si,sp
  mov di,0
  mov cx,200
  liney: 
    mov dx,cx
    push cx
    mov cx,320
    linex:
        push cx    
        push 160
        push dx
        push 100 
        push ax 
        
        fild word[si-0x2] 
        fild word[si-0x4] 
        fsub st0
        fmul st0
       
        fild word[si-0x6]
        fild word[si-0x8]
        fsub st0
        fmul st0
        
        faddp st1  
        fistp word [si-0xA]
        
         
        pop ax
        pop bx
        pop bx
        pop bx
        pop bx
        
        
  
        
        mov [es:di],al
        inc di
    loop linex
    pop cx
  loop liney
  in al,0x60 
  dec al
jnz nextframe
int 20h
Next 256B in progress, cool!
About FPU: you can use dword variables, example declaration: var_name dd 0.0 But remember that each occupies 4 bytes, and commands FPU-mem are big (usually 4 bytes each), so you should avoid often using them.
About algorithm: use your brain.
About screen flickering: standard method used in 256B intros is to generate frame in pixel buffer (can be used program segment, after code), and copy it to video mem by using string command (movsx) repeated. Waiting for retrace is also a good habit.
I encourage you to study sources of some intros, for example Amoeba has very simple code. I see many things can be optimized in yours.
  
About FPU: you can use dword variables, example declaration: var_name dd 0.0 But remember that each occupies 4 bytes, and commands FPU-mem are big (usually 4 bytes each), so you should avoid often using them.
About algorithm: use your brain.
About screen flickering: standard method used in 256B intros is to generate frame in pixel buffer (can be used program segment, after code), and copy it to video mem by using string command (movsx) repeated. Waiting for retrace is also a good habit.
I encourage you to study sources of some intros, for example Amoeba has very simple code. I see many things can be optimized in yours.
And you should know pouet BBS is a right place to talk about your socks and catarrh, for code issues try to find better forums, check DBF-GVY Demo Code Forum.
  
Many thx man!
the intro is finish right now, but sill neeed to optimize it (65 bytes to much)
  
the intro is finish right now, but sill neeed to optimize it (65 bytes to much)
Maybe I can help you with optimizing, just contact me via e-mail (displayed on my site), I can't see your address anywhere.
  
