Sign in to follow this  
Guest GerrishGray

FSDS2 Object library won't compile

Recommended Posts

I tried to generate library object from FSDS2 api. For some reason I cannot compile the file using Scasm 2.88, which is strange since I managed to compile similar file before...This time the compilation ends with error:Error in line 722 -> EndObj -> -> Linebuffer (20478) overflow, line 21/275 truncated ! -> too many errors ( 32767 )Scasm compilation status: abortedThe problematic file can be found from: http://home.earthlink.net/~jussi.rantala/dls/testi_lib.zip- Jussi

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Increase the value in the Set( linbuf 2048 ). I tried it with 10000 instead of 2048 and then it works.Btw, after that you'll have a missing label, because :Skip is not defined. You should put it somewhere (depends on where you want to jump too).Besides that all different parts end with a Return command and thus only the first one will be shown when you call this object. All others are never called.Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Share this post


Link to post
Share on other sites

Hi JussiLike Arno, I had a look at your code for you. The only two errors are[ol][li]You need a larger line buffer, as Arno has said, by using a setting such as Set( linbuf 10000 ). This is because the SCASM line buffer needs to be long enough to hold and analyse a whole command at a time, not merely a physical line of the source code, and floating point code in SCASM involves some very long commands, such as your vertex list from lines 22 to 314 of your source code.[/li][li]Again, as Arno pointed out, you have an undefined label :Skip on line 608 of your source code. The label needs to be inserted before the Return on line 631[/li][/ol]There are no other errors in your code as far as I can see from a quick code inspection. All the Return's are in the correct places and are required. I think Arno got himself a little confused here ... perhaps what he really meant was that you could have coded this slightly more "efficiently" by removing the sequence of Call32() commands in lines 317 to 323 altogether and let the whole block of code be executed in one single sequence by removing the Return's at the end of each separate subroutine. This probably sounds like anathema to you from the point of view of correct 'structured' modular programming style, but is exactly the sort of "dirty trick" used in assembler programming (or code optimisation) to save a few instructions and improve execution speed. Although this idea might seem trivial, any subroutine Call is actually quite 'costly' in the world of BGL p-code and getting rid of them where not needed can help optimise frame rates. This is part of MS's thinking behind the replacement of TransformCall() by the new Transform_Mat() ... TransformEnd structure - it eliminates the overhead of the subroutine call involved in TransformCall(). But there is nothing wrong with the code as you have structured it and you might prefer to keep it in its present modular form - "if it ain't broke, don't fix it" as the old saying goes, especially as you would certainly not be able to measure the tiny improvement in frame rates that you would get from restructuring it!!!CheersGerrish

Share this post


Link to post
Share on other sites

Gerrish is right :), I missed the Call commands and thought they were not there. Maybe it is because I am not used to FSDS1 and there the Call commands are at the beginning of the file and not as in FSDS2 at the middle.So the two errors Gerrish pointed out are the only ones.Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Share this post


Link to post
Share on other sites

Hi Ranatala!Welcome to the world of FSDS2 bugs! :) Really seriously, this is one of strange bugs and the reason for this bugs are.... Labels! FSDS V2.10 puts too many underscores in labes that SCASM does not like so the best way is to change every label from :_tmp_0_my_new_and_awesome_shiny_and_beautiful_part_X to:MyPartX where this X is the next part nuber. Just use X from Your tooo long label. Anyway, this is one of a lot of bugs I have reported to Abacus before Christmas and I hope in the latest update (V2.11 I think) they are all corrected; for some I am sure, but not for all.And to others; I have tried different values for Set instructions and it did not help even for such simple objects as Rantala's. Changing label names is the best and really workable solution for so short macros although I agree, that jumps to :Skip labels are sometimes just tooo long. In this case I just put some label named :RetX (where X is the number of part) before Return instruction at the end of part and Reroute jump from :Skip label to :RetX label:

:Part2IfVarRange( :Skip 33b 0 16384 ) <<<note jump to :Skip labelTransform_Mat(	2.930000 6.150000 0.000000	0.961262 0.275637 0.000000	0.000000 -0.000000 1.000000	0.275637 -0.961262 -0.000000	)SetMaterial( 2 -1 )DrawTriList( 153	0 1 2	0 2 3	4 5 6	4 6 7	8 9 10	8 10 11	12 13 14	12 14 15	16 17 18	16 18 19	20 21 22	20 22 23	)TransformEndReturn

And corrected code:

:Part2IfVarRange( :Ret2 33b 0 16384 ) <<<note jump to :Ret2 labelTransform_Mat(	2.930000 6.150000 0.000000	0.961262 0.275637 0.000000	0.000000 -0.000000 1.000000	0.275637 -0.961262 -0.000000	)SetMaterial( 2 -1 )DrawTriList( 153	0 1 2	0 2 3	4 5 6	4 6 7	8 9 10	8 10 11	12 13 14	12 14 15	16 17 18	16 18 19	20 21 22	20 22 23	)TransformEnd:Ret2Return

BTW, when changing label names, do not forget, that SCASM is Case Sensitive when talking about labels!Hope it helps. Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

I didn't get an error about the label names, compiled just fine here. The only error (after I increased the line buffer) was the unresolved label :Skip. Maybe we use a different version of SCASM?Arno


Member Netherlands 2000 Scenery Team[link:home.wanadoo.nl/arno.gerretsen]Arno's FlightSim World for scenery design hints, tips and other tricks...

Share this post


Link to post
Share on other sites

Hi Arno!No, I have SCASM 2.88 and FSDS V2.11 althoug the last macro I did was in FSDS V2.10. Really, I wrote some mails about bugs in FSDS 2 to Abacus' and one of it is about too long labels. I discivered this bug quite soon as I have purchased FSDS 2 and on some simple object. I think it was a ramp which can be down or up on sport airfield and I like to name part. But in slovene language nemas can be a little longer than in english. Imagine You have a big terminal with let say 30 or so objects and name them like "fence in front of caffe", "Fence on tower", "Fence ..." I like to nem parts like this instead of fence.1, fence.2... and the worse thing is that I use some special non english characters which are also replaced by underscores. And when I looked in the code and change part labels, SCASM did not complain about it! I tried several times to leave labels as they were and sometimes API compiled, sometimes API needed my intervention. But I have never needed increasing linebuf though althoug that was my first idea for correction. I changed it to really oversized values like 65536 ar even bigger but it did not help :-(And that jump to label :Skip was problematic for me already in FSDS 1.x; I never liked such long jumps and I always correct them.Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hi,This becomes really strange and I am puzzled. I added the missing :Skip to line 613 and increased linbuffer to 10000. Still I got the error: SCENERY Assembler vers. 2.88 (32) Copyright ©1995-2002 by Manfred Moldenhauer, M_Moldenhauer@compuserve.com Any unauthorized distribution prohibitedError in line 725 -> EndObj -> -> Linebuffer (20478) overflow, line 21/275 truncated ! -> too many errors ( 32767 )Scasm compilation status: abortedNext I corrected all labels as Gorchi suggested, but it did not help!I'm using Scasm 2.88:SCASM EXE 158,208 04-08-02 7:01p scasm.exeand the compiler command is: e:sca288scasm testi_lib.sca- Jussi

Share this post


Link to post
Share on other sites

Hi JussiI actually did the compilation for you this time instead of just a quick code inspection. The length of the VertexList() command was still too long (as the error messages you were receiving made clear - they were reporting that the problem was a line buffer overflow provoked by code starting at line 21).I cured it by replacing all the '.000000' sequences with '.0' - one quick Edit, Replace operation - and that reduced the length of the command sufficietly to allow compilation. As it turned out, it then worked fine with the original LINEBUFF value of 2048.You should report this problem and its solution to Louis Sinclair (i.e. FSDS2 support).Incidentally, there is no problem with the original labels - that was a 'red herring' as we say in England. SCASM is perfectly happy with the labels that FSDS2 produces. Perhaps Goran's problem was actually caused by some other feature of the code he was testing?Kind RegardsGerrish

Share this post


Link to post
Share on other sites

Hi Gerrish!

Incidentally, there is no problem with the original labels - that was a 'red herring' as we say in England. SCASM is perfectly happy with the labels that FSDS2 produces. Perhaps Goran's problem was actually caused by some other feature of the code he was testing?

Regarding my problems maybe I can send You an object or two to check it? It is weird that some object do comile with ultra_long labels with a heap of underscores, while others do not. Maybe it is also connected to usual problem with decimal separator, where we have decimal comma?But what is really weird is Your problem solution. This object code is short (for me). I have never changed numbers in VertexList() instruction even for some ultra long macros. And really, I have some macros which are more than 150kb long, so Area( 5...) must be changed to Area( C ...) to compile.Anyway, if You are interested, send me message and I will gladly send You API's for inspection (although I made them work with label corrections :) )Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hi GoranYes, mail me some of your examples at gerrish@flightsims.co.uk and I will have a look at them and see if we can find out what the problem is. There are some other internal settings in SCASM to do with labels, so it might be something to do with that?More interesting stuff - MSFS certainly keeps us occupied and prevents any danger of boredom, eh!CheersGerrish

Share this post


Link to post
Share on other sites

Thank you for your help!The 0.000000 into 0.0 did the trick and now I can compile my library!Best Regards,Jussi

Share this post


Link to post
Share on other sites

Hi Gerrish!Thanks for Your help in advance. Sometime in this weekend I will send You mail with those api's. Do You need only API's or source for projects in FSDS2 also?Best regrads,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.netemail:slovenia@avsim.net

Share this post


Link to post
Share on other sites

Hi GoranThanks for the API's. I had a careful look and found two different problems with the labels :-[ol][li]Several of the labels included the '-' (hyphen character. This was being interpreted by SCASM as a minus operator, and therefore terminated the label at that point. The legal character set for labels is letters, digits and underscores (plus the special symbol @).[/li][li]Some other labels were too long - the maximum length appears to be 32 chars (although Manfred's manual actually says 30).[/li][/ol]When I replaced the hyphens with underscrores, and reduced the length of two of the labels to 32 chars, everything compiled OK. So you need to keep part names in FSDS to a maximum of 25 chars and avoid the use of anything other than letters, digits and underscores.CheersGerrish

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this