Author Topic: [32b] vertical scrolling rainbow bars (for lack of a better name)  (Read 2535 times)

0 Members and 1 Guest are viewing this topic.

Offline donvito

  • n00bzor
  • ZX 81
  • *
  • Posts: 15
  • Karma: 1
  • programming <3
    • View Profile
hey all, this is what an hour of tinkering got me...

ps, actually its 30bytes :D



Code: [Select]
org 100h
init:
     les si,[bx]   ;0a000h
     mov al,13h    ;video mode 13h
     int 10h

main:
     mov dx,100
     mov cx,100
     mov al,0
l:
     stosd
     add di,100
     inc al
     loop l

exit:
     in al,60h    ;check keys
     dec al       ;put to 0
     jnz main     ;if not 0, rtn to main
     ret          ;goodbye blue sky

please modify if you'd like, but please comment the code, so i can learn!!!
« Last Edit: February 24, 2010 by donvito »

Offline Praecor

  • Atari ST
  • ***
  • Posts: 176
  • Karma: 13
    • View Profile
Nice man! + Thanks for showing the src.
Now try this shit in DX10 and its 5000 loc :)
Challenge Trophies Won:

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Code: [Select]
org 100h
init:
     les si,[bx]   ;0a000h
     mov al,13h    ;video mode 13h
     int 10h

main:
     mov dx,100 ; you can comment this out or see below as you can also use dx in the add di,100
     mov cx,100
     mov al,0
l:
     stosd
     add di,100 ; since dx is always = 100 might be a good idea to use add di, dx here instead of commenting out dx.
     inc al
     loop l

exit:
     ;in al,60h    ;check keys
     ;dec al       ;put to 0 try
     in ax,60h    ; will zero ah for you so that you can use dec ax (one byte smaller than dec al)
     dec ax       ; and now you have saved on byte by doing it this way
     jnz main     ;if not 0, rtn to main
     ret          ;goodbye blue sky
Always good to see someone getting into the tiny code, I added a few tips above on how to shave off some bytes. Keep it up bro.


Challenge Trophies Won:

Offline donvito

  • n00bzor
  • ZX 81
  • *
  • Posts: 15
  • Karma: 1
  • programming <3
    • View Profile
awesome!  thanks for the tips rain_storm!

i ended up fooling around with this last night, and managed to make a crazy crazy rainbow static type of effect, but i lost it!

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Thats always happening to me too. There is an astonishing ammount of effects that can be done in 32bytes. For me its the code itself that is the real art.

Challenge Trophies Won:

Offline Praecor

  • Atari ST
  • ***
  • Posts: 176
  • Karma: 13
    • View Profile
*speechless* how well rain_storm put it

The lowlevel C/Asm is the most closest form of art to me too, those modern languages I have started to observe them more or less as money-making machines (only my opinion so no fighting)
I don't want things to get developed to that point that no coders are required anymore around and all is automated to "so good" the bot just copies things from sublibs and makes an app.

I don't want to be that 100% effective or fast etc and make something complex with a 1 func call(that sb else wrote). I rather choose to have fun and do some more lines of coding of my own (+ learn) and feel comfortable (and proud of myself)

If i'm truly 100% honest to myself, i've had most of the fun during the years with C/Asm, instead of trying to be super effective + non-stop chase that cash or to get through the 8 hours at work producing as much Results as possible for the ppl who just wrap the major cash *ugh., ie. if I really wanted to be richy and money I wouldn't be a programmer at all, but the thing is, it's the something else I see beautiful in this (maybe it's those constant accomplishment feelings it gives + in what other job you can actually make anything happen you've in your head, i'm sure the coding is the only one).

When the child stops drawing, his life is gone! (Don't stop!1)
« Last Edit: February 25, 2010 by Praecor »
Challenge Trophies Won: