Author Topic: Programs written with an Axe program  (Read 15985 times)

0 Members and 1 Guest are viewing this topic.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Programs written with an Axe program
« Reply #30 on: December 11, 2010, 08:29:22 am »
wow thats nice, cant wait until next version!
I'm not a nerd but I pretend:

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Programs written with an Axe program
« Reply #31 on: December 11, 2010, 09:17:24 am »
The easiest way *not available until the next version* is to absorb them directly into the program.

Recall that when you have a title screen that takes up the whole screen, you don't want to have to type out the entire 1536 hex characters:
[123ABC...]

Instead, you can absorb an OS picture into the program simply by doing this:
[Pic1]

The same thing applies for tokens.  If you want a string of tokens, then instead of doing:
Data(t1,t2,t3,tA,tB,tC,...)

You can do any of these:
[Ans]
[Str1]
[prgmABC]
[appvABC]


And the data will be directly absorbed into the program, depending on where you have your tokens stored (The one with Ans is kinda volatile, I wouldn't recommend that).  To find the length of some data of unknown size, you can't use length() because its not necessarily zero terminated, and you shouldn't use it anyway since its a slow routine and you already know the pointers are static.  Instead you can just subtract the start from the end of the data pointer.

:[Str1]->Str1
:[]->Str1E
:Copy(Str1,L1,Str1E-Str1)


That will be great in Sprite Editors which give us the HEX code in Str1, we will then absorb it and save it as a program-variable.

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: Programs written with an Axe program
« Reply #32 on: December 11, 2010, 12:50:46 pm »
Does Str1E-Str1 optimize to the actual number of bytes?




Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Programs written with an Axe program
« Reply #33 on: December 11, 2010, 01:33:21 pm »
I was considering doing this a while ago, but I had to delete everything off my calc. Irritating test, and when i got back home my computer crashed and has yet to be fixed, and I had to find number values for everything, and unfortunately no one at my school has Axe :'(

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: Programs written with an Axe program
« Reply #34 on: December 11, 2010, 01:40:57 pm »
Yeah, something like that. But I'm really only talking about for a 'public' release.  The odds of having less than 15ish bytes left on your calculator is probably very rare.  Any triple digit of bytes is rare for me at least.  If you're just doing this to quickly test out the features or to generate a file like from a map editor then you really don't need the error checking since you're aware of the problem and know how to avoid it.  Its only if other people use your program that you would want to check for errors.
Ah, right, what if the programmer checks how much RAM is left prior the game execution and exit if it's too low, though?

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Programs written with an Axe program
« Reply #35 on: December 11, 2010, 03:39:01 pm »
yeah i didn't include error checking because i would hope that people have at least 10 bytes to spare on their calculator. that is neat though, absorbing other variables directly into your program. why are you taking it out next version?