• Axe Q&A 5 5
Currently:  

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

0 Members and 1 Guest are viewing this topic.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Q&A
« Reply #450 on: June 05, 2011, 06:42:13 pm »
By the way, a faster way to determine if a number is 2 or 3 (since that's a continuous range) is like this:

Code: [Select]
If D-2<2
.D is 2 or 3
End
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #451 on: June 05, 2011, 06:46:26 pm »
Actually if you wanted to see if a number was 2 or 3:

Code: [Select]
!If D/2-1
.D is 2 or 3
End

4 bytes smaller. ;) But for general cases, yes, that's a good way to check if a number is in a certain range.

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 #452 on: June 05, 2011, 08:42:26 pm »
* Darl181 was using 2 and 3 as example numbers :P

It gets interesting, like =6, =8, =10 or ^2.
And every statement is different.
« Last Edit: June 05, 2011, 08:42:40 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Axe Q&A
« Reply #453 on: June 10, 2011, 10:54:05 am »
Is
Code: [Select]
!If {L5 + 22} + 1 . Check if that byte is 255equal to
Code: [Select]
!If {L5 + 22} - 255 . Check if that byte is 255?

It seems to be different, for whatever reason.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #454 on: June 10, 2011, 10:58:47 am »
They're different. Although the memory read only reads a 1-byte value, all Axe math is done with 2-byte numbers. So the first statement would evaluate to 255+1=256, which is nonzero and will not activate the !If condition.
« Last Edit: June 10, 2011, 10:59:19 am by Runer112 »

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Q&A
« Reply #455 on: June 10, 2011, 11:00:37 am »
Solution: the sign{} command. It'll take a one-byte value and convert it into the appropriate two byte number.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe Q&A
« Reply #456 on: June 10, 2011, 11:01:45 am »
I would like to know what the free lists are in Axe, are there any lists I can save numbers to? Thanks.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #457 on: June 10, 2011, 11:14:11 am »
The Commands.htm file included in Axe releases has a pretty good summary of the L1-L6 RAM areas. And you can save data to any section of RAM you want. The question is what it will corrupt.

Quote from: Commands.htm
L1 = 714 bytes (saveSScreen) Volatility: LOW
L2 = 531 bytes (statVars) Volatility: LOW (Do not use this area when custom interrupts are enabled, including Mirage OS)
L3 = 768 bytes (appBackUpScreen) Volatility: MED (Saving to back-buffer will corrupt)
L4 = 256 bytes (tempSwapArea) Volatility: MED (Corrupt when archiving/unarchiving in program)
L5 = 128 bytes (textShadow) Volatility: MED ("Disp","Output", and "ClrHome" will corrupt)
L6 = 768 bytes (plotSScreen) Volatility: HIGH (Any buffer drawing will corrupt)

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Axe Q&A
« Reply #458 on: June 11, 2011, 03:32:36 pm »
Does
Code: [Select]
If 20 - {E} -> {E} > 10return something wrong or rather something other than
Code: [Select]
20 - {E} -> {E}
If {E} > 10
or is it just me? Is the upper code not working because the TI needs already HL for taking the E'th byte from the RAM?
« Last Edit: June 11, 2011, 03:33:17 pm by Aichi »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Q&A
« Reply #459 on: June 11, 2011, 03:36:37 pm »
Those return different things.

Something->{E} will return E instead of {E} after the store since E is variable.  On the other hand, if you store to a constant location like Something->{L1} then it will return {L1} instead of L1.  This strange behaviour is only because it leads to massive optimizations in the executables.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #460 on: June 11, 2011, 03:41:25 pm »
Those two blocks of code are different in a few ways:

  • Whereas the first block of code stores the value 20-{E} to the byte pointed to by E, the second block of code stores this value directly to E. In this case, the first block of code probably does what you want.
  • Whereas the second block of code compares the value of the byte pointed to by E to 10, the first block of code compares the value of E to 10. In this case, the second block of code probably does what you want.

Put the two together and you get this, which I believe should do what you want:
Code: [Select]
If {20-{E}→{E}}>10

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe Q&A
« Reply #461 on: June 11, 2011, 04:13:55 pm »
The Commands.htm file included in Axe releases has a pretty good summary of the L1-L6 RAM areas. And you can save data to any section of RAM you want. The question is what it will corrupt.

Quote from: Commands.htm
L1 = 714 bytes (saveSScreen) Volatility: LOW
L2 = 531 bytes (statVars) Volatility: LOW (Do not use this area when custom interrupts are enabled, including Mirage OS)
L3 = 768 bytes (appBackUpScreen) Volatility: MED (Saving to back-buffer will corrupt)
L4 = 256 bytes (tempSwapArea) Volatility: MED (Corrupt when archiving/unarchiving in program)
L5 = 128 bytes (textShadow) Volatility: MED ("Disp","Output", and "ClrHome" will corrupt)
L6 = 768 bytes (plotSScreen) Volatility: HIGH (Any buffer drawing will corrupt)

Thanks I guess L5 is the one I can use.

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Axe Q&A
« Reply #462 on: June 13, 2011, 06:52:22 pm »
How can I increase / decrase the contrast? I don't get it.
Shade( {E8447} + 1) just crashes my TI. :/

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Axe Q&A
« Reply #463 on: June 15, 2011, 12:58:57 am »
I thought you need {E8447}^r?

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Axe Q&A
« Reply #464 on: June 15, 2011, 03:36:17 pm »
I thought you need {E8447}^r?

I forgot the r in my post, sorry.^^
Shade( {E8447}r + 1) doesn't work.