Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: The VFX Wizard on March 21, 2018, 09:57:30 pm

Title: GDB vs Pic
Post by: The VFX Wizard on March 21, 2018, 09:57:30 pm
I was wondering what the difference was between GDB and Pic as they seem to do the exact same thing and use the same hex codes. Is there a time you would use GDB over Pic? Thanks!
Title: Re: GDB vs Pic
Post by: Streetwalrus on March 22, 2018, 08:29:12 am
They're functionally the exact same thing, it's just a matter of semantics. It's the general consensus to use Pic* for sprites and other graphical data, and GDB* for other types of data. But nothing beats using custom names with the ° symbol in terms of readability.
Title: Re: GDB vs Pic
Post by: The VFX Wizard on March 22, 2018, 09:01:28 am
I'm sorry, I don't know what you mean by the degree symbol.
Title: Re: GDB vs Pic
Post by: Eeems on March 23, 2018, 12:32:56 pm
I'm sorry, I don't know what you mean by the degree symbol.
Search for °VAR in https://axe.eeems.ca/Commands.html
Title: Re: GDB vs Pic
Post by: johnbchron on March 23, 2018, 02:17:02 pm
Wait a sec, so you can type:
Code: [Select]
15 -> °FOO
and it will store to foo?!?
Title: Re: GDB vs Pic
Post by: Streetwalrus on March 23, 2018, 03:47:02 pm
Yes, though that is a constant. You can make that constant a memory location and use it as a pointer, or use it just like Pic*, GDB*, and others.
Title: Re: GDB vs Pic
Post by: johnbchron on March 23, 2018, 04:12:50 pm
So it would make more sense to say
Code: [Select]
blah blah -> °86EC
which would put it in L1?
Title: Re: GDB vs Pic
Post by: E37 on March 25, 2018, 06:40:36 pm
The o means that what follows is the memory location not the variable. {oA}r is exactly the same as A. It lets you make custom variables.

:L5->oVariableName
:25->VariableName
:Disp VariableName>Dec

In fact, VariableName can be anything you want! It can be as long as you want and contin numbers and lowercase letters as long as it doesn't start with a lowercase letter or number. You can also make as many as you want! (There is tecnically a limit but you will never hit it) These custom named variables can be used in ANY situation you could have used an Alpha variable. Note that each one takes up two bytes so if you place one at L5 then the next one should be placed at L5+2 and so on. There is no reason not to use them. They are just as fast as Alpha variables. In fact, the only difference between a custom named variable and the Alpha variables is the space they take up in the source code.

The o can be used for data also.

:"Im a string!"->oVariableName
:Disp oVariableName

Is the exact same as

:"Im a string!"->Str1
:Disp Str1

Notice that you need the o when it points to data. The symbol means that you want to use it as a constant and not a variable just like GDB or Str. It is useful for constants also. If you need map width and height in your program but don't need them to change while it is running make them constants. That way if you need to change the dimensions of the map, all you have to do is change the one line where they are declared.

Sorry I'm a bit late to the party... :P
Title: Re: GDB vs Pic
Post by: Streetwalrus on March 26, 2018, 12:02:21 pm
That's a good explanation of it, thanks for doing my job. :P
Title: Re: GDB vs Pic
Post by: E37 on March 26, 2018, 07:12:58 pm
That's a good explanation of it, thanks for doing my job. :P
Are there positions open there?  ^-^