Jump to content
Sign in to follow this  
Guest

SCASM problem

Recommended Posts

Guest

I have a macro that is generating an error with scasm 2.89.The macro contains the following code block:Area( 5 %1 %2 %3 ) IfVarRange( :extend 346 %12 4 ) ;check complexity PerspectiveCall( :air_1@ ) Jump( :extend When I run the compiler I get the following error message:Error in macro file d:flight~1macrosmymacrosapitestmacro.api line 6960 -> EndA -> destination ":extend" out of range (33058), source line 55After studying the documentation I changed the "jump" command to a "jump32" command since the documentation says "Jump32( :Label ) Jump with a 32 bit address displacement. Practically no limit of jump distance" My new code block below:Area( 5 %1 %2 %3 ) IfVarRange( :extend 346 %12 4 ) ;check complexity PerspectiveCall( :air_1@ ) Jump32( :extend )Now I get the same error message but with a slight change (2 bytes) in the error message.Error in macro file d:flight~1macrosmymacrosapitestmacro.api line 6960 -> EndA -> destination ":extend" out of range (33060), source line 55What am I doing wrong? Can anyone help.Thanks,Ray

Share this post


Link to post
Share on other sites
Guest gorchi

Hi!Have You made this API with FSDS V2 and is complex? Has more than 140.000 bytes? Well, then try Area( C %1 %2 %3 ) instead of Area( 5 %1 %2 %3 ) and maybe this will help.Also put these three lines before Area() command:Set( BUF 1024 )Set( areamx 1024 )Set( LINBUF 2048 )Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites
Guest

Thanks for the tip but it did not work. I modified the code to this:mif( $Version > 216 )Set( BUF 1024 )Set( areamx 1024 )Set( LINBUF 2048 )mifendArea(C %1 %2 %3 ) IfVarRange( :extend 346 %12 4 ) ;check complexity PerspectiveCall( :air_1@ ) Jump( :extend )And I still get the same error message.Any more tips?Rayp.s. The macro is from a mdl to bgl conversion, not from and FSDS although I have had similar problems from FSDS macros that have been solved with larger areamx statements. I am curious though, what does changing the Area statement to a C instead of a 5 do?.

Share this post


Link to post
Share on other sites
Guest

Hi RayI use a batch file, or several as it seems and I include the following line prior to compling and reset it afterwards, because of other files that don't need this, so this is not in the *.sca file, but sets up the compiler!!!! set scasm=-LB 48000scasm ?.scacopy ?.bgl F:progra~1micros~1fs2002scenery /yset scasm=-LB 20000I see goran has included the 'Linebuffer', needs increasing maybe, I think 20,000 is default a (Linebuffer Overflow) see Manfred.Moldenhauer files with scasm, Scadoc.doc and usef_int.docHis documents are my bible, almost take them to bed, wife permitting:-jumpya note of warning, I have spent hours trying to resolve compiling issues to do with Trevor de Stigter's excellent programs, but some files just don't seem to convert well, Transparency issues is one of them, but that can be resolved/modifiedHe does have another program, 'MdDisAs' which does read 'Mdl' files and enables more flexibility and enables saving to *.sca file so you extract the code for the Mdl file and take the parts which are appropreiate, although this does obviously require authors permission, which is why the line buffer is on overload, long files.I myself have wrestled with static aircraft, and using this approach, and it seems alot of code for the scenery to load as a static aircraft, also because his programme's cope better with Fs98 files, contacting authors becomes a nightmare, because they may no longer be involved in Fs Community's, any more.... I have this problem with R22 robinson Helicopter, luckly Gmax author is helping me out.Sorry to go onHope this helpsRegardsDavePs Area() command Type 'C' is a newer FS2K command, and Manfred only comments that 'their is no size limit'Usual types are, 2/abs (msl Mean sea level)7/rel (Zero Agl E= Height Ft/Mtrs)3/ns (msl no scale involved)I stand correctrd on this though, as I am quoting from dated document's

Share this post


Link to post
Share on other sites
Guest gorchi

Hi Roy,can You maybe attach or mail me Your API to look closely about the problem? Maybe there is something below the header. Also yesterday my colleague had same problem and when I changed area type from 5 to C and inserted it into one of my scenery project for test, it did compile while he still has some problems...Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Area type C is allowed to be bigger then area type 5. If I remember correct type 5 has a maximum size of 65536 bytes. So for complex objects (and I think a MDL file fits into that), you need type C.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Small comment Dave :).The type 2,3 and 7 you mention are for the RefPoint and they indeed are for the different altitudes (absolute or ground level). This is something different the the types for the Area (4/5/C), which all have a different maximum size.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest

Hi ArnoYeah, he glares, I don't no my elbow from Ar.....thanks, good job someone is keeping an eye:-doh Daveps a/ai sw's seem to be working well:-)

Share this post


Link to post
Share on other sites
Guest luissa

Ray,Please try this:Area( 5 %1 %2 %3 )IfVarRange( :jump_here 346 %12 4 ) ; is this line 55?PerspectiveCall( :air_1@ ):jump_hereJump32( :extend )Regards,Luis

Share this post


Link to post
Share on other sites
Guest

HURRAY .. it worked.Thank you.Ray

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...