Author Topic: Axe Q&A  (Read 589047 times)

0 Members and 1 Guest are viewing this topic.

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Axe Q&A
« Reply #1080 on: November 26, 2011, 12:58:25 pm »
Which of these is faster?
Code: [Select]
:C>0+C->C
or
Code: [Select]
:If C>0
:C++
:End
Basically it comes down to an If statement, versus an expression evaluated each time.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Axe Q&A
« Reply #1081 on: November 26, 2011, 01:44:54 pm »


I suspect that you don't really need to test if it's positive, in which case !if c would be the fastest way. Otherwise, the second one is fastest.



∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Axe Q&A
« Reply #1082 on: November 26, 2011, 03:48:08 pm »
Hey guys. How do I make a white 4x8 sprite in Axe? So that if I display it on a black background(pt-off) it doesn't draw a white 8x8?
I heard something of a masked sprite, but I don't know what that is.
Thanks in advance> :)


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Axe Q&A
« Reply #1083 on: November 26, 2011, 03:49:36 pm »
So you'll want to create a greyscale sprite like this:

Black is where you want black
light grey is where you want white
dark grey is where you want grey
white is where you want transparency

and just Pt-Mask (under plot for some reason) with the usual arguments.
In-progress: Graviter (...)

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Axe Q&A
« Reply #1084 on: November 26, 2011, 05:06:23 pm »
Which of these is faster?
Code: [Select]
:C>0+C->C
or
Code: [Select]
:If C>0
:C++
:End
Basically it comes down to an If statement, versus an expression evaluated each time.

If you are using negative numbers, use the >> operation.  If you just use >, every number except 0 will execute the code

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #1085 on: November 26, 2011, 05:29:24 pm »
Is there a faster way to xor two buffers together than with a For() loop?
Vy'o'us pleorsdti thl'e gjaemue

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Axe Q&A
« Reply #1086 on: November 26, 2011, 05:55:17 pm »
Is there a way to draw a sprite directly to the screen?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Q&A
« Reply #1087 on: November 26, 2011, 06:37:33 pm »
Is there a faster way to xor two buffers together than with a For() loop?
No I don't believe so

Is there a way to draw a sprite directly to the screen?
Not in Axe at any rate.  One could write an axiom for it maybe, why do you want to draw a sprite to the screen only?

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Axe Q&A
« Reply #1088 on: November 26, 2011, 07:13:00 pm »
So I don't have to worry about platforms and such being erased. On the same idea, how do I draw mono "transparent" sprites?

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Axe Q&A
« Reply #1089 on: November 27, 2011, 12:45:13 am »
So I don't have to worry about platforms and such being erased. On the same idea, how do I draw mono "transparent" sprites?
I believe the command you're looking for is Pt-Mask()r
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Axe Q&A
« Reply #1090 on: November 27, 2011, 05:41:48 am »
So you'll want to create a greyscale sprite like this:

Black is where you want black
light grey is where you want white
dark grey is where you want grey
white is where you want transparency

and just Pt-Mask (under plot for some reason) with the usual arguments.
Thanks. So I must just use it like this? :
pt-mask(x,y,pic1)r(or no r?)


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #1091 on: November 27, 2011, 11:31:24 am »
I'm pretty sure it's like that, just have the second line of hex under/part of the first one.

...
Ok, I was optimizing last night and wrote down a bunch of Q's as I went.

Do the ?/?? conditionals save space in the executable in relation to conventional If loops?  How about speed?

Can they be nested?  like B?(A++5?-1→A),→A works, nvm that

Which is faster: If (commonly true) / If (sparsely true) ?

So it's optimized to put the constants at the end...what if it's like L2+2?  Would a different order influence anything?
Vy'o'us pleorsdti thl'e gjaemue

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Axe Q&A
« Reply #1092 on: November 27, 2011, 05:56:58 pm »
AH!!!!!
so, swords is almost done, and the executable is 17000 bytes. I just tried compiling it into an app, but I got an Err: Memory D:
is there any way to get around this?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Q&A
« Reply #1093 on: November 27, 2011, 06:01:41 pm »
One-page app capacity (minus the header and signature) is 16160 bytes. I guess you could either do some hardcore optimization or put some data in an external appvar.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Axe Q&A
« Reply #1094 on: November 27, 2011, 06:03:06 pm »
One-page app capacity (minus the header and signature) is 16160 bytes. I guess you could either do some hardcore optimization or put some data in an external appvar.
ok then, I'll do that. :)