Author Topic: Axe Parser  (Read 488403 times)

0 Members and 2 Guests 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 Parser
« Reply #510 on: April 25, 2010, 01:11:07 am »
All static pointers are distinct.  Even Str1 and Str01 are not the same.  GetCalc currently only works for appvars and programs so graph database files can not be read.

You can kind of get the Nth data pointer if all the data is the same size and declared consecutively.  If you have:
:[C0FFEE]->Str0
:[DECAFF]->Str1
:[CAFE00]->Str2

You can get the Nth pointer here by doing "N*3+Str0"

There is another way to get the Nth arbitrary pointer (not consecutive not the same size) but its a little more complicated and involves pointers to pointers.
« Last Edit: April 25, 2010, 01:11:46 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Axe Parser
« Reply #511 on: April 25, 2010, 01:15:21 am »
GDB0 and GDB10 are two separate pointers. It doesn't use the OS for this so it doesn't use the OS's silly rules about that.
EDIT: Ninja'd
« Last Edit: April 25, 2010, 01:16:13 am by Eeems »
/e

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #512 on: April 25, 2010, 01:19:01 am »
There is another way to get the Nth arbitrary pointer (not consecutive not the same size) but its a little more complicated and involves pointers to pointers.

Want to clarify for me? Because all my data sets are of different sizes ;D
« Last Edit: April 25, 2010, 01:20:00 am by Runer112 »

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 Parser
« Reply #513 on: April 25, 2010, 01:31:00 am »
Sure, lets say you have 10 blocks of data:

[Data Block 0]->Str0
[Data Block 1]
[Data Block 2]
...
[Data Block 9]

You then make an array with the cumulative sizes for each block like this:

dList(0,size of block 0,total size of blocks 0 to 1,total size of blocks 0 to 2, ... )->GDB1

These should all be 2 byte numbers so end them all with the "r" modifier.

Now, lets say you want the pointer to the Nth block of data, you can get it by doing:

Str0+{N*2+GDB1}r

So if you want the 3rd byte of the 4th block of data, you could do:

{2+Str0+{6+GDB1}r}
« Last Edit: April 25, 2010, 01:31:49 am by Quigibo »
___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 Parser
« Reply #514 on: April 25, 2010, 01:38:07 am »
Ok that looks pretty good. Just checking, though, this is a lot of data: 50 blocks totaling almost 10KB. Is it possible/safe to add all this data to just one reference?

EDIT: And while we're on the topic of large amounts of level data (this is data for 50 levels), storing all 50 levels in RAM is obviously not the best way to go. I'll probably end up putting this all into an archived AppVar (or program?), but then the question becomes: How do you extract only one level at a time?
« Last Edit: April 25, 2010, 01:45:12 am by Runer112 »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Axe Parser
« Reply #515 on: April 25, 2010, 01:43:13 am »
Yeah I'm used to forums where double-posting is just fine, so sometimes I don't think to check here. But once I look down at my post(s) and see two in a row I instantly realize :-[


But anyways...

For the GDB# thing. I don't think there is a GDB10, only GDB0 to GDB9. Could be wrong though, please correct me if I'm wrong.

From the documentation:

Quote
Another thing is that Axe allows you to name everything with up to 2 numbers/letters instead of just a single number. The following are all valid names:
Str1
Pic0
GDB4
Str1A
Pic9Z
GDB45
Str66
Pic8C
GDB3X

Ah ok, I wasn't aware you could add a second character in Axe to those.

And at that point if it was in an AppVars then that is where GetCalc( comes in handy, I believe.
« Last Edit: April 25, 2010, 01:44:40 am by meishe91 »
Spoiler For Spoiler:



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

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 Parser
« Reply #516 on: April 25, 2010, 01:48:09 am »
It should be as long as all the data is one after the other, but be careful with the size counting!  I think the limit to program sizes is 16k though or something just becasue of the way the RAM is works.  What are you doing that uses that much memory?  Is it picture files or something?  And how is the parser working by the way, I haven't actually tried it with that much data before.

EDIT: As for individual levels at a time, there really isn't an easy way to do that.  You could split the level data into more than one appvar maybe.  Also, you can get more room in the ram if you have the program archive itself at the start (doesn't affect the copy of the program that is actually running).
« Last Edit: April 25, 2010, 01:53:31 am by Quigibo »
___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 Parser
« Reply #517 on: April 25, 2010, 01:58:11 am »
The parser seems to be handling the large amounts of data just fine. It takes a second or two to get through it all but it works.



And you were wondering what the data is?

I was wondering Quigibo because I plan on making a project in which tiles will appear in groups of 16 at a time, with each tile being either white or black.

16 bits (2 bytes) * ~50-100 tile groups per level * 50 levels = ~5-10KB

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #518 on: April 25, 2010, 02:02:34 am »
Just a head up: backup often before testing! If you're doing it already, fine, but else, you take big risks when testing your stuff (a crash occurs and all your stuff is gone).

I'm saying this often lately, especially to newer members or people starting a new project in a new language or new libs, because on the old Omnimaga forums I saw too many cases of projects dying due to data loss and the author giving up.

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 Parser
« Reply #519 on: April 25, 2010, 06:42:52 pm »
Hope everyone likes the new update!

I had a bad experience when I accidentally did drawing off-screen.  I couldn't get the calculator to ram clear and removing the batteries wasn't helping either.  I had to actually unscrew the case and remove the little button cell battery to unfreeze the calc.  Anyway, I don't want that to happen to anybody else, so I added a little check when drawing pixels.  Its only 6 more bytes total and any slowdown is negligible compared to the entire routine.  It also allows you to clip lines off the right and bottom sides of the screen if they overextend.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #520 on: April 25, 2010, 07:34:47 pm »
its 6 bytes per program, not six bytes per call correct?  Or else that would be very significant :P yayyyy line routine!  This is one i have been waiting for a while, glad its finally in :) and signed division yaayyyyy!  Haha now to go through and re-optimise some of the code i have ;D

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 Parser
« Reply #521 on: April 25, 2010, 11:13:02 pm »
its 6 bytes per program, not six bytes per call correct?  Or else that would be very significant :P yayyyy line routine!  This is one i have been waiting for a while, glad its finally in :) and signed division yaayyyyy!  Haha now to go through and re-optimise some of the code i have ;D
Yes, for the entire program.  Glad you like the update :)
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #522 on: April 25, 2010, 11:20:49 pm »
Wow awesome! I'm happy to finally see Line support! This will be very useful for drawing game menus, because I don't always want to have to draw borders using sprites.

Keep up the good work!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #523 on: April 30, 2010, 09:42:16 am »
wow ticalc stats epic failed again

Axe currently has 39 downloads and 11 in the past 7 days.

Wasn't it over 80 for both? D:

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Re: Axe Parser
« Reply #524 on: April 30, 2010, 12:00:31 pm »
Ticalc must have magic-transferred some stats to me. I suddenly get 100 downloads/week...