• Axe Parser 5 1
Currently:  

Author Topic: Axe Parser  (Read 545473 times)

0 Members and 3 Guests are viewing this topic.

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 #795 on: June 15, 2010, 05:11:30 pm »
Yeah, I don't think that was his real code since its an infinite loop on top of that.  I initialized A and changed the "While 1" to "Repeat getkey(15)" when I tested this I should mention.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Parser
« Reply #796 on: June 15, 2010, 10:12:56 pm »
Are you sure Str2 is exactly 10 characters?  Maybe you mistyped it.
there we go...I missed it by one and I guess it messed things up
you guys are right, that's only a boiled down version of my actual code but I actually use infinite loops a lot while working on a project since in Mirage I can always just exit using OnMode lol

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 #797 on: June 15, 2010, 10:22:23 pm »
Are you sure Str2 is exactly 10 characters?  Maybe you mistyped it.
OnMode
wow didn't even know that and I used Mirage for almost a decade x.x

Is it safe, though?

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 #798 on: June 15, 2010, 10:28:47 pm »
As long as you have interrupts enabled, and don't write data over the L2 free ram, then its safe to use.  But it doesn't save you from buffer overflows or corrupting ram of course.

What I'm curious about is the opposite.  If you disable interrupts, can you use L2 ram area in mirage? (All the DispGraph routines re-enable interrupts so immediately disable them after those).
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Parser
« Reply #799 on: June 15, 2010, 10:31:49 pm »
As long as you have interrupts enabled, and don't write data over the L2 free ram, then its safe to use.  But it doesn't save you from buffer overflows or corrupting ram of course.

What I'm curious about is the opposite.  If you disable interrupts, can you use L2 ram area in mirage? (All the DispGraph routines re-enable interrupts so immediately disable them after those).
Yeah, that sounds right. By the way, if you want, you can add some simple code to preserve interrupt state. Having interrupts enabled for even one microsecond can cause disasters.

Start your routine with this:
ld a,i
push af
di

and end it with this:
pop af
ret po
ei
ret
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #800 on: June 15, 2010, 10:42:13 pm »
Oh wow!  That's really cool!  I totally forgot about the "ld a,i" instruction, I was about to ask if it was possible to preserve interrupt state.  This seems to be a good way to do it.  Its 6 more bytes I think, but it will surely come in handy when I add custom interrupt support; Just in case someone decides to draw to the screen in their interrupt routine.
___Axe_Parser___
Today the calculator, tomorrow the world!

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: Axe Parser
« Reply #801 on: June 16, 2010, 11:04:00 am »
Oh, wow!  I'd never heard of On + Mode.  That should help me if I get infinite loops in Mirage. :D

Calc, how does this line work?
ret po
Thanks. ;D

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 #802 on: June 16, 2010, 11:39:24 am »
ztrumpet: when you do "ld a,i" or "ld a,r" the content of the iff1 flip-flop (which tells whether or not interrupts are disabled) is put into the p flag. So, if interrupts were previously disabled, this line returns. If they were enabled, the next two lines enable interrupts then return.
"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 #803 on: June 17, 2010, 01:27:59 am »
Okay, first thing, Axe Tokens.  Enable and disable them with Alpha+Vars.  If the screen flashes, you know they have been toggled.  The current token remapping is this:

Code: [Select]
conj <-> Copy
Expr <-> Exch
SinReg <-> Freq
det <-> Zeros
int <-> sign
>Frac <-> >Char
deltalist <-> Data
Repeat <-> Until
Tangent <-> Bitmap

Let me know if you all like it.  I might decide to make it  quote unquote 'Mandatory'.  Like the code would be pretty unreadable without it.

I modified my RPG demo to use subroutines if you want to look at it.  Basically, you call it with up to 6 arguments and then in the subroutines, the arguments turn into r1 through r6.  Do not use subroutines with arguments in subroutines with arguments otherwise there could be conflicts since they all share these values.  While these new variables can be used outside of subroutines, it is discouraged because they get erased every time you call a subroutine with arguments.

EDIT: Oops, I just realized I accidentally switched Fill( with Zeros( instead of det(.  I'm releasing another version soon to fix stupid typos like this.  I think that will be the pattern from now on.  Big improvements followed by corrections.  I'll wait to see what other corrections need to be made first of course.
« Last Edit: June 17, 2010, 01:42:59 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

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 #804 on: June 17, 2010, 01:32:41 am »
Axe Parse 0.3.0 just came out.

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 calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Parser
« Reply #805 on: June 17, 2010, 01:40:06 am »
Ooh, base 2 logarithm/exponent can be useful for a simple floating-point implementation.

Come to think of it, to improve the usefulness of fixed-point values (see: sin/cos), you should make an alternate multiplication routine, "**", to multiply two numbers but return the top 16 bits of the 32-bit result. Currently, there is no easy way to do that.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #806 on: June 17, 2010, 01:45:50 am »
Ooh, base 2 logarithm/exponent can be useful for a simple floating-point implementation.

Come to think of it, to improve the usefulness of fixed-point values (see: sin/cos), you should make an alternate multiplication routine, "**", to multiply two numbers but return the top 16 bits of the 32-bit result. Currently, there is no easy way to do that.

That's a good idea.  Design me a little routine and I'll add it.  I'm not sure how to approach it :)
___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 #807 on: June 17, 2010, 01:46:14 am »
A little more explanation on your Tangent command please?
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 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 #808 on: June 17, 2010, 01:49:13 am »
Ah yes, the good ol' bcall(_DisplayImage)

Here is how you use it.  Define the sprite like this:
Data(height,width)->Pic1
[row1]
[row2]
...
[last row]

Then, when you want to display the sprite:
Tangent(X,Y,Pic1)
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Parser
« Reply #809 on: June 17, 2010, 01:50:40 am »
Is width in pixels or bytes? If it's not a multiple of 8 pixels, do you pad the last byre?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman