See VanillaTilesetUtil.cs, AcIslandTilesetChanges.cs, and Nesoberi.cs, where tileset16s are modified. Currently vanilla tilesets are decompressed to just a pile of shorts, and these classes just know how to modify the array directly.
VanillaTilesetUtil should instead be returning a Tileset16 structure (and also taking one, in the recompress code) that these other classes use to do the same changes.
The structure of each 16-bit value can be seen in a comment in AcIslandTilesetChanges and is as follows:
4x [VHAPPPTTTTTTTTT]
where each 16-bit value controls an 8x8 tile reference inside a single tile16:
V is a vertical flip flag
H is a horizontal flip flag
A is an alternate render layer flag (causes some tiles to show in front of or behind sprites)
PPP is a 3-bit palette id
TTTTTTTTTT is a 10-bit tile index into the associated tileset8
For each tile16, there are four of these 16-bit blocks in a row: one for upper left 8x8 tile, one for upper right, one for lower left, and one for lower right.
Every Tileset16 has 384 tile16s - 192 background and 192 foreground.
Since the data is compressed, it probably doesn't make sense to use VanillaStructure.cs for this, since it's meant for data directly pulled from/pushed to the ROM.
See VanillaTilesetUtil.cs, AcIslandTilesetChanges.cs, and Nesoberi.cs, where tileset16s are modified. Currently vanilla tilesets are decompressed to just a pile of shorts, and these classes just know how to modify the array directly.
VanillaTilesetUtil should instead be returning a Tileset16 structure (and also taking one, in the recompress code) that these other classes use to do the same changes.
The structure of each 16-bit value can be seen in a comment in AcIslandTilesetChanges and is as follows: 4x [VHAPPPTTTTTTTTT] where each 16-bit value controls an 8x8 tile reference inside a single tile16:
Every Tileset16 has 384 tile16s - 192 background and 192 foreground.
Since the data is compressed, it probably doesn't make sense to use VanillaStructure.cs for this, since it's meant for data directly pulled from/pushed to the ROM.