Xeeynamo / sotn-decomp

Decompilation of Castlevania: Symphony of the Night (PSX+Saturn)
https://sotn.xee.dev/
GNU Affero General Public License v3.0
508 stars 55 forks source link

Castle Entrance (NP3): Remove the legacy .ext.generic #747

Closed Xeeynamo closed 3 weeks ago

Xeeynamo commented 1 year ago

What

In the past we used a structure for our Entity system that held all the unknown values. Later on we found the last 0x40 bytes are a reserved memory area for each entity to store their custom values. After a few proposals #187, #188, #195 we decided to come with a pattern where all this reserved areas for each entity will fall into their respective unique struct found in include/entity.h with ET_ as a prefix. This approach was never retroactively applied to the already decompiled entities, which are now using the structure ET_Generic and used as .ext.generic. This is legacy and it is creating unnecessary coupling to a dying structure.

This is an opportunity to learn how the Castle Entrance map work in Symphony of the Night. You will have the freedom of documenting what an entity does and take ownership of each entity function. This is very similar to #746 as they both share a large amount of code.

Acceptance criteria

For the overlay NP3 and all the files under src/st/np3, remove any reference to .ext.generic and use dedicated structures for the entity. No union or weird casts should to be used with the new structures.

Xeeynamo commented 1 month ago

Only one left at EntityCavernDoorLever, duplicate of #746

Xeeynamo commented 3 weeks ago

Done in #1825