scmJS docs

MRGN

The locations. A StarCraft 1.00 map has 64 slots and a Brood War map 255. Slot 64 is Anywhere, the whole map. An unused slot has no name and no size.

The elevation word works the other way round from how StarEdit shows it: a set bit leaves out that elevation, so 0 means the location covers every elevation. Conditions such as Bring only count units on the elevations the location covers.

Name MRGN (4D 52 47 4E)
Size 20 bytes per location.
Read by The game.
Required Yes. The game does not load a map without it.
More than one copy Every copy is written over the start of the same fixed-size space, in file order, so a later copy replaces only as many bytes as it carries.
In scmJS Read, and written again when you change what it holds.

Each location:

Offset Type Holds
0 i32 Left edge, in pixels
4 i32 Top edge
8 i32 Right edge
12 i32 Bottom edge
16 u16 Name, a string number
18 u16 Elevations the location leaves out (below)

Elevations:

Bit Meaning
0x01 Low ground
0x02 Medium ground
0x04 High ground
0x08 Low air
0x10 Medium air
0x20 High air

Example#

A location covering five tiles across and four down, for ground units only. The right and bottom edges are the pixel just past the last tile, and the elevation word lists what the location leaves out:

   0  40 01 00 00  left 320 px (tile 10)
   4  80 01 00 00  top 384 px (tile 12)
   8  E0 01 00 00  right 480 px: tiles up to 14
  12  00 02 00 00  bottom 512 px: tiles up to 15
  16  05 00        name: string 5
  18  38 00        leaves out low air, medium air, high air