Formalise a bit in each cell as an "IsActive()" bit

This commit is contained in:
2018-03-28 01:00:55 +01:00
parent b6dcfafb6d
commit b653c11606
4 changed files with 70 additions and 38 deletions

View File

@@ -400,15 +400,15 @@ Investigation has so far suggested the following:
* 0x40: Animated object
* `Cell[2]` hasn't been seen with a value > 0 yet
* `Cell[3]` Object 0 (Surface) Area (Sets/*.set lookup)
* `Cell[4]` Object 0 (Surface) Sprite + ???
* `Cell[4]` Object 0 (Surface) Sprite + active flag
* Bottom bits encode the sprite (frame number in the .obj file)
* 0x80 is set too. A flag?
* `Cell[5]` Object 1 (Left) Area (Sets/*.set lookup)
* `Cell[6]` Object 1 (Surface) Sprite + ???
* `Cell[6]` Object 1 (Surface) Sprite + active flag
* `Cell[7]` Object 2 (Right) Area (Sets/*.set lookup)
* `Cell[6]` Object 2 (Right) Sprite + ???
* `Cell[6]` Object 2 (Right) Sprite + active flag
* `Cell[9]` Object 3 (Center) Area (Sets/*.set lookup)
* `Cell[10]` Object 3 (Right) Sprite + ???
* `Cell[10]` Object 3 (Right) Sprite + active flag
* `Cell[11]` all 255?
* `Cell[12]` all 0?
* `Cell[13]` all 0?
@@ -436,6 +436,12 @@ So `CellIdx == 9` points to the center object's Area, looked up in the set file!
It seems the area numbers are absolute indexes into the set, rather than having
a new set of indices for each type.
We have to remove 0x80 from the sprite byte to get a valid reference. This seems
to act as an "active" flag - without it, Chapter01.MAP has a "ghost" of the
template close to the 0,0 boundary. Theory: the devs originally started at 0,0
but then they decided to center smaller maps rather than being there, so the
layout got moved!
With this information, we can render a given Z index for a map quite easily,
using the new `view-map` binary. It draws the four objects for every cell, and
gives results like this: