Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Runer112

Pages: 1 ... 92 93 [94] 95 96 ... 153
1396
The Axe Parser Project / Re: Axiom SDK For Developers
« on: March 27, 2011, 03:09:17 am »
So is there currently a way to write an Axiom for something like Pt-On(_x,_y,_ptr)r?

That routine already exists, why would you want to write a new one? Also note that in most cases, you can't use tokens that Axe already uses for the built-in commands in your Axioms.


Do axioms generally run faster than generic Axe commands?

There are a few things that Axioms can't be used for, like control structures and auto optimizations, so these cannot be compared. For everything else, the speed of the command is simply dependent on the assembly code of the routine. If you took the code for a built-in Axe command and included it in an Axiom, both versions would result in exactly the same compiled code and run at the same speed. For other routines, the speed is simply dependent upon what the routine does, how well it was coded, and how much the programmer was aiming for speed over size.

1397
Axe / Re: Bitmap( Clipping
« on: March 26, 2011, 11:44:55 am »
Interesting...from my experience, Bitmap( handled clipping perfectly unless the image was entirely off screen.

Now that I think of my testing, I think this might be right...

1398
Axe / Re: Bitmap( Clipping
« on: March 25, 2011, 10:39:19 pm »
Well I just tried using Bitmap() to draw an image offscreen. Miraculously it didn't cause a RAM clear, but it turned the screen to maximum contrast and changed the z address, so I'd say the clipping is far from perfect.

1399
Axe / Re: Bitmap( Clipping
« on: March 25, 2011, 10:33:32 pm »
Nope.

1400
The Axe Parser Project / Re: Bug Reports
« on: March 23, 2011, 07:03:25 pm »
[0000000000000000]->Pic0->Pic2
Does not work.

I'm not really sure why you would want to do this. If you have already defined the data as Pic0, defining it again as something else would just be a waste of symbols.

1401
Axe / Re: Simple Axe Questions
« on: March 23, 2011, 05:48:44 pm »
How to optimize this?:

Code: [Select]
Pxl-On(90,1
Pxl-On(91,2
Pxl-On(92,3
Pxl-On(93,2
Pxl-On(94,1
Pxl-On(90,5
Pxl-On(91,4
Pxl-On(93,4
Pxl-On(94,5

Pixel method: 117 bytes not counting the pixel routine, 158 bytes with it; 2853 cycles
 

Code: [Select]
Pt-On(88,0,[0022140814220000])

Aligned sprite method: 24 bytes not counting the sprite routine, 150 bytes with it; 918 cycles

1402
Axe / Re: Mismade
« on: March 23, 2011, 05:15:43 pm »
Here are the things that seem odd/problematic to me:

  • What is Zeros(9)→Z for? It shouldn't cause any problems, but unless you actually use it anywhere, you don't need it.
  • Unlike most other variable types, float variables don't have a 2-byte header denoting their size. The GetCalc() routines unfortunately do not account for this, so they exhibit a number of problems when operating on float variables:
    • Using GetCalc() to either locate or create a float will expect a size header to be present and thus advance the pointer returned by 2 bytes. However, floats don't have this header and this advance shouldn't be made. This can be corrected for by subtracting 2 from the pointer returned from GetCalc() calls dealing with floats. Make sure to make this adjustment after checking whether or not the function was successful, though, so returned values of 0 indicating failure aren't changed to -2.
    • When creating a float, the GetCalc() routine will add an unwanted 2-byte size header. This effect can be negated by decreasing the size argument of the call by 2, so 9-2 for a real variable and 18-2 for a complex variable. I'm guessing you meant to create a real variable with GetCalc("varW",18) and just picked up the 18 from the memory management screen, but you really want 7. Unless you did mean to create a complex variable, in which case you want 16.


Here would be my suggested code for what I have interpreted as what you meant to do:

Code: [Select]
.Not sure what this line is for.
Zeros(9)→Z

.Don't forget error handling!
!If GetCalc("varC")
   .You'll want code here that either jumps to a unified error handler or handles the error itself and returns/quits.
End

.Unless you plan on using the pointer to the OS variable C later, no need to store the GetCalc() result to a variable, you can just carry it right into the float{} command. Also added a -2 to correct for GetCalc() problems.
float{-2}→C

...stuff...

.More error handling! Also changed the size argument to account for GetCalc() issues.
!If GetCalc("varW",9-2)
  .More error handling.
End

.Save the pointer to the OS variable because we can't just carry it straight into the float command this time. Also subtracted 2.
-2→A

.Store the Axe value W into the OS value W
W→float{A}

Hopefully this will work. Tell me if you have problems with it.

1403
The Axe Parser Project / Re: Bug Reports
« on: March 23, 2011, 05:09:58 pm »
New bug: Apparently Axe adds two after finding a pointer to a real var after using GetCalc(, even though it isn't needed (you probably already know about this).

For more info, see: http://ourl.ca/4072/176999

1404
Axe / Re: Sound loudness?
« on: March 23, 2011, 03:47:53 pm »
It's not a real ban, but the same effect.
It won't let me log in as "that email address is already associated with another account"  I check and it's not.
Have you ever tried asking for their help?  TI does more than they do :/

It sounds like you're trying to create an account instead of simply logging into your existing one. The account that the email address is already associated with is probably your own. Go here and enter your email address, then check your email for a response. That should let you regain your account.

1405
Axe / Re: Sound loudness?
« on: March 23, 2011, 11:46:53 am »
If you're talking about the Axe Freq() command, as far as I know there is no way to change the volume. The volume of a sound is proportional to the amplitude, but since Freq() only produces a 1-bit wave, I don't think there is a way to increase or decrease the amplitude.

1406
Axe / Re: Simple Axe Questions
« on: March 22, 2011, 09:13:31 pm »
By the way, I think a few people have gotten confused a bit. This is not the general Axe Q&A thread, this is just a thread that Scout started to ask a few specific questions for his program. If you want to ask short questions, in the future it would probably be better to ask them in the general Axe Q&A thread made for this purpose.


Can someone explain what and, or, and xor do in axe?
Not in If statements, but otherwise.  It's not very descriptive in the commands list :P

I think Wikipedia can explain the bitwise operations better than I can. The examples they give are for 4-bit numbers, whereas Axe uses 16-bit numbers. The and, or, xor, and not() commands only operate on the low 8 bits (the high 8 bits will simply be copied from one of the arguments). The ·, ?, ?, and not()r commands perform the operation on the full 16 bits.

1407
Axe / Re: Data Transmission question
« on: March 22, 2011, 07:50:45 pm »
Sending 8-bit values? You must be dreaming. The serial port is designed to send only 1 bit at a time, which is a large part of what necessitates the need for the special Get() and Send() functions.

1408
Axe / Re: Simple Axe Questions
« on: March 22, 2011, 06:37:24 pm »
The "proper" way to shake the screen is with the z-addressing feature of the display driver. However, Axe does not have a command for this. With a little bit of assembly, I used z-addressing in my otherwise entirely Axe crazy tunnel. You could use z-addressing with something like:
Code: [Select]
Zsub(Z)

Lbl Z
  Asm(147DE63FF640D310)
Return

The input would be taken mod 64 and then applied as the screen's z-address. A z-address of 0 would mean the screen is in its normal state, and for every increase by 1, the screen would be shifted down 1 pixel. Pixels that are shifted off the bottom of the screen wrap around back to the top. This doesn't change the buffer data at all, it just changes how it is mapped to the display.

1409
Axe / Re: Axe Q&A
« on: March 20, 2011, 10:27:27 pm »
Well they might want all the terminating zeros on the strings. But if not, you can always avoid that by doing something like the following:

Code: [Select]
.Will have a terminating zero
"Test"→Str0
.Will not have a terminating zero
"Test"[]→Str0

1410
Axe / Re: Axe Q&A
« on: March 20, 2011, 09:52:22 pm »
Yeah, that method would work. Let me compare and contrast the available methods so we can find which one would be best in which scenarios. I'll also optimize your routine while I'm at it. :P


LUT Method

Code: (Example) [Select]
.Data
"This"→Str000
"is"→Str001
"a"→Str002
"test."→Str003
Data(Str000ʳ,Str001ʳ,Str002ʳ,Str003ʳ)→GDB0

.Example call
5sub(SF)

.String fetching routine
Lbl SF
  {*2+GDB0}ʳ
Return







  • Size: 2n+10 bytes, n=number of strings; smaller for n≤18
  • Speed: 83 cycles; always faster
  • Symbols used: n+2 for easy method, 3 for manual string length counting method

Final verdict: The fastest solution, and the smallest for a low number of strings. As the number of strings goes up, it will become larger than the search method and will consume many symbols, requiring you to start manually calculating the length of strings to put in the LUT. Suggested if speed is important or if using a low number of strings (≤18).
       
Search Method

Code: (Example) [Select]
.Data
"This"→Str0
"is"[00]
"a"[00]
"test."[00]


.Example call
5sub(SF)

.String fetching routine
Lbl SF
  →r₁
  Str0
  Goto SF0
  While 1
    -1→r₁
    length(r₂)+r₂+1
    Lbl SF0
    →r₂
  End!If r₁
  r₂
Return

  • Size: 47 bytes; smaller for n>18
  • Speed: 21m+157n+129, m=number of bytes searched, n=string index; always slower
  • Symbols used: 3

Final verdict: Uses only 3 symbols without requiring the programmer to manually enter the length of the strings in a table. A smaller solution for a larger number of strings, but will quickly become many times slower than the LUT method with more and longer strings (e.g. getting the pointer to the name of a first generation Pokemon might take on average 20,000 cycles). Suggested if speed is not important for a larger number of strings (>18) or if you are tight on symbols and do not want to tally up the string lengths to put in a LUT.

Pages: 1 ... 92 93 [94] 95 96 ... 153