Author Topic: Routines  (Read 318105 times)

0 Members and 2 Guests are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Routines
« Reply #255 on: April 06, 2010, 11:46:24 pm »
Very nice, Builderboy. Looks cool.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Routines
« Reply #256 on: April 07, 2010, 01:57:52 am »
yes, sure. Altough I don't get excactly what you mean, how u did it. But I'll discover that...
« Last Edit: April 07, 2010, 02:19:30 am by LordConiupiter »
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Routines
« Reply #257 on: April 07, 2010, 10:15:38 am »
Heh, yeah the pixel drawing routine is kinda convoluted because of the 8 pixels per byte thing, and the need to do bitmasking and stuff.  I'll get the code commented later today.

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Routines
« Reply #258 on: April 07, 2010, 04:08:00 pm »
BTW: instead of Typing
Code: [Select]
0->X
0->K
etc...
you can just type
Code: [Select]
0->X->K->etc...
« Last Edit: April 07, 2010, 04:08:48 pm by LordConiupiter »
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Routines
« Reply #259 on: April 07, 2010, 08:17:24 pm »
Yep, thats true, i didn't do any optimizing at all in this routine :P I'm really no good at it yet.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #260 on: April 07, 2010, 08:19:16 pm »
(I suggest providing both optimized and non optimized version when providing routines, btw, for now. It might actually help people even more about learning the syntax and stuff, to see more examples)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #261 on: April 28, 2010, 11:45:10 pm »
.NOM
StoreGDB
StorePic
ClrDraw
<draw shit in here>             <-example: Line(0,34,95,34)
Repeat Getkey(15)
DispGraphr
End

The screen content right before running this prog will be copied to the back buffer then displayed in grayscale as background behind some other stuff you can draw right before the repeat loop. It will exit when you press CLEAR.

Just some graphical fanciness :P

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Routines
« Reply #262 on: April 28, 2010, 11:58:58 pm »
Why does it make the Asm(prgmNOM and the run indicator go into grey scale but no the line?

Cool piece of code by the way :)
« Last Edit: April 28, 2010, 11:59:16 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

_player1537

  • Guest
Re: Routines
« Reply #263 on: April 29, 2010, 12:12:06 am »
hmm, if I had to guess, it is because when you draw stuff it isn't actually sent to the screen.  IE it didn't have a normal DispGraph after you drew it.  that's just my guess though.

Edit:
hmm...I was able to get it to do text and the line and greyscale, but not at the same time...

anyways here was my code for the text:
ClrDraw
<output text here>
StoreGDB
StorePic
ClrDraw
repeat getkey(15)
DispGraph(r)
End

and one for the line:
ClrDraw
StoreGDB
<lines and whatnot here>
StorePic
ClrDraw
repeat getkey(15)
DispGraph(r)
End

« Last Edit: April 29, 2010, 12:26:47 am by _player1537 »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Routines
« Reply #264 on: April 29, 2010, 12:24:00 am »
OH! Nevermind. I see why. It's because the line isn't already there when you store to the buffer and back-buffer. It's getting displayed after. (Had to look up a couple commands :P)

P.S. The smiley face that is used for examples in the Axe Parser Documentation looks funny when used with the grey scale command :P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #265 on: April 29, 2010, 12:53:23 am »
Why does it make the Asm(prgmNOM and the run indicator go into grey scale but no the line?

Cool piece of code by the way :)
everything that was in the screen right before running the prog turns into grayscale. What's drawn after the screen content is stored to back buffer remains black, though.

the grayscale command can be useful, for example, in a RPG where you see the map, and when entering the menu, the map becomes lighter and you see a monochrome menu on top of it.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #266 on: May 24, 2010, 02:14:59 am »
The following is pretty simple, but can be extremly useful for RPG magic animations or weather effects. It's a sandstorm effect program with grayscale. There are two versions, one that displays the sand in gray and the screen content in black in front and the other that displays the sand in black and the screen content behind in gray (altough hard to see in certain cases). Here's a screenshot attached to the post and the source code/zip file

Quote
:.SANDSTRM
:StoreGDB
:For(Z,0,50
:conj(Z,L3,768
:For(A,0,1
:DispGraphr
:End
:End
:DispGraph
Generated by SourceCoder, © 2005 Cemetech

Quote
:.SANDSTR2
:StoreGDB
:StorePic
:For(Z,0,50
:conj(Z,L6,768
:For(A,0,1
:DispGraphr
:End
:End
:RecallPic
:DispGraph
Generated by SourceCoder, © 2005 Cemetech

All it does, basically, is copying the RAM content starting at Z until 768 bytes further in either the screen buffer or the back-buffer, depending of the routine. Since doing such thing normally looks like garbage, making that garbage scroll will cause a sandstorm effect

The routines can be altered to make the scrolling start elsewhere (as long as it's within the RAM boundaries), move faster or slower and last longer.

A pretty cheap, but fast way to do such animation :P

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Routines
« Reply #267 on: May 24, 2010, 02:18:43 am »
That's really cool. I personally like the gray "sand" with black background better, but that's just me. Great job :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #268 on: May 24, 2010, 02:22:42 am »
Yeah same. It looks much better IMHO. The other one could probably work best in tilemaps that have lot of black areas.

And thanks, lol, altough it wasn't much work really except for one RAM clear cuz I used conj({Z},{L6},768 instead of conj(Z,L6,768 at first :P

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Routines
« Reply #269 on: May 24, 2010, 07:48:24 am »
That's really cool! I like the gray sand over the black background.  This makes me wish I was programming an Axe RPG. ;D