Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: chattahippie on August 02, 2011, 05:55:39 pm

Title: Using OS Variables in Axe Question
Post by: chattahippie on August 02, 2011, 05:55:39 pm
I have been trying to take either a string or a pic (the string would only have 1 & 0s) from a Basic program and use an Axe program to display each bit as a black or white square, white for 1 and black for 0 (I know that that is backwards of normal).  [sarcasm]Using my vast knowledge of Axe[/sarcasm], all I managed to create was a program that displays random bits of garbage and a lot of black squares.

Here's what I currently have:
Code: [Select]
DiagnosticOff
GetCalc("Pic1")->Y
[FFFFFFFFFFFFFFFF]->Pic0
[0000000000000000]

ClrDraw
For(A,0,3)
For(B,0,3)
Pt-On(8*B,8*A,{A*4+B+Y}+Pic0)
End
End
DispGraph
Repeat getKey(15)
End

The dimensions work to my knowledge, as it seems to be that garbage and black only appear in the 32x32 square that is supposed to be created
If anyone knows why it isn't just black and white 8x8 squares, help would be appreciated!
Title: Re: Using OS Variables in Axe Question
Post by: yunhua98 on August 02, 2011, 05:58:46 pm
I don't understand how you are using Pic1.  couldn't you just store this in the program to somewhere in RAM?
Title: Re: Using OS Variables in Axe Question
Post by: chattahippie on August 02, 2011, 06:05:48 pm
I'm using a Basic program to do some number crunching, then it outputs it data in binary onto the graph screen, in the first row, the first 16 pixels.  Then it stores the picture to Pic1.  I'm then trying to access the data in Axe (storing the pointer to Pic1 to Y) so that I can display it better.  I did make this display the way I wanted in Basic using a string, but it was way to slow to be practical, so I was trying to convert it to Axe.

Also, what do you mean by store this somewhere in RAM?
Title: Re: Using OS Variables in Axe Question
Post by: yunhua98 on August 02, 2011, 06:28:20 pm
okay, forget what I said about storing in RAM, I thought you needed predefined data.
But could you store the binary into a string instead?  I'm not too sure how data in the pic is stored.
Title: Re: Using OS Variables in Axe Question
Post by: FinaleTI on August 02, 2011, 06:59:44 pm
Picture data is stored in consecutive bytes, like any free RAM, such as L6 or L3 in Axe. In order to access the individual pixels, you'll need to read the bits in each byte.
Title: Re: Using OS Variables in Axe Question
Post by: calc84maniac on August 02, 2011, 07:01:52 pm
I think your problem is that the pixels in the buffer are stored in bits, not bytes. A simple solution is to use the arbitrary-buffer pxl-test instruction, like so:
Pt-On(B*8,A*8,pxl-Test(A*4+B,0,Y)*8+Pic0)
Title: Re: Using OS Variables in Axe Question
Post by: chattahippie on August 02, 2011, 08:46:40 pm
I think your problem is that the pixels in the buffer are stored in bits, not bytes. A simple solution is to use the arbitrary-buffer pxl-test instruction, like so:
Pt-On(B*8,A*8,pxl-Test(A*4+B,0,Y)*8+Pic0)

I tried this, and it says Err: Argument when compiling, it says that only two arguments are needed for pxl-test(
Title: Re: Using OS Variables in Axe Question
Post by: ztrumpet on August 02, 2011, 08:48:38 pm
I think your problem is that the pixels in the buffer are stored in bits, not bytes. A simple solution is to use the arbitrary-buffer pxl-test instruction, like so:
Pt-On(B*8,A*8,pxl-Test(A*4+B,0,Y)*8+Pic0)

I tried this, and it says Err: Argument when compiling, it says that only two arguments are needed for pxl-test(
What version of Axe are you using?
Title: Re: Using OS Variables in Axe Question
Post by: chattahippie on August 02, 2011, 08:55:33 pm
What version of Axe are you using?
0.5.2

EDIT: Yay I updated and it works now! Thanks!