• Axe Q&A 5 5
Currently:  

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

0 Members and 2 Guests are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Q&A
« Reply #1350 on: February 06, 2012, 03:32:23 pm »
You would never have known it unless someone told you :) The two bytes before the data of all variables is its size information, which in the case of programs, appvars, strings, and equations is in bytes.




Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1351 on: February 07, 2012, 10:01:40 pm »
What is the most convenient way to time events in axe?  Like with the timing of framerate and keypress functions.  I guess what I am asking is is there a means of timing which is independent of the program, that is, is not slown (slowed?) down or sped up by varying amount of code to be executed?

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 #1352 on: February 07, 2012, 10:04:40 pm »
You would want to look into interrupts, which allow your program to call a subroutine at regular intervals independently of what your own program is doing :D

Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1353 on: February 08, 2012, 07:53:27 pm »
Thanks, I'll see what they can do. :) Another thing I was wondering was if there is a way to access the calculators clock and use that as a means of timing, freeing up L2's dataspace. Is there a reference-able-by-pointer clock variable somewhere?

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 #1354 on: February 08, 2012, 08:14:52 pm »
I don't know of any myself, as the crystal timers are Ti84 only, and they are only accessible by Port access, which would take some custom assembly code.  Another option would be to analyze what is causing your program to run at different speeds, and use that to your advantage.  If it is a case where different numbers of objects are causing your program to run at different speeds, you can use the number of objects as a crude estimate for how long each frame of simulation is taking.  What specifically is causing your program to run at different speeds?

Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1355 on: February 09, 2012, 09:12:37 pm »
Ah yea, I didn't think of that alternative.  A sprites apparent speed was being affected by code run during a key press.  I think I'm going to want to use L2 for data, so I'll see how this option works out.  Thanks for the help :)

Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1356 on: February 10, 2012, 06:40:55 pm »
The copy command, it doesn't perhaps work to shift data, like one byte over, does it?  Probably have to make a temporary copy, no?

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 #1357 on: February 10, 2012, 06:48:54 pm »
Copy(r1,r1+1,length){^r}

IIRC where r1 is the end of the array
« Last Edit: February 10, 2012, 06:49:19 pm by leafy »
In-progress: Graviter (...)

Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1358 on: February 10, 2012, 06:56:08 pm »
*facepalm*  Didn't see that command there!  Sorry for the bother :-\

Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1359 on: February 12, 2012, 03:05:51 pm »
I've been having some* trouble with the copy command.  At least I think it's the copy command.  Does it have any bugs or quirks that would cause unexpected behavior?  like not being able to use it in a subroutine, or use custom named variables within the command, etc? 

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 #1360 on: February 12, 2012, 03:06:53 pm »
For the Copy() command and some similar to it (Fill Exch etc), you don't need to use the curly brackets for pointers.  Afaict everything else is normal tho.
« Last Edit: February 12, 2012, 03:07:14 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

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 #1361 on: February 12, 2012, 04:01:22 pm »
I've been having some* trouble with the copy command.  At least I think it's the copy command.  Does it have any bugs or quirks that would cause unexpected behavior?  like not being able to use it in a subroutine, or use custom named variables within the command, etc? 
Post the context in which you are using it, maybe we can see what might be going wrong.

Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1362 on: February 12, 2012, 05:49:52 pm »
Code: [Select]
12->SizeX
8->SizeY
copy(SizeX*SizeY->P-1+L1->N,N+SizeX,P)[sup]r[/sup]
Fill(L1,SizeX,2)

What I want it to do is shift the tilemap data at L1 SizeX bytes to the right.  It doesn't appear to do this... and exiting after running this bit of code in my program causes the home screen to glitch up (it displays input characters not where they should be, if it displays them at all), until I enter and exit a selection menu (like the program menu).  Some of my other attempts at it have resulted in ram clears :(  The screen does not glitch if that code is commented out.  What is going on? ???

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 #1363 on: February 12, 2012, 06:08:25 pm »
The way copy(A,B,L)r works, is you copy from location A to location B, then you copy from location A-1 to B-1, and so on for L times.  Is this the behavior you were expecting or were you expecting it to go forwards?  From the looks of your code, you will eventually be copying to addresses that come before L1, which is probably causing the errors you are experiencing.  I tried it myself without custom variables and it crashed for me too.

Offline Dvorak227

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1364 on: February 12, 2012, 06:27:22 pm »
hmm...  that is the way I thought it worked, but am I copying to addresses before L1?  Replacing the variables with numbers:

Code: [Select]
copy(95+L1,107+L1,96)r

As I understand it, or as I don't understand it, from location 95+L1-95 to 107+L1-95 is the last write the command performs.  But least it crashed for you too (I'm not crazy! :w00t:)