First, some background. If you've ever ported a map from Majora's Mask to Ocarina of Time, chances are you've seen missing or misplaced map meshes.
"What causes this?", you might ask yourself. Let's inspect the display list in a hex editor and find out.
Perfect, everything works now. Case closed. Except, not really. How do these look from above?
Oh no, they are locked to face the camera from all angles! You'll get problems with these posts anytime the camera is looking up or down. When the camera isn't level, something is noticeably wrong with them.
It turns out that all objects using matrix
After inspecting the behavior of matrix
You can witness the difference for yourself outside the Astral Observatory in Majora's Mask. It turns out, one of the stars uses a spherical billboard and the other uses a cylindrical billboard. Perhaps the cylindrical billboard matrix was added late in the game's development and they forgot to update this one.
"But Ocarina of Time does that too! What about the flame actors?", you may be thinking. This was very boggling, but it turns out actors that do this in OoT calculate their position relative to the camera and rotate the models so they align to the camera on all axes besides Y (up). In this sense, OoT does cylindrical billboards, but not via a global matrix. We cannot apply this hack on maps.
Since OoT does not create this matrix,
Now, to write an assembly hack that will create a cylindrical billboard matrix that will be accessible in maps and objects by pushing matrix
To save you a long story detailing all the trouble it was and how it still isn't perfect, I'll just say that it's usable for the purposes I intended for it to be usable for.
As an additional test, I modeled a lamppost and embedded it into Kokiri Forest's geometry.
The lower right image is a screenshot from Killgore52 (aka E-Gor) showing that the assembly and mesh are hardware compatible. Thanks man!
Finally, here's a zip containing the modified
* Because content was added to Kokiri Forest, its size increased, so keep that in mind when putting it in the rom for testing!