Author Topic: Importing picture variables?  (Read 4071 times)

0 Members and 1 Guest are viewing this topic.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Importing picture variables?
« on: November 29, 2010, 08:00:02 pm »
Hello - from an Axe program, how would I be able to pick an arbitrary picture variable (which is editable by the average user via either the pen command or through manipulating the graphscreen), then copy the contents of the picture to the buffer (or back-buffer, or other such place)?  Also, how would I be able to do the reverse (i.e. to copy the contents of an arbitrary buffer to a picture variable)?

I would also like to know the method for importing a picture variable once at compilation (for elaborate title screens and such).

Also, what is the most commonly used and accepted acronym or abbreviation for 'picture variable'?
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 Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Importing picture variables?
« Reply #1 on: November 29, 2010, 08:02:44 pm »
I don't know much about Axe, sorry, but Pic vars might be the phrase you are looking for (or just pic).

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Importing picture variables?
« Reply #2 on: November 29, 2010, 08:16:23 pm »
Yeah Pic, picvar, or something to that effect.
The syntax to include the data of a picture into a compiled file is this:
Code: [Select]
[Pic1]->Pic0It inserts the data from TI-OS var Pic1 and makes it accessible through the Pic0 static pointer.
As for reading an arbitrary pic, do you mean in the sense of "a certain picvar I choose at compile time" or "a picvar chosen at runtime, perhaps by user input"?
The first is easy, and can be done like this:
Code: [Select]
If GetCalc("Pic1")->X
Copy(X,L6,756
End
This code, if Pic1 exists, copies it to the main buffer.
Dealing with a variable one is a bit harder, and I forget the specifics, but it involves overwriting a byte in the name to change it.
Same situation for writing. Here is code that copies from the buffer to Pic1.
Code: [Select]
If GetCalc("Pic1",768)->X
Copy(L6,X,768
End
For both reading and writing an arbitrary one in the second sense, you need the overwriting, but, after you change the name, the general process is the same.
Note what 756 and 768 mean. A picture of size 768 includes the bottom (63rd) row, but size 756 does not.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

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: Importing picture variables?
« Reply #3 on: November 29, 2010, 08:24:08 pm »
And if you're unsure what size the picture is, since it could be either one or something else, you can use {X-2}r to return the size of the picture where X is the pointer to its data.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Importing picture variables?
« Reply #4 on: November 29, 2010, 08:25:27 pm »
Wait, if the size of the screen is 768 bytes, shouldn't picvars invariably also have a set number of bytes?
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 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: Importing picture variables?
« Reply #5 on: November 29, 2010, 08:28:16 pm »
No.  They can be any size that's a multiple of 12, larger or smaller than the screen.  In fact, pictures created by StorePic on the calculator are actually only 63 rows long and pictures created on the computer with TI's software are 64 rows long.  I have no idea why TI decided to do this...
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Importing picture variables?
« Reply #6 on: November 29, 2010, 08:29:42 pm »
No ;)
You can create a 2000-byte picvar. The OS won't complain, even if you use RecallPic with it.
756 and 768 are the two most common sizes because the OS uses 756 (63 rows) and 768 is the full screen (64 rows)
Edit: ninja'd. maybe.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Importing picture variables?
« Reply #7 on: December 01, 2010, 04:56:14 am »
lol, I made a ninja'd-ing topic ('screen to pic#?' to be exact)
I'm not a nerd but I pretend: