Map connections are the biggest pain in the ass. My notes may not be 100%, as I didn't update them often. Connections are also at the end of the secondary map header.
==Secondary header format==
1 byte - Border block
1 byte - Height in blocks
1 byte - Width in blocks
3 bytes - Map block data pointer
1 byte - Bank of script/event data
2 bytes - Pointer to room script, using event/script bank byte
2 bytes - Pointer to event data, using event/script bank byte
1 byte - The map connections, bits 0 to 3 set for existing connection, reset for no connection in north, south, west, east resp.
[Follow connection format for each map]
==Connection format==
12 bytes per connection
1 byte - Bank of map
1 byte - Map number
2 bytes - Pointer to upper left corner of viewing area of connected map in connected map's map data
2 bytes - Viewing area location
1 byte - Dimension of viewing area
1 byte - Connected map's width
1 byte - Y offset of map in half blocks
1 byte - X offset of map in half blocks
2 bytes - Viewing area destination
2 bytes - Backwards memory pointer pointing to the block you can stand at to see the next map
All maps memory address (Starting) - 0xC700 + (width of current map + 0x06) * (0x03)
I fixed this. Basically, the
viewing area location points to ram where the viewing area should start on the current map including it's 3 border blocks in all directions.
Viewing area destination points to the upper left block
after changing maps.
Dimension of viewing area is the viewing area's width for horizontal connections (north, south) and it's height for vertical connections (west, east). X and Y offsets are in half-blocks (2×2 tiles where the player fits into).
Equations for the most-common connection modes can be found (in German) at
RHWiki.
cYa,
Tauwasser