Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Michael_Lee on March 29, 2011, 06:07:09 pm

Title: Why does this not compile?
Post 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:

Code: (Context) [Select]
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?
Title: Re: Why does this not compile?
Post by: yunhua98 on March 29, 2011, 06:10:42 pm
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.
Title: Re: Why does this not compile?
Post by: Michael_Lee on March 29, 2011, 06:13:04 pm
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).
Title: Re: Why does this not compile?
Post by: yunhua98 on March 29, 2011, 06:14:41 pm
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?
Title: Re: Why does this not compile?
Post by: Michael_Lee on March 29, 2011, 06:19:37 pm
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).
Title: Re: Why does this not compile?
Post by: yunhua98 on March 29, 2011, 06:21:29 pm
Do you have a slightly older version?  If not, do you remember what you changed?
Title: Re: Why does this not compile?
Post by: Michael_Lee on March 29, 2011, 06:24:31 pm
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.
Title: Re: Why does this not compile?
Post by: jnesselr on March 29, 2011, 09:17:59 pm
strange.  Is pic2 being defined as well?
Title: Re: Why does this not compile?
Post by: ztrumpet on March 29, 2011, 09:20:24 pm
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)
Title: Re: Why does this not compile?
Post by: Runer112 on March 29, 2011, 09:22:23 pm
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:
Code: [Select]
... [[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:

Code: [Select]
... [[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
Title: Re: Why does this not compile?
Post by: ztrumpet on March 29, 2011, 09:25:06 pm
Very nice, Runer.  For the record, I fail. ;)
Kudos, Runer, great job. ;D
Title: Re: Why does this not compile?
Post by: Michael_Lee on March 29, 2011, 09:44:40 pm
Runer, you are a genius and a wizard.

Thankyouthankyou.

And that is one of the weirdest bugs ever.