Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Michael_Lee on March 29, 2011, 06:07:09 pm
-
I was recently starting up some old projects again, and made a few changes.
The attached program will not compile (under Axe 0.5.0 and 0.5.1), it stops on the second pass, 93% finished with an 'UNDEFINED' error, with the cursor hereabouts:
Lbl MAP
ClrDraw
ClrDraw^^r
sub(RCT,1,1,94,62,1)
sub(RCT,3,3,90,58,1)
For(T,0,6)
For(S,0,10)
11*T+S+L1->W
!If {W}/16-1
!If rand^16
4->{W}
End
Else
{W}^16->{W}
End
Pt-Mask(S*8+4,T*8+4,{W}*16+Pic1)
End
End
Return
Specifically, it stops on the Pt-Mask, right at the Pic1 part. This puzzles me, since one of the first things I do is to explicitly store data to Pic1.
Attached is the 8xp and for convenience, a text file translation.
(I would also attach a screenie, but for some reason, Wabbitemu no longer seems to want to run apps, which is weird.)
Help?
-
It could be an error scrolling error. :P
If it is, do you have RCT defined?
also, did you store data by accident into Str1 or something instead?
EDIT: disregard. I'm going to try this when I get home, I've looked at the source using SC already.
-
What is RT?
And I checked several times to make sure that they matched - I tried changing both to Str8 or something several times, and all the other pointers seem to work (I tried commenting that line out - apart from the fact that I couldn't see my tiles, the game worked fine).
-
I meant RCT. But you did define that... Do you have any braces where they're not supposed to be? As in, should {W} be W?
-
Well, I commented that single line out, and the game worked nearly perfectly (apart from not drawing what I wanted to draw). I think I matched up all of my braces (I think), and it's probably not a problem with the specific version of Axe I'm using (I compiled previous versions fine, but after I made a few minor changes, this happened).
-
Do you have a slightly older version? If not, do you remember what you changed?
-
Here is the last backup I have -- I don't think I modified it beyond recognition to the current one, but I did make a large amount of changes that still compiled correctly. I don't remember exactly what changes I did that stopped it from compiling.
-
strange. Is pic2 being defined as well?
-
It has to do with the brackets in any of the Pt commands. I'm not sure how to fix it, but you could always do something like this:
{W}->A
Pt-Mask(S*8+4,T*8+4,A*16+Pic1)
-
After a bit of testing I found the problem, and I bet you'll never guess in what code I found it...
COMMENTS! You thought they didn't affect your program, but you were wrong! Apparently there's a very peculiar bug regarding multi-line comments for which I will make a post in the Bug Reports thread as soon as I'm done with this post. If the ending "..." for a multi-line comment has an odd number of blank lines immediately preceding it, the comment doesn't actually end! So although you thought the parser was doing this:
... [[START COMMENT]]
SOLID WALL
BREAK WALL
WALK FLOOR
INCREASE RADIUS
... [[END COMMENT]]
[7EFFFFFFFFFFFF7E→Pic1
[7EC39FBFFFFFFF7E
[7EC5A3A995C5A37E
[7EFFFFFFFFFFFF7E
[00242400423C0000
[FFDBDBFFBDC3FFFF
[003C525E7A4A3C00
[003C7E7E7E7E3C00]
... [[START COMMENT]]
P1
P2
P3
P4
BOMB SMALL
BOMB MED
BOMB LARGE
BOMB EXPLODE
TOMBSTONE
... [[END COMMENT]]
It was actually doing this:
... [[START COMMENT]]
SOLID WALL
BREAK WALL
WALK FLOOR
INCREASE RADIUS
... [[1 BLANK LINE ABOVE, DO NOTHING]]
[7EFFFFFFFFFFFF7E→Pic1
[7EC39FBFFFFFFF7E
[7EC5A3A995C5A37E
[7EFFFFFFFFFFFF7E
[00242400423C0000
[FFDBDBFFBDC3FFFF
[003C525E7A4A3C00
[003C7E7E7E7E3C00]
... [[3 BLANK LINES ABOVE, DO NOTHING]]
P1
P2
P3
P4
BOMB SMALL
BOMB MED
BOMB LARGE
BOMB EXPLODE
TOMBSTONE
... [[0 BLANK LINES ABOVE, END COMMENT]]
Very peculiar, indeed. You have to wonder how seemingly random bugs like this even come to be. :o
-
Very nice, Runer. For the record, I fail. ;)
Kudos, Runer, great job. ;D
-
Runer, you are a genius and a wizard.
Thankyouthankyou.
And that is one of the weirdest bugs ever.