The following example shows the complete BGL database header.
;DATABASE HEADER ********************************************************
dw0001;00 world set number (not saved to file list)
dd0004c4eabh;02 N bound 43 degrees meter units
dd000400000h;06 S bound
dd0cf000000h;10 E bound 85 degrees 32-bit pseudo
dd0bf000000h;14 W bound
ddVOR_DATA;18 VOR_DATA
dw50;22 lowest vor freq (channel 0–199)
dw50;24 highest vor freq (108.00–117.95)
ddSYNTH_SEEDS_08;26 seeds level 8
ddSYNTH_SEEDS_09;30 seeds level 9
ddSYNTH_SEEDS_10;34 seeds level 10
ddSYNTH_SEEDS_11;38 seeds level 11
ddSYNTH_SEEDS_12;42 seeds level 12
ddSYNTH_SEEDS_13;46 seeds level 13
ddSYNTH_SEEDS_14;50 seeds level 14
ddSYNTH_SEEDS_15;54 seeds level 15
ddOBJECT_DATA;58 OBJECT_DATA
ddLIBRARY_DATA;62 LIBRARY_DATA
ddFACILITIES_DATA;66 FACILITIES_DATA
ddANCHOR_POINTS;70 ANCHOR POINT DATA
ddCOM_DATA;74 COM RADIO DATA
ddADF_DATA;78 ADF DATA
ddDYN_PATH_DATA;82 DYNAMIC OBJECT PATHS
dw3,3,2,1;86 Library id min
dw5,3,2,1;94 Library id max
ddMISC_DATA;102 MISC_DATA (iom, landme)
ddTITLE_DATA;106 TITLE AND DESCRIPTION DATA
ddMAGDEC_MAP;110 MAGVAR MAP PTR
ddEXCEPTIONS_DATA;114 EXCEPTION LIST PTR
dd0;118 spare 1
dd0;122 (not saved to file list)
dw0;126 (not saved to file list)
Most of the entries in the preceding header have been covered in other topics. The remaining entries are of minor importance to scenery design and relate to Flight Simulator systems. This topic briefly covers each of these entries.
Anchor Point Data
This pointer at offset 70 refers to a list of anchor points. Anchor points were used in Flight Simulator, version 5.0, to equate locations in the LOGOL world of earlier versions of Flight Simulator to the latitude/longitude coordinated system of Flight Simulator, version 5.0. Because LOGOL isn't compatible with the current version of Flight Simulator, this entry is no longer necessary.
COM Radio Data
The air traffic control system is not advanced, but on communications radios you can tune into ATIS airport information. The following example contains a code excerpt from a file called Atis.asm that defines this information.
;COM DATABASE***********************************************************
;NAV ENTITY OPCODE DEFINITIONS -
;OpFormatDefinition
;-----------------------------------------------------------------
;4ATIS
ATIS macro freq,op_end,lathi,latlo,lonhi,lonlo,rng,rw1,rw2,rw3,rw4
localop_base
op_basedb4;;opcode
dwfreq;;bcd frequency (example-1850h=118.50 MHz)
dwlatlo;;N (2M units)
dblathi
dwlonlo;;W (24-bit pseudo)
dblonhi
dbrng;;range in 2048M units (approx 2 KM)
dwop_end-op_base;;atis entity size in bytes
dbrw1,rw2,rw3,rw4;;runways for n,s,e,w winds
endm
leftequ01000000b
rghtequ10000000b
cntrequ11000000b
COM_DATA:
rel_base=com_data
LATBAND_REL2800h,2A00h,com_2800;289c Everett Payne
;28cc Port Angeles
;2849 Boeing Field
;2837 Seattle Tacoma
;29fe Octeville Le Havre France
;298a Paris Charles de Gaulle
;2985 Paris Le Borget
;2950 Paris Orly
;290f W. Germany Augsburg
;2812 Austria Innsbruck
;28da Germany Jesenwang
;28fd Germany Munich
LATBAND_REL2600h,2800h,com_2600;27d2 Olympia
LATBAND_REL2200h,2400h,com_2200;237d Chicago Meigs
;236c Chicago Midway
;2399 Chicago O'Hare
;2273 New York Kennedy Intl.
;22e7 Bridgeport Sikorsky
;2319 Martha's Vinyard
;23e9 Boston Logan
EOL
COM_2800:
;Snohomish County - Paine Field
ATIS2865h,end_281,28h,09c61h,0a9h,00aa2h,80,34+left,11,16+rght,29
db'Snohomish County-Paine Field-',133,'Oscar'
db130,128,139,137,132
db138,136,134,135,140
db'you have Oscar',0
end_281label word
.
.
.
.
;Germany Munich
ATIS1837h,end_28c,28h,0fd91h,008h,06514h,80,08+left,08+left,26+rght,26+rght
db'Munich-',133,'Foxtrot'
db130,128,139,137,132
db138,136,134,135,140
db'you have Foxtrot',0
end_28clabel word
EOL
You can use LATBAND_REL commands to define the latitude range of the ATIS facilities. Notice that many airports throughout the world are at similar latitudes. In the preceding example, the pointer references the COM_2800 label. This label is a list of ATIS entities, one for each airport. The first entity in the list is for Paine Field, and the last is for Munich, Germany.
The message is the same as the COM radio’s text readout. In the preceding example, this is a mixture of ASCII text and tokens (values above 127). These tokens intersperse commonly used text and information that changes, such as temperature and barometric pressure at the airport. The following example shows the table that these tokens are accessed from.
;************************************************************
;Text expressions
; Referenced by character codes >127
;t128=128, t129=129, etc.
;************************************************************
token_expressionsPVOIDt128,t129,t130,t131,t132,t133,t134,t135,t136,t137
wndinxPVOIDt138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148
align1;all of these messages need to be packed together
t128db' weather - ',0
t129db' observation ',0
t130db' '
tokzuldb' 12:00 zulu ',0
t131db0
t132db' Temperature '
toktmpdb'75 '
toktmptdb'f - ',0
t133db' Information ',0
t134db' Landing and departing runway '
tokrundb'31'
toklrcdb'l - ',0
t135db' Advise controller ',0
t136db' Altimeter '
tokpresdb' - ',0
t137db' Visibility '
tokvisdb' 10 mi - ',0
t138db' Winds '
tokwdrdb'330 at '
tokwvldb' 27 - ',0
t138cdb' Winds calm -',0
t138vdb' Winds light and variable -',0
t139db100 dup (0)
t140db' on initial contact ',0
t141db0
t142db0
align4
;version 4.00 tokens
t143db'Microsoft Flight Simulator',0
t144db' requesting ',0
t145db'clearance ',0
t146db', you are cleared ',0
t147db'... ',0
squawklabel word
t148db'7777 ',0;transponder squawk code
Dynamic Object Paths
The dynamic object paths pointer references dynamic scenery information that is handled by the dynamic scenery system.
Miscellaneous Data
The miscellaneous data category is designed to contain database information that isn't too common, and, as a result, doesn't justify a separate data section. This category also includes room for expansion of new items that didn't exist when the original format was specified. Currently, the miscellaneous data section includes inner, middle, and outer marker beacon information for instrument landing approaches and “land me paths” for the “land me system.” These paths define traffic patterns around runways that the system uses to land the aircraft on the appropriate runway. The following example illustrates the use of MISC_DATA.
MISC_DATA:
rel_base=MISC_DATA
LATBAND_REL8960,9216,MISC_DATA_LIST_0001
EOL
MISC_DATA_LIST_0001:
OUTER_MARKER023h,07c22h,0c1h,0b40bh,180,0
MIDDLE_MARKER023h,07d22h,0c1h,0b40bh,180,0
INNER_MARKER023h,07e22h,0c1h,0b40bh,180,0
LANDME_RUNWAY_E1 023h,07c91h,0c1h,0b387h,0180h,0;Meigs 36
LANDME_RUNWAY_E2 023h,07e8fh,0c1h,0b388h,0180h,0
LANDME_RUNWAY_INFO 0,'Chicago Meigs 36 '
LANDME_RUNWAY_E1 023h,06ee9h,0c1h,09abbh,0180h,0;MIDWAY22L
LANDME_RUNWAY_E2 023h,06c56h,0c1h,09802h,0180h,0
LANDME_RUNWAY_INFO 0,'Chicago Midway 22L '
LANDME_RUNWAY_E1 023h,09577h,0c1h,08112h,0180h,0;O'HARE27L
LANDME_RUNWAY_E2 023h,09573h,0c1h,07a9dh,0180h,0
LANDME_RUNWAY_INFO 0,"Chicago O'HARE 27L "
EOL
The following example specifies the entity definitions.
;MISC_DATA ENTITY OPCODE DEFINITIONS -
;OpFormatDefinition
;-----------------------------------------------------------------
;4db 4;00 opcode = INNER MARKER BEACON
;db 11;01 byte count of all bytes in this entity
;db 0,0,0;02 N latitude (2 M units)
;db 0,0,0;05 E longitude (pseudo deg 24-bit)
;dw 0;08 Altitude (m)
;db 0;10 Orientation 8-bit pseudodeg
INNER_MARKER macro northhi,north,easthi,east,altitude,orient
db4
db11
dwnorth;;N latitude (2 M units)
dbnorthhi
dweast;;E longitude (24-bit pseudo)
dbeasthi
dwaltitude;;ALT (ii)m
dborient
endm
MIDDLE_MARKER macro northhi,north,easthi,east,altitude,orient
db5
db11
dwnorth;;N latitude (2 M units)
dbnorthhi
dweast;;E longitude (24-bit pseudo)
dbeasthi
dwaltitude;;ALT (ii)m
dborient
endm
OUTER_MARKER macro northhi,north,easthi,east,altitude,orient
db6
db11
dwnorth;;N latitude (2 M units)
dbnorthhi
dweast;;E longitude (24-bit pseudo)
dbeasthi
dwaltitude;;ALT (ii)m
dborient
endm
LANDME_RUNWAY_E1 macro e1nhi,e1n,e1ehi,e1e,e1alt,e1altfract
db7
db53
dwe1n;;02 end 1 N lat (2 M units)
dbe1nhi
dwe1e;;05 end 1 E lon (24-bit pseudo)
dbe1ehi
dbe1altfract;;08 end 1 ALT (.f)m
dwe1alt;; ALT (ii)m
endm
LANDME_RUNWAY_E2 macro e2nhi,e2n,e2ehi,e2e,e2alt,e2altfract
dwe2n;;11 end 1 N lat (2 M units)
dbe2nhi
dwe2e;;14 end 1 E lon (24-bit pseudo)
dbe2ehi
dbe2altfract;;17 end 1 ALT (.f)m
dwe2alt;; (ii)m
endm
LANDME_RUNWAY_INFO macro patdir,ident
dwpatdir;;20 pattern direction 0=left hand 1=right hand
dbident,0;;22 31-byte 0-padded asciiz approach name
;;53
endm
Title and Description Data
Title and description data specifies the name of the BGL file (up to 30 characters, followed by a 0) and a description of the BGL file (up to 255 characters, followed by a zero). The following example shows the format of this data.
;TITLE AND DESCRIPTION DATA *************************************************
;OBJECT ENTITY OPCODE DEFINITIONS -
;OpFormatDefinition
;-----------------------------------------------------------------
;1db 1TITLE
;(see macro below)
;3db 2DESCRIPTION
;(see macro below)
TITLE_INFOmacro
db01;;opcode
db31 dup (0);;31-char asciiz title string
endm
DESCRIPTIONmacro
db02;;opcode
db256 dup (0);;256-char asciiz description string
endm
TITLE_DATA:
rel_base=TITLE_DATA
TITLE_INFO
DESCRIPTION
EOL
Magnetic Deviation (Magvar Map)
The geographic north pole and the magnetic north pole are not in the same location. This characteristic, along with other geological features ,such as large mountains filled with iron ore, makes magnetic compasses deviate from proper readings. In Flight Simulator, magnetic deviation is factored in using magnetic deviation information that is contained in BGL files. Flight Simulator includes a complete world map of deviations, and you don't need to worry about magnetic deviation for any new area—it's already covered by the application. In the following example, offset 110 shows the entry for the pointer to the magnetic deviation data.
dd0;110 MAGVAR MAP PTR
ddEXCEPTIONS_DATA;114 EXCEPTION LIST PTR
Exception Data
One of the problems with LOGOL scenery was that there was no upgrade path for new and improved scenery, other than throwing away the old scenery files and replacing them with new ones. The introduction of BGL changed that by featuring a method of “knocking out” old scenery while leaving the old scenery files in place. This is done using exception data that enables you to eliminate old scenery in an area and replace it with new data.
In the following example, the pointer at offset 114 points to EXCEPTIONS_DATA. A list of exclusion objects can exist at this address. Each object identifies (by latitude/longitude) an object (in an old database) that will be excluded.
EX_OBJ macro nhi,nlo,ehi,elo,near_far,cnt1,[cnt2],[cnt3]
db4;;00 opcode Exclude OBJ
dwnlo;;01 latitude iiii M units
dwnhi
dwelo;;05 longitude 32-bit pseudo
dwehi
dbnear_far;;09 xxxxxxx1 = exclude near object
xxxxxx1x = exclude far object
xxxxx1xx = exclude near/far object
dbcnt1;;10 byte count lsbyte for 1st obj type
dbcnt2;;11 byte count lsbyte for 2nd obj type
dbcnt3;;12 byte count lsbyte for 3rd obj type
endm
INCLUSIONmacro north,south,east,west,mask
db3;;00 opcode Exclude OBJ
dwmask;;01 inclusion type mask
;; ...............1 = objects
;; ..............1. = vors
;; .............1.. = adfs
;;............1... = com
ddnorth;;03 north M units (inclusive)
ddsouth;;07 south M units (inclusive)
ddeast;;11 east M units (inclusive)
ddwest;;15 west M units (inclusive)
endm
Objects in other files are eliminated (in reality, set to be ignored) by identifying not only their latitude/longitude, but also identifying their type (near, far, or near/far). A bit in the near_far status byte indicates what type of object you want to eliminate, and you can, in fact, eliminate all three types of object at the specified latitude/longitude using this command. You must also specify the byte count least-significant byte for the object you want to eliminate; doing this acts a cross-check to make sure that the correct object is eliminated. (Another object may exist at the same latitude/longitude, but if the count doesn’t match, it won’t be eliminated.)
There is another form of exception called range inclusion. The format of the range inclusion command is shown in the preceding example. This command must be the first command in the exception list, and only one range inclusion is allowed per BGL file. The command specifies the area that the BGL database file includes and indicates that any objects, VORs, ADFs, or COM entities (you specify this in the mask word) in other files at higher layers are eliminated, leaving the design area free for a new design.