Author Topic: Using OS Variables in Axe Question  (Read 5986 times)

0 Members and 1 Guest are viewing this topic.

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Using OS Variables in Axe Question
« 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!

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Using OS Variables in Axe Question
« Reply #1 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?

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Using OS Variables in Axe Question
« Reply #2 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?

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Using OS Variables in Axe Question
« Reply #3 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.

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Using OS Variables in Axe Question
« Reply #4 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.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Using OS Variables in Axe Question
« Reply #5 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)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Using OS Variables in Axe Question
« Reply #6 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(

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Using OS Variables in Axe Question
« Reply #7 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?

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Using OS Variables in Axe Question
« Reply #8 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!
« Last Edit: August 02, 2011, 09:14:29 pm by chattahippie »