ORIGINAL OPENING GEOMETRY: CONSERVATIVE NATIVE MOVEMENT DATA

Source: the user's supplied Secret of Mana (USA), headerless 2,097,152 bytes.
SHA256 4c15013131351e694e05f22e38bb1b3e4031dedac77ec75abecebe8520d82d5f
The source ROM is read only, checked by SHA256 before export, and rechecked
after export. No emulator is used by this exporter.

REPRODUCE (Python 3.10+, no additional packages)

From the packaged java-viewer directory, with the preserved ROM supplied:
  python tools/export_opening_collision.py --rom PATH_TO_ORIGINAL_USA_ROM --maps-dir ../assets/maps --output dist/data/opening-collision
The full source map JSONs are under ../assets/maps. The browser's smaller
dist/assets JSONs are runtime copies and are not the reproduction input.

The original map grids are supplied by the independent export_maps.py map
decoder. These grids were assembled with story flags zero. This exporter
verifies their original header against the ROM and records both layer grid
hashes. It directly reads the ROM's collision, object, trigger and door data.

JSON API

map-N.json: mapId, widthTiles, heightTiles, tileSize=16.
Array order is row-major: index=y*widthTiles+x.
Layer array 0 is original logical layer1; array1 is original logical layer2.
collisionIds[2]: original type IDs derived from original metatile indices.
flatWalkable[2]: conservative native DEVELOPMENT movement permission mask.
flatWalkableWithTriggerHandler[2]: additionally allows flat trigger tiles;
  use only when the correct original door/event trigger is handled natively.
activeCollisionLayer: follows the original incoming door's collision bit.
  Map256=1; maps128,129,130,131=0. Never merge the layers or fall back to a
  different layer. The unused opening foreground layers contain open tiles.
cutsceneOnly: map256=true, other four maps=false. This is a native integration
  restriction: the source opening map is controlled by the original script.
tileTriggers: verified row-major tileX/tileY positions, original table slot,
  original value, event/door ID and source address; doors include target map,
  tile coordinates, original transition byte and hero spawn origin.
entryTrigger: original walk-on/map-entry event when enabled by header bit04.
objects: every original eight-byte object record and decoded fields.
incomingDoors: all original 1,024-entry table records targeting this map.
collisionTypes: each used type's original four bytes and source address.
unsupportedIds: all types excluded from the current permission masks.

VERIFIED SOURCE INTERPRETATION

ROM offsets are headerless USA offsets, not SNES CPU bank addresses.
0B0400+tileset16*384: one original collision ID for each 16x16 metatile.
0B0000+collisionId*4: the original four-byte collision type record.
Original code at02A043 multiplies the ID by4. At02A052 and02A05A it loads
both little-endian words from CPU bankCB into the collision tables.

Original consumers at01B855 and01BC37 test byte0 AND07. The kind03 branch
differs from kinds00/01/02; kinds01 and02 depend on actor collision state.
The movement code then considers byte2's corner/slope fields. Therefore a
single universal "bit0 means blocked" rule would be incorrect. The source
NoCollision hack removes bit0 and byte2, but it is not a faithful interpreter.

The current mask allows only these checked original records:
  ID00: 12 06 00 00 (kind02, ordinary flat land)
  ID17: 12 07 00 00 (kind02, flat type; includes original default tiles)
  ID1D: 10 07 00 00 (kind00, flat type)
  ID4A: 12 02 00 00 (kind02, shallow water; documented as noncolliding water)
All have zero corner/slope bytes. Other types remain unsupported and blocked.
These are a conservative original-terrain subset, not a complete reproduction
of the original player movement, collision radius or elevation system.

IDs0A (10 80 00 00) and0D (10 C0 00 00) have no corner mask but contain tile
triggers; they are excluded from flatWalkable and included in the conditional
mask. Type10's wall/special trigger is excluded from both masks.
Original code00D058 loads a collision word and branches on its sign, proving
byte1 bit7 marks a tile trigger. The original trigger utility documents
row-major order after entry/special events. Each of the opening maps has
exactly the expected number of trigger positions and no unassigned entries.

Doors use bit0 of byte1 for map bit8, byte1>>1 for X, byte2>>1 for Y and bit0
of byte2 for collision layer. The original hero placement uses tile*16+(8,10);
NPC placement uses tile*16+(4,4). Both are sprite origins, not automatically
the visual feet or a decoded collision-footprint point. Their verified source
locations are00CA10/00CA3F plus01E0B9/01E0C9 (hero) and00DE9F-00DEBA (NPC).

OPENING CONNECTIONS (tile coordinates; door IDs hexadecimal)

Map256 entry event100. Original companionsC0/C1 occupy tiles4,8 and5,8.
The original event400 ends by taking Door00 to map256 then jumping to106.
Event106 at byte offset607 takes Door82 to map128 tile30,27, then at612
jumps to101. The fall/action sequence still requires native event handlers.

Map128 has no entry event:
  tile47,50 and47,51 -> Door47 -> map129 tile21,37
  tile40,54 -> event104 (route blocked until sword/story state)
  tile26,59 -> event102 (the sword's calling sequence)
  sword object at31,59 speciesD8 -> event103
Map129 entry event105:
  tile15,36 and15,37 -> Door46 -> map128 tile41,51
  tile4,40 -> Door10 -> map15 tile40,24
  tile11,61 -> Door4A -> map130 tile27,11
Map130 entry event70E:
  tile26,10 -> event605 (special blocked trigger type10)
  tile33,11 -> Door01 -> map129 tile18,61
  tile33,31 -> Door08 -> map131 tile10,23
Map131 entry event610:
  tile4,23 and4,24 -> Door4B -> map130 tile27,31
  the other seven door tiles lead to original village interiors/map16.
All trigger targets and door bytes are present in JSON, including areas not
yet supported by the native opening exploration.

LIMITS

Slopes, corners, stairs, elevation, boundary wrapping, collision against
actors, changing collision layer, cuttable terrain, special events and
runtime map alterations are not implemented by this mask export. Story flags
can change map pieces and object presence; current map grids are zero-state.
The original full footprint/radius behavior has not been decoded. Source
trigger sampling uses predicted actor origin, without a visual-feet offset;
see opening-composition/README.txt for the exact sample/latch guards.
Native speed and footprint settings remain development controls.
Do not present these JSONs as a completed original movement implementation.

Primary source links and exact original code guard bytes are in manifest.json.
