• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

BGLC variable during compilation

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi all,

Is there someone who is a bit more familiar with BGLC (or asembler code in general)? I am looking for a way to have a variable defined in my source code that I can use during compilation (so not in the final BGL code). A bit like the UVar variable in SCASM.

Second question (but I guess the answer is no here), does anyone know if BGLC also has some math functions coded in? I am looking for sine and cosine functions mainly.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,945
Country
us-wisconsin
Hi Arno.

BGLC is basically MASM:

http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/

So anything possible with assembly code should be possible with BGLC.

BGLC has this:

Code:
ASMCALL_32  macro asm_offset

      dw    08Ch

      dd    offset asm_offset

      endm


which appears to be able to use an assembly code routine.

I don't believe there is any higher math functions in BGLC... but you should be able to add them via macros if you can create the ASM coding.

Dick
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Thanks Dick. Yes I was aware that in principle it is just asembler code, but I could not find something useful when I searched the internet yesterday. I will bookmark this one now :).

I don't think that ASMCALL_32 command really helps, as it still writes data to the BGL file. That is not what I need. But I am sure that that reference guide will help me in solving it.

For the mathematical functions I already thought that was the answer. I can also do the calculations offline of course and just enter the answer :).
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Dick,

It was even easier than I thought. The include files of BGLC already show how to do it (a lot of variables are defined there as well, so we can use easier names like tod (time of day) etc).

This is the code I used in the end:

Code:
SAFEGATE_HEADING_SIN EQU 23169
SAFEGATE_HEADING_COS EQU 23169
 
Top