home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 9 / CD_ASCQ_09_1193.iso / news / 2331 / fs5str02 / bgl_11.des < prev    next >
Text File  |  1993-10-26  |  4KB  |  196 lines

  1. ; DESCRIPTION FILE FOR PARTIAL .BGL DECODING
  2. ;
  3. ; SECTION 10 - AIRPORTS
  4. ;
  5. ; This file contains some setup statements and the descriptions of records
  6. ; used in static scenery files.
  7. ; It is intended to be used for partial .BGL decoding with the /U option
  8. ;
  9. ; Record usage:
  10. ; A: used as accumulator during calculations
  11. ; G: holds the current section start offset; used to calculate section-relative
  12. ;    offsets
  13.  
  14. ; Initialisation
  15.  
  16. 0    #H    ---------------
  17. 0    #H    SECTION_10_AIRPORTS
  18. 0    #H    ---------------
  19. 0    #R    G=W    set section start offset
  20.  
  21. ; jump over subroutines
  22. >START    #J
  23.  
  24. ; ***************
  25. ; * SUBROUTINES *
  26. ; ***************
  27.  
  28. ; * LAT/LONG CONVERSIONS *
  29.  
  30. ; convert into Latitude a 32-bit value in the V register
  31.  
  32. :N32
  33. 0    #R    B=0        reset sign flag
  34. >N32POS    #I    V>0
  35. 0    #R    V*-1        if V<0, change sign
  36. 0    #R    B=1        and set flag
  37. :N32POS
  38. 0    #R    A=V        store value
  39. 0    #R    V/14224710    V=degrees (14,224,710 = 55,565.277 * 256)
  40. 2    I-    |°
  41. 0    #R    V*14224710    degrees into 256th of Nu (128th of m)
  42. 0    #R    A-V        A = remainder from degrees
  43. 0    #R    V=A
  44. 0    #R    V/237079    V=primes
  45. 2    I-    |'
  46. 0    #R    V*237079    primes into 256th of Nu
  47. 0    #R    A-V        A = remainder from primes
  48. 0    #R    V=A
  49. 0    #R    V*100
  50. 0    #R    V/1543        V=256th of seconds
  51. 2    J-    |"
  52. >POSN32    #I    B=1
  53. 0    #T    N
  54. 0    #E
  55. :POSN32
  56. 0    #T    S
  57. 0    #E
  58.  
  59. ; convert into Longitude a 32-bit value in the V register
  60.  
  61. :E32
  62. 0    #R    B=0        reset sign flag
  63. >E32POS    #I    V>0
  64. 0    #R    V*-1        if V<0, change sign
  65. 0    #R    B=1        and set flag
  66. :E32POS
  67. 0    #R    A=V        store value
  68. 0    #R    V/11930464    V=degrees (11,930,464 = 46,603.677 * 256)
  69. 2    I-    |°
  70. 0    #R    V*11930464    degrees into 256th of Eu
  71. 0    #R    A-V        A = remainder from degrees
  72. 0    #R    V=A
  73. 0    #R    V/198841    V=primes
  74. 2    I-    |'
  75. 0    #R    V*198841    primes into 256th of Eu
  76. 0    #R    A-V        A = remainder from primes
  77. 0    #R    V=A
  78. 0    #R    V*100
  79. 0    #R    V/1295        V=256th of seconds
  80. 2    J-    |"
  81. >POSE32    #I    B=1
  82. 0    #T    E
  83. 0    #E
  84. :POSE32
  85. 0    #T    W
  86. 0    #E
  87.  
  88. ; output 32-bit Latitude/Longitude pair
  89.  
  90. :NE32
  91. 4    -
  92. >N32    #C    |,
  93. 4    -
  94. >E32    #C    |;
  95. 0    #E
  96.  
  97. ; output a 24-bit Latitude
  98.  
  99. :N24
  100. 3    -
  101. 0    #R    V*256        into 32-bit coord
  102. >N32    #C    |
  103. 0    #E
  104.  
  105. ; output a 24-bit Longitude
  106.  
  107. :E24
  108. 3    -
  109. 0    #R    V*256        into 32-bit coord
  110. >E32    #C    |
  111. 0    #E
  112.  
  113. ; output 24-bit Latitude/Longitude pair
  114.  
  115. :NE24
  116. 3    -
  117. 0    #R    V*256        into 32-bit coord
  118. >N32    #C    |,
  119. 3    -
  120. 0    #R    V*256        into 32-bit coord
  121. >E32    #C    |;
  122. 0    #E
  123.  
  124. ; * LINK POINTS *
  125.  
  126. ; insert a 4-byte link point relative to the beginning of the section
  127. :SECLINK
  128. 4    i
  129. >NULLPT    #I    V=0
  130. 0    #R    V+G    add section base offset to current displacement
  131. 3    X-    at_    print skip-to point
  132. 0    #R    @=V    insert absolute link point
  133. 0    #E
  134. :NULLPT
  135. 0    #T    _NULL
  136. 0    #E
  137.  
  138. ; inserts a 4-byte link point and outputs offset and real address
  139.  
  140. :LINK_PT
  141. 4    i$
  142. 0    #R    V+Q    add record offset to field value
  143. 3    X-    at_    print skip-to point
  144. 0    #E
  145.  
  146. ; *************************
  147. ; * EXECUTION BEGINS HERE *
  148. ; *************************
  149.  
  150. :START
  151.  
  152. ; *********************
  153. ; * 00h  End of table *
  154. ; *********************
  155.  
  156. 0    -R    #End_Of_Table
  157. 0    #H    ---------------
  158.  
  159. ; ****************************
  160. ; * 15h  North range pointer *
  161. ; ****************************
  162.  
  163. 21    -R    #NORTH
  164. 2    -
  165. 0    #R    V*65536    to 32-bit coord
  166. >N32    #C    |_-
  167. 2    -
  168. 0    #R    V*65536    to 32-bit coord
  169. >N32    #C
  170. >SECLINK    #C
  171.  
  172. ; ************
  173. ; *    01h   *
  174. ; ************
  175.  
  176. 1    -R    #AREA_-
  177. 2    I$    rec._length:_|,
  178. >SECLINK    #C    Table_
  179. -1    S    #___
  180.  
  181. ; **************
  182. ; * 03 Airport *
  183. ; **************
  184.  
  185. 3    -R    #AIRPORT:
  186. 2    I$    rec._length_|,
  187. >NE32    #C
  188. 4    J    #___Alt._|m,
  189. 2    G    heading_|,
  190. 2    Y    COM__1
  191. 2    Y    #___NAV1_1
  192. 2    I    _OBI1_|,
  193. 2    Y    NAV2_1
  194. 2    I    _OBI2_|
  195. -1    S    #___
  196.