Xeeynamo / sotn-decomp

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

Fix analyze_calls for boss stages #1672

Closed bismurphy closed 2 days ago

bismurphy commented 2 days ago

In analyze_calls, we need to analyze a function's calls, and be able to track where they go. Given that a jal call only has a function name, it's possible for it to go to a function in any overlay. Therefore, we need to disambiguate across overlays.

We do this by identifying what overlay every function is in. This comes from the filename of the assembly file.

Since the overlay might be in, for example, asm/us/dra (a "level 3 overlay" because it has 3 directory names) or asm/us/st/cen (a "level 4 overlay") we had special logic for testing for "st".

Now that we can also have level 4 overlays in "boss" (with Maria and BO3 coming up) we need to test for those too.

While we're at it, we also only run on the "us" version's assembly files.