Moppu / SecretOfManaRandomizer

Randomizer for Secret of Mana
GNU Lesser General Public License v2.1
8 stars 3 forks source link

Add structure for Tileset16 #10

Closed Moppu closed 2 months ago

Moppu commented 2 months ago

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.