Author Topic: Several questions  (Read 13403 times)

0 Members and 1 Guest are viewing this topic.

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Several questions
« on: October 04, 2010, 11:45:10 am »
So... I was working on porting necro's gfx to axe parser format (for my zelda-like game), and I stumbled upon 2 questions.
1. Can axe read from programs stored in the archive? (Then I mean, my program, since my gfx are in a program in the archive)
2. I have this program data file (created the same way as an appvar), but its source is open (I can read it using TIOS's edit), how can I lock this?
3. Can I "break" loops? For example, I have a for loop that goes from 1 to 10, but as soon as it discovers that number 6 is empty, that it will skip the 7-10 as well?
« Last Edit: October 04, 2010, 12:14:40 pm by Ikkerens »

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Several questions
« Reply #1 on: October 04, 2010, 01:50:58 pm »
I don't know about questions 1 and 2, but I think that to break out of loops you could just set A to a number higher then 10.
So...
For(A,0,10)
Misc. Code
If A=6 or other conditions
11->A
End
End
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Several questions
« Reply #2 on: October 04, 2010, 01:53:02 pm »
Hmm... strange I didn't think of that myself.
Thanks though.

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

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: Several questions
« Reply #3 on: October 04, 2010, 02:09:23 pm »
1. Can axe read from programs stored in the archive? (Then I mean, my program, since my gfx are in a program in the archive)
2. I have this program data file (created the same way as an appvar), but its source is open (I can read it using TIOS's edit), how can I lock this?
3. Can I "break" loops? For example, I have a for loop that goes from 1 to 10, but as soon as it discovers that number 6 is empty, that it will skip the 7-10 as well?

1) If you mean can Axe compile from Archive, then yes. To read data from Archive within a program is possible, I think, but the routines aren't the same as reading from RAM.

2) If you don't want to user to see the source, then I simply wouldn't include the source with the program.

3) You could also use a Goto to skip somewhere in the program. But the 11-->A thing is more memory efficient.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Several questions
« Reply #4 on: October 04, 2010, 02:17:03 pm »
No, I mean. I am Copy('ing my pics to a prgm created by Getcalc(
But that file is also editable trough the TIOS basic editor.
Even though the contents make no sense at all
How can I "lock" this program?

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

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: Several questions
« Reply #5 on: October 04, 2010, 02:22:02 pm »
Oh... I've been wondering how to do that for a little while now. I think if you put an invalid character into the file name, TI-OS shouldn't be able to open it. But my guess is as good as yours.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Several questions
« Reply #6 on: October 04, 2010, 03:19:46 pm »
So... I was working on porting necro's gfx to axe parser format (for my zelda-like game), and I stumbled upon 2 questions.
1. Can axe read from programs stored in the archive? (Then I mean, my program, since my gfx are in a program in the archive)
2. I have this program data file (created the same way as an appvar), but its source is open (I can read it using TIOS's edit), how can I lock this?
3. Can I "break" loops? For example, I have a for loop that goes from 1 to 10, but as soon as it discovers that number 6 is empty, that it will skip the 7-10 as well?

1. Yes, Axe is able to read data from archive. Reading tilemap data and sprite data from the archive is how my Zelda demo worked :P (It seems that everybody wants to make a Zelda or Zelda-like clone lol)
2. You can change the protection status of programs with the flash application Calcsys by finding the program in the VAT and typing "P" to change its protection status.
3. As others have said, to break from a loop, just set the loop variable to an exit condition.
« Last Edit: October 04, 2010, 03:21:23 pm by Runer112 »

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Several questions
« Reply #7 on: October 04, 2010, 03:22:16 pm »
Could you give an example on how to read from the archive?

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on it...

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Several questions
« Reply #8 on: October 04, 2010, 03:28:05 pm »
I suggest looking at page 15 of the Documentation.pdf file. Reading from archive is explained well there, and it has an example too.

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: Several questions
« Reply #9 on: October 04, 2010, 03:30:56 pm »
So... I was working on porting necro's gfx to axe parser format (for my zelda-like game), and I stumbled upon 2 questions.
1. Can axe read from programs stored in the archive? (Then I mean, my program, since my gfx are in a program in the archive)
2. I have this program data file (created the same way as an appvar), but its source is open (I can read it using TIOS's edit), how can I lock this?
3. Can I "break" loops? For example, I have a for loop that goes from 1 to 10, but as soon as it discovers that number 6 is empty, that it will skip the 7-10 as well?

1. Yes, Axe is able to read data from archive. Reading tilemap data and sprite data from the archive is how my Zelda demo worked :P (It seems that everybody wants to make a Zelda or Zelda-like clone lol)
/me hopes it is still alive D:

Also I think Ikkerens has been working on one for a while too, as he had it in his sig for months. However he went inactive for a while then worked on the contest entry. Also, if you think many people wants to make a Zelda clone, then you haven't seen with Pokémon. Had jsj795 and Iambian started their respective Pokémon clone attempts and had Shmibs continued his xLIB one, I would have started a project sub-forum just for Pokémon clones and it would still get more activity than United-TI forums as a whole :P
« Last Edit: October 04, 2010, 03:33:30 pm by DJ Omnimaga »

Offline Ikkerens

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 378
  • Rating: +28/-9
  • JavaScript Magician
    • View Profile
    • Walotech
Re: Several questions
« Reply #10 on: October 04, 2010, 03:37:35 pm »
I suggest looking at page 15 of the Documentation.pdf file. Reading from archive is explained well there, and it has an example too.

Ok, now I feel stupid, can't believe I didn't spot that before.

Splut for Android [----------]
Paused/halted indefinitely, might be abandoned, our graphic designer quit and the rest of us simply doesn't have the time to work on 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: Several questions
« Reply #11 on: October 04, 2010, 03:50:01 pm »
I think it was added in the last few versions, because it wasn't there before. I tend to not check the doc much because it used to be rarely updated at all. In fact, it was updated so rarely that sometimes the version number stated in it was a few versions behind.

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Several questions
« Reply #12 on: October 04, 2010, 04:22:55 pm »
well, I thought it was just only the version number in the Commandlist that was not updated. But I've just only token a look at the Documentation one or two times, but it clarified a lot :D

IMO it is nice but not usual in pre-releases of programs to update the doc every new release (I even forget creating a Documentation al all (A))
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 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: Several questions
« Reply #13 on: October 04, 2010, 04:46:43 pm »
Just to let everyone know, the only commands currently able to read from files in archive are {} and Copy(), but I am hoping to extend this to int{}, float{}, and nib{} in the future.  Also, a goto is more efficient to exit a loop than to set a variable to a number above the maximum because it will save time in the code and its 3 bytes less.

EDIT: In the future, I will add that the documentation was updated in the update descriptions :)
« Last Edit: October 04, 2010, 04:51:41 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

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: Several questions
« Reply #14 on: October 04, 2010, 04:49:13 pm »
I assume nib{} will be useful for example to read half-byte tilemap data directly?