Author Topic: 256 byte intro  (Read 15608 times)

0 Members and 1 Guest are viewing this topic.

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
256 byte intro
« on: May 08, 2006 »
Code: [Select]
;**********************************************************
;
; FlOWER256(Updated with displacement and a nice palette)
; Morphing tunnel of the overused XOR texture. :*)
; Another 256 Byte demo by
; Relsoft (Richard Eric M. Lope BSN RN)
; http://rel.betterwebber.com
; Assemble with FASM (FlatAssembler.net)
; NOTE!!Do not run from inside the ZIP. Unzip the archive
; to see the full effect because it winzip somehow likes
; to mess with SI when you run the demo from the temporary
; file winzip loads. :*(
;**********************************************************

diameter        = 32
diamxscale      = (64 * diameter)
scx             = 160
scy             = 100


org 100h


;*****************************************************************
;*****************************************************************
;*****************************************************************

               push word 0a000h        ;word
               pop es                  ;byte

               mov   al, 13h           ; mode 13h
               int   10h               ; we are now in 320x200x256
               mov dx, 03c8h           ;palette write register
               xor ax, ax
               mov word[fold_off],ax
               out dx, al
               mov cx, 20
               inc dx
         genpal:
               out dx, al
               xchg al, ah
               out dx, al
               xor ax, cx
               xchg al, ah
               out dx, al
               inc al
               jnz genpal
               mov word[si], 0ffffh
main_loop:
        ;si = frame counter
        inc word [si]

        ;flower
        ;fold_off += 0.2
        fld [c_fold_scale]
        fadd dword[fold_off]
        fstp dword[fold_off]
        ;fold_scale = 0.5 * sin(frame / 40)
        fild word [si]               ;st0 = frame; st1 = 0.3
        mov ax, 90
        mov bx, bp
        mov word [bx], ax
        fidiv word [bx]

        fstp dword [bx]
        fld dword [bx]
        fsincos
        fmul [c_fold_scale]
        fstp dword[fold_scale]

        ;displacement
        mov word[bx], ax
        fimul word[bx]
        fistp word[cenx]
        add word[cenx], scx
        fld dword[fold_scale]
        fimul word[bx]
        fistp word[ceny]
        add word[ceny], scy

        ;===========tunnel
        mov dx,200
        xor di, di
      tunnel_yloop:
        mov cx,320
      tunnel_xloop:
        ;bx = word pointer
        ;bp = dword ptr
        ;
        ;
        ;atan2
        fninit                          ;call this to ditch the st pops
        mov bx, bp
        mov ax, [ceny]
        mov word [bx], ax
        sub [bx], dx
        fild word [bx]                  ;st0 = dy
        mov ax, [cenx]
        mov word [bx], ax
        sub [bx], cx
        fild word [bx]                  ;st0 = dx, st1 = dy

        fpatan                          ;st0 = atan(dy/dx) = atan(st1/st0)
        ;flower
        ;xdist = xdist * ((sin(fold_off + fold_num * angle) * fold_scale)+1)
        fstp dword [bx]
        fld dword [bx]                  ;restore
        fld dword [bx]
        fimul [fold_num]
        fadd dword[fold_off]
        fsin
        fmul dword[fold_scale]
        mov word [bx], 1
        fiadd word [bx]
        fstp dword [bp]                 ;real_var =((sin(fold_off + fold_num * angle) * fold_scale)+1)

        fmul [c_scale]                  ;atan(st0))*256/pi
        fistp word [bx]                 ;short_var = scaledpi
        mov gs,[bx]
        mov ax, [cenx]
        sub ax, cx                      ;cmx
        mov [bx], ax
        fild word [bx]                  ;st0 = cmx
        fmul st0, st0                   ;cmx * cmx
        mov ax, [ceny]
        sub ax, dx
        mov [bx], ax
        fild word [bx]                  ;st0 = cmy st1 = cmx*cmx
        fmul st0, st0                   ;cmy * cmy
        fadd st0, st1                   ;st0 cmx^2 + cmy^2
        fsqrt                           ;sqrt st0
        fmul dword [bp]
        mov word [bx], diamxscale       ;st0 = diamxscale st1 = sqrt(dist)
        fidivr word [bx]                ;st0 = diamxscale / dist
        fistp word [bx]
        mov ax, word [bx]
        add ax, word [si]
        mov bx, gs
        add bx, word [si]
        xor ax, bx
        stosb
        dec cx
        jnz tunnel_xloop
        dec dx
        jnz tunnel_yloop
        mov dx,3dah
  vsync:
        in al,dx
        and al,8
        jz vsync

        in al,60h
        dec al
        jnz main_loop

        ret

fold_num        dw  5
c_fold_scale    dd  0.35
c_scale         dd  40.74
fold_scale      dd  ?
fold_off        dd  ?
cenx            dw  ?
ceny            dw  ?
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: 256 byte intro
« Reply #1 on: May 08, 2006 »
Really cool dude  ;D

Thanks for share it with us !
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: 256 byte intro
« Reply #2 on: May 09, 2006 »
Thanks!  I found this forum to be cool and  the people who frequent here are very smart.  I think this is the only democoding forum I frequent to. :*)
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: 256 byte intro
« Reply #3 on: May 09, 2006 »
Neat  :) Cheers for the code and the kind comments!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Roly

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 7
    • View Profile
Re: 256 byte intro
« Reply #4 on: May 09, 2006 »
Cool 256 B effect. Looking good.

cya
Røly

Offline zparticle

  • Atari ST
  • ***
  • Posts: 168
  • Karma: 11
    • View Profile
    • ScottShaver2000
Re: 256 byte intro
« Reply #5 on: May 09, 2006 »
can someone post an exe of this, in general it woould be nice if all examples had an attached executable.

Offline Roly

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 7
    • View Profile
Re: 256 byte intro
« Reply #6 on: May 09, 2006 »
Yip, here it is.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: 256 byte intro
« Reply #7 on: May 09, 2006 »
Nice one Relsoft.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline zparticle

  • Atari ST
  • ***
  • Posts: 168
  • Karma: 11
    • View Profile
    • ScottShaver2000
Re: 256 byte intro
« Reply #8 on: May 09, 2006 »
very cool

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: 256 byte intro
« Reply #9 on: May 11, 2006 »
@Relsoft:Â  Â Did you have used Paul Bourke formula (super shape) to do that ?

If yes, very impressive and well done  ;D

I'm trying to code a tunnel using this nice formula  :D
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: 256 byte intro
« Reply #10 on: May 11, 2006 »
@Relsoft:Â  Â Did you have used Paul Bourke formula (super shape) to do that ?

If yes, very impressive and well done  ;D

I'm trying to code a tunnel using this nice formula  :D


Nope.  used the old skool distance tunnel with radial displacement for the flower effect. :*)  But I think his approach is like the one I used in the glass tunnel effect.  haven't read this article yet but I'm having goosebumps right now thinking about how I arrived at the glass effect w/o reading his tute.

Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: 256 byte intro
« Reply #11 on: May 11, 2006 »
Cool, nice one !  ;D
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: 256 byte intro
« Reply #12 on: May 11, 2006 »
BTW, I posted an example of radial dsplacement in the freebasic area. :*)

Challenge Trophies Won:

Offline Optimus

  • DBF Aficionado
  • ******
  • Posts: 2456
  • Karma: 128
    • View Profile
    • Optimouse Demo Site
Re: 256 byte intro
« Reply #13 on: May 18, 2006 »
Wow. Your older 256b, quite improved now (better pallete, moving around, faster). Perhaps it would be a nice entry for Pouet or a future 256b intro!
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: 256 byte intro
« Reply #14 on: May 19, 2006 »
Wow. Your older 256b, quite improved now (better pallete, moving around, faster). Perhaps it would be a nice entry for Pouet or a future 256b intro!

Thanks!!! How do you upload things at pouet?
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: 256 byte intro
« Reply #15 on: May 19, 2006 »
I didnt see anything of use on the FAQ.

See if this helps mate: http://www.pouet.net/account.php

Then you simply goto the submit tab. http://www.pouet.net/submit.php And all should be easyish.

Hope it helps,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Optimus

  • DBF Aficionado
  • ******
  • Posts: 2456
  • Karma: 128
    • View Profile
    • Optimouse Demo Site
Re: 256 byte intro
« Reply #16 on: May 19, 2006 »
Maybe I could add it for you.
But maybe you can make an account so that you check the other features too!
Then you can write comments about demos and thumb up/piggie/down what you like/dislike.

And submit anything demorelated if you wish (normally it's ok for 256b intros, but for bigger stuff I usually upload stuff that looks like a demo with several parts. I've done it with few basic demos. It's not that right to upload a single effect sometimes (except from 256b intros and stuff released at demoparties) but there are no strict rules.)

There is a submit button up.
Warning: Not all of the places should be filled.
For example, your 256b intro is not released unter a group name, so you don't need to fill the group ID. Though, some people put their nick as a group name, it's ok for some.
What you need to fill here is the release date, type, platform, infofile if you wish (you can put the source code as it), and screenshot (make one with Print Screen, scale it down to 400*300 or 320*240 or as you wish. But less that 400*300)

There are other stuff like CSDb, Zxspectrum ID and others, referring to other sites. Those you don't need to fill now.

Mmm,. maybe I can add it to you. But I put this intructions so that you come and use the features and put some comments if you wish.

p.s. I've added Quickbasic demos in the past, like
http://www.pouet.net/prod.php?which=10927
http://www.pouet.net/prod.php?which=4638
and others I don't remember right now.
Yep, I've added your mono and disco too, a long time ago. Don't know if I should have asked, but Pouet works like a huge database of everything demoscene related and people just add stuff, new, old, everything to make the database more complete.

If you are bored to make an account or add your 256b, tell me and I'll add. I just want to let you come to Pouet :)

p.p.s. I am KARMAK right now. But I do sign up as Optimus there. Now, this i just an inside joke for an old group with people having nicks starting of K and 6 letters. And that sign! You will recognize me as KARMAK now in this site, I'll put my classic nick back later ;)
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: 256 byte intro
« Reply #17 on: May 19, 2006 »
Karmak: Not knowing what to do there on my own, could you add that 256b flower tunnel at pouet? Hehehehehehe

Thanks for uploading Mono and disco!
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: 256 byte intro
« Reply #18 on: May 19, 2006 »
I tried those links, but their broke. And they look fantastic to say the least.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17426
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: 256 byte intro
« Reply #19 on: May 19, 2006 »
NEXT EMPIRE DOMINATION!!
Shockwave ^ Codigos
Challenge Trophies Won: