Author Topic: Axe Parser  (Read 551875 times)

0 Members and 7 Guests are viewing this topic.

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: Axe Parser
« Reply #1050 on: July 26, 2010, 10:39:49 pm »
For the second, no, it's not. I just checked (with Axe 0.4.0). You have to do

Code: (Axe BASIC) [Select]
Value→{Pointer}
Fill(Pointer,X-1)

I think it's because Fill( takes the pointer of the data, but Value→{Pointer} leaves the data value itself. In otherwords, you're Fill(ing the data at pointer Value.




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: Axe Parser
« Reply #1051 on: July 26, 2010, 11:12:58 pm »
Well, you're both partially correct.  If the Pointer is a static pointer, then Deep Thought is correct, because the return value is not the pointer, but the value you're storing to the pointer.  On the the other hand, Runer is correct for non-static pointers such as a pointer to an appvar because then the return value is the location rather than the value stored.
___Axe_Parser___
Today the calculator, tomorrow the world!

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: Axe Parser
« Reply #1052 on: July 26, 2010, 11:33:57 pm »
Oh, so the one line would work if Value was a GetCalc( statement?
« Last Edit: July 28, 2010, 07:49:20 am by Deep Thought »




Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Axe Parser
« Reply #1053 on: July 27, 2010, 12:02:32 pm »
How exactly do you use the new PORT commands to send data?

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Axe Parser
« Reply #1054 on: July 27, 2010, 01:32:17 pm »
I dunno if those are there to establish a foundation for the automated linking or what...

Perhaps it involves bit manipulation?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Axe Parser
« Reply #1055 on: July 27, 2010, 02:56:04 pm »
How exactly do you use the new PORT commands to send data?
There isn't automatic linking yet, so no multilayer games until next version, but you can manipulate the link port directly for applications like sound, interaction with micro controllers, shake detectors, etc. The codes are as follows:  0-both tip,ring high, 1-tip low, ring high, 2-tip high, ring low, 3-both tip,ring low.  I might have ring and tip mixed up.

EDIT: Oh yeah, the main purpose for the big-endian was for reading 2 byte tokens from programs since they're stored in reverse order.

Apparently, it hasn't been implemented yet. Gotta wait till next version.
« Last Edit: July 27, 2010, 02:57:33 pm by Art_of_camelot »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Axe Parser
« Reply #1056 on: July 27, 2010, 04:13:20 pm »
So, quick tutorial on Port. (And the link port in general)
As you know, the link port has two lines on which to send data, the tip and the ring. Each can be in one of two states, high or low.
When you write a set bit, it pulls that line low, while writing a reset bit allow it to go high.
Bit 0 is the tip and bit 1 is the ring.
Like Quigibo said, you write 0 to let both go high, 1 to pull the tip low and let the ring go high, 2 to let the tip go high and pull the ring low, and 3 to pull both low.
Reading, however, is somewhat different. Instead of a set bit indicating that it is low, a set bit indicates that the line is high. A reset bit indicates that the line is low.
This means that when you read 0, both are low; 1, the tip is high and the ring is low; 2, the ring is high and the tip is low; 3, both are high.
With respect to two connected calcs, a line is read as low if either calc is pulling it low. The line will only be read as high if both calcs are letting it go high.
Hope this helps! :D
"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 Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Axe Parser
« Reply #1057 on: July 27, 2010, 04:27:43 pm »
So, what does high and low mean?  Does it mean priority in recieving data, the speed at which data is sent/recieved, or what?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #1058 on: July 27, 2010, 04:44:22 pm »
This is no data transfer routine if i remember correctly, this is direct access to the hardware, so you have to write your own data sending routines if you want to send actual numbers.  Here is my understanding of the command:

The IO cable has 3 wires, called the tip, ring, and ground.  Ground is not used for transfering data, so we will only concern ourselves with the tip and the ring.  The ring and the tip can either be in two 'states' or voltages, high and low.  The calculator can either "pull" a ring/tip low, or let it go high.  What this means is that if it is "pulled" low, the calculator forces the tip/ring to go into a low voltage.  Even if the other calculator is letting the voltage go high, the tip/ring will still be at low.  Thats where the term "pulling low" comes from, because the calculator "pulls" and forces the voltage.  When the calculator "lets the voltage go high" it does not force it, but only lets it go.  If both calculators let go, the voltage goes high.  If either one (or both) of the calculators is pulling low, the line will be read as low.

To SET the cable, use the #->Port command.
0 lets both lines go high
1 pulls the tip low
2 pulls the ring low
3 pulls both lines low

To READ the port, use the Port->Var command.
0 means both lines are low
1 means tip is high
2 means ring is high
3 means both lines are high

Yeah reading and writing is confuzzling, but thats the way it works unfortunately.  Note that i haven't actually used the link port at all so all of this is conceptual :P if any of this is incorrect please let me know!

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Axe Parser
« Reply #1059 on: July 27, 2010, 04:54:47 pm »
Yeah, sorry about that. Low and high are just different states, which are represented by different voltages. It's easiest to just consider it to be a bit (which is all it really is, anyway ;D)
"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: Axe Parser
« Reply #1060 on: July 28, 2010, 04:51:17 am »
Let me explain the new masked sprite routine because its really cool.  The first layer is the sprite and the second layer is the mask.  The way it works is that anything drawn on the first layer is going to be black or gray and any bit that is neither in the sprite layer nor the mask layer becomes transparent.  So the codes are 11 for black, 10 for gray, 01 for white, and 00 for transparent.  Think of it like a controlled Pt-Off() that also draws gray since you can control which pixels to see through when drawing.  The routine is slower than the normal sprite drawing but much faster than trying to draw to both layers individually.  Also, due to the choice of color codes, you can use this for monochrome masking as well with the first layer being the sprite you want to draw and the second layer is black in the areas you want to draw over.  However keep in mind that the routine still draws to both buffers so make sure you aren't storing anything there first.  Here is an example

Layer1:
    ████████
  ██        ██
██            ██
██    ████    ██
██    ████    ██
██            ██
  ██        ██
    ████████

Layer2:
    ████████
  ████████████
████████████████
██████    ██████
██████    ██████
████████████████
  ████████████
    ████████

Result:
░░░░████████░░░░
░░██        ██░░
██            ██
██    ████    ██
██    ████    ██
██            ██
░░██        ██░░
░░░░████████░░░░

The crosshatched color means those pixels don't change when drawing the sprite (transparent).

Also, please let me know if you are still getting errors that you were getting before.  I tried to fix as much as I could but since I still can't figure out the problem, that means I'm just guessing so I need your help to see if anything actually got fixed.
« Last Edit: July 28, 2010, 04:52:00 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Axe Parser
« Reply #1061 on: July 28, 2010, 08:52:25 am »
Can't download yet.
I'm on a public computer.

How fast is the routine? Can you still animate?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







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: Axe Parser
« Reply #1062 on: July 28, 2010, 01:23:38 pm »
Let me explain the new masked sprite routine because its really cool.  The first layer is the sprite and the second layer is the mask.  The way it works is that anything drawn on the first layer is going to be black or gray and any bit that is neither in the sprite layer nor the mask layer becomes transparent.  So the codes are 11 for black, 10 for gray, 01 for white, and 00 for transparent.  Think of it like a controlled Pt-Off() that also draws gray since you can control which pixels to see through when drawing.  The routine is slower than the normal sprite drawing but much faster than trying to draw to both layers individually.  Also, due to the choice of color codes, you can use this for monochrome masking as well with the first layer being the sprite you want to draw and the second layer is black in the areas you want to draw over.  However keep in mind that the routine still draws to both buffers so make sure you aren't storing anything there first.  Here is an example

Layer1:
    ████████
  ██        ██
██            ██
██    ████    ██
██    ████    ██
██            ██
  ██        ██
    ████████

Layer2:
    ████████
  ████████████
████████████████
██████    ██████
██████    ██████
████████████████
  ████████████
    ████████

Result:
░░░░████████░░░░
░░██        ██░░
██            ██
██    ████    ██
██    ████    ██
██            ██
░░██        ██░░
░░░░████████░░░░

The crosshatched color means those pixels don't change when drawing the sprite (transparent).

Also, please let me know if you are still getting errors that you were getting before.  I tried to fix as much as I could but since I still can't figure out the problem, that means I'm just guessing so I need your help to see if anything actually got fixed.
Wow nice, that will come handy for sure for grayscale games. Nice update. I will try to test app compiling when the app exist at one point, although I cannot promise yet.

Also although I am late on this, the previous update was pretty great too. I also noticed my ball game dropped by a few bytes from 0.3.3 to 0.4.0

Offline Magic Banana

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 371
  • Rating: +77/-1
  • It's not an apple, it's a ... magic banana.
    • View Profile
Re: Axe Parser
« Reply #1063 on: July 28, 2010, 04:46:51 pm »
So, about that new sprite masking routine, if I were to use it for monochrome sprites, would I need to run it in 6MHz mode or would it be fine in 15MHz mode?

EDIT:Also, just to make sure, if I were to use grayscale sprites with this routine, it's required to run in 6MHz mode, right?
« Last Edit: July 28, 2010, 04:49:31 pm by Magic Banana »
I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13

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: Axe Parser
« Reply #1064 on: July 28, 2010, 04:54:05 pm »
The routine only renders the sprites, you still need to call DispGraphr to display them, so it still needs to be in 6mHz. (I'm pretty sure.)
At least for displaying greyscale. Rendering the sprites should work at either speed, cause I think it's just a modified version of the original sprite routine.
« Last Edit: July 28, 2010, 04:55:32 pm by FinaleTI »


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.