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 ... 115 116 [117] 118 119 ... 153
1741
Axe / Re: Axiom structure
« on: November 16, 2010, 08:20:45 pm »
Unfortunately, due to the way the token hook works, it would be virtually impossible to add custom token replacements.  In order for that to work, every token you type in the editor would have to scan the entire program for the Axiom() keyword, look in that file, compare against all the replaceable tokens, and then copy the new value.  This would be way too much of a delay and scrolling would be really sluggish.

That's why my suggestion was to force the user to include all Axiom includes on the line immediately following the header. That way, you would only need to fully reload the custom token set when the user modifies the second line, and otherwise just use the modified token set like usual during normal editing. Although now that I think of it, it may be difficult to target changes in only one line of the program. An easier alternative would be to only scan for Axioms and load token replacements upon opening the program source, and not during any subsequent editing. If the user adds another Axiom into their program's source, it should be simple enough for them to quit and reopen the program to continue editing with the updated token replacements.

1742
Axe / Re: Routine Thread Index
« on: November 16, 2010, 02:33:55 am »
By the way ztrumpet, you still have yet to mark off fixed point multiplication and sprite rotating/flipping as being covered by Axe. I made a post a short while ago saying that they were outdated, but it looks like you must have missed that post. Don't miss this one! ;)

1743
The Axe Parser Project / Re: Axe Parser
« on: November 15, 2010, 11:21:53 pm »
This isn't a bug and doesn't need to be urgently fixed or anything, so I'm posting it here instead of in the Bug Reports thread. But this always bugs the OCD side of me when I see it. The p_Rand function in the Commands.inc is classified under the Input section with p_GetKey and p_DKey. Perhaps move it to Advanced Math or something similar? :P

1744
Axe / Re: Axiom structure
« on: November 15, 2010, 08:18:47 pm »
I have a question/feature request that would be quite helpful: Will Axioms be able to implement token replacements? Perhaps have the user put any Axioms used in their program on the second line, like includes, and add any token replacements defined in those Axioms to the ones already used by Axe?

The main reason I'm asking this is because I feel that once full Axiom support is added in 1.0, anyone could write Axioms for a good deal of feature additions. This would help to not only relieve the burden of feature requests on you, but also get features out much more quickly. But it's often very hard to find a fitting token for something as it is, and with an influx of more commands, I'm sure it would become even harder. Additionally, the fact that Axioms aren't standard parts of Axe and wouldn't be in the command list would make it even harder to remember/look up the right tokens for commands.

1745
The Axe Parser Project / Re: Axe Parser
« on: November 15, 2010, 01:01:07 am »
If you're checking a 0-based value, you need to add 1 to everything (except the null terminator). You could alternatively just use a 1-based value instead and not have to worry about this.

1746
The Axe Parser Project / Re: Bug Reports
« on: November 15, 2010, 12:51:02 am »
I realize that signed overflows wrap like that natively, but for this purpose it isn't the desired outcome. Multiplying two positive numbers and getting a negative number seems less practical than getting a clipped positive number.

1747
The Axe Parser Project / Re: Bug Reports
« on: November 15, 2010, 12:39:15 am »
EDIT 2: Oh, and in the commands list you accidentally call EXP1**EXP2 signed multiplication instead of fixed point multiplication.
It actually is a signed fixed-point multiplication. The list doesn't say "fixed-point" in so many words, though it does describe the type of number it is.

You're right, there's definitely some signed stuff going on here. But it's a good thing you pointed this out, because now that I look into it more, it appears that the routine itself is buggy. For instance, ᴇ0400**ᴇ2000 evaluates to ᴇ8000, although I believe it should be ᴇ0000 signed. It seems to be a problem with signed overflows not carrying properly. As another example, ᴇ0410**ᴇ2000 evaluates to ᴇ7E00, although I believe it should be ᴇ0200.

Can someone please verify that this is a problem? Or tell me how I'm misunderstanding it and why it's not a problem?

1748
The Axe Parser Project / Re: Features Wishlist
« on: November 14, 2010, 10:33:16 pm »
This is what disassembly is for :P

Code: [Select]
;getKey stuff here
ld hl,($8700) ;$8700 = K
ld a,l ;K=4 check
sub 4
or h
ld hl,$01
jr z,$+3
dec l
ld a,h ;Standard If statement code
or l
jp z,EndIf
ld hl,string ;If statement contents
ld ($870A),hl ;$870A = P
EndIf:
;Other stuff


string:
.db "Up", 0

1749
Axe / Re: Routines
« on: November 14, 2010, 09:50:35 pm »
This is hardly a routine, as it's only a one-liner, but it can be quite useful to know if you use any Shade() commands in your program to change the contrast. No more exiting your program with a contrast value you hope was close to the original value! The following line of code will set the screen's contrast to the value the user/OS previously had it set at:

Code: [Select]
Shade({ᴇ8447}ʳ+24)
Note: The contrast value is actually only one byte, not two as the ʳ would suggest. The ʳ is just included as an optimization.

1750
TI Z80 / Re: Breakout clone
« on: November 14, 2010, 09:43:58 pm »
Also, the contrast sets itself to 45 when you exit that mode, which I find to be a decent number.  If you don't like that, please tell me :P (note, for those of you inexperienced in axe/asm, reading the contrast value is not possible, so no maintaining it, sry) (at least not in axe without hex codes)

It's actually very simple to return the contrast to the value it was previously set to, without any need for assembly. To change the contrast value to what the user had it set to:

Code: [Select]
Shade({ᴇ8447}ʳ+24)

1751
Art / Re: Dice
« on: November 14, 2010, 09:02:29 pm »
Perhaps this would be of help. I'm not entirely sure if you'd be able to use these, and unfortunately its creator has been inactive for 180 weeks so contacting him/her is probably out of the question.


1752
The Axe Parser Project / Re: Axe Parser
« on: November 14, 2010, 05:43:37 pm »
Double-clicked? ;)

Anyway, that's a pretty clear explanation, thanks!

Whoops... someone delete the first one lol. I must've done something weird when editing it and instead created a second post instead of just editing the first one.

1753
The Axe Parser Project / Re: Features Wishlist
« on: November 14, 2010, 03:59:25 pm »
These should not be hard to make and I expect them in next version, so.

Quigibo has been very busy with things in life besides Axe, and has just been trying to get out the next version of Axe as it is, without adding everybody's feature requests. There have been many feature requests, and there's no reasonable way he could get to all of them, especially with how busy he has been lately. I've made a few feature requests myself. For one of them I even gave him the exactly assembly code he would need for it. And I still don't expect that Quigibo has to include it in the next version, or any version for that matter. He will add features as he deems that they should be added, and when he has the time to add them. It's not any one of our calls but his to say that the features we want should be in the next version. Announcing that you expect features to be in the next version puts Quigibo in the unfair position of feeling that he needs to include these features in the next version or he will disappoint you.

1754
The Axe Parser Project / Re: Axe Parser
« on: November 14, 2010, 03:31:17 pm »
Here's the description from the commands list:

inData(BYTE,PTR)
Key: inString()
   
Searches for the byte in the zero-terminated data. If found, it returns the position it was found in (starting at 1). If not found, 0 is returned.

The first argument accepts a byte value. Because Axe variables and math functions return two-byte values, this means that the high byte will be discarded. This argument essentially accepts whatever you enter mod 256.

The second argument accepts a pointer to data. In this data should be a series of byte values which will be stepped through one by one and checked to see if they are equal to the first argument (mod 256). The end of the data is signified by a zero so the search doesn't continue infinitely. For this reason, zero has to be reserved for the terminator and cannot be a value you want to compare.



Breaking down a more specific example, like: If inData(A+1,Data(2,7,17,0))

In the first argument, A represents whatever 0-based number, say an item ID, that you want to check. However, because 0 is reserved for the terminator of the data, we add 1 to it to shift all the item IDs to essentially be 1-based.

The second argument isn't really data itself. The data is defined somewhere in the bottom of the program, and this argument is instead given the value of a pointer to that data. As noted earlier, this data that is pointed to should be a list of nonzero byte values to check if the first argument is equal with, and the data should be terminated with a 0. Because 1 was added to our first argument to account for the fact that 0 is reserved for the terminator, 1 would also be added to the values we want to compare against. In this case, I wanted to compare against the values 1, 6, and 16, which turn into 2, 7, and 17 when 1 is added to them.

Finally, when the routine is run, the data is stepped through byte by byte, checking to see if a byte from the data equals the first argument (mod 256). Let's say we wanted to check if a selected item was a consumable potion, and item IDs 1, 6, and 16 were the potions present in our game. If the selected item ID (A) was 16, this value would be increased by 1, giving 17 for the first argument. This would then be checked to see if it equals 2, 7, or 17, which are the item IDs of the potions all plus 1. It doesn't equal 2 or 7, but it does equal 16. The routine would return the position of the match value, in this case 3, because the third element matched. For our purposes, all we really needed to know is whether or not a match was present, but inData() returning the match position works for this. Any match position returned will be greater than or equal to 1, which will make our IF statement true. If the item ID were 5, it wouldn't match any of the three values in our list. Once the routine hit a zero byte, it would know the searching was done and return a 0 for no match, making our IF statement false.


I hope this helps clarify things a bit :)

1755
The Axe Parser Project / Re: Axe Parser
« on: November 14, 2010, 04:59:27 am »
A is just whatever zero-based value you wanted to check. Adding 1 makes it 1-based so the comparison data can be null-terminated.

Pages: 1 ... 115 116 [117] 118 119 ... 153